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());
}
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);
}
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);
}
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);
}
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);
}
Aggregations