Package com.infiniteautomation.serial.vo

Examples of com.infiniteautomation.serial.vo.SerialPointLocatorVO


              pr.addContextualMessage("testString", "serial.test.noMessageMatch");
              return pr;
            }
            String identifier = m.group(ds.getPointIdentifierIndex());
            for(DataPointVO pnt : points) {
              SerialPointLocatorVO plVo = (SerialPointLocatorVO) pnt.getPointLocator();
              if(identifier.equals(plVo.getPointIdentifier())) {
                Pattern v = Pattern.compile(plVo.getValueRegex());
                Matcher vm = v.matcher(msg);
                if(vm.find())
                  pr.addContextualMessage("testString", "serial.test.consumed", pnt.getName(), vm.group(0));
              }
               
            }
          }
          else {
            pr.addContextualMessage("testString", "serial.test.noTerminator");
            return pr;
          }
        }
        else {
          for(DataPointVO pnt : points) {
            SerialPointLocatorVO plVo = (SerialPointLocatorVO) pnt.getPointLocator();
            Pattern p = Pattern.compile(plVo.getValueRegex());
            Matcher m = p.matcher(msg);
            if(m.find())
              pr.addContextualMessage("testString", "serial.test.consumed", pnt.getName(), m.group(0));         
          }
        }
View Full Code Here


                    String pointIdentifier = messageMatcher.group(pointIdentifierIndex);
                   
                    //Update all points that have this Identifier
                    for(DataPointRT dp: this.dataPoints){
                      SerialPointLocatorRT pl = dp.getPointLocator();
                      SerialPointLocatorVO plVo = pl.getVo();
                      if(plVo.getPointIdentifier().equals(pointIdentifier)){
                        Pattern pointValuePattern = Pattern.compile(plVo.getValueRegex());
                        Matcher pointValueMatcher = pointValuePattern.matcher(msg); //Use the index from the above message
                            if(pointValueMatcher.matches()){
                              String value = pointValueMatcher.group(plVo.getValueIndex());                 
                              PointValueTime newValue = new PointValueTime(DataValue.stringToValue(value, plVo.getDataTypeId()),
                                  Common.timer.currentTimeMillis());
                            dp.updatePointValue(newValue);
                            }//end if value matches
                      }//end for this point id
                    }
View Full Code Here

    for(DataPointRT rt : dataPoints) {
        Pattern p = ((SerialPointLocatorRT)rt.getPointLocator()).getPattern();
        Matcher m = p.matcher(msg);
        if(m.find()) { //Could use length consumed to allow many points to receive values from the same strings
          SerialPointLocatorRT pl = rt.getPointLocator();
            SerialPointLocatorVO plVo = pl.getVo();
          String value = m.group(plVo.getValueIndex());                 
              PointValueTime newValue = new PointValueTime(DataValue.stringToValue(value, plVo.getDataTypeId()),
                  Common.timer.currentTimeMillis());
            rt.updatePointValue(newValue);
          buffer.pop(m.group(0).length());
          index -= m.group(0).length();
          searchRegex(new String(buffer.peekAll()), depth+1);
View Full Code Here

TOP

Related Classes of com.infiniteautomation.serial.vo.SerialPointLocatorVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.