Examples of DataValue


Examples of com.serotonin.m2m2.rt.dataImage.types.DataValue

  @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

Examples of com.serotonin.m2m2.rt.dataImage.types.DataValue

            // The first value is always a date.
            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
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.types.DataValue

                log.debug("Attraction point is not enabled");
            // Point is not currently active.
            return new NumericValue(current);
        }

        DataValue attractorValue = PointValueTime.getValue(point.getPointValue());
        if (attractorValue == null) {
            if (log.isDebugEnabled())
                log.debug("Attraction point has not vaue");
            return new NumericValue(current);
        }

        double attraction = attractorValue.getDoubleValue();

        // Move half the distance toward the attractor...
        double change = (attraction - current) / 2;

        // ... subject to the maximum change allowed...
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.types.DataValue

    //Get the data type
    ByteArrayBuilder b = new ByteArrayBuilder(bytes, readOffset, bytes.length);

    //Get the data type
    int dataType = b.getShort();
    DataValue dataValue = null;
   
    //Second put in the data value
    switch(dataType){
      case DataTypes.ALPHANUMERIC:
        String s = b.getString();
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.types.DataValue

    @Override
    public void doPoll(long time) {
        for (DataPointRT dataPoint : dataPoints) {
            VirtualPointLocatorRT locator = dataPoint.getPointLocator();

            DataValue oldValue = locator.getCurrentValue();

            // Change the point values according to their definitions.
            locator.change();

            DataValue newValue = locator.getCurrentValue();

            // Update the data image with the new value if necessary.
            //TP EDIT, let the data point settings in the core choose this for us
            //TP TODO: this actually causes issues in high polling data sources.  When setting the value from the UI
            // it will set the value once from there and another time from here.
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.types.DataValue

        // For each point.
        for (PointInfo pointInfo : points) {
            DataPointVO point = pointInfo.getPoint();
            int dataType = point.getPointLocator().getDataTypeId();

            DataValue startValue = null;
            if (!instance.isFromInception()) {
                // Get the value just before the start of the report
                PointValueTime pvt = pointValueDao.getPointValueBefore(point.getId(), instance.getReportStartTime());
                if (pvt != null)
                    startValue = pvt.getValue();
View Full Code Here

Examples of com.serotonin.m2m2.rt.dataImage.types.DataValue

            DataPointVO point = pointInfo.getPoint();
            pointIds.add(point.getId());
            int dataType = point.getPointLocator().getDataTypeId();
           
           
            DataValue startValue = null;
            if (!instance.isFromInception()) {
                // Get the value just before the start of the report
                PointValueTime pvt = pointValueDao.getPointValueBefore(point.getId(), instance.getReportStartTime());
                if (pvt != null)
                    startValue = pvt.getValue();
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.DataValue

          // for example)
          //this.updateInstrument(instrument);
        }
        // TF:6/6/07: if updateData() has not been called on the instrument, we won't know it's type
        // so we are going to have to assume string
        DataValue value = ((ConfigValueInst)instrument).getData();
        if (value != null) {
          String frameworkName = value.getClass().getName();
          if (frameworkName.equalsIgnoreCase("net.helipilot50.stocktrade.framework.IntegerData")) {
            typeName = "java.lang.Integer";
          }
          else if (frameworkName.equalsIgnoreCase("net.helipilot50.stocktrade.framework.DoubleData")) {
            typeName = "java.lang.Double";
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.DataValue

    public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException {
        Instrument instrument = this.findInstrument(name);
        Object result = null;
        if (instrument instanceof ConfigValueInst) {
            DataValue value = ((ConfigValueInst)instrument).getData();
            result = value.toString();
        }
        if (instrument instanceof CounterInst) {
            result = ((CounterInst)instrument).getIntegerValue();
        }
        if (instrument instanceof AverageInst) {
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.DataValue

    }

    public void setAttribute (Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
        Instrument instrument = this.findInstrument(attribute.getName());
        if (instrument instanceof ConfigValueInst) {
            DataValue theAttribute = null;
            if (attribute.getValue() instanceof java.lang.Integer) {
                theAttribute = new IntegerData((Integer)attribute.getValue());
            }
            if (attribute.getValue() instanceof java.lang.Double) {
                theAttribute = new DoubleData((Double)attribute.getValue());
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.