Search in sources :

Example 1 with MeasurementFilterDto

use of com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850PvSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeReadException {
    final int logicalDeviceIndex = systemFilter.getId();
    LOGGER.info("Get data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    final List<MeasurementDto> measurements = new ArrayList<>();
    for (final MeasurementFilterDto filter : systemFilter.getMeasurementFilters()) {
        final RtuReadCommand<MeasurementDto> command = Iec61850PvCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            measurements.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    return new GetDataSystemIdentifierDto(systemFilter.getId(), systemFilter.getSystemType(), measurements);
}
Also used : GetDataSystemIdentifierDto(com.alliander.osgp.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) MeasurementDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto)

Example 2 with MeasurementFilterDto

use of com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850BatterySystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeReadException {
    final int logicalDeviceIndex = systemFilter.getId();
    LOGGER.info("Get data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    final List<MeasurementDto> measurements = new ArrayList<>();
    for (final MeasurementFilterDto filter : systemFilter.getMeasurementFilters()) {
        final RtuReadCommand<MeasurementDto> command = Iec61850BatteryCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            measurements.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    final List<ProfileDto> profiles = new ArrayList<>();
    for (final ProfileFilterDto filter : systemFilter.getProfileFilters()) {
        final RtuReadCommand<ProfileDto> command = Iec61850RtuReadProfileCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            profiles.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    return new GetDataSystemIdentifierDto(systemFilter.getId(), systemFilter.getSystemType(), measurements, profiles);
}
Also used : GetDataSystemIdentifierDto(com.alliander.osgp.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) ProfileFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.ProfileFilterDto) MeasurementDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto) ProfileDto(com.alliander.osgp.dto.valueobjects.microgrids.ProfileDto)

Example 3 with MeasurementFilterDto

use of com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850BoilerSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeReadException {
    final int logicalDeviceIndex = systemFilter.getId();
    LOGGER.info("Get data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    final List<MeasurementDto> measurements = new ArrayList<>();
    for (final MeasurementFilterDto filter : systemFilter.getMeasurementFilters()) {
        final RtuReadCommand<MeasurementDto> command = Iec61850BoilerCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            measurements.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    final List<ProfileDto> profiles = new ArrayList<>();
    for (final ProfileFilterDto filter : systemFilter.getProfileFilters()) {
        final RtuReadCommand<ProfileDto> command = Iec61850RtuReadProfileCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            profiles.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    return new GetDataSystemIdentifierDto(systemFilter.getId(), systemFilter.getSystemType(), measurements, profiles);
}
Also used : GetDataSystemIdentifierDto(com.alliander.osgp.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) ProfileFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.ProfileFilterDto) MeasurementDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto) ProfileDto(com.alliander.osgp.dto.valueobjects.microgrids.ProfileDto)

Example 4 with MeasurementFilterDto

use of com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850ChpSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeReadException {
    final int logicalDeviceIndex = systemFilter.getId();
    LOGGER.info("Get data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    final List<MeasurementDto> measurements = new ArrayList<>();
    for (final MeasurementFilterDto filter : systemFilter.getMeasurementFilters()) {
        final RtuReadCommand<MeasurementDto> command = Iec61850ChpCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            measurements.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    return new GetDataSystemIdentifierDto(systemFilter.getId(), systemFilter.getSystemType(), measurements);
}
Also used : GetDataSystemIdentifierDto(com.alliander.osgp.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) MeasurementDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto)

Example 5 with MeasurementFilterDto

use of com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850HeatPumpSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeReadException {
    final int logicalDeviceIndex = systemFilter.getId();
    LOGGER.info("Get data called for logical device {}{}", DEVICE.getDescription(), logicalDeviceIndex);
    final List<MeasurementDto> measurements = new ArrayList<>();
    for (final MeasurementFilterDto filter : systemFilter.getMeasurementFilters()) {
        final RtuReadCommand<MeasurementDto> command = Iec61850HeatPumpCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            measurements.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    final List<ProfileDto> profiles = new ArrayList<>();
    for (final ProfileFilterDto filter : systemFilter.getProfileFilters()) {
        final RtuReadCommand<ProfileDto> command = Iec61850RtuReadProfileCommandFactory.getInstance().getCommand(filter);
        if (command == null) {
            LOGGER.warn("Unsupported data attribute [{}], skip get data for it", filter.getNode());
        } else {
            profiles.add(command.execute(client, connection, DEVICE, logicalDeviceIndex));
        }
    }
    return new GetDataSystemIdentifierDto(systemFilter.getId(), systemFilter.getSystemType(), measurements, profiles);
}
Also used : GetDataSystemIdentifierDto(com.alliander.osgp.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) ProfileFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.ProfileFilterDto) MeasurementDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto) ProfileDto(com.alliander.osgp.dto.valueobjects.microgrids.ProfileDto)

Aggregations

GetDataSystemIdentifierDto (com.alliander.osgp.dto.valueobjects.microgrids.GetDataSystemIdentifierDto)10 MeasurementDto (com.alliander.osgp.dto.valueobjects.microgrids.MeasurementDto)10 MeasurementFilterDto (com.alliander.osgp.dto.valueobjects.microgrids.MeasurementFilterDto)10 ArrayList (java.util.ArrayList)10 ProfileDto (com.alliander.osgp.dto.valueobjects.microgrids.ProfileDto)4 ProfileFilterDto (com.alliander.osgp.dto.valueobjects.microgrids.ProfileFilterDto)4