Package com.serotonin.m2m2.rt.dataImage

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


                // Update the next value time.
                nextValueTime = time + 1000 * 60 * 60;

                for (DataPointRT dp : dataPoints) {
                    PointValueTime pvt = dp.getPointValue();
                    if (pvt != null && pvt.getTime() >= time)
                        // This value is in the past. Ignore it.
                        continue;

                    EnvCanPointLocatorVO plvo = dp.getVO().getPointLocator();
                    if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.TEMP && !Double.isNaN(temp))
                        pvt = new PointValueTime(temp, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.DEW_POINT_TEMP
                            && !Double.isNaN(dptemp))
                        pvt = new PointValueTime(dptemp, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.REL_HUM && !Double.isNaN(relhum))
                        pvt = new PointValueTime(relhum, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.WIND_DIR
                            && !Double.isNaN(winddir))
                        pvt = new PointValueTime(winddir, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.WIND_SPEED
                            && !Double.isNaN(windspd))
                        pvt = new PointValueTime(windspd, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.VISIBILITY
                            && !Double.isNaN(visibility))
                        pvt = new PointValueTime(visibility, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.STN_PRESS
                            && !Double.isNaN(stnpress))
                        pvt = new PointValueTime(stnpress, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.HUMIDEX && !Double.isNaN(humidex))
                        pvt = new PointValueTime(humidex, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.WIND_CHILL
                            && !Double.isNaN(windchill))
                        pvt = new PointValueTime(windchill, time);
                    else if (plvo.getAttributeId() == EnvCanPointLocatorVO.Attributes.WEATHER && weather != null)
                        pvt = new PointValueTime(weather, time);
                    else
                        continue;

                    dp.updatePointValue(pvt);
                }
View Full Code Here


            Map<String, IDataPointValueSource> context = new HashMap<String, IDataPointValueSource>();
            context.put(PointLinkRT.CONTEXT_VAR_NAME, point);
            int targetDataType = new DataPointDao().getDataPoint(targetPointId).getPointLocator().getDataTypeId();

            try {
                PointValueTime pvt = scriptExecutor.execute(script, context, System.currentTimeMillis(),
                        targetDataType, -1);
                if (pvt.getValue() == null)
                    message = new TranslatableMessage("event.pointLink.nullResult");
                else if (pvt.getTime() == -1)
                    message = new TranslatableMessage("pointLinks.validate.success", pvt.getValue());
                else
                    message = new TranslatableMessage("pointLinks.validate.successTs", pvt.getValue(),
                            Functions.getTime(pvt.getTime()));
            }
            catch (ScriptException e) {
                message = new TranslatableMessage("common.default", e.getMessage());
            }
            catch (ResultTypeException e) {
View Full Code Here

            Map<String, IDataPointValueSource> context = new HashMap<String, IDataPointValueSource>();
            DataPointRT source = Common.runtimeManager.getDataPoint(vo.getSourcePointId());
            context.put(CONTEXT_VAR_NAME, source);

            try {
                PointValueTime pvt = scriptExecutor.execute(vo.getScript(), context, newValue.getTime(),
                        targetDataType, newValue.getTime());
                if (pvt.getValue() == null) {
                    raiseFailureEvent(newValue.getTime(), new TranslatableMessage("event.pointLink.nullResult"));
                    return;
                }
                newValue = pvt;
            }
View Full Code Here

            String monitorId = InternalPointLocatorVO.MONITOR_NAMES[locator.getPointLocatorVO().getAttributeId()];
            // They are all integer monitors so far, so this is fine.
            IntegerMonitor m = (IntegerMonitor) Common.MONITORED_VALUES.getValueMonitor(monitorId);
            if (m != null)
                dataPoint.updatePointValue(new PointValueTime((double) m.getValue(), time));
        }
    }
View Full Code Here

        // Get the data point status from the data image.
        DataPointRT pointRT = Common.runtimeManager.getDataPoint(pointVO.getId());
        if (pointRT == null)
            state.setDisabled(true);
        else {
            PointValueTime pvt = pointRT.getPointValue();
            state.setTime(Functions.getTime(pvt));

            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", pointVO);
                model.put("pointValue", pvt);
                state.setValue(BaseDwr.generateContent(request, "imageValueThumbnail.jsp", model));
View Full Code Here

      } catch (NumberFormatException e) {
        startObject = new NumericValue(0);
      }
    } else {
      if (startValue == null)
        startObject = new AlphanumericValue("");
      else
        startObject = new AlphanumericValue(startValue);
    }
    return new VirtualPointLocatorRT(changeType, startObject, isSettable());
  }
View Full Code Here

  @Override
  public PointLocatorRT createRuntime() {
    ChangeTypeRT changeType = getChangeType().createRuntime();
    String startValue = getChangeType().getStartValue();
    DataValue startObject;
    if (dataTypeId == DataTypes.BINARY)
      startObject = BinaryValue.parseBinary(startValue);
    else if (dataTypeId == DataTypes.MULTISTATE) {
      try {
        startObject = MultistateValue.parseMultistate(startValue);
View Full Code Here

      startObject = BinaryValue.parseBinary(startValue);
    else if (dataTypeId == DataTypes.MULTISTATE) {
      try {
        startObject = MultistateValue.parseMultistate(startValue);
      } catch (NumberFormatException e) {
        startObject = new MultistateValue(0);
      }
    } else if (dataTypeId == DataTypes.NUMERIC) {
      try {
        startObject = NumericValue.parseNumeric(startValue);
      } catch (NumberFormatException e) {
View Full Code Here

      }
    } else if (dataTypeId == DataTypes.NUMERIC) {
      try {
        startObject = NumericValue.parseNumeric(startValue);
      } catch (NumberFormatException e) {
        startObject = new NumericValue(0);
      }
    } else {
      if (startValue == null)
        startObject = new AlphanumericValue("");
      else
View Full Code Here

        return "publisherEdit.squwk";
    }

    @Override
    protected PublisherVO<? extends PublishedPointVO> createPublisherVO() {
        return new SquwkSenderVO();
    }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.rt.dataImage.PointValueTime

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.