Search in sources :

Example 76 with DeviceConnection

use of com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection in project Protocol-Adapter-IEC61850 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 Exception {
            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);
            DeviceMessageLoggingService.logMessage(deviceMessageLog, deviceConnection.getDeviceIdentification(), deviceConnection.getOrganisationIdentification(), false);
            return null;
        }
    };
    iec61850Client.sendCommandWithRetry(function, "SetEventNoficationFilter", deviceConnection.getDeviceIdentification());
}
Also used : Function(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.Function) DeviceMessageLog(com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog) NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 77 with DeviceConnection

use of com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850ScheduleIdCommand method execute.

@Override
public MeasurementDto execute(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex) throws NodeReadException {
    final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, this.logicalNode, DATA_ATTRIBUTE, FC);
    client.readNodeDataValues(connection.getConnection().getClientAssociation(), containingNode.getFcmodelNode());
    return this.translate(containingNode);
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 78 with DeviceConnection

use of com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850LoadMinimumActualPowerCommand method execute.

@Override
public MeasurementDto execute(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex) throws NodeReadException {
    final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, this.logicalNode, DataAttribute.MIN_ACTUAL_POWER, Fc.MX);
    client.readNodeDataValues(connection.getConnection().getClientAssociation(), containingNode.getFcmodelNode());
    return this.translate(containingNode);
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 79 with DeviceConnection

use of com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850LoadTotalEnergyCommand method execute.

@Override
public MeasurementDto execute(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex) throws NodeReadException {
    final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, this.logicalNode, DataAttribute.TOTAL_ENERGY, Fc.ST);
    client.readNodeDataValues(connection.getConnection().getClientAssociation(), containingNode.getFcmodelNode());
    return this.translate(containingNode);
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 80 with DeviceConnection

use of com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850MaterialStatusCommand method execute.

@Override
public MeasurementDto execute(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex) throws NodeReadException {
    final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, this.logicalNode, DataAttribute.MATERIAL_STATUS, Fc.SP);
    client.readNodeDataValues(connection.getConnection().getClientAssociation(), containingNode.getFcmodelNode());
    return this.translate(containingNode);
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Aggregations

NodeContainer (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)55 ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)22 DeviceConnection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection)18 ConnectionFailureException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException)17 NodeWriteException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException)17 JMSException (javax.jms.JMSException)16 DeviceMessageLog (com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog)15 Function (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.Function)15 FunctionalException (com.alliander.osgp.shared.exceptionhandling.FunctionalException)14 TechnicalException (com.alliander.osgp.shared.exceptionhandling.TechnicalException)13 ArrayList (java.util.ArrayList)8 Ssld (com.alliander.osgp.core.db.api.iec61850.entities.Ssld)7 LogicalNode (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.LogicalNode)6 DeviceOutputSetting (com.alliander.osgp.core.db.api.iec61850.entities.DeviceOutputSetting)6 DateTime (org.joda.time.DateTime)6 BdaBoolean (org.openmuc.openiec61850.BdaBoolean)5 Iec61850ClientAssociation (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850ClientAssociation)4 Iec61850Connection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850Connection)4 ClientAssociation (org.openmuc.openiec61850.ClientAssociation)4 ServerModel (org.openmuc.openiec61850.ServerModel)4