Search in sources :

Example 1 with MeasurementElement

use of org.opensmartgridplatform.domain.da.measurements.MeasurementElement 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);
}
Also used : BitmaskMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement) TimestampMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.TimestampMeasurementElement) ArrayList(java.util.ArrayList) FloatMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.FloatMeasurementElement) BitmaskMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement) FloatMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.FloatMeasurementElement) TimestampMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.TimestampMeasurementElement) MeasurementElement(org.opensmartgridplatform.domain.da.measurements.MeasurementElement)

Example 2 with MeasurementElement

use of org.opensmartgridplatform.domain.da.measurements.MeasurementElement 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);
}
Also used : BitmaskMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement) TimestampMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.TimestampMeasurementElement) ArrayList(java.util.ArrayList) FloatMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.FloatMeasurementElement) BitmaskMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement) FloatMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.FloatMeasurementElement) TimestampMeasurementElement(org.opensmartgridplatform.domain.da.measurements.elements.TimestampMeasurementElement) MeasurementElement(org.opensmartgridplatform.domain.da.measurements.MeasurementElement)

Aggregations

ArrayList (java.util.ArrayList)2 MeasurementElement (org.opensmartgridplatform.domain.da.measurements.MeasurementElement)2 BitmaskMeasurementElement (org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement)2 FloatMeasurementElement (org.opensmartgridplatform.domain.da.measurements.elements.FloatMeasurementElement)2 TimestampMeasurementElement (org.opensmartgridplatform.domain.da.measurements.elements.TimestampMeasurementElement)2