use of org.opensmartgridplatform.dto.da.iec61850.LogicalNodeDto 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 org.opensmartgridplatform.dto.da.iec61850.LogicalNodeDto in project open-smart-grid-platform by OSGP.
the class Iec61850ClientDaRTUEventListener method processReport.
private void processReport(final Report report, final String reportDescription) throws ProtocolAdapterException {
final List<FcModelNode> dataSetMembers = report.getValues();
final List<LogicalDevice> logicalDevices = new ArrayList<>();
if (CollectionUtils.isEmpty(dataSetMembers)) {
this.logger.warn("No dataSet members available for {}", reportDescription);
return;
}
for (final FcModelNode member : dataSetMembers) {
// we are only interested in measurements
if (member.getFc() == Fc.MX) {
this.processMeasurementNode(logicalDevices, member);
}
}
final List<LogicalDeviceDto> logicalDevicesDtos = new ArrayList<>();
for (final LogicalDevice logicalDevice : logicalDevices) {
final List<LogicalNodeDto> logicalNodeDtos = new ArrayList<>();
for (final LogicalNode logicalNode : logicalDevice.getLogicalNodes()) {
final LogicalNodeDto logicalNodeDto = new LogicalNodeDto(logicalNode.getName(), logicalNode.getDataSamples());
logicalNodeDtos.add(logicalNodeDto);
}
final LogicalDeviceDto logicalDeviceDto = new LogicalDeviceDto(logicalDevice.getName(), logicalNodeDtos);
logicalDevicesDtos.add(logicalDeviceDto);
}
final GetPQValuesResponseDto response = new GetPQValuesResponseDto(logicalDevicesDtos);
this.deviceManagementService.sendPqValues(this.deviceIdentification, report.getRptId(), response);
}
use of org.opensmartgridplatform.dto.da.iec61850.LogicalNodeDto 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;
}
Aggregations