use of com.beanit.openiec61850.BasicDataAttribute in project open-smart-grid-platform by OSGP.
the class LogicalDevice method setFixedInt.
protected BasicDataAttribute setFixedInt(final LogicalDeviceNode node, final int val) {
final BdaInt64 value = (BdaInt64) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
value.setValue((byte) val);
return value;
}
use of com.beanit.openiec61850.BasicDataAttribute in project open-smart-grid-platform by OSGP.
the class LogicalDevice method setVisibleString.
protected BasicDataAttribute setVisibleString(final LogicalDeviceNode node, final byte[] d) {
final BdaVisibleString value = (BdaVisibleString) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
value.setValue(d);
return value;
}
use of com.beanit.openiec61850.BasicDataAttribute in project open-smart-grid-platform by OSGP.
the class LogicalDevice method setRandomByte.
protected BasicDataAttribute setRandomByte(final LogicalDeviceNode node, final int min, final int max) {
final BdaInt8 value = (BdaInt8) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
value.setValue((byte) ThreadLocalRandom.current().nextInt(min, max));
return value;
}
use of com.beanit.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 com.beanit.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));
}
Aggregations