use of com.beanit.openiec61850.Rcb in project open-smart-grid-platform by OSGP.
the class Iec61850RtuDeviceReportingService method enableReports.
private void enableReports(final DeviceConnection connection, final String deviceIdentification, final Collection<? extends Rcb> reports) {
for (final Rcb report : reports) {
final String reportReference = report.getReference().toString();
try {
LOGGER.info("Enable reporting for report {} on device {}.", reportReference, deviceIdentification);
if (report instanceof Brcb) {
this.resyncBufferedReport(connection, deviceIdentification, (Brcb) report);
}
final NodeContainer node = new NodeContainer(connection, report);
node.writeBoolean(SubDataAttribute.ENABLE_REPORTING, true);
} catch (final NullPointerException e) {
LOGGER.debug("NullPointerException", e);
LOGGER.warn("Skip enable reporting for report {} on device {}.", reportReference, deviceIdentification);
} catch (final NodeWriteException e) {
LOGGER.debug("NodeWriteException", e);
LOGGER.error("Enable reporting for report {} on device {} failed with exception: {}", reportReference, deviceIdentification, e.getMessage());
}
}
}
use of com.beanit.openiec61850.Rcb in project open-smart-grid-platform by OSGP.
the class Iec61850RtuDeviceReportingService method enableReport.
private void enableReport(final String serverName, final String deviceIdentification, final Iec61850Report iec61850Report, final ServerModel serverModel, final ClientAssociation clientAssociation) {
int i = 1;
Rcb rcb = this.getRcb(serverModel, this.getReportNode(serverName, iec61850Report.getLogicalDevice(), i, iec61850Report.getLogicalNode()));
while (rcb != null) {
this.enableRcb(deviceIdentification, clientAssociation, rcb);
i += 1;
rcb = this.getRcb(serverModel, this.getReportNode(serverName, iec61850Report.getLogicalDevice(), i, iec61850Report.getLogicalNode()));
}
}
Aggregations