Search in sources :

Example 11 with BasicDataAttribute

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

Example 12 with BasicDataAttribute

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

Example 13 with BasicDataAttribute

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

Example 14 with BasicDataAttribute

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

Example 15 with BasicDataAttribute

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));
}
Also used : LogicalDevice(com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.LogicalDevice) BasicDataAttribute(org.openmuc.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