Search in sources :

Example 1 with MeasurementFilterDto

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

the class CommunicationRecoveryService method createRequest.

private GetDataRequestDto createRequest(final RtuDevice rtu) {
    LOGGER.debug("Creating data request for rtu {}.", rtu.getDeviceIdentification());
    final List<MeasurementFilterDto> measurementFilters = new ArrayList<>();
    measurementFilters.add(new MeasurementFilterDto(MEASUREMENT_ID, MEASUREMENT_NODE, false));
    final List<SystemFilterDto> systemFilters = new ArrayList<>();
    systemFilters.add(new SystemFilterDto(SYSTEM_ID, SYSTEM_TYPE, measurementFilters, false));
    return new GetDataRequestDto(systemFilters);
}
Also used : GetDataRequestDto(org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataRequestDto) SystemFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SystemFilterDto) ArrayList(java.util.ArrayList) MeasurementFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementFilterDto)

Example 2 with MeasurementFilterDto

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

the class Iec61850RtuSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    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 = this.iec61850RtuCommandFactory.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(org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) ProfileFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileFilterDto) MeasurementDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementFilterDto) ProfileDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)

Example 3 with MeasurementFilterDto

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

the class Iec61850WindSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    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 = this.iec61850WindCommandFactory.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(org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) MeasurementDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementFilterDto)

Example 4 with MeasurementFilterDto

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

the class Iec61850BoilerSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    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 = this.iec61850BoilerCommandFactory.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(org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) ProfileFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileFilterDto) MeasurementDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementFilterDto) ProfileDto(org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)

Example 5 with MeasurementFilterDto

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

the class Iec61850GasFurnaceSystemService method getData.

@Override
public GetDataSystemIdentifierDto getData(final SystemFilterDto systemFilter, final Iec61850Client client, final DeviceConnection connection) throws NodeException {
    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 = this.iec61850GasFurnaceCommandFactory.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(org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto) ArrayList(java.util.ArrayList) MeasurementDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto) MeasurementFilterDto(org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementFilterDto)

Aggregations

ArrayList (java.util.ArrayList)13 MeasurementFilterDto (org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementFilterDto)13 GetDataSystemIdentifierDto (org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataSystemIdentifierDto)12 MeasurementDto (org.opensmartgridplatform.dto.valueobjects.microgrids.MeasurementDto)12 ProfileDto (org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileDto)5 ProfileFilterDto (org.opensmartgridplatform.dto.valueobjects.microgrids.ProfileFilterDto)5 GetDataRequestDto (org.opensmartgridplatform.dto.valueobjects.microgrids.GetDataRequestDto)1 SystemFilterDto (org.opensmartgridplatform.dto.valueobjects.microgrids.SystemFilterDto)1