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));
}
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));
}
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));
}
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));
}
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);
}
Aggregations