|  |  | 1 |  | using Morpho25.Geometry; | 
|  |  | 2 |  | using System; | 
|  |  | 3 |  | using System.Collections.Generic; | 
|  |  | 4 |  | using System.Linq; | 
|  |  | 5 |  |  | 
|  |  | 6 |  |  | 
|  |  | 7 |  | namespace Morpho25.Settings | 
|  |  | 8 |  | { | 
|  |  | 9 |  |     /// <summary> | 
|  |  | 10 |  |     /// OutputSettings class. | 
|  |  | 11 |  |     /// </summary> | 
|  |  | 12 |  |     public class OutputSettings : Configuration | 
|  |  | 13 |  |     { | 
|  |  | 14 |  |         public const int NESTING_GRID = 0; | 
|  |  | 15 |  |  | 
|  |  | 16 |  |         private int _mainFiles; | 
|  |  | 17 |  |         private int _textFiles; | 
|  |  | 18 |  |  | 
|  |  | 19 |  |         /// </summary> | 
|  |  | 20 |  |         /// Enable NetCDF output. | 
|  |  | 21 |  |         /// </summary> | 
|  | 3 | 22 |  |         public Active NetCDF { get; set; } | 
|  |  | 23 |  |  | 
|  |  | 24 |  |         /// <summary> | 
|  |  | 25 |  |         /// Merge NetCDF files. | 
|  |  | 26 |  |         /// </summary> | 
|  | 3 | 27 |  |         public Active NetCDFAllDataInOneFile { get; set; } | 
|  |  | 28 |  |  | 
|  |  | 29 |  |         /// <summary> | 
|  |  | 30 |  |         /// NetCDF small size. | 
|  |  | 31 |  |         /// </summary> | 
|  | 3 | 32 |  |         public Active NetCDFWriteOnlySmallFiles { get; set; } | 
|  |  | 33 |  |  | 
|  |  | 34 |  |         /// <summary> | 
|  |  | 35 |  |         /// Include nesting grid. | 
|  |  | 36 |  |         /// </summary> | 
|  | 1 | 37 |  |         public Active IncludeNestingGrid { get; set; } | 
|  |  | 38 |  |  | 
|  |  | 39 |  |         /// <summary> | 
|  |  | 40 |  |         /// Decide in which output interval save output files. | 
|  |  | 41 |  |         /// </summary> | 
|  |  | 42 |  |         public int MainFiles | 
|  |  | 43 |  |         { | 
|  | 3 | 44 |  |             get { return _mainFiles; } | 
|  |  | 45 |  |             set | 
|  | 2 | 46 |  |             { | 
|  | 2 | 47 |  |                 ItIsPositive(value); | 
|  | 2 | 48 |  |                 _mainFiles = value; | 
|  | 2 | 49 |  |             } | 
|  |  | 50 |  |         } | 
|  |  | 51 |  |         /// <summary> | 
|  |  | 52 |  |         /// Decide in which output interval save receptor and building files. | 
|  |  | 53 |  |         /// </summary> | 
|  |  | 54 |  |         public int TextFiles | 
|  |  | 55 |  |         { | 
|  | 3 | 56 |  |             get { return _textFiles; } | 
|  |  | 57 |  |             set | 
|  | 2 | 58 |  |             { | 
|  | 2 | 59 |  |                 ItIsPositive(value); | 
|  | 2 | 60 |  |                 _textFiles = value; | 
|  | 2 | 61 |  |             } | 
|  |  | 62 |  |         } | 
|  |  | 63 |  |  | 
|  |  | 64 |  |         /// </summary> | 
|  |  | 65 |  |         /// Enable Agent output. | 
|  |  | 66 |  |         /// </summary> | 
|  | 5 | 67 |  |         public Active WriteAgents { get; set; } | 
|  |  | 68 |  |  | 
|  |  | 69 |  |  | 
|  |  | 70 |  |         /// </summary> | 
|  |  | 71 |  |         /// Enable Atmosphere output. | 
|  |  | 72 |  |         /// </summary> | 
|  | 3 | 73 |  |         public Active WriteAtmosphere { get; set; } | 
|  |  | 74 |  |  | 
|  |  | 75 |  |         /// </summary> | 
|  |  | 76 |  |         /// Enable Buildings output. | 
|  |  | 77 |  |         /// </summary> | 
|  | 3 | 78 |  |         public Active WriteBuildings { get; set; } | 
|  |  | 79 |  |  | 
|  |  | 80 |  |         /// </summary> | 
|  |  | 81 |  |         /// Enable Objects output. | 
|  |  | 82 |  |         /// </summary> | 
|  | 3 | 83 |  |         public Active WriteObjects { get; set; } | 
|  |  | 84 |  |  | 
|  |  | 85 |  |         /// </summary> | 
|  |  | 86 |  |         /// Enable Greenpass output. | 
|  |  | 87 |  |         /// </summary> | 
|  | 3 | 88 |  |         public Active WriteGreenpass { get; set; } | 
|  |  | 89 |  |  | 
|  |  | 90 |  |         /// </summary> | 
|  |  | 91 |  |         /// Enable Nesting output. | 
|  |  | 92 |  |         /// </summary> | 
|  | 3 | 93 |  |         public Active WriteNesting { get; set; } | 
|  |  | 94 |  |  | 
|  |  | 95 |  |         /// </summary> | 
|  |  | 96 |  |         /// Enable Radiation output. | 
|  |  | 97 |  |         /// </summary> | 
|  | 3 | 98 |  |         public Active WriteRadiation { get; set; } | 
|  |  | 99 |  |  | 
|  |  | 100 |  |         /// </summary> | 
|  |  | 101 |  |         /// Enable Soil output. | 
|  |  | 102 |  |         /// </summary> | 
|  | 3 | 103 |  |         public Active WriteSoil { get; set; } | 
|  |  | 104 |  |  | 
|  |  | 105 |  |         /// </summary> | 
|  |  | 106 |  |         /// Enable SolarAccess output. | 
|  |  | 107 |  |         /// </summary> | 
|  | 3 | 108 |  |         public Active WriteSolarAccess { get; set; } | 
|  |  | 109 |  |  | 
|  |  | 110 |  |         /// </summary> | 
|  |  | 111 |  |         /// Enable Surface output. | 
|  |  | 112 |  |         /// </summary> | 
|  | 4 | 113 |  |         public Active WriteSurface { get; set; } | 
|  |  | 114 |  |  | 
|  |  | 115 |  |         /// </summary> | 
|  |  | 116 |  |         /// Enable Buildings output. | 
|  |  | 117 |  |         /// </summary> | 
|  | 3 | 118 |  |         public Active WriteVegetation { get; set; } | 
|  |  | 119 |  |  | 
|  |  | 120 |  |         /// <summary> | 
|  |  | 121 |  |         /// Create new OutputSettings. | 
|  |  | 122 |  |         /// </summary> | 
|  | 2 | 123 |  |         public OutputSettings() | 
|  | 2 | 124 |  |         { | 
|  | 2 | 125 |  |             MainFiles = 60; | 
|  | 2 | 126 |  |             TextFiles = 60; | 
|  | 2 | 127 |  |             NetCDF = Active.NO; | 
|  | 2 | 128 |  |             NetCDFAllDataInOneFile = Active.NO; | 
|  | 2 | 129 |  |             NetCDFWriteOnlySmallFiles = Active.NO; | 
|  | 2 | 130 |  |             WriteAgents = Active.NO; | 
|  | 2 | 131 |  |             WriteAtmosphere = Active.YES; | 
|  | 2 | 132 |  |             WriteBuildings = Active.YES; | 
|  | 2 | 133 |  |             WriteObjects = Active.NO; | 
|  | 2 | 134 |  |             WriteGreenpass = Active.NO; | 
|  | 2 | 135 |  |             WriteNesting = Active.NO; | 
|  | 2 | 136 |  |             WriteRadiation = Active.YES; | 
|  | 2 | 137 |  |             WriteSoil = Active.YES; | 
|  | 2 | 138 |  |             WriteSolarAccess = Active.YES; | 
|  | 2 | 139 |  |             WriteSurface = Active.YES; | 
|  | 2 | 140 |  |             WriteVegetation = Active.YES; | 
|  | 2 | 141 |  |         } | 
|  |  | 142 |  |  | 
|  |  | 143 |  |         /// <summary> | 
|  |  | 144 |  |         /// Title of the XML section | 
|  |  | 145 |  |         /// </summary> | 
|  | 1 | 146 |  |         public string Title => "OutputSettings"; | 
|  |  | 147 |  |  | 
|  |  | 148 |  |         /// <summary> | 
|  |  | 149 |  |         /// Values of the XML section | 
|  |  | 150 |  |         /// </summary> | 
|  | 1 | 151 |  |         public string[] Values => new[] { | 
|  | 1 | 152 |  |             MainFiles.ToString(), | 
|  | 1 | 153 |  |             TextFiles.ToString(), | 
|  | 1 | 154 |  |             ((int)NetCDF).ToString(), | 
|  | 1 | 155 |  |             ((int)NetCDFAllDataInOneFile).ToString(), | 
|  | 1 | 156 |  |             ((int)NetCDFWriteOnlySmallFiles).ToString(), | 
|  | 1 | 157 |  |             ((int)IncludeNestingGrid).ToString(), | 
|  | 1 | 158 |  |             ((int)WriteAgents).ToString(), | 
|  | 1 | 159 |  |             ((int)WriteAtmosphere).ToString(), | 
|  | 1 | 160 |  |             ((int)WriteBuildings).ToString(), | 
|  | 1 | 161 |  |             ((int)WriteObjects).ToString(), | 
|  | 1 | 162 |  |             ((int)WriteGreenpass).ToString(), | 
|  | 1 | 163 |  |             ((int)WriteNesting).ToString(), | 
|  | 1 | 164 |  |             ((int)WriteRadiation).ToString(), | 
|  | 1 | 165 |  |             ((int)WriteSoil).ToString(), | 
|  | 1 | 166 |  |             ((int)WriteSolarAccess).ToString(), | 
|  | 1 | 167 |  |             ((int)WriteSurface).ToString(), | 
|  | 1 | 168 |  |             ((int)WriteVegetation).ToString(), | 
|  | 1 | 169 |  |         }; | 
|  |  | 170 |  |  | 
|  |  | 171 |  |         /// <summary> | 
|  |  | 172 |  |         /// Tags of the XML section | 
|  |  | 173 |  |         /// </summary> | 
|  | 1 | 174 |  |         public string[] Tags => new[] { | 
|  | 1 | 175 |  |             "mainFiles", | 
|  | 1 | 176 |  |             "textFiles", | 
|  | 1 | 177 |  |             "netCDF", | 
|  | 1 | 178 |  |             "netCDFAllDataInOneFile", | 
|  | 1 | 179 |  |             "netCDFWriteOnlySmallFile", | 
|  | 1 | 180 |  |             "inclNestingGrids", | 
|  | 1 | 181 |  |             "writeAgents", | 
|  | 1 | 182 |  |             "writeAtmosphere", | 
|  | 1 | 183 |  |             "writeBuildings", | 
|  | 1 | 184 |  |             "writeObjects", | 
|  | 1 | 185 |  |             "writeGreenpass", | 
|  | 1 | 186 |  |             "writeNesting", | 
|  | 1 | 187 |  |             "writeRadiation", | 
|  | 1 | 188 |  |             "writeSoil", | 
|  | 1 | 189 |  |             "writeSolarAccess", | 
|  | 1 | 190 |  |             "writeSurface", | 
|  | 1 | 191 |  |             "writeVegetation" | 
|  | 1 | 192 |  |         }; | 
|  |  | 193 |  |  | 
|  |  | 194 |  |         /// <summary> | 
|  |  | 195 |  |         /// String representation of OutputSettings. | 
|  |  | 196 |  |         /// </summary> | 
|  |  | 197 |  |         /// <returns>String representation.</returns> | 
|  | 0 | 198 |  |         public override string ToString() => $"Config::OutputSettings::{NetCDF}"; | 
|  |  | 199 |  |     } | 
|  |  | 200 |  |  | 
|  |  | 201 |  | } |