Examples of PointValueTime


Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

                }
                else {
                    try {
                        String data = parts[position];
                        Double value = new Double(data);
                        dp.updatePointValue(new PointValueTime(value, time));
                    }
                    catch (NumberFormatException e) {
                        log.error("Weird. We couldn't parse the value " + parts[position]
                                + " into a double. attribute=" + locator.getAttributeId());
                    }
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

        String value;
        DataPointRT dataPointRT = rtm.getDataPoint(dataPointVO.getId());
        if (dataPointRT == null)
            value = disabledValue;
        else {
            PointValueTime pvt = dataPointRT.getPointValue();

            if (pvt != null && pvt.getValue() instanceof ImageValue) {
                // Text renderers don't help here. Create a thumbnail.
                Map<String, Object> model = new HashMap<String, Object>();
                model.put("point", dataPointVO);
                model.put("pointValue", pvt);
                value = BaseDwr.generateContent(request, "imageValueThumbnail.jsp", model);
            }
            else {
                int hint = raw ? TextRenderer.HINT_RAW : TextRenderer.HINT_FULL;
                value = dataPointVO.getTextRenderer().getText(pvt, hint);
                if (pvt != null && time)
                    state.setTime(pvt.getTime());
            }
        }
        state.setValue(value);
    }
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

        private boolean send(List<PublishQueueEntry<SquwkPointVO>> entries) {
            List<SampleAppendRequest> reqs = new ArrayList<SampleAppendRequest>();

            for (PublishQueueEntry<SquwkPointVO> entry : entries) {
                SquwkPointVO vo = entry.getVo();
                PointValueTime pvt = entry.getPvt();
                SampleAppendRequest req = new SampleAppendRequest(vo.getGuid(), pvt.getTime(), coerceDataValue(
                        pvt.getValue(), vo.getDataType()));
                reqs.add(req);
            }

            // Send the request. Set message non-null if there is a failure.
            ResultHandler resultHandler = new ResultHandler();
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

            long time = dtf.parseDateTime(nextLine[0]).getMillis();

            // The rest of the values are point samples.
            for (int i = 1; i < nextLine.length; i++) {
                DataValue value = DataValue.stringToValue(nextLine[i], vos[i - 1].getPointLocator().getDataTypeId());
                PointValueTime pvt = new PointValueTime(value, time);

                if (rts[i - 1] != null)
                    rts[i - 1].savePointValueDirectToCache(pvt, null, true, true);
                else
                    // Save directly to the database
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

        private void donePoint() {
            if (quantizer != null)
                quantizer.done();
            if (point != null)
                // Add in an end value to calculate stats until the end of the report.
                point.getStats().done(new PointValueTime(0D, end));
        }
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

        DataPointRT dataPointRT = Common.runtimeManager.getDataPoint(dataPointVO.getId());
        if (dataPointRT == null)
            write(out, disabledValue);
        else {
            PointValueTime pvt = dataPointRT.getPointValue();

            if (pvt != null && pvt.getValue() instanceof ImageValue) {
                // Text renderers don't help here. Create a thumbnail.
                Map<String, Object> model = new HashMap<String, Object>();
                model.put("point", dataPointVO);
                model.put("pointValue", pvt);
                write(out, BaseDwr.generateContent(request, "imageValueThumbnail.jsp", model));
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

            Pattern pointValuePattern = Pattern.compile(plVo.getValueRegex());
            Matcher pointValueMatcher = pointValuePattern.matcher(msg); //Use the index from the above message
            if(pointValueMatcher.find()){
              if(plVo.getPointIdentifier().equals(pointValueMatcher.group(plVo.getPointIdentifierIndex()))) {
                String value = pointValueMatcher.group(plVo.getValueIndex());                 
                PointValueTime newValue;
                Date dt;
                if(plVo.getHasTimestamp() && !plVo.getTimestampFormat().equals(".")) {
                  SimpleDateFormat fmt = new SimpleDateFormat(plVo.getTimestampFormat());
                  dt = fmt.parse(pointValueMatcher.group(plVo.getTimestampIndex()));
                }
                else if(plVo.getHasTimestamp()) {
                  dt = new Date(Long.parseLong(pointValueMatcher.group(plVo.getTimestampIndex())));
                }
                else {
                  dt = new Date();
                }
               
                //Switch on the type
                switch(plVo.getDataTypeId()){
                case DataTypes.ALPHANUMERIC:
                  newValue = new PointValueTime(value, dt.getTime());
                  break;
                case DataTypes.NUMERIC:
                  newValue = new PointValueTime(Double.parseDouble(value), dt.getTime());
                  break;
                case DataTypes.MULTISTATE:
                  newValue = new PointValueTime(Integer.parseInt(value), dt.getTime());
                  break;
                case DataTypes.BINARY:
                  newValue = new PointValueTime(Boolean.parseBoolean(value), dt.getTime());
                  break;
                default:
                  throw new ShouldNeverHappenException("Uknown Data type for point");
                }
               
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

        DataPointRT point = rtm.getDataPoint(pointVO.getId());

        WatchListState state = new WatchListState();
        state.setId(Integer.toString(pointVO.getId()));

        PointValueTime pointValue = prepareBasePointState(Integer.toString(pointVO.getId()), state, pointVO, point,
                model);
        setEvents(pointVO, user, model);
        if (pointValue != null && pointValue.getValue() instanceof ImageValue) {
            // Text renderers don't help here. Create a thumbnail.
            setImageText(request, state, pointVO, model, pointValue);
        }
        else
            setPrettyText(state, pointVO, model, pointValue);
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

                      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

Examples of com.serotonin.m2m2.rt.dataImage.PointValueTime

        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
Copyright © 2018 www.massapi.com. 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.