Search in sources :

Example 1 with BdaFloat32

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);
}
Also used : DataSampleDto(org.osgpfoundation.osgp.dto.da.iec61850.DataSampleDto) BdaFloat32(org.openmuc.openiec61850.BdaFloat32) FcModelNode(org.openmuc.openiec61850.FcModelNode) ModelNode(org.openmuc.openiec61850.ModelNode) Date(java.util.Date) BigDecimal(java.math.BigDecimal) MathContext(java.math.MathContext)

Example 2 with BdaFloat32

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);
}
Also used : BdaFloat32(org.openmuc.openiec61850.BdaFloat32)

Example 3 with BdaFloat32

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;
}
Also used : BdaFloat32(org.openmuc.openiec61850.BdaFloat32)

Example 4 with BdaFloat32

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);
}
Also used : DataSampleDto(org.opensmartgridplatform.dto.da.iec61850.DataSampleDto) BdaFloat32(com.beanit.openiec61850.BdaFloat32) FcModelNode(com.beanit.openiec61850.FcModelNode) ModelNode(com.beanit.openiec61850.ModelNode) Date(java.util.Date) BigDecimal(java.math.BigDecimal) MathContext(java.math.MathContext)

Example 5 with BdaFloat32

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;
}
Also used : BdaFloat32(com.beanit.openiec61850.BdaFloat32)

Aggregations

BdaFloat32 (com.beanit.openiec61850.BdaFloat32)8 BdaFloat32 (org.openmuc.openiec61850.BdaFloat32)5 BigDecimal (java.math.BigDecimal)4 MathContext (java.math.MathContext)4 DataSampleDto (org.opensmartgridplatform.dto.da.iec61850.DataSampleDto)3 Array (com.beanit.openiec61850.Array)2 BdaTimestamp (com.beanit.openiec61850.BdaTimestamp)2 Date (java.util.Date)2 NodeWriteException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException)1 FcModelNode (com.beanit.openiec61850.FcModelNode)1 ModelNode (com.beanit.openiec61850.ModelNode)1 Array (org.openmuc.openiec61850.Array)1 FcModelNode (org.openmuc.openiec61850.FcModelNode)1 ModelNode (org.openmuc.openiec61850.ModelNode)1 NodeWriteException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeWriteException)1 DataSampleDto (org.osgpfoundation.osgp.dto.da.iec61850.DataSampleDto)1