Search in sources :

Example 1 with EventType

use of org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.EventType in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850ClientSSLDEventListener method determineEventType.

private EventTypeDto determineEventType(final FcModelNode evnRpn, final String reportDescription) {
    final BdaInt8U evnTypeNode = (BdaInt8U) evnRpn.getChild(EVENT_NODE_EVENT_TYPE);
    if (evnTypeNode == null) {
        throw this.childNodeNotAvailableException(evnRpn, EVENT_NODE_EVENT_TYPE, reportDescription);
    }
    final short evnTypeCode = evnTypeNode.getValue();
    final EventType eventType = EventType.forCode(evnTypeCode);
    return eventType.getOsgpEventType();
}
Also used : EventType(com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.EventType) BdaInt8U(org.openmuc.openiec61850.BdaInt8U)

Example 2 with EventType

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

the class Iec61850SetEventNotificationFilterCommand method setEventNotificationFilterOnDevice.

public void setEventNotificationFilterOnDevice(final Iec61850Client iec61850Client, final DeviceConnection deviceConnection, final String filter) throws ProtocolAdapterException {
    final Function<Void> function = new Function<Void>() {

        @Override
        public Void apply(final DeviceMessageLog deviceMessageLog) throws ProtocolAdapterException {
            LOGGER.info("Setting the event notification filter");
            final NodeContainer eventBufferConfiguration = deviceConnection.getFcModelNode(LogicalDevice.LIGHTING, LogicalNode.STREET_LIGHT_CONFIGURATION, DataAttribute.EVENT_BUFFER, Fc.CF);
            iec61850Client.readNodeDataValues(deviceConnection.getConnection().getClientAssociation(), eventBufferConfiguration.getFcmodelNode());
            LOGGER.info("Updating the enabled EventType filter to {}", filter);
            eventBufferConfiguration.writeString(SubDataAttribute.EVENT_BUFFER_FILTER, filter);
            deviceMessageLog.addVariable(LogicalNode.STREET_LIGHT_CONFIGURATION, DataAttribute.EVENT_BUFFER, Fc.CF, SubDataAttribute.EVENT_BUFFER_FILTER, filter);
            Iec61850SetEventNotificationFilterCommand.this.loggingService.logMessage(deviceMessageLog, deviceConnection.getDeviceIdentification(), deviceConnection.getOrganisationIdentification(), false);
            return null;
        }
    };
    iec61850Client.sendCommandWithRetry(function, "SetEventNoficationFilter", deviceConnection.getDeviceIdentification());
}
Also used : Function(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.Function) DeviceMessageLog(org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog) NodeContainer(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 3 with EventType

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

the class Iec61850ClientSSLDEventListener method determineEventType.

private EventTypeDto determineEventType(final FcModelNode evnRpn, final String reportDescription) {
    final BdaInt8U evnTypeNode = (BdaInt8U) evnRpn.getChild(EVENT_NODE_EVENT_TYPE);
    if (evnTypeNode == null) {
        throw this.childNodeNotAvailableException(evnRpn, EVENT_NODE_EVENT_TYPE, reportDescription);
    }
    final short evnTypeCode = evnTypeNode.getValue();
    final EventType eventType = EventType.forCode(evnTypeCode);
    return eventType.getOsgpEventType();
}
Also used : EventType(org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.EventType) BdaInt8U(com.beanit.openiec61850.BdaInt8U)

Aggregations

EventType (com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.EventType)1 BdaInt8U (com.beanit.openiec61850.BdaInt8U)1 BdaInt8U (org.openmuc.openiec61850.BdaInt8U)1 DeviceMessageLog (org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog)1 EventType (org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.EventType)1 Function (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.Function)1 NodeContainer (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)1