|
6 | 6 | package edu.ie3.datamodel.io.factory.input;
|
7 | 7 |
|
8 | 8 | import edu.ie3.datamodel.models.OperationTime;
|
9 |
| -import edu.ie3.datamodel.models.StandardUnits; |
10 | 9 | import edu.ie3.datamodel.models.input.OperatorInput;
|
11 | 10 | import edu.ie3.datamodel.models.input.thermal.DomesticHotWaterStorageInput;
|
12 | 11 | import edu.ie3.datamodel.models.input.thermal.ThermalBusInput;
|
13 |
| -import edu.ie3.util.quantities.interfaces.SpecificHeatCapacity; |
14 | 12 | import java.util.UUID;
|
15 |
| -import javax.measure.quantity.Power; |
16 |
| -import javax.measure.quantity.Temperature; |
17 |
| -import javax.measure.quantity.Volume; |
18 |
| -import tech.units.indriya.ComparableQuantity; |
19 | 13 |
|
20 | 14 | public class DomesticHotWaterStorageInputFactory
|
21 |
| - extends AssetInputEntityFactory<DomesticHotWaterStorageInput, ThermalUnitInputEntityData> { |
22 |
| - private static final String STORAGE_VOLUME_LVL = "storageVolumeLvl"; |
23 |
| - private static final String INLET_TEMP = "inletTemp"; |
24 |
| - private static final String RETURN_TEMP = "returnTemp"; |
25 |
| - private static final String C = "c"; |
26 |
| - private static final String P_THERMAL_MAX = "pThermalMax"; |
| 15 | + extends AbstractThermalStorageInputFactory<DomesticHotWaterStorageInput> { |
27 | 16 |
|
28 | 17 | public DomesticHotWaterStorageInputFactory() {
|
29 | 18 | super(DomesticHotWaterStorageInput.class);
|
30 | 19 | }
|
31 | 20 |
|
32 |
| - @Override |
33 |
| - protected String[] getAdditionalFields() { |
34 |
| - return new String[] {STORAGE_VOLUME_LVL, INLET_TEMP, RETURN_TEMP, C, P_THERMAL_MAX}; |
35 |
| - } |
36 |
| - |
37 | 21 | @Override
|
38 | 22 | protected DomesticHotWaterStorageInput buildModel(
|
39 | 23 | ThermalUnitInputEntityData data,
|
40 | 24 | UUID uuid,
|
41 | 25 | String id,
|
42 | 26 | OperatorInput operator,
|
43 | 27 | OperationTime operationTime) {
|
| 28 | + |
44 | 29 | final ThermalBusInput bus = data.getBusInput();
|
45 |
| - final ComparableQuantity<Volume> storageVolumeLvl = |
46 |
| - data.getQuantity(STORAGE_VOLUME_LVL, StandardUnits.VOLUME); |
47 |
| - final ComparableQuantity<Temperature> inletTemp = |
48 |
| - data.getQuantity(INLET_TEMP, StandardUnits.TEMPERATURE); |
49 |
| - final ComparableQuantity<Temperature> returnTemp = |
50 |
| - data.getQuantity(RETURN_TEMP, StandardUnits.TEMPERATURE); |
51 |
| - final ComparableQuantity<SpecificHeatCapacity> c = |
52 |
| - data.getQuantity(C, StandardUnits.SPECIFIC_HEAT_CAPACITY); |
53 |
| - final ComparableQuantity<Power> pThermalMax = |
54 |
| - data.getQuantity(P_THERMAL_MAX, StandardUnits.ACTIVE_POWER_IN); |
55 | 30 | return new DomesticHotWaterStorageInput(
|
56 | 31 | uuid,
|
57 | 32 | id,
|
58 | 33 | operator,
|
59 | 34 | operationTime,
|
60 | 35 | bus,
|
61 |
| - storageVolumeLvl, |
62 |
| - inletTemp, |
63 |
| - returnTemp, |
64 |
| - c, |
65 |
| - pThermalMax); |
| 36 | + getStorageVolumeLvl(data), |
| 37 | + getInletTemp(data), |
| 38 | + getReturnTemp(data), |
| 39 | + getSpecificHeatCapacity(data), |
| 40 | + getMaxThermalPower(data)); |
66 | 41 | }
|
67 | 42 | }
|
0 commit comments