use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method getCopyWithNewValue.
private BasicDataAttribute getCopyWithNewValue(final BasicDataAttribute original, final String value) {
final BasicDataAttribute copy = (BasicDataAttribute) original.copy();
BasicDataAttributesHelper.setValue(copy, value);
return copy;
}
use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method mockValue.
public void mockValue(final String logicalDeviceName, final String node, final String value) {
if (!this.stopGeneratingValues.get()) {
/*
* A mocked value is explicitly set, stop changing values with
* generateData, because one of those might break the mock value
* that will be expected.
*/
this.ensurePeriodicDataGenerationIsStopped();
}
final LogicalDevice logicalDevice = this.getLogicalDevice(logicalDeviceName);
final BasicDataAttribute basicDataAttribute = logicalDevice.getAttributeAndSetValue(node, value);
this.server.setValues(Arrays.asList(basicDataAttribute));
}
use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.
the class LogicalDevice method setRandomInt.
protected BasicDataAttribute setRandomInt(final String node, final Fc fc, final int min, final int max) {
final BdaInt32 value = (BdaInt32) this.serverModel.findModelNode(this.createNodeName(node), fc);
value.setValue(ThreadLocalRandom.current().nextInt(min, max));
return value;
}
use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.
the class LogicalDevice method setTime.
protected BasicDataAttribute setTime(final String node, final Fc fc, final Date date) {
final BdaTimestamp value = (BdaTimestamp) this.serverModel.findModelNode(this.createNodeName(node), fc);
value.setDate(date);
return value;
}
use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.
the class LogicalDevice method setFixedInt.
protected BasicDataAttribute setFixedInt(final String node, final Fc fc, final int val) {
final BdaInt64 value = (BdaInt64) this.serverModel.findModelNode(this.createNodeName(node), fc);
value.setValue((byte) val);
return value;
}
Aggregations