Search in sources :

Example 1 with Iec61850DeviceReportGroup

use of org.opensmartgridplatform.adapter.protocol.iec61850.domain.entities.Iec61850DeviceReportGroup in project open-smart-grid-platform by OSGP.

the class DeviceManagementService method sendPqValues.

public void sendPqValues(final String deviceIdentification, final String reportDataSet, final GetPQValuesResponseDto response) {
    final Iec61850DeviceReportGroup deviceReportGroup = this.deviceReportGroupRepository.findByDeviceIdentificationAndReportDataSet(deviceIdentification, reportDataSet);
    final ProtocolResponseMessage responseMessage = ProtocolResponseMessage.newBuilder().messageMetadata(MessageMetadata.newBuilder().withDeviceIdentification(deviceIdentification).withOrganisationIdentification(NO_ORGANISATION).withCorrelationUid(NO_CORRELATION_UID).withMessageType(MessageType.GET_POWER_QUALITY_VALUES.name()).withDomain(deviceReportGroup.getDomain()).withDomainVersion(deviceReportGroup.getDomainVersion()).withMessagePriority(0).withScheduled(false).build()).result(ResponseMessageResultType.OK).dataObject(response).build();
    this.responseSender.send(responseMessage);
}
Also used : ProtocolResponseMessage(org.opensmartgridplatform.shared.infra.jms.ProtocolResponseMessage) Iec61850DeviceReportGroup(org.opensmartgridplatform.adapter.protocol.iec61850.domain.entities.Iec61850DeviceReportGroup)

Example 2 with Iec61850DeviceReportGroup

use of org.opensmartgridplatform.adapter.protocol.iec61850.domain.entities.Iec61850DeviceReportGroup in project open-smart-grid-platform by OSGP.

the class Iec61850RtuDeviceReportingService method enableSpecificReports.

private void enableSpecificReports(final DeviceConnection connection, final String deviceIdentification, final String serverName) {
    final ServerModel serverModel = connection.getConnection().getServerModel();
    final ClientAssociation clientAssociation = connection.getConnection().getClientAssociation();
    final List<Iec61850DeviceReportGroup> deviceReportGroups = this.iec61850DeviceReportRepository.findByDeviceIdentificationAndEnabled(deviceIdentification, true);
    for (final Iec61850DeviceReportGroup deviceReportGroup : deviceReportGroups) {
        this.enableReportGroup(serverName, deviceIdentification, deviceReportGroup.getIec61850ReportGroup(), serverModel, clientAssociation);
    }
}
Also used : ServerModel(com.beanit.openiec61850.ServerModel) Iec61850DeviceReportGroup(org.opensmartgridplatform.adapter.protocol.iec61850.domain.entities.Iec61850DeviceReportGroup) ClientAssociation(com.beanit.openiec61850.ClientAssociation)

Aggregations

Iec61850DeviceReportGroup (org.opensmartgridplatform.adapter.protocol.iec61850.domain.entities.Iec61850DeviceReportGroup)2 ClientAssociation (com.beanit.openiec61850.ClientAssociation)1 ServerModel (com.beanit.openiec61850.ServerModel)1 ProtocolResponseMessage (org.opensmartgridplatform.shared.infra.jms.ProtocolResponseMessage)1