Search in sources :

Example 1 with ReportDto

use of org.opensmartgridplatform.dto.valueobjects.microgrids.ReportDto in project open-smart-grid-platform by OSGP.

the class Iec61850ClientRTUEventListener method processReport.

private void processReport(final Report report, final String reportDescription, final Iec61850ReportHandler reportHandler) throws ProtocolAdapterException {
    final List<FcModelNode> dataSetMembers = report.getValues();
    if (CollectionUtils.isEmpty(dataSetMembers)) {
        this.logger.warn("No dataSet members available for {}", reportDescription);
        return;
    }
    final List<MeasurementDto> measurements = this.processMeasurements(reportHandler, reportDescription, dataSetMembers);
    final GetDataSystemIdentifierDto systemResult = reportHandler.createResult(measurements);
    final List<GetDataSystemIdentifierDto> systems = new ArrayList<>();
    systems.add(systemResult);
    final ReportDto reportDto = new ReportDto(report.getSqNum(), new DateTime(report.getTimeOfEntry().getTimestampValue()), report.getRptId());
    this.deviceManagementService.sendMeasurements(this.deviceIdentification, new GetDataResponseDto(systems, reportDto));
    this.reportingService.storeLastReportEntry(report, this.deviceIdentification);
}
Also used : GetDataResponseDto(org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataResponseDto) GetDataSystemIdentifierDto(org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) FcModelNode(com.beanit.openiec61850.FcModelNode) ReportDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ReportDto) MeasurementDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto) DateTime(org.joda.time.DateTime)

Aggregations

FcModelNode (com.beanit.openiec61850.FcModelNode)1 ArrayList (java.util.ArrayList)1 DateTime (org.joda.time.DateTime)1 GetDataResponseDto (org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataResponseDto)1 GetDataSystemIdentifierDto (org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto)1 MeasurementDto (org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto)1 ReportDto (org.opensmartgridplatform.dto.valueobjects.microgrids.ReportDto)1