use of org.opensmartgridplatform.dto.da.measurements.MeasurementReportHeaderDto 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.MeasurementReportHeaderDto 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.MeasurementReportHeaderDto in project open-smart-grid-platform by OSGP.
the class DomainDistributionAutomationMapperTest method testMeasurementReportMapping.
@Test
public void testMeasurementReportMapping() {
// Arrange
final int commonAddress = 55;
final String groupIdentification = "137";
final float[] gasFlowMeasurements = { 78.733f, 21.000f };
// Arrange domain
final MeasurementGroup expectedGroup = DomainMeasurementsFactory.gasFlowMeasurementGroup(groupIdentification, gasFlowMeasurements);
final List<MeasurementGroup> expectedGroups = new ArrayList<>();
expectedGroups.add(expectedGroup);
final MeasurementReport expected = new MeasurementReport(DomainMeasurementsFactory.spontaneousReportHeader(commonAddress), expectedGroups);
// Arrange DTO
final MeasurementReportHeaderDto dtoHeader = DtoMeasurementsFactory.spontaneousReportHeader(commonAddress);
final MeasurementGroupDto dtoGroup = DtoMeasurementsFactory.gasFlowMeasurementGroup(groupIdentification, gasFlowMeasurements);
final List<MeasurementGroupDto> dtoGroups = new ArrayList<>();
dtoGroups.add(dtoGroup);
final MeasurementReportDto dtoReport = new MeasurementReportDto(dtoHeader, dtoGroups);
// Act
final MeasurementReport actual = this.mapper.map(dtoReport, MeasurementReport.class);
// Assert
assertThat(actual).isEqualTo(expected);
}
use of org.opensmartgridplatform.dto.da.measurements.MeasurementReportHeaderDto in project open-smart-grid-platform by OSGP.
the class DomainDistributionAutomationMapperTest method testMeasurementReportHeaderMapping.
@Test
public void testMeasurementReportHeaderMapping() {
// Arrange
final int commonAddress = 234;
final MeasurementReportHeader expected = DomainMeasurementsFactory.spontaneousReportHeader(commonAddress);
final MeasurementReportHeaderDto dtoMeasurementReportHeader = DtoMeasurementsFactory.spontaneousReportHeader(commonAddress);
// Act
final MeasurementReportHeader actual = this.mapper.map(dtoMeasurementReportHeader, MeasurementReportHeader.class);
// Assert
assertThat(actual).isEqualTo(expected);
}
Aggregations