Search in sources :

Example 1 with DeviceResponseService

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.DeviceResponseService in project open-smart-grid-platform by OSGP.

the class SinglePointInformationWithTimeTagAsduHandler method handleAsdu.

@Override
public void handleAsdu(final ASdu asdu, final ResponseMetadata responseMetadata) {
    LOGGER.debug("Received asdu {} for device {}.", asdu, responseMetadata.getDeviceIdentification());
    final MeasurementReportDto measurementReportDto = this.converter.convert(asdu);
    final DeviceResponseService deviceResponseService = this.deviceResponseServiceRegistry.forDeviceType(responseMetadata.getDeviceType());
    if (CauseOfTransmission.SPONTANEOUS == asdu.getCauseOfTransmission()) {
        deviceResponseService.processEvent(measurementReportDto, responseMetadata);
    } else {
        deviceResponseService.process(measurementReportDto, responseMetadata);
    }
}
Also used : DeviceResponseService(org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.DeviceResponseService) MeasurementReportDto(org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto)

Aggregations

DeviceResponseService (org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.DeviceResponseService)1 MeasurementReportDto (org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto)1