use of com.beanit.openiec61850.BdaFloat32 in project Protocol-Adapter-IEC61850 by OSGP.
the class DistributionAutomationGetPQValuesRequestMessageProcessor method processPQValue.
private DataSampleDto processPQValue(final ModelNode node) {
Date ts = null;
String type = null;
BigDecimal value = null;
if (node.getChildren() != null) {
ts = this.findBdaTimestampNodeValue(node);
final ModelNode floatNode = this.findBdaFloat32NodeInConstructedDataAttribute(node);
if (floatNode != null) {
type = node.getName() + "." + floatNode.getParent().getName() + "." + floatNode.getName();
value = new BigDecimal(((BdaFloat32) floatNode).getFloat(), new MathContext(3, RoundingMode.HALF_EVEN));
}
}
return new DataSampleDto(type, ts, value);
}
use of com.beanit.openiec61850.BdaFloat32 in project Protocol-Adapter-IEC61850 by OSGP.
the class NodeContainer method writeFloat.
public void writeFloat(final SubDataAttribute child, final Float value) throws NodeWriteException {
final BdaFloat32 bdaFloat = (BdaFloat32) this.parent.getChild(child.getDescription());
bdaFloat.setFloat(value);
this.writeNode(bdaFloat);
}
use of com.beanit.openiec61850.BdaFloat32 in project Protocol-Adapter-IEC61850 by OSGP.
the class LogicalDevice method setFixedFloat.
protected BasicDataAttribute setFixedFloat(final String node, final Fc fc, final float val) {
final BdaFloat32 value = (BdaFloat32) this.serverModel.findModelNode(this.createNodeName(node), fc);
value.setFloat(val);
return value;
}
use of com.beanit.openiec61850.BdaFloat32 in project open-smart-grid-platform by OSGP.
the class DistributionAutomationGetPQValuesRequestMessageProcessor method processPQValue.
private DataSampleDto processPQValue(final ModelNode node) {
Date ts = null;
String type = null;
BigDecimal value = null;
if (node.getChildren() != null) {
ts = this.findBdaTimestampNodeValue(node);
final ModelNode floatNode = this.findBdaFloat32NodeInConstructedDataAttribute(node);
if (floatNode != null) {
type = node.getName() + "." + floatNode.getParent().getName() + "." + floatNode.getName();
value = new BigDecimal(((BdaFloat32) floatNode).getFloat(), new MathContext(3, RoundingMode.HALF_EVEN));
}
}
return new DataSampleDto(type, ts, value);
}
use of com.beanit.openiec61850.BdaFloat32 in project open-smart-grid-platform by OSGP.
the class Node method getChangedMagnitudeAttributeForNode.
private BasicDataAttribute getChangedMagnitudeAttributeForNode(final ModelNode node) {
final BdaFloat32 bda = (BdaFloat32) node;
bda.setFloat((float) this.value);
return bda;
}
Aggregations