Search in sources :

Example 1 with ObjectReference

use of com.beanit.openiec61850.ObjectReference 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 LogicalNode logicalNode, final DataAttribute dataAttribute, final Fc fc) throws NodeNotFoundException {
    final ObjectReference objectReference = this.createObjectReference(logicalDevice, 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)

Example 2 with ObjectReference

use of com.beanit.openiec61850.ObjectReference 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)2 ObjectReference (com.beanit.openiec61850.ObjectReference)2 NodeNotFoundException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeNotFoundException)2