use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class RtuSimulator method addLoadDevices.
private void addLoadDevices(final ServerModel serverModel) {
final String loadPrefix = "LOAD";
int i = 1;
String logicalDeviceName = loadPrefix + i;
ModelNode loadNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (loadNode != null) {
this.logicalDevices.add(new Load(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = loadPrefix + i;
loadNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class RtuSimulator method addWindDevices.
private void addWindDevices(final ServerModel serverModel) {
final String windPrefix = "WIND";
int i = 1;
String logicalDeviceName = windPrefix + i;
ModelNode windNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (windNode != null) {
this.logicalDevices.add(new Wind(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = windPrefix + i;
windNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class RtuSimulator method addLightMeasurementDevice.
private void addLightMeasurementDevice(final ServerModel serverModel) {
final String logicalDeviceName = "LD0";
final ModelNode lightMeasurementRtuNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
if (lightMeasurementRtuNode != null) {
// Light Measurement RTU found in the server model.
LOGGER.info("Adding lmRtu {}", logicalDeviceName);
this.logicalDevices.add(new LightMeasurementRtu(this.getDeviceName(), logicalDeviceName, serverModel));
}
}
use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform 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 com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class UpdateHealthStatusEventListener method updateServerValue.
private void updateServerValue(final ServerSap serverSap) {
LOGGER.debug("updateServerValue");
final ServerModel serverModel = serverSap.getModelCopy();
final ModelNode modelNode = serverModel.findModelNode(HEALTH_NODE, Fc.ST);
if (modelNode != null) {
final ModelNode dataNode = modelNode.getChild(STATUS_VALUE);
if (dataNode != null && dataNode instanceof BdaInt8) {
final List<BasicDataAttribute> changedAttributes = new ArrayList<>();
final BdaInt8 bda = (BdaInt8) dataNode;
bda.setValue(bda.getValue() == OK ? WARNING : (bda.getValue() == WARNING ? ALARM : OK));
changedAttributes.add(bda);
serverSap.setValues(changedAttributes);
}
}
}
Aggregations