Search in sources :

Example 1 with Rcb

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());
        }
    }
}
Also used : Rcb(com.beanit.openiec61850.Rcb) Brcb(com.beanit.openiec61850.Brcb) NodeWriteException(org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeWriteException) NodeContainer(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 2 with Rcb

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()));
    }
}
Also used : Rcb(com.beanit.openiec61850.Rcb)

Aggregations

Rcb (com.beanit.openiec61850.Rcb)2 Brcb (com.beanit.openiec61850.Brcb)1 NodeWriteException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeWriteException)1 NodeContainer (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)1