use of com.beanit.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class DistributionAutomationGetPQValuesRequestMessageProcessor method processPQValueNodeChildren.
private List<DataSampleDto> processPQValueNodeChildren(final LogicalNode node) {
final List<DataSampleDto> data = new ArrayList<>();
final Collection<ModelNode> children = node.getChildren();
final Map<String, Set<Fc>> childMap = new HashMap<>();
for (final ModelNode child : children) {
if (!childMap.containsKey(child.getName())) {
childMap.put(child.getName(), new HashSet<Fc>());
}
childMap.get(child.getName()).add(((FcModelNode) child).getFc());
}
for (final Map.Entry<String, Set<Fc>> childEntry : childMap.entrySet()) {
final List<DataSampleDto> childData = this.processPQValuesFunctionalConstraintObject(node, childEntry.getKey(), childEntry.getValue());
if (!childData.isEmpty()) {
data.addAll(childData);
}
}
return data;
}
use of com.beanit.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 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 Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceReportingService method enableHeatPumpReportingOnDevice.
private void enableHeatPumpReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
final ServerModel serverModel = connection.getConnection().getServerModel();
final String heatPumpPrefix = LogicalDevice.HEAT_PUMP.getDescription();
int i = 1;
String logicalDeviceName = heatPumpPrefix + i;
ModelNode heatPumpNode = serverModel.getChild(this.serverName + logicalDeviceName);
while (heatPumpNode != null) {
this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.HEAT_PUMP, i, DataAttribute.REPORT_STATUS_ONE);
this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.HEAT_PUMP, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
i += 1;
logicalDeviceName = heatPumpPrefix + i;
heatPumpNode = serverModel.getChild(this.serverName + logicalDeviceName);
}
}
use of com.beanit.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceReportingService method enableLoadReportingOnDevice.
private void enableLoadReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
final ServerModel serverModel = connection.getConnection().getServerModel();
final String loadPrefix = LogicalDevice.LOAD.getDescription();
int i = 1;
String logicalDeviceName = loadPrefix + i;
ModelNode loadNode = serverModel.getChild(this.serverName + logicalDeviceName);
while (loadNode != null) {
this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.LOAD, i, DataAttribute.REPORT_STATUS_ONE);
this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.LOAD, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
i += 1;
logicalDeviceName = loadPrefix + i;
loadNode = serverModel.getChild(this.serverName + logicalDeviceName);
}
}
use of com.beanit.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceReportingService method enableBoilerReportingOnDevice.
private void enableBoilerReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
final ServerModel serverModel = connection.getConnection().getServerModel();
final String boilerPrefix = LogicalDevice.BOILER.getDescription();
int i = 1;
String logicalDeviceName = boilerPrefix + i;
ModelNode boilerNode = serverModel.getChild(this.serverName + logicalDeviceName);
while (boilerNode != null) {
this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.BOILER, i, DataAttribute.REPORT_STATUS_ONE);
this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.BOILER, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
i += 1;
logicalDeviceName = boilerPrefix + i;
boilerNode = serverModel.getChild(this.serverName + logicalDeviceName);
}
}
Aggregations