Package tcg.scada.cos

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


    updateTs = datapoint.getTimestamp();
    outputTs = Calendar.getInstance().getTimeInMillis();
    sleep(1);

    // set override (bool value)
    value.longValue(10);
    boolStatus = datapoint.setOverride(value);
    Assert.assertEquals(true, boolStatus);
    // override flag is set
    Assert.assertEquals(true, datapoint.isOverride());
    // no update on source value/quality/timestamp
View Full Code Here


    outputTs = datapoint.getTimestamp();
    updateTs = Calendar.getInstance().getTimeInMillis();
    sleep(1);

    // re-override with new value (succed with override value updated)
    value.longValue(110);
    boolStatus = datapoint.setOverride(value);
    Assert.assertEquals(true, boolStatus);
    // no update on source value/quality/timestamp
    Assert.assertEquals(-20, datapoint.getSourceValue().longValue());
    Assert.assertTrue(datapoint.getSourceTimestamp() == sourceTs);
View Full Code Here

    sourceTs = Calendar.getInstance().getTimeInMillis();
    updateTs = Calendar.getInstance().getTimeInMillis();
    outputTs = Calendar.getInstance().getTimeInMillis();

    // set override (bool value)
    value.longValue(10);
    boolStatus = datapoint.setOverride(value);
    Assert.assertEquals(true, boolStatus);
    // override flag is set
    Assert.assertEquals(true, datapoint.isOverride());
    // no update on source value/quality/timestamp
View Full Code Here

    sourceTs = datapoint.getSourceTimestamp();
    updateTs = Calendar.getInstance().getTimeInMillis();
    outputTs = Calendar.getInstance().getTimeInMillis();

    // re-override with new value (succed with override value updated)
    value.longValue(110);
    boolStatus = datapoint.setOverride(value);
    Assert.assertEquals(true, boolStatus);
    // no update on source value/quality/timestamp
    Assert.assertEquals(-20, datapoint.getSourceValue().longValue());
    Assert.assertTrue(datapoint.getSourceTimestamp() == sourceTs);
View Full Code Here

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

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

    // update-time is set to current time
    Assert.assertTrue(datapoint.getUpdateTimestamp() >= updateTs);

    // set with timestamp
    updateTs = Calendar.getInstance().getTimeInMillis();
    value.longValue(15);
    status = datapoint.setSourceValue(value, true);
    Assert.assertEquals(1, status);
    // source value is updated, source timestamp is set to current time
    Assert.assertEquals(15, datapoint.getSourceValue().longValue());
    Assert.assertTrue(datapoint.getSourceTimestamp() >= updateTs);
View Full Code Here

    // update-time is set to current time
    Assert.assertTrue(datapoint.getUpdateTimestamp() >= updateTs);

    // set with timestamp
    updateTs = Calendar.getInstance().getTimeInMillis();
    value.longValue(15);
    status = datapoint.setSourceValue(value, true);
    Assert.assertEquals(1, status);
    Assert.assertEquals(15, datapoint.getSourceValue().unsignedValue());
    Assert.assertTrue(datapoint.getSourceTimestamp() >= updateTs);
    Assert.assertEquals(15, datapoint.getValue().unsignedValue());
View Full Code Here

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

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

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

    // update-time is set to current time
    Assert.assertTrue(datapoint.getUpdateTimestamp() >= updateTs);

    // set with timestamp
    updateTs = Calendar.getInstance().getTimeInMillis();
    value.longValue(15);
    status = datapoint.setSourceValue(value, true);
    Assert.assertEquals(1, status);
    Assert.assertEquals(15, datapoint.getSourceValue().longValue());
    Assert.assertTrue(datapoint.getSourceTimestamp() >= updateTs);
    Assert.assertEquals(15, datapoint.getValue().longValue());
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.