| | 1 | | namespace Morpho25.Settings |
| | 2 | | { |
| | 3 | | /// <summary> |
| | 4 | | /// Tree settings class. |
| | 5 | | /// </summary> |
| | 6 | | public class PlantSetting |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// CO2 background level (ppm). |
| | 10 | | /// The default value of the CO2 background concentration is set to 400 ppm. |
| | 11 | | /// </summary> |
| 6 | 12 | | public uint CO2 { get; set; } |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// Use old calculation model. |
| | 16 | | /// or use user defined value. |
| | 17 | | /// </summary> |
| 3 | 18 | | public Active LeafTransmittance { get; set; } |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Use tree calendar, |
| | 22 | | /// </summary> |
| 5 | 23 | | public Active TreeCalendar { get; set; } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Create a new PlantSetting object. |
| | 27 | | /// </summary> |
| 2 | 28 | | public PlantSetting() |
| 2 | 29 | | { |
| 2 | 30 | | CO2 = 400; |
| 2 | 31 | | LeafTransmittance = Active.YES; |
| 2 | 32 | | TreeCalendar = Active.YES; |
| 2 | 33 | | } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Title of the XML section |
| | 37 | | /// </summary> |
| 1 | 38 | | public string Title => "PlantModel"; |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// Values of the XML section |
| | 42 | | /// </summary> |
| 1 | 43 | | public string[] Values => new[] { |
| 1 | 44 | | CO2.ToString("n5"), |
| 1 | 45 | | ((int)LeafTransmittance).ToString(), |
| 1 | 46 | | ((int)TreeCalendar).ToString() |
| 1 | 47 | | }; |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// Tags of the XML section |
| | 51 | | /// </summary> |
| 1 | 52 | | public string[] Tags => new[] { |
| 1 | 53 | | "CO2BackgroundPPM", |
| 1 | 54 | | "LeafTransmittance", |
| 1 | 55 | | "TreeCalendar" |
| 1 | 56 | | }; |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// String representation of PlantSetting object. |
| | 60 | | /// </summary> |
| | 61 | | /// <returns>String representation.</returns> |
| 0 | 62 | | public override string ToString() => "Config::PlantSetting"; |
| | 63 | | } |
| | 64 | | } |