use of org.openmuc.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method addRtuDevices.
private void addRtuDevices(final ServerModel serverModel) {
final String rtuPrefix = "RTU";
int i = 1;
String logicalDeviceName = rtuPrefix + i;
ModelNode rtuNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (rtuNode != null) {
this.logicalDevices.add(new Rtu(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = rtuPrefix + i;
rtuNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
use of org.openmuc.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method addEngineDevices.
private void addEngineDevices(final ServerModel serverModel) {
final String enginePrefix = "ENGINE";
int i = 1;
String logicalDeviceName = enginePrefix + i;
ModelNode engineNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (engineNode != null) {
this.logicalDevices.add(new Engine(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = enginePrefix + i;
engineNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
use of org.openmuc.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method assertValue.
public void assertValue(final String logicalDeviceName, final String node, final String value) {
final LogicalDevice logicalDevice = this.getLogicalDevice(logicalDeviceName);
// Get a new model copy to see values that have been set on the server.
logicalDevice.refreshServerModel(this.server.getModelCopy());
final ModelNode actual = logicalDevice.getBasicDataAttribute(node);
if (actual == null) {
throw new AssertionError("RTU Simulator does not have expected node \"" + node + "\" on logical device \"" + logicalDeviceName + "\".");
}
if (!(actual instanceof BasicDataAttribute)) {
throw new AssertionError("RTU Simulator value has node \"" + node + "\" on logical device \"" + logicalDeviceName + "\", but it is not a BasicDataAttribute: " + actual.getClass().getName());
}
final BasicDataAttribute expected = this.getCopyWithNewValue((BasicDataAttribute) actual, value);
if (!BasicDataAttributesHelper.attributesEqual(expected, (BasicDataAttribute) actual)) {
throw new AssertionError("RTU Simulator attribute for node \"" + node + "\" on logical device \"" + logicalDeviceName + "\" - expected: [" + expected + "], actual: [" + actual + "]");
}
}
use of org.openmuc.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method addGasFurnaceDevices.
private void addGasFurnaceDevices(final ServerModel serverModel) {
final String gasFurnacePrefix = "GAS_FURNACE";
int i = 1;
String logicalDeviceName = gasFurnacePrefix + i;
ModelNode gasFurnaceNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (gasFurnaceNode != null) {
this.logicalDevices.add(new GasFurnace(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = gasFurnacePrefix + i;
gasFurnaceNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
use of org.openmuc.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method addHeatBufferDevices.
private void addHeatBufferDevices(final ServerModel serverModel) {
final String heatBufferPrefix = "HEAT_BUFFER";
int i = 1;
String logicalDeviceName = heatBufferPrefix + i;
ModelNode heatBufferNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (heatBufferNode != null) {
this.logicalDevices.add(new HeatBuffer(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = heatBufferPrefix + i;
heatBufferNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
Aggregations