use of org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement in project open-smart-grid-platform by OSGP.
the class DomainDistributionAutomationMapperTest method testBitmaskMeasurementElementMapping.
@Test
public void testBitmaskMeasurementElementMapping() {
// Arrange
final byte value = (byte) 40;
final BitmaskMeasurementElement expected = new BitmaskMeasurementElement(value);
final BitmaskMeasurementElementDto dtoMeasurementElement = new BitmaskMeasurementElementDto(value);
// Act
final BitmaskMeasurementElement actual = this.mapper.map(dtoMeasurementElement, BitmaskMeasurementElement.class);
// Assert
assertThat(actual).isEqualTo(expected);
}
use of org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement in project open-smart-grid-platform by OSGP.
the class DomainMeasurementsFactory method gasFlowMeasurement.
public static Measurement gasFlowMeasurement(final float gasFlow) {
final BitmaskMeasurementElement flags = new BitmaskMeasurementElement((byte) 96);
final TimestampMeasurementElement from = new TimestampMeasurementElement(1546800000501l);
final TimestampMeasurementElement until = new TimestampMeasurementElement(1546700000444l);
final FloatMeasurementElement cubicMeters = new FloatMeasurementElement(gasFlow);
final List<MeasurementElement> measurementElements = new ArrayList<>();
measurementElements.add(flags);
measurementElements.add(from);
measurementElements.add(until);
measurementElements.add(cubicMeters);
return DomainMeasurementsFactory.measurementFrom(measurementElements);
}
use of org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement in project open-smart-grid-platform by OSGP.
the class DomainMeasurementsFactory method gasFlowMeasurement.
public static Measurement gasFlowMeasurement(final float gasFlow) {
final BitmaskMeasurementElement flags = new BitmaskMeasurementElement((byte) 96);
final TimestampMeasurementElement from = new TimestampMeasurementElement(1546800000501l);
final TimestampMeasurementElement until = new TimestampMeasurementElement(1546700000444l);
final FloatMeasurementElement cubicMeters = new FloatMeasurementElement(gasFlow);
final List<MeasurementElement> measurementElements = new ArrayList<>();
measurementElements.add(flags);
measurementElements.add(from);
measurementElements.add(until);
measurementElements.add(cubicMeters);
return DomainMeasurementsFactory.measurementFrom(measurementElements);
}
Aggregations