use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850Client method readServerModelFromDevice.
/**
* Read the device model from the device.
*
* @param clientAssociation
* The {@link ClientAssociation} instance.
*
* @return A {@link ServerModel} instance.
* @throws ProtocolAdapterException
*/
public ServerModel readServerModelFromDevice(final ClientAssociation clientAssociation) throws ProtocolAdapterException {
try {
LOGGER.debug("Start reading server model from device");
// RetrieveModel() will call all GetDirectory and GetDefinition ACSI
// services needed to get the complete server model.
final ServerModel serverModel = clientAssociation.retrieveModel();
LOGGER.debug("Completed reading server model from device");
return serverModel;
} catch (final ServiceError e) {
clientAssociation.close();
throw new ProtocolAdapterException("Service Error requesting model.", e);
} catch (final IOException e) {
throw new ProtocolAdapterException("Fatal IOException requesting model.", e);
}
}
use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceReportingService method enableChpReportingOnDevice.
private void enableChpReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
final ServerModel serverModel = connection.getConnection().getServerModel();
final String chpPrefix = LogicalDevice.CHP.getDescription();
int i = 1;
String logicalDeviceName = chpPrefix + i;
ModelNode chpNode = serverModel.getChild(this.serverName + logicalDeviceName);
while (chpNode != null) {
this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.CHP, i, DataAttribute.REPORT_STATUS_ONE);
this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.CHP, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
i += 1;
logicalDeviceName = chpPrefix + i;
chpNode = serverModel.getChild(this.serverName + logicalDeviceName);
}
}
use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceReportingService method enableRtuReportingOnDevice.
private void enableRtuReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
final ServerModel serverModel = connection.getConnection().getServerModel();
final String rtuPrefix = LogicalDevice.RTU.getDescription();
int i = 1;
String logicalDeviceName = rtuPrefix + i;
ModelNode rtuNode = serverModel.getChild(this.serverName + logicalDeviceName);
while (rtuNode != null) {
this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.RTU, i, DataAttribute.REPORT_STATUS_ONE);
i += 1;
logicalDeviceName = rtuPrefix + i;
rtuNode = serverModel.getChild(this.serverName + logicalDeviceName);
}
}
use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceReportingService method enablePvReportingOnDevice.
private void enablePvReportingOnDevice(final DeviceConnection connection, final String deviceIdentification) {
final ServerModel serverModel = connection.getConnection().getServerModel();
final String pvPrefix = LogicalDevice.PV.getDescription();
int i = 1;
String logicalDeviceName = pvPrefix + i;
ModelNode pvNode = serverModel.getChild(this.serverName + logicalDeviceName);
while (pvNode != null) {
this.enableStatusReportingOnDevice(connection, deviceIdentification, LogicalDevice.PV, i, DataAttribute.REPORT_STATUS_ONE);
this.enableMeasurementReportingOnDevice(connection, deviceIdentification, LogicalDevice.PV, i, DataAttribute.REPORT_MEASUREMENTS_ONE);
i += 1;
logicalDeviceName = pvPrefix + i;
pvNode = serverModel.getChild(this.serverName + logicalDeviceName);
}
}
use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.
the class RtuSimulator method addPvDevices.
private void addPvDevices(final ServerModel serverModel) {
final String pvPrefix = "PV";
int i = 1;
String logicalDeviceName = pvPrefix + i;
ModelNode pvNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
while (pvNode != null) {
this.logicalDevices.add(new Pv(this.getDeviceName(), logicalDeviceName, serverModel));
i += 1;
logicalDeviceName = pvPrefix + i;
pvNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
}
}
Aggregations