Search in sources :

Example 1 with Brcb

use of com.beanit.openiec61850.Brcb 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)

Aggregations

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