Search in sources :

Example 21 with ServerModel

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

the class DistributionAutomationGetDeviceModelRequestMessageProcessor method processLogicalDevices.

private synchronized List<LogicalDeviceDto> processLogicalDevices(final ServerModel model) {
    final List<LogicalDeviceDto> logicalDevices = new ArrayList<>();
    for (final ModelNode node : model.getChildren()) {
        if (node instanceof LogicalDevice) {
            final List<LogicalNodeDto> logicalNodes = this.processLogicalNodes((LogicalDevice) node);
            logicalDevices.add(new LogicalDeviceDto(node.getName(), logicalNodes));
        }
    }
    return logicalDevices;
}
Also used : LogicalDeviceDto(org.osgpfoundation.osgp.dto.da.iec61850.LogicalDeviceDto) LogicalDevice(org.openmuc.openiec61850.LogicalDevice) LogicalNodeDto(org.osgpfoundation.osgp.dto.da.iec61850.LogicalNodeDto) ArrayList(java.util.ArrayList) ModelNode(org.openmuc.openiec61850.ModelNode)

Example 22 with ServerModel

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

the class Iec61850DeviceConnectionService method getModelNode.

private FcModelNode getModelNode(final String logicalDevice, final Iec61850Connection iec61850Connection, final String description) throws ProtocolAdapterException {
    final ServerModel serverModel = iec61850Connection.getServerModel();
    if (serverModel == null) {
        final String msg = String.format("ServerModel is null for logicalDevice {%s}", logicalDevice);
        throw new ProtocolAdapterException(msg);
    }
    final String objRef = description + logicalDevice + "/" + LogicalNode.LOGICAL_NODE_ZERO.getDescription() + "." + DataAttribute.NAME_PLATE.getDescription();
    final FcModelNode modelNode = (FcModelNode) serverModel.findModelNode(objRef, Fc.DC);
    if (modelNode == null) {
        final String msg = String.format("ModelNode is null for {%s}", objRef);
        throw new ProtocolAdapterException(msg);
    }
    return modelNode;
}
Also used : ServerModel(org.openmuc.openiec61850.ServerModel) FcModelNode(org.openmuc.openiec61850.FcModelNode) ProtocolAdapterException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)

Example 23 with ServerModel

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

the class Iec61850RtuDeviceReportingService method enableHeatPumpReportingOnDevice.

private void enableHeatPumpReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
    final ServerModel serverModel = connection.getConnection().getServerModel();
    final String heatPumpPrefix = LogicalDevice.HEAT_PUMP.getDescription();
    int i = 1;
    String logicalDeviceName = heatPumpPrefix + i;
    ModelNode heatPumpNode = serverModel.getChild(this.serverName + logicalDeviceName);
    while (heatPumpNode != null) {
        this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.HEAT_PUMP, i, DataAttribute.REPORT_STATUS_ONE);
        this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.HEAT_PUMP, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
        i += 1;
        logicalDeviceName = heatPumpPrefix + i;
        heatPumpNode = serverModel.getChild(this.serverName + logicalDeviceName);
    }
}
Also used : ServerModel(org.openmuc.openiec61850.ServerModel) ModelNode(org.openmuc.openiec61850.ModelNode)

Example 24 with ServerModel

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

the class Iec61850RtuDeviceReportingService method enableLoadReportingOnDevice.

private void enableLoadReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
    final ServerModel serverModel = connection.getConnection().getServerModel();
    final String loadPrefix = LogicalDevice.LOAD.getDescription();
    int i = 1;
    String logicalDeviceName = loadPrefix + i;
    ModelNode loadNode = serverModel.getChild(this.serverName + logicalDeviceName);
    while (loadNode != null) {
        this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.LOAD, i, DataAttribute.REPORT_STATUS_ONE);
        this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.LOAD, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
        i += 1;
        logicalDeviceName = loadPrefix + i;
        loadNode = serverModel.getChild(this.serverName + logicalDeviceName);
    }
}
Also used : ServerModel(org.openmuc.openiec61850.ServerModel) ModelNode(org.openmuc.openiec61850.ModelNode)

Example 25 with ServerModel

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

the class Iec61850RtuDeviceReportingService method enableBoilerReportingOnDevice.

private void enableBoilerReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
    final ServerModel serverModel = connection.getConnection().getServerModel();
    final String boilerPrefix = LogicalDevice.BOILER.getDescription();
    int i = 1;
    String logicalDeviceName = boilerPrefix + i;
    ModelNode boilerNode = serverModel.getChild(this.serverName + logicalDeviceName);
    while (boilerNode != null) {
        this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.BOILER, i, DataAttribute.REPORT_STATUS_ONE);
        this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.BOILER, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
        i += 1;
        logicalDeviceName = boilerPrefix + i;
        boilerNode = serverModel.getChild(this.serverName + logicalDeviceName);
    }
}
Also used : ServerModel(org.openmuc.openiec61850.ServerModel) ModelNode(org.openmuc.openiec61850.ModelNode)

Aggregations

ModelNode (org.openmuc.openiec61850.ModelNode)21 ServerModel (org.openmuc.openiec61850.ServerModel)17 ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)7 ConnectionFailureException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException)4 Iec61850ClientAssociation (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850ClientAssociation)4 Iec61850Connection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850Connection)4 DeviceConnection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection)4 ClientAssociation (org.openmuc.openiec61850.ClientAssociation)4 EmptyDeviceResponse (com.alliander.osgp.adapter.protocol.iec61850.device.ssld.responses.EmptyDeviceResponse)3 JMSException (javax.jms.JMSException)3 DaDeviceResponse (com.alliander.osgp.adapter.protocol.iec61850.device.da.rtu.DaDeviceResponse)1 GetDataDeviceResponse (com.alliander.osgp.adapter.protocol.iec61850.device.ssld.responses.GetDataDeviceResponse)1 Iec61850Device (com.alliander.osgp.adapter.protocol.iec61850.domain.entities.Iec61850Device)1 Iec61850ClientBaseEventListener (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.reporting.Iec61850ClientBaseEventListener)1 GetDataResponseDto (com.alliander.osgp.dto.valueobjects.microgrids.GetDataResponseDto)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