| | 1 | | using Morpho25.Utility; |
| | 2 | |
|
| | 3 | |
|
| | 4 | | namespace Morpho25.Settings |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// BuildingSettings class. |
| | 8 | | /// </summary> |
| | 9 | | public class BuildingSettings |
| | 10 | | { |
| | 11 | | private double _indoorTemp; |
| | 12 | | private double _surfaceTemp; |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// Indoor temperature [°C]. |
| | 16 | | /// </summary> |
| | 17 | | public double IndoorTemp |
| | 18 | | { |
| 9 | 19 | | get { return _indoorTemp; } |
| | 20 | | set |
| 3 | 21 | | { |
| 3 | 22 | | _indoorTemp = value + Util.TO_KELVIN; |
| 3 | 23 | | } |
| | 24 | | } |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// Surface temperature [°C] of the building. |
| | 28 | | /// </summary> |
| | 29 | | public double SurfaceTemp |
| | 30 | | { |
| 3 | 31 | | get { return _surfaceTemp; } |
| | 32 | | set |
| 2 | 33 | | { |
| 2 | 34 | | _surfaceTemp = value + Util.TO_KELVIN; |
| 2 | 35 | | } |
| | 36 | | } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Active the setpoint. |
| | 40 | | /// </summary> |
| 3 | 41 | | public Active IndoorConst { get; set; } |
| | 42 | |
|
| | 43 | | /// <summary> |
| | 44 | | /// Active the air conditioning. |
| | 45 | | /// </summary> |
| 5 | 46 | | public Active AirCondHeat { get; set; } |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Create a new BuildingSettings object. |
| | 50 | | /// </summary> |
| | 51 | | /// <param name="indoorTemp">Indoor temperature [°C].</param> |
| | 52 | | /// <param name="indoorConst">Active the setpoint.</param> |
| 2 | 53 | | public BuildingSettings() |
| 2 | 54 | | { |
| 2 | 55 | | IndoorTemp = 19.85; |
| 2 | 56 | | IndoorConst = Active.YES; |
| | 57 | |
|
| 2 | 58 | | SurfaceTemp = 19.85; |
| 2 | 59 | | AirCondHeat = Active.NO; |
| 2 | 60 | | } |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Title of the XML section |
| | 64 | | /// </summary> |
| 1 | 65 | | public string Title => "Building"; |
| | 66 | |
|
| | 67 | | /// <summary> |
| | 68 | | /// Values of the XML section |
| | 69 | | /// </summary> |
| 1 | 70 | | public string[] Values => new[] { |
| 1 | 71 | | SurfaceTemp.ToString("n5"), |
| 1 | 72 | | IndoorTemp.ToString("n5"), |
| 1 | 73 | | ((int)IndoorConst).ToString(), |
| 1 | 74 | | ((int)AirCondHeat).ToString(), |
| 1 | 75 | | }; |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Tags of the XML section |
| | 79 | | /// </summary> |
| 1 | 80 | | public string[] Tags => new[] { |
| 1 | 81 | | "surfaceTemp", |
| 1 | 82 | | "indoorTemp", |
| 1 | 83 | | "indoorConst", |
| 1 | 84 | | "airConHeat", |
| 1 | 85 | | }; |
| | 86 | |
|
| | 87 | | /// <summary> |
| | 88 | | /// String representation of building settings. |
| | 89 | | /// </summary> |
| | 90 | | /// <returns>String representation.</returns> |
| 0 | 91 | | public override string ToString() => "Config::BuildingSettings"; |
| | 92 | | } |
| | 93 | |
|
| | 94 | | } |