Search in sources :

Example 21 with NodeException

use of org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeException in project open-smart-grid-platform by OSGP.

the class Iec61850MaterialFlowCommand method execute.

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

Example 22 with NodeException

use of org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeException in project open-smart-grid-platform by OSGP.

the class Iec61850MaterialTypeCommand method execute.

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

Example 23 with NodeException

use of org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeException in project open-smart-grid-platform by OSGP.

the class Iec61850MaximumPowerLimitCommand method execute.

@Override
public MeasurementDto execute(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex) throws NodeException {
    final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, LogicalNode.DER_CONTROLLER_CHARACTERISTICS_ONE, DataAttribute.MAXIMUM_POWER_LIMIT, Fc.CF);
    client.readNodeDataValues(connection.getConnection().getClientAssociation(), containingNode.getFcmodelNode());
    return this.translate(containingNode);
}
Also used : NodeContainer(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 24 with NodeException

use of org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeException in project open-smart-grid-platform by OSGP.

the class Iec61850Commands method enableOperationOfRelay.

/**
 * Checks if {@code CfSt.enbOper [CF]} for the given {@code logicalNode} is set to {@code true} on
 * the Lighting device, because this is necessary to be able to operate the relay.
 *
 * <p>If it is {@code false}, switching of the relay is enabled by writing boolean {@code true} to
 * {@code CfSt.enbOper [CF]}.
 */
public static void enableOperationOfRelay(final DeviceConnection deviceConnection, final Iec61850Client iec61850Client, final DeviceMessageLog deviceMessageLog, final LogicalNode logicalNode, final Integer index) throws NodeException {
    final NodeContainer masterControl = deviceConnection.getFcModelNode(LogicalDevice.LIGHTING, logicalNode, DataAttribute.MASTER_CONTROL, Fc.CF);
    iec61850Client.readNodeDataValues(deviceConnection.getConnection().getClientAssociation(), masterControl.getFcmodelNode());
    final BdaBoolean enbOper = masterControl.getBoolean(SubDataAttribute.ENABLE_OPERATION);
    if (enbOper.getValue()) {
        LOGGER.info("masterControl.enbOper is true, switching of relay {} is enabled", index);
    } else {
        LOGGER.info("masterControl.enbOper is false, switching of relay {} is disabled", index);
        masterControl.writeBoolean(SubDataAttribute.ENABLE_OPERATION, true);
        LOGGER.info("set masterControl.enbOper to true to enable switching of relay {}", index);
        deviceMessageLog.addVariable(logicalNode, DataAttribute.MASTER_CONTROL, Fc.CF, SubDataAttribute.ENABLE_OPERATION, Boolean.toString(true));
    }
}
Also used : BdaBoolean(com.beanit.openiec61850.BdaBoolean) NodeContainer(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 25 with NodeException

use of org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeException in project open-smart-grid-platform by OSGP.

the class Iec61850DisableRegistrationCommand method disableRegistration.

public void disableRegistration(final DeviceConnection deviceConnection) throws NodeException {
    final NodeContainer deviceRegistration = deviceConnection.getFcModelNode(LogicalDevice.LIGHTING, LogicalNode.STREET_LIGHT_CONFIGURATION, DataAttribute.REGISTRATION, Fc.CF);
    deviceRegistration.writeBoolean(SubDataAttribute.DEVICE_REGISTRATION_ENABLED, false);
    LOGGER.info("Registration disabled for device: {}", deviceConnection.getDeviceIdentification());
}
Also used : NodeContainer(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Aggregations

NodeContainer (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)53 Iec61850ClientBaseEventListener (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.reporting.Iec61850ClientBaseEventListener)5 BdaBoolean (com.beanit.openiec61850.BdaBoolean)2 Date (java.util.Date)2 DateTime (org.joda.time.DateTime)1 ProfilePair (org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.ProfilePair)1 LogicalNode (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.LogicalNode)1