Package tcg.scada.cos

Examples of tcg.scada.cos.CosDpValueUnion.unsignedValue()


   
    timestamp = Calendar.getInstance().getTimeInMillis();
    sleep(1);

    // set value (new value)
    value.unsignedValue(10);
    status = datapoint.setValue(value);
    Assert.assertEquals(1, status);
    Assert.assertEquals(10, datapoint.getValue().unsignedValue());
    Assert.assertTrue(datapoint.getTimestamp() > timestamp);
View Full Code Here


    Assert.assertEquals(0, datapoint.getValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getTimestamp());

    // set without timestamp
    updateTs = Calendar.getInstance().getTimeInMillis();
    value.unsignedValue(11);
    status = datapoint.setSourceValue(value, false);
    Assert.assertEquals(1, status);
    Assert.assertEquals(11, datapoint.getSourceValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getSourceTimestamp());
    Assert.assertEquals(11, datapoint.getValue().unsignedValue());
View Full Code Here

    Assert.assertEquals(0, datapoint.getSourceValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getSourceTimestamp());
    Assert.assertEquals(0, datapoint.getValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getTimestamp());
    //set value (with timestamp)
    value.unsignedValue(11);
    status = datapoint.setSourceValue(value, true);
    Assert.assertEquals(-1, status);
    Assert.assertEquals(0, datapoint.getSourceValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getSourceTimestamp());
    Assert.assertEquals(0, datapoint.getValue().unsignedValue());
View Full Code Here

    Assert.assertEquals(0, datapoint.getValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getTimestamp());

    // set without timestamp
    updateTs = Calendar.getInstance().getTimeInMillis();
    value.unsignedValue(11);
    status = datapoint.setSourceValue(value, false);
    Assert.assertEquals(1, status);
    Assert.assertEquals(11, datapoint.getSourceValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getSourceTimestamp());
    Assert.assertEquals(11, datapoint.getValue().unsignedValue());
View Full Code Here

    if (subsystem != null && subsystem.isSourceSetValue()
        && type == EDataPointType.TYPE_REAL)
    {
      // convert to associated structure
      CosDpValueUnion myValue = new CosDpValueUnion();
      myValue.unsignedValue(value);
      // pass to subsystem
      if (subsystem.setValue(this, myValue))
      {
        return +1;
      }
View Full Code Here

    Assert.assertEquals(0, datapoint.getValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getTimestamp());
   
    // set without timestamp
    updateTs = Calendar.getInstance().getTimeInMillis();
    value.unsignedValue(11);
    status = datapoint.setSourceValue(value, false);
    Assert.assertEquals(1, status);
    Assert.assertEquals(11, datapoint.getSourceValue().unsignedValue());
    Assert.assertEquals(0, datapoint.getSourceTimestamp());
    Assert.assertEquals(11, datapoint.getValue().unsignedValue());
View Full Code Here

        break;
      case CosDpValueTypeEnum._TypeNumber:
        value.longValue(parse_int(str));
        break;
      case CosDpValueTypeEnum._TypeUnsigned:
        value.unsignedValue(parse_int(str));
        break;
      case CosDpValueTypeEnum._TypeDouble:
        value.dblValue(parse_dbl(str));
        break;
      case CosDpValueTypeEnum._TypeString:
View Full Code Here

    datapoint.keyId = keyId++;
    datapoint.name = "real-unsigned";
    //initial value
    Assert.assertEquals(0, datapoint.getValue().unsignedValue());
    // set with new value
    value.unsignedValue(10);
    status = datapoint.setValue(value);
    Assert.assertEquals(-1, status);
    Assert.assertEquals(0, datapoint.getValue().unsignedValue());

    // real-double datapoint
View Full Code Here

          //ignore
        }
        //set the value
        if (obj == null)
        {
          value.unsignedValue(0);    //default value
        }
        else
        {
          value.unsignedValue(intObj.intValue());
        }
View Full Code Here

        {
          value.unsignedValue(0);    //default value
        }
        else
        {
          value.unsignedValue(intObj.intValue());
        }
        break;
      case CosDpValueTypeEnum._TypeDouble:
        //cast it
        dblObj = null;
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.