|
27 | 27 | import javax.measure.Unit; |
28 | 28 | import javax.measure.quantity.Angle; |
29 | 29 | import javax.measure.quantity.Dimensionless; |
| 30 | +import javax.measure.quantity.Energy; |
30 | 31 | import javax.measure.quantity.Length; |
| 32 | +import javax.measure.quantity.Power; |
31 | 33 | import javax.measure.quantity.Pressure; |
32 | 34 | import javax.measure.quantity.Speed; |
33 | 35 | import javax.measure.quantity.Temperature; |
| 36 | +import javax.measure.quantity.Volume; |
34 | 37 | import javax.measure.spi.SystemOfUnits; |
35 | 38 |
|
36 | 39 | import org.eclipse.jdt.annotation.NonNullByDefault; |
|
41 | 44 | import org.openhab.core.i18n.TranslationProvider; |
42 | 45 | import org.openhab.core.i18n.UnitProvider; |
43 | 46 | import org.openhab.core.library.dimension.Intensity; |
| 47 | +import org.openhab.core.library.dimension.VolumetricFlowRate; |
44 | 48 | import org.openhab.core.library.types.PointType; |
45 | 49 | import org.openhab.core.library.unit.ImperialUnits; |
| 50 | +import org.openhab.core.library.unit.MetricPrefix; |
46 | 51 | import org.openhab.core.library.unit.SIUnits; |
47 | 52 | import org.openhab.core.library.unit.Units; |
48 | 53 | import org.osgi.framework.Bundle; |
@@ -377,5 +382,21 @@ private void initDimensionMap() { |
377 | 382 | angleMap.put(SIUnits.getInstance(), Units.DEGREE_ANGLE); |
378 | 383 | angleMap.put(ImperialUnits.getInstance(), Units.DEGREE_ANGLE); |
379 | 384 | dimensionMap.put(Angle.class, angleMap); |
| 385 | + |
| 386 | + Map<SystemOfUnits, Unit<? extends Quantity<?>>> volumeMap = new HashMap<>(); |
| 387 | + volumeMap.put(SIUnits.getInstance(), tec.uom.se.unit.Units.CUBIC_METRE); |
| 388 | + dimensionMap.put(Volume.class, volumeMap); |
| 389 | + |
| 390 | + Map<SystemOfUnits, Unit<? extends Quantity<?>>> volumeFlowMap = new HashMap<>(); |
| 391 | + volumeFlowMap.put(SIUnits.getInstance(), Units.CUBICMETRE_PER_HOUR); |
| 392 | + dimensionMap.put(VolumetricFlowRate.class, volumeFlowMap); |
| 393 | + |
| 394 | + Map<SystemOfUnits, Unit<? extends Quantity<?>>> energyMap = new HashMap<>(); |
| 395 | + energyMap.put(SIUnits.getInstance(), Units.KILOWATT_HOUR); |
| 396 | + dimensionMap.put(Energy.class, energyMap); |
| 397 | + |
| 398 | + Map<SystemOfUnits, Unit<? extends Quantity<?>>> powerMap = new HashMap<>(); |
| 399 | + powerMap.put(SIUnits.getInstance(), MetricPrefix.KILO(Units.WATT)); |
| 400 | + dimensionMap.put(Power.class, powerMap); |
380 | 401 | } |
381 | 402 | } |
0 commit comments