use of com.beanit.openiec61850.BdaFloat32 in project open-smart-grid-platform by OSGP.
the class NodeContainer method writeFloatArray.
public void writeFloatArray(final SubDataAttribute child, final Float[] values) throws NodeWriteException {
final Array array = (Array) this.parent.getChild(child.getDescription());
if (array.size() != values.length) {
throw new NodeWriteException(String.format("Invalid array size %d. Size on device is %d", values.length, array.size()));
}
for (int i = 0; i < values.length; i++) {
final BdaFloat32 bdaFloat = (BdaFloat32) array.getChild(i);
bdaFloat.setFloat(values[i]);
}
this.writeNode(array);
}
use of com.beanit.openiec61850.BdaFloat32 in project open-smart-grid-platform by OSGP.
the class NodeContainer method getFloatArray.
public Float[] getFloatArray(final SubDataAttribute child) {
final Array array = (Array) this.parent.getChild(child.getDescription());
final int size = array.size();
final Float[] result = new Float[size];
for (int i = 0; i < size; i++) {
result[i] = ((BdaFloat32) array.getChild(i)).getFloat();
}
return result;
}
use of com.beanit.openiec61850.BdaFloat32 in project open-smart-grid-platform by OSGP.
the class LogicalDevice method setFixedFloat.
protected BasicDataAttribute setFixedFloat(final LogicalDeviceNode node, final float val) {
final BdaFloat32 value = (BdaFloat32) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
value.setFloat(val);
return value;
}
use of com.beanit.openiec61850.BdaFloat32 in project open-smart-grid-platform by OSGP.
the class LogicalDevice method setRandomFloat.
protected BasicDataAttribute setRandomFloat(final LogicalDeviceNode node, final int min, final int max) {
final BdaFloat32 value = (BdaFloat32) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
value.setFloat((float) ThreadLocalRandom.current().nextInt(min, max));
return value;
}
Aggregations