Search in sources :

Example 11 with BasicDataAttribute

use of org.openmuc.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 12 with BasicDataAttribute

use of org.openmuc.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)

Example 13 with BasicDataAttribute

use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.

the class LogicalDevice method setRandomInt.

protected BasicDataAttribute setRandomInt(final String node, final Fc fc, final int min, final int max) {
    final BdaInt32 value = (BdaInt32) this.serverModel.findModelNode(this.createNodeName(node), fc);
    value.setValue(ThreadLocalRandom.current().nextInt(min, max));
    return value;
}
Also used : BdaInt32(org.openmuc.openiec61850.BdaInt32)

Example 14 with BasicDataAttribute

use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.

the class LogicalDevice method setTime.

protected BasicDataAttribute setTime(final String node, final Fc fc, final Date date) {
    final BdaTimestamp value = (BdaTimestamp) this.serverModel.findModelNode(this.createNodeName(node), fc);
    value.setDate(date);
    return value;
}
Also used : BdaTimestamp(org.openmuc.openiec61850.BdaTimestamp)

Example 15 with BasicDataAttribute

use of org.openmuc.openiec61850.BasicDataAttribute in project Protocol-Adapter-IEC61850 by OSGP.

the class LogicalDevice method setFixedInt.

protected BasicDataAttribute setFixedInt(final String node, final Fc fc, final int val) {
    final BdaInt64 value = (BdaInt64) this.serverModel.findModelNode(this.createNodeName(node), fc);
    value.setValue((byte) val);
    return value;
}
Also used : BdaInt64(org.openmuc.openiec61850.BdaInt64)

Aggregations

BasicDataAttribute (org.openmuc.openiec61850.BasicDataAttribute)4 LogicalDevice (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.LogicalDevice)3 BdaInt32 (org.openmuc.openiec61850.BdaInt32)3 BdaFloat32 (org.openmuc.openiec61850.BdaFloat32)2 BdaInt8 (org.openmuc.openiec61850.BdaInt8)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 BdaBoolean (org.openmuc.openiec61850.BdaBoolean)1 BdaInt64 (org.openmuc.openiec61850.BdaInt64)1 BdaQuality (org.openmuc.openiec61850.BdaQuality)1 BdaTimestamp (org.openmuc.openiec61850.BdaTimestamp)1 ModelNode (org.openmuc.openiec61850.ModelNode)1 Scheduled (org.springframework.scheduling.annotation.Scheduled)1