Search in sources :

Example 6 with BasicDataAttribute

use of com.beanit.openiec61850.BasicDataAttribute in project open-smart-grid-platform by OSGP.

the class LogicalDevice method setRandomInt.

protected BasicDataAttribute setRandomInt(final LogicalDeviceNode node, final int min, final int max) {
    final BdaInt32 value = (BdaInt32) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
    value.setValue(ThreadLocalRandom.current().nextInt(min, max));
    return value;
}
Also used : BdaInt32(com.beanit.openiec61850.BdaInt32)

Example 7 with BasicDataAttribute

use of com.beanit.openiec61850.BasicDataAttribute in project open-smart-grid-platform by OSGP.

the class LogicalDevice method setInt.

protected BasicDataAttribute setInt(final LogicalDeviceNode node, final int val) {
    final BdaInt32 value = (BdaInt32) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
    value.setValue(val);
    return value;
}
Also used : BdaInt32(com.beanit.openiec61850.BdaInt32)

Example 8 with BasicDataAttribute

use of com.beanit.openiec61850.BasicDataAttribute in project open-smart-grid-platform by OSGP.

the class LogicalDevice method setBoolean.

protected BasicDataAttribute setBoolean(final LogicalDeviceNode node, final boolean b) {
    final BdaBoolean value = (BdaBoolean) this.serverModel.findModelNode(this.createNodeName(node), node.getFc());
    value.setValue(b);
    return value;
}
Also used : BdaBoolean(com.beanit.openiec61850.BdaBoolean)

Example 9 with BasicDataAttribute

use of com.beanit.openiec61850.BasicDataAttribute 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)

Example 10 with BasicDataAttribute

use of com.beanit.openiec61850.BasicDataAttribute in project open-smart-grid-platform by OSGP.

the class Node method getChangedAttributes.

public List<BasicDataAttribute> getChangedAttributes() {
    final List<BasicDataAttribute> changedAttributes = new ArrayList<>();
    final BasicDataAttribute changedMagnitudeAttribute = this.getChangedMagnitudeAttribute();
    if (changedMagnitudeAttribute != null) {
        changedAttributes.add(changedMagnitudeAttribute);
    }
    final BasicDataAttribute changedTimestampAttribute = this.getChangedTimestampAttribute();
    if (changedTimestampAttribute != null) {
        changedAttributes.add(changedTimestampAttribute);
    }
    return changedAttributes;
}
Also used : ArrayList(java.util.ArrayList) BasicDataAttribute(com.beanit.openiec61850.BasicDataAttribute)

Aggregations

BasicDataAttribute (com.beanit.openiec61850.BasicDataAttribute)11 ArrayList (java.util.ArrayList)7 BasicDataAttribute (org.openmuc.openiec61850.BasicDataAttribute)4 LogicalDevice (org.opensmartgridplatform.simulator.protocol.iec61850.server.logicaldevices.LogicalDevice)4 LogicalDevice (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.LogicalDevice)3 BdaFloat32 (com.beanit.openiec61850.BdaFloat32)3 BdaInt32 (com.beanit.openiec61850.BdaInt32)3 BdaInt8 (com.beanit.openiec61850.BdaInt8)3 BdaTimestamp (com.beanit.openiec61850.BdaTimestamp)2 BdaVisibleString (com.beanit.openiec61850.BdaVisibleString)2 ModelNode (com.beanit.openiec61850.ModelNode)2 ServerModel (com.beanit.openiec61850.ServerModel)2 Date (java.util.Date)2 Scheduled (org.springframework.scheduling.annotation.Scheduled)2 BdaBoolean (com.beanit.openiec61850.BdaBoolean)1 BdaInt64 (com.beanit.openiec61850.BdaInt64)1 BdaQuality (com.beanit.openiec61850.BdaQuality)1 SclParseException (com.beanit.openiec61850.SclParseException)1 IOException (java.io.IOException)1 Matcher (java.util.regex.Matcher)1