Search in sources :

Example 1 with MeasurementGroupDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto in project open-smart-grid-platform by OSGP.

the class MeasurementReportFactory method getMeasurementGroup.

private static MeasurementGroupDto getMeasurementGroup(final String identification, final byte value) {
    final MeasurementElementDto me = new BitmaskMeasurementElementDto(value);
    final MeasurementDto m = new MeasurementDto(Arrays.asList(me));
    return new MeasurementGroupDto(identification, Arrays.asList(m));
}
Also used : BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) MeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.MeasurementElementDto) MeasurementGroupDto(org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto) MeasurementDto(org.opensmartgridplatform.dto.da.measurements.MeasurementDto) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)

Example 2 with MeasurementGroupDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto in project open-smart-grid-platform by OSGP.

the class MeasurementReportFactory method getMeasurementReportDto.

public static MeasurementReportDto getMeasurementReportDto() {
    final MeasurementReportHeaderDto mrh = new MeasurementReportHeaderDto("M_SP_NA_1", "INTERROGATED_BY_STATION", 0, 0);
    final MeasurementGroupDto mg1 = getMeasurementGroup(Iec60870DeviceFactory.LMD_1_IOA, LMD_1_ON);
    final MeasurementGroupDto mg2 = getMeasurementGroup(Iec60870DeviceFactory.LMD_2_IOA, LMD_2_ON);
    return new MeasurementReportDto(mrh, Arrays.asList(mg1, mg2));
}
Also used : MeasurementReportDto(org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto) MeasurementGroupDto(org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto) MeasurementReportHeaderDto(org.opensmartgridplatform.dto.da.measurements.MeasurementReportHeaderDto)

Example 3 with MeasurementGroupDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto in project open-smart-grid-platform by OSGP.

the class SinglePointWithQualityAsduHandlerTest method createMeasurementReportDto.

private MeasurementReportDto createMeasurementReportDto() {
    final MeasurementReportHeaderDto mrh = new MeasurementReportHeaderDto(MEASUREMENT_TYPE, MEASUREMENT_REASON, MEASUREMENT_ORIGINATOR_ADDRESS, MEASUREMENT_COMMON_ADDRESS);
    final MeasurementGroupDto mg1 = this.createMeasurementGroup(Integer.toString(LMD_1_IOA), LMD_1_ON);
    final MeasurementGroupDto mg2 = this.createMeasurementGroup(Integer.toString(LMD_2_IOA), LMD_2_ON);
    return new MeasurementReportDto(mrh, Arrays.asList(mg1, mg2));
}
Also used : MeasurementReportDto(org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto) MeasurementGroupDto(org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto) MeasurementReportHeaderDto(org.opensmartgridplatform.dto.da.measurements.MeasurementReportHeaderDto)

Example 4 with MeasurementGroupDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto in project open-smart-grid-platform by OSGP.

the class SinglePointWithQualityAsduHandlerTest method createMeasurementGroup.

private MeasurementGroupDto createMeasurementGroup(final String identification, final boolean value) {
    final byte b = value ? (byte) 1 : (byte) 0;
    final MeasurementElementDto me = new BitmaskMeasurementElementDto(b);
    final MeasurementDto m = new MeasurementDto(Arrays.asList(me));
    return new MeasurementGroupDto(identification, Arrays.asList(m));
}
Also used : BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) MeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.MeasurementElementDto) MeasurementGroupDto(org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto) MeasurementDto(org.opensmartgridplatform.dto.da.measurements.MeasurementDto) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)

Example 5 with MeasurementGroupDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto in project open-smart-grid-platform by OSGP.

the class Iec60870InformationObjectConverterTest method testConvertInformationObjectToMeasurementGroupDto.

@Test
public void testConvertInformationObjectToMeasurementGroupDto() {
    // Arrange
    final MeasurementGroupDto expected = MEASUREMENT_GROUP_DTO;
    final InformationObject source = INFORMATION_OBJECT;
    // Act
    final MeasurementGroupDto actual = this.mapper.map(source, MeasurementGroupDto.class);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : MeasurementGroupDto(org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto) InformationObject(org.openmuc.j60870.ie.InformationObject) Test(org.junit.jupiter.api.Test)

Aggregations

MeasurementGroupDto (org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto)7 Test (org.junit.jupiter.api.Test)3 MeasurementReportDto (org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto)3 MeasurementReportHeaderDto (org.opensmartgridplatform.dto.da.measurements.MeasurementReportHeaderDto)3 MeasurementGroup (org.opensmartgridplatform.domain.da.measurements.MeasurementGroup)2 MeasurementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementDto)2 MeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementElementDto)2 BitmaskMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)2 ArrayList (java.util.ArrayList)1 InformationObject (org.openmuc.j60870.ie.InformationObject)1 MeasurementReport (org.opensmartgridplatform.domain.da.measurements.MeasurementReport)1