Search in sources :

Example 11 with ServerModel

use of com.beanit.openiec61850.ServerModel in project open-smart-grid-platform 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.opensmartgridplatform.dto.da.iec61850.LogicalDeviceDto) LogicalDevice(com.beanit.openiec61850.LogicalDevice) LogicalNodeDto(org.opensmartgridplatform.dto.da.iec61850.LogicalNodeDto) ArrayList(java.util.ArrayList) ModelNode(com.beanit.openiec61850.ModelNode)

Example 12 with ServerModel

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

the class RtuSimulator method addHeatPumpDevices.

private void addHeatPumpDevices(final ServerModel serverModel) {
    final String heatPumpPrefix = "HEAT_PUMP";
    int i = 1;
    String logicalDeviceName = heatPumpPrefix + i;
    ModelNode heatPumpNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (heatPumpNode != null) {
        this.logicalDevices.add(new HeatPump(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = heatPumpPrefix + i;
        heatPumpNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : HeatPump(org.opensmartgridplatform.simulator.protocol.iec61850.server.logicaldevices.HeatPump) ModelNode(com.beanit.openiec61850.ModelNode)

Example 13 with ServerModel

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

the class RtuSimulator method addEngineDevices.

private void addEngineDevices(final ServerModel serverModel) {
    final String enginePrefix = "ENGINE";
    int i = 1;
    String logicalDeviceName = enginePrefix + i;
    ModelNode engineNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (engineNode != null) {
        this.logicalDevices.add(new Engine(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = enginePrefix + i;
        engineNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : ModelNode(com.beanit.openiec61850.ModelNode) Engine(org.opensmartgridplatform.simulator.protocol.iec61850.server.logicaldevices.Engine)

Example 14 with ServerModel

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

the class RtuSimulator method addLoadDevices.

private void addLoadDevices(final ServerModel serverModel) {
    final String loadPrefix = "LOAD";
    int i = 1;
    String logicalDeviceName = loadPrefix + i;
    ModelNode loadNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (loadNode != null) {
        this.logicalDevices.add(new Load(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = loadPrefix + i;
        loadNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : Load(org.opensmartgridplatform.simulator.protocol.iec61850.server.logicaldevices.Load) ModelNode(com.beanit.openiec61850.ModelNode)

Example 15 with ServerModel

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

the class RtuSimulator method addBatteryDevices.

private void addBatteryDevices(final ServerModel serverModel) {
    final String batteryPrefix = "BATTERY";
    int i = 1;
    String logicalDeviceName = batteryPrefix + i;
    ModelNode batteryNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (batteryNode != null) {
        this.logicalDevices.add(new Battery(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = batteryPrefix + i;
        batteryNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : Battery(org.opensmartgridplatform.simulator.protocol.iec61850.server.logicaldevices.Battery) ModelNode(com.beanit.openiec61850.ModelNode)

Aggregations

ServerModel (org.openmuc.openiec61850.ServerModel)17 ModelNode (com.beanit.openiec61850.ModelNode)16 ServerModel (com.beanit.openiec61850.ServerModel)12 ModelNode (org.openmuc.openiec61850.ModelNode)10 ProtocolAdapterException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)8 ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)7 JMSException (javax.jms.JMSException)6 ClientAssociation (com.beanit.openiec61850.ClientAssociation)5 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 ConnectionFailureException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.ConnectionFailureException)4 Iec61850ClientAssociation (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.Iec61850ClientAssociation)4 Iec61850Connection (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.Iec61850Connection)4 DeviceConnection (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection)4 EmptyDeviceResponse (com.alliander.osgp.adapter.protocol.iec61850.device.ssld.responses.EmptyDeviceResponse)3 EmptyDeviceResponse (org.opensmartgridplatform.adapter.protocol.iec61850.device.ssld.responses.EmptyDeviceResponse)3 BasicDataAttribute (com.beanit.openiec61850.BasicDataAttribute)2