use of com.beanit.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceReportingService method enableGasFurnaceReportingOnDevice.
private void enableGasFurnaceReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
final ServerModel serverModel = connection.getConnection().getServerModel();
final String gasFurnacePrefix = LogicalDevice.GAS_FURNACE.getDescription();
int i = 1;
String logicalDeviceName = gasFurnacePrefix + i;
ModelNode gasFurnaceNode = serverModel.getChild(this.serverName + logicalDeviceName);
while (gasFurnaceNode != null) {
this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.GAS_FURNACE, i, DataAttribute.REPORT_STATUS_ONE);
this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.GAS_FURNACE, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
i += 1;
logicalDeviceName = gasFurnacePrefix + i;
gasFurnaceNode = serverModel.getChild(this.serverName + logicalDeviceName);
}
}
use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class DistributionAutomationGetDeviceModelRequestMessageProcessor method processLogicalDevices.
private synchronized List<LogicalDeviceDto> processLogicalDevices(final ServerModel model) {
final List<LogicalDeviceDto> logicalDevices = new ArrayList<>();
for (final ModelNode node : model.getChildren()) {
if (node instanceof LogicalDevice) {
final List<LogicalNodeDto> logicalNodes = this.processLogicalNodes((LogicalDevice) node);
logicalDevices.add(new LogicalDeviceDto(node.getName(), logicalNodes));
}
}
return logicalDevices;
}
use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class DistributionAutomationGetPQValuesRequestMessageProcessor method processPQValuesFunctionalChildConstraintObject.
private List<DataSampleDto> processPQValuesFunctionalChildConstraintObject(final LogicalNode parentNode, final String childName, final Fc constraint) {
final List<DataSampleDto> data = new ArrayList<>();
final ModelNode node = parentNode.getChild(childName, constraint);
if (Fc.MX == constraint && node.getChildren() != null) {
if (this.nodeHasBdaQualityChild(node)) {
data.add(this.processPQValue(node));
} else {
for (final ModelNode subNode : node.getChildren()) {
data.add(this.processPQValue(node, subNode));
}
}
}
return data;
}
use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class RtuSimulator method addBatteryDevices.
private void addBatteryDevices(final ServerModel serverModel) {
final String batteryPrefix = "BATTERY";
int i = 1;
String logicalDeviceName = batteryPrefix + i;
ModelNode batteryNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (batteryNode != null) {
this.logicalDevices.add(new Battery(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = batteryPrefix + i;
batteryNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
use of com.beanit.openiec61850.ModelNode in project open-smart-grid-platform by OSGP.
the class RtuSimulator method addHeatPumpDevices.
private void addHeatPumpDevices(final ServerModel serverModel) {
final String heatPumpPrefix = "HEAT_PUMP";
int i = 1;
String logicalDeviceName = heatPumpPrefix + i;
ModelNode heatPumpNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (heatPumpNode != null) {
this.logicalDevices.add(new HeatPump(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = heatPumpPrefix + i;
heatPumpNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
Aggregations