Search in sources :

Example 6 with ProfileDto

use of org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto in project open-smart-grid-platform by OSGP.

the class Iec61850PqSystemService method setData.

@Override
public void setData(final SetDataSystemIdentifierDto systemIdentifier, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    final int logicalDeviceIndex = systemIdentifier.getId();
    LOGGER.info("Set data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    /*
     * Set profiles before setpoints, so that profile updates can be
     * detected by an increment of the SchdId after the profiles are already
     * set to the RTU
     */
    for (final ProfileDto p : systemIdentifier.getProfiles()) {
        final RtuWriteCommand<ProfileDto> command = Iec61850WriteProfileCommandFactory.getInstance().getCommand(p.getNode() + p.getId());
        if (command == null) {
            LOGGER.warn("Unsupported profile [{}], skip set data for it.", p.getNode() + p.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, p);
        }
    }
    for (final SetPointDto sp : systemIdentifier.getSetPoints()) {
        final RtuWriteCommand<SetPointDto> command = Iec61850SetPointCommandFactory.getInstance().getCommand(sp.getNode() + sp.getId());
        if (command == null) {
            LOGGER.warn("Unsupported set point [{}], skip set data for it.", sp.getNode() + sp.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, sp);
        }
    }
}
Also used : SetPointDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SetPointDto) ProfileDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)

Example 7 with ProfileDto

use of org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto in project open-smart-grid-platform by OSGP.

the class Iec61850WindSystemService method setData.

@Override
public void setData(final SetDataSystemIdentifierDto systemIdentifier, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    final int logicalDeviceIndex = systemIdentifier.getId();
    LOGGER.info("Set data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    /*
     * Set profiles before setpoints, so that profile updates can be
     * detected by an increment of the SchdId after the profiles are already
     * set to the RTU
     */
    for (final ProfileDto p : systemIdentifier.getProfiles()) {
        final RtuWriteCommand<ProfileDto> command = Iec61850WriteProfileCommandFactory.getInstance().getCommand(p.getNode() + p.getId());
        if (command == null) {
            LOGGER.warn("Unsupported profile [{}], skip set data for it.", p.getNode() + p.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, p);
        }
    }
    for (final SetPointDto sp : systemIdentifier.getSetPoints()) {
        final RtuWriteCommand<SetPointDto> command = Iec61850SetPointCommandFactory.getInstance().getCommand(sp.getNode() + sp.getId());
        if (command == null) {
            LOGGER.warn("Unsupported set point [{}], skip set data for it.", sp.getNode() + sp.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, sp);
        }
    }
}
Also used : SetPointDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SetPointDto) ProfileDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)

Example 8 with ProfileDto

use of org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto in project open-smart-grid-platform by OSGP.

the class Iec61850BoilerSystemService method setData.

@Override
public void setData(final SetDataSystemIdentifierDto systemIdentifier, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    final int logicalDeviceIndex = systemIdentifier.getId();
    LOGGER.info("Set data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    /*
     * Set profiles before setpoints, so that profile updates can be
     * detected by an increment of the SchdId after the profiles are already
     * set to the RTU
     */
    for (final ProfileDto p : systemIdentifier.getProfiles()) {
        final RtuWriteCommand<ProfileDto> command = Iec61850WriteProfileCommandFactory.getInstance().getCommand(p.getNode() + p.getId());
        if (command == null) {
            LOGGER.warn("Unsupported profile [{}], skip set data for it.", p.getNode() + p.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, p);
        }
    }
    for (final SetPointDto sp : systemIdentifier.getSetPoints()) {
        final RtuWriteCommand<SetPointDto> command = Iec61850SetPointCommandFactory.getInstance().getCommand(sp.getNode() + sp.getId());
        if (command == null) {
            LOGGER.warn("Unsupported set point [{}], skip set data for it.", sp.getNode() + sp.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, sp);
        }
    }
}
Also used : SetPointDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SetPointDto) ProfileDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)

Example 9 with ProfileDto

use of org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto in project open-smart-grid-platform by OSGP.

the class Iec61850BatterySystemService method setData.

@Override
public void setData(final SetDataSystemIdentifierDto systemIdentifier, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    final int logicalDeviceIndex = systemIdentifier.getId();
    LOGGER.info("Set data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    /*
     * Set profiles before setpoints, so that profile updates can be
     * detected by an increment of the SchdId after the profiles are already
     * set to the RTU
     */
    for (final ProfileDto p : systemIdentifier.getProfiles()) {
        final RtuWriteCommand<ProfileDto> command = Iec61850WriteProfileCommandFactory.getInstance().getCommand(p.getNode() + p.getId());
        if (command == null) {
            LOGGER.warn("Unsupported profile [{}], skip set data for it.", p.getNode() + p.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, p);
        }
    }
    for (final SetPointDto sp : systemIdentifier.getSetPoints()) {
        final RtuWriteCommand<SetPointDto> command = Iec61850SetPointCommandFactory.getInstance().getCommand(sp.getNode() + sp.getId());
        if (command == null) {
            LOGGER.warn("Unsupported set point [{}], skip set data for it.", sp.getNode() + sp.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, sp);
        }
    }
}
Also used : SetPointDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SetPointDto) ProfileDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)

Example 10 with ProfileDto

use of org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto in project open-smart-grid-platform by OSGP.

the class Iec61850EngineSystemService method setData.

@Override
public void setData(final SetDataSystemIdentifierDto systemIdentifier, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    final int logicalDeviceIndex = systemIdentifier.getId();
    LOGGER.info("Set data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    /*
     * Set profiles before setpoints, so that profile updates can be
     * detected by an increment of the SchdId after the profiles are already
     * set to the RTU
     */
    for (final ProfileDto p : systemIdentifier.getProfiles()) {
        final RtuWriteCommand<ProfileDto> command = Iec61850WriteProfileCommandFactory.getInstance().getCommand(p.getNode() + p.getId());
        if (command == null) {
            LOGGER.warn("Unsupported profile [{}], skip set data for it.", p.getNode() + p.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, p);
        }
    }
    for (final SetPointDto sp : systemIdentifier.getSetPoints()) {
        final RtuWriteCommand<SetPointDto> command = Iec61850SetPointCommandFactory.getInstance().getCommand(sp.getNode() + sp.getId());
        if (command == null) {
            LOGGER.warn("Unsupported set point [{}], skip set data for it.", sp.getNode() + sp.getId());
        } else {
            command.executeWrite(client, connection, DEVICE, logicalDeviceIndex, sp);
        }
    }
}
Also used : SetPointDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SetPointDto) ProfileDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)

Aggregations

ProfileDto (org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)12 SetPointDto (org.opensmartgridplatform.dto.valueobjects.microgrids.SetPointDto)7 ArrayList (java.util.ArrayList)5 GetDataSystemIdentifierDto (org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto)5 MeasurementDto (org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto)5 MeasurementFilterDto (org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementFilterDto)5 ProfileFilterDto (org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileFilterDto)5