Search in sources :

Example 51 with NodeException

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

the class Iec61850ActivePowerCommand 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, this.dataAttribute, 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 52 with NodeException

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

the class Iec61850AlarmOtherCommand 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.GENERIC_PROCESS_I_O, DataAttribute.ALARM_OTHER, Fc.ST);
    client.readNodeDataValues(connection.getConnection().getClientAssociation(), containingNode.getFcmodelNode());
    return this.translate(containingNode);
}
Also used : NodeContainer(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 53 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)

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