| | 1 | | using System; |
| | 2 | |
|
| | 3 | |
|
| | 4 | | namespace Morpho25.Settings |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// SolarAdjust class. |
| | 8 | | /// </summary> |
| | 9 | | public class SolarAdjust |
| | 10 | | { |
| | 11 | | private double _sWfactor; |
| | 12 | |
|
| | 13 | | /// <summary> |
| | 14 | | /// Solar adjustment factor. |
| | 15 | | /// </summary> |
| | 16 | | public double SWfactor |
| | 17 | | { |
| 9 | 18 | | get { return _sWfactor; } |
| | 19 | | set |
| 4 | 20 | | { |
| 4 | 21 | | if (value > 1.50 || value < 0.50) |
| 1 | 22 | | throw new ArgumentException("Sw factor must be in range (0.5, 1.50)."); |
| 3 | 23 | | _sWfactor = value; |
| 3 | 24 | | } |
| | 25 | | } |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// Create a new SolarAdjust object. |
| | 29 | | /// </summary> |
| | 30 | | /// <param name="sWfactor">Solar adjustment factor to apply. double in range (0.5, 1.50).</param> |
| 2 | 31 | | public SolarAdjust() |
| 2 | 32 | | { |
| 2 | 33 | | SWfactor = 1.0; |
| 2 | 34 | | } |
| | 35 | |
|
| | 36 | | /// <summary> |
| | 37 | | /// Title of the XML section |
| | 38 | | /// </summary> |
| 1 | 39 | | public string Title => "SolarAdjust"; |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Values of the XML section |
| | 43 | | /// </summary> |
| 1 | 44 | | public string[] Values => new[] { |
| 1 | 45 | | SWfactor.ToString("n5") |
| 1 | 46 | | }; |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Tags of the XML section |
| | 50 | | /// </summary> |
| 1 | 51 | | public string[] Tags => new[] { |
| 1 | 52 | | "SWFactor" |
| 1 | 53 | | }; |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// String representation of solar adjust object. |
| | 57 | | /// </summary> |
| | 58 | | /// <returns>String representation.</returns> |
| 0 | 59 | | public override string ToString() => "Config::SolarAdjust"; |
| | 60 | | } |
| | 61 | |
|
| | 62 | | } |