Search in sources :

Example 1 with MeasurementDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementDto 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 MeasurementDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementDto 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 3 with MeasurementDto

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

the class DomainDistributionAutomationMapperTest method testMeasurementMapping.

@Test
public void testMeasurementMapping() {
    // Arrange
    final float gasFlowMeasurement = 3077f;
    final Measurement expected = DomainMeasurementsFactory.gasFlowMeasurement(gasFlowMeasurement);
    final MeasurementDto dtoMeasurement = DtoMeasurementsFactory.gasFlowMeasurement(gasFlowMeasurement);
    // Act
    final Measurement actual = this.mapper.map(dtoMeasurement, Measurement.class);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : Measurement(org.opensmartgridplatform.domain.da.measurements.Measurement) MeasurementDto(org.opensmartgridplatform.dto.da.measurements.MeasurementDto) Test(org.junit.jupiter.api.Test)

Aggregations

MeasurementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementDto)3 MeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementElementDto)2 MeasurementGroupDto (org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto)2 BitmaskMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)2 Test (org.junit.jupiter.api.Test)1 Measurement (org.opensmartgridplatform.domain.da.measurements.Measurement)1