Search in sources :

Example 26 with ModelNode

use of org.openmuc.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.

the class DistributionAutomationGetPQValuesRequestMessageProcessor method processPQValuesFunctionalChildConstraintObject.

private List<DataSampleDto> processPQValuesFunctionalChildConstraintObject(final LogicalNode parentNode, final String childName, final Fc constraint) {
    final List<DataSampleDto> data = new ArrayList<>();
    final ModelNode node = parentNode.getChild(childName, constraint);
    if (Fc.MX == constraint && node.getChildren() != null) {
        if (this.nodeHasBdaQualityChild(node)) {
            data.add(this.processPQValue(node));
        } else {
            for (final ModelNode subNode : node.getChildren()) {
                data.add(this.processPQValue(node, subNode));
            }
        }
    }
    return data;
}
Also used : DataSampleDto(org.osgpfoundation.osgp.dto.da.iec61850.DataSampleDto) ArrayList(java.util.ArrayList) FcModelNode(org.openmuc.openiec61850.FcModelNode) ModelNode(org.openmuc.openiec61850.ModelNode)

Example 27 with ModelNode

use of org.openmuc.openiec61850.ModelNode in project Protocol-Adapter-IEC61850 by OSGP.

the class DistributionAutomationGetPQValuesRequestMessageProcessor method processPQValueNodeChildren.

private List<DataSampleDto> processPQValueNodeChildren(final LogicalNode node) {
    final List<DataSampleDto> data = new ArrayList<>();
    final Collection<ModelNode> children = node.getChildren();
    final Map<String, Set<Fc>> childMap = new HashMap<>();
    for (final ModelNode child : children) {
        if (!childMap.containsKey(child.getName())) {
            childMap.put(child.getName(), new HashSet<Fc>());
        }
        childMap.get(child.getName()).add(((FcModelNode) child).getFc());
    }
    for (final Map.Entry<String, Set<Fc>> childEntry : childMap.entrySet()) {
        final List<DataSampleDto> childData = this.processPQValuesFunctionalConstraintObject(node, childEntry.getKey(), childEntry.getValue());
        if (!childData.isEmpty()) {
            data.addAll(childData);
        }
    }
    return data;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) DataSampleDto(org.osgpfoundation.osgp.dto.da.iec61850.DataSampleDto) FcModelNode(org.openmuc.openiec61850.FcModelNode) ModelNode(org.openmuc.openiec61850.ModelNode) Fc(org.openmuc.openiec61850.Fc) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

ModelNode (org.openmuc.openiec61850.ModelNode)25 ServerModel (org.openmuc.openiec61850.ServerModel)11 FcModelNode (org.openmuc.openiec61850.FcModelNode)5 ArrayList (java.util.ArrayList)3 DataSampleDto (org.osgpfoundation.osgp.dto.da.iec61850.DataSampleDto)3 NodeReadException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeReadException)1 ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)1 Iec61850Connection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850Connection)1 Battery (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Battery)1 Boiler (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Boiler)1 Chp (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Chp)1 Engine (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Engine)1 GasFurnace (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.GasFurnace)1 HeatBuffer (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.HeatBuffer)1 HeatPump (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.HeatPump)1 Load (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Load)1 LogicalDevice (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.LogicalDevice)1 Pv (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Pv)1 Rtu (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Rtu)1 BigDecimal (java.math.BigDecimal)1