Search in sources :

Example 1 with MeasurementElementDto

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

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

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

the class DtoMeasurementsFactory method gasFlowMeasurement.

public static MeasurementDto gasFlowMeasurement(final float gasFlow) {
    final BitmaskMeasurementElementDto flags = new BitmaskMeasurementElementDto((byte) 96);
    final TimestampMeasurementElementDto from = new TimestampMeasurementElementDto(1546800000501L);
    final TimestampMeasurementElementDto until = new TimestampMeasurementElementDto(1546700000444L);
    final FloatMeasurementElementDto cubicMeters = new FloatMeasurementElementDto(gasFlow);
    final List<MeasurementElementDto> measurementElements = new ArrayList<>();
    measurementElements.add(flags);
    measurementElements.add(from);
    measurementElements.add(until);
    measurementElements.add(cubicMeters);
    return DtoMeasurementsFactory.measurementFrom(measurementElements);
}
Also used : TimestampMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.TimestampMeasurementElementDto) FloatMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.FloatMeasurementElementDto) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) TimestampMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.TimestampMeasurementElementDto) FloatMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.FloatMeasurementElementDto) MeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.MeasurementElementDto) ArrayList(java.util.ArrayList) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)

Aggregations

MeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementElementDto)3 BitmaskMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)3 MeasurementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementDto)2 MeasurementGroupDto (org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto)2 ArrayList (java.util.ArrayList)1 FloatMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.FloatMeasurementElementDto)1 TimestampMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.TimestampMeasurementElementDto)1