Search in sources :

Example 11 with LogicalDevice

use of com.beanit.openiec61850.LogicalDevice in project open-smart-grid-platform by OSGP.

the class DeviceConnection method getFcModelNode.

/**
 * Returns a {@link NodeContainer} for the given {@link ObjectReference} data and the Functional
 * constraint.
 *
 * @throws NodeNotFoundException
 */
public NodeContainer getFcModelNode(final LogicalDevice logicalDevice, final int logicalDeviceIndex, final LogicalNode logicalNode, final DataAttribute dataAttribute, final Fc fc) throws NodeNotFoundException {
    final ObjectReference objectReference = this.createObjectReference(logicalDevice, logicalDeviceIndex, logicalNode, dataAttribute);
    final FcModelNode fcModelNode = (FcModelNode) this.connection.getServerModel().findModelNode(objectReference, fc);
    if (fcModelNode == null) {
        LOGGER.error("FcModelNode is null, most likely the data attribute: {} does not exist", dataAttribute.getDescription());
        throw new NodeNotFoundException(String.format("FcModelNode with objectReference %s does not exist", objectReference));
    }
    return new NodeContainer(this, fcModelNode);
}
Also used : NodeNotFoundException(org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeNotFoundException) ObjectReference(com.beanit.openiec61850.ObjectReference) FcModelNode(com.beanit.openiec61850.FcModelNode)

Aggregations

FcModelNode (com.beanit.openiec61850.FcModelNode)5 BasicDataAttribute (com.beanit.openiec61850.BasicDataAttribute)4 ArrayList (java.util.ArrayList)4 LogicalDevice (org.opensmartgridplatform.simulator.protocol.iec61850.server.logicaldevices.LogicalDevice)4 ModelNode (com.beanit.openiec61850.ModelNode)2 ObjectReference (com.beanit.openiec61850.ObjectReference)2 NodeNotFoundException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeNotFoundException)2 LogicalDeviceDto (org.opensmartgridplatform.dto.da.iec61850.LogicalDeviceDto)2 LogicalNodeDto (org.opensmartgridplatform.dto.da.iec61850.LogicalNodeDto)2 LogicalDevice (com.beanit.openiec61850.LogicalDevice)1 SclParseException (com.beanit.openiec61850.SclParseException)1 ServerModel (com.beanit.openiec61850.ServerModel)1 IOException (java.io.IOException)1 Date (java.util.Date)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 LogicalDevice (org.openmuc.openiec61850.LogicalDevice)1 ModelNode (org.openmuc.openiec61850.ModelNode)1 NodeReadException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeReadException)1 ProtocolAdapterException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)1