< Summary

Information
Class: Morpho25.Settings.SoilSettings
Assembly: Morpho25
File(s): D:\a\Morpho\Morpho\project\Morpho\Morpho25\Settings\SoilSettings.cs
Line coverage
98%
Covered lines: 71
Uncovered lines: 1
Coverable lines: 72
Total lines: 171
Line coverage: 98.6%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

D:\a\Morpho\Morpho\project\Morpho\Morpho25\Settings\SoilSettings.cs

#LineLine coverage
 1using Morpho25.Utility;
 2
 3
 4namespace Morpho25.Settings
 5{
 6    /// <summary>
 7    /// Soil settings class.
 8    /// </summary>
 9    public class SoilSettings : Configuration
 10    {
 11        private double _tempUpperlayer;
 12        private double _tempMiddlelayer;
 13        private double _tempDeeplayer;
 14        private double _tempBedrockLayer;
 15        private double _waterUpperlayer;
 16        private double _waterMiddlelayer;
 17        private double _waterDeeplayer;
 18        private double _waterBedrockLayer;
 19
 20        private double ToKelvin(double value)
 921        {
 922            return value + Util.TO_KELVIN;
 923        }
 24        /// <summary>
 25        /// Initial Temperature Upper Layer (0-20 cm) [°C].
 26        /// </summary>
 27        public double TempUpperlayer
 28        {
 929            get { return _tempUpperlayer; }
 30            set
 331            {
 332                _tempUpperlayer = ToKelvin(value);
 333            }
 34        }
 35        /// <summary>
 36        /// Initial Temperature Middle Layer (20-50 cm) [°C].
 37        /// </summary>
 38        public double TempMiddlelayer
 39        {
 340            get { return _tempMiddlelayer; }
 41            set
 242            {
 243                _tempMiddlelayer = ToKelvin(value);
 244            }
 45        }
 46        /// <summary>
 47        /// Initial Temperature Deep Layer (below 50-200 cm) [°C].
 48        /// </summary>
 49        public double TempDeeplayer
 50        {
 351            get { return _tempDeeplayer; }
 52            set
 253            {
 254                _tempDeeplayer = ToKelvin(value);
 255            }
 56        }
 57        /// <summary>
 58        /// Initial Temperature Bedrock Layer (200 cm) [°C].
 59        /// </summary>
 60        public double TempBedrockLayer
 61        {
 362            get { return _tempBedrockLayer; }
 63            set
 264            {
 265                _tempBedrockLayer = ToKelvin(value);
 266            }
 67        }
 68        /// <summary>
 69        /// Relative Humidity Upper Layer (0-20 cm).
 70        /// </summary>
 71        public double WaterUpperlayer
 72        {
 373            get { return _waterUpperlayer; }
 74            set
 275            {
 276                IsHumidityOk(value);
 277                _waterUpperlayer = value;
 278            }
 79        }
 80        /// <summary>
 81        /// Relative Humidity Middle Layer (20-50 cm).
 82        /// </summary>
 83        public double WaterMiddlelayer
 84        {
 385            get { return _waterMiddlelayer; }
 86            set
 287            {
 288                IsHumidityOk(value);
 289                _waterMiddlelayer = value;
 290            }
 91        }
 92        /// <summary>
 93        /// Relative Humidity Deep Layer (50-200 cm).
 94        /// </summary>
 95        public double WaterDeeplayer
 96        {
 397            get { return _waterDeeplayer; }
 98            set
 399            {
 3100                IsHumidityOk(value);
 2101                _waterDeeplayer = value;
 2102            }
 103        }
 104        /// <summary>
 105        /// Relative Humidity Bedrock (below 200 cm).
 106        /// </summary>
 107        public double WaterBedrockLayer
 108        {
 3109            get { return _waterBedrockLayer; }
 110            set
 2111            {
 2112                IsHumidityOk(value);
 2113                _waterBedrockLayer = value;
 2114            }
 115        }
 116        /// <summary>
 117        /// Create soil settings object.
 118        /// </summary>
 2119        public SoilSettings()
 2120        {
 2121            TempUpperlayer = 19.85;
 2122            TempMiddlelayer = 19.85;
 2123            TempDeeplayer = 19.85;
 2124            TempBedrockLayer = 19.85;
 2125            WaterUpperlayer = 70.0;
 2126            WaterMiddlelayer = 75.0;
 2127            WaterDeeplayer = 75.0;
 2128            WaterBedrockLayer = 75.0;
 2129        }
 130
 131        /// <summary>
 132        /// Title of the XML section
 133        /// </summary>
 1134        public string Title => "Soil";
 135
 136        /// <summary>
 137        /// Values of the XML section
 138        /// </summary>
 1139        public string[] Values => new[] {
 1140            TempUpperlayer.ToString("n5"),
 1141            TempMiddlelayer.ToString("n5"),
 1142            TempDeeplayer.ToString("n5"),
 1143            TempBedrockLayer.ToString("n5"),
 1144            WaterUpperlayer.ToString("n5"),
 1145            WaterMiddlelayer.ToString("n5"),
 1146            WaterDeeplayer.ToString("n5"),
 1147            WaterBedrockLayer.ToString("n5")
 1148        };
 149
 150        /// <summary>
 151        /// Tags of the XML section
 152        /// </summary>
 1153        public string[] Tags => new[] {
 1154            "tempUpperlayer",
 1155            "tempMiddlelayer",
 1156            "tempDeeplayer",
 1157            "tempBedrockLayer",
 1158            "waterUpperlayer",
 1159            "waterMiddlelayer",
 1160            "waterDeeplayer",
 1161            "waterBedrockLayer"
 1162        };
 163
 164        /// <summary>
 165        /// String representation of SoilSettings object.
 166        /// </summary>
 167        /// <returns>String representation.</returns>
 0168        public override string ToString() => "Config::SoilSettings";
 169    }
 170
 171}