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