-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathEngineSettings.cs
374 lines (320 loc) · 11.8 KB
/
EngineSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;
namespace DHI.Generic.NetCDF.MIKE
{
public class EngineSettings
{
private string _inputFilePreFix, _inputFileExtension, _outputFilePrefix, _workingDirectory;
private List<CommandSettings> _commandSettings;
[CategoryAttribute("Instance Settings"), ReadOnlyAttribute(false)]
public string InputFilePrefix
{
get { return _inputFilePreFix; }
set { _inputFilePreFix = value; }
}
[CategoryAttribute("Instance Settings"), ReadOnlyAttribute(false)]
public string InputFileExtension
{
get { return _inputFileExtension; }
set { _inputFileExtension = value; }
}
[CategoryAttribute("Instance Settings"), ReadOnlyAttribute(false)]
public string OutputFilePrefix
{
get { return _outputFilePrefix; }
set { _outputFilePrefix = value; }
}
[CategoryAttribute("Instance Settings"), ReadOnlyAttribute(false)]
public string WorkingDirectory
{
get { return _workingDirectory; }
set { _workingDirectory = value; }
}
[CategoryAttribute("Instance Settings"), ReadOnlyAttribute(false)]
public List<CommandSettings> Commands
{
get { return _commandSettings; }
set { _commandSettings = value; }
}
}
public class CommandSettings
{
private string _commandName, _inputFileName, _outputFileName, _xAxisName, _yAxisName, _zAxisName, _timeAxisName, _inputFileExtension, _outputFileExtension;
private string _xAxisDimensionName, _yAxisDimensionName, _zAxisDimensionName, _timeAxisDimensionName;
private int _zLayer;
private int _timeLayer;
private bool _useDataSet;
private string _yLayer, _xLayer;
private List<string> _selectedVariables;
private List<DHICFEntry> _selectedVariablesMapping;
private List<bool> _isVariablesSelected;
private List<TransectPoint> _transectPoints;
private string _mapProjectionString;
private string _eastNorthMultiplier;
private float _dz, _dx, _dy;
private int _num_x_cells, _num_y_cells, _num_z_cells;
private int _maxBlockSizeMB;
private int _transectSpaceStepsNum;
private int _timeStepSeconds;
private double _overwriteOriginX;
private double _overwriteOriginY;
private double _overwriteRotation;
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string CommandName
{
get { return _commandName; }
set { _commandName = value; }
}
public bool UseDataSet
{
get { return _useDataSet; }
set { _useDataSet = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string InputFileName
{
get { return _inputFileName; }
set { _inputFileName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string InputFileExtension
{
get { return _inputFileExtension; }
set { _inputFileExtension = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string OutputFileName
{
get { return _outputFileName; }
set { _outputFileName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string OutputFileExtension
{
get { return _outputFileExtension; }
set { _outputFileExtension = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int MaxBlockSizeMB
{
get { return _maxBlockSizeMB; }
set { this._maxBlockSizeMB = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(
"System.Windows.Forms.Design.StringCollectionEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
"System.Drawing.Design.UITypeEditor, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public List<string> Variables
{
get { return _selectedVariables; }
set { _selectedVariables = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public List<DHICFEntry> VariablesMappings
{
get { return _selectedVariablesMapping; }
set { _selectedVariablesMapping = value; }
}
public List<bool> IsVariablesSelected
{
get { return _isVariablesSelected; }
set { _isVariablesSelected = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string XAxisName
{
get { return _xAxisName; }
set { _xAxisName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string XAxisDimensionName
{
get { return _xAxisDimensionName; }
set { _xAxisDimensionName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string XLayer
{
get { return _xLayer; }
set { _xLayer = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public double OverwriteOriginX
{
get { return _overwriteOriginX; }
set { _overwriteOriginX = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public double OverwriteOriginY
{
get { return _overwriteOriginY; }
set { _overwriteOriginY = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public double OverwriteRotation
{
get { return _overwriteRotation; }
set { _overwriteRotation = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string YAxisName
{
get { return _yAxisName; }
set { _yAxisName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string YAxisDimensionName
{
get { return _yAxisDimensionName; }
set { _yAxisDimensionName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string YLayer
{
get { return _yLayer; }
set { _yLayer = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string ZAxisName
{
get { return _zAxisName; }
set { _zAxisName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string ZAxisDimensionName
{
get { return _zAxisDimensionName; }
set { _zAxisDimensionName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int ZLayer
{
get { return _zLayer; }
set { _zLayer = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string TimeAxisName
{
get { return _timeAxisName; }
set { _timeAxisName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string TimeAxisDimensionName
{
get { return _timeAxisDimensionName; }
set { _timeAxisDimensionName = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int TimeLayer
{
get { return _timeLayer; }
set { _timeLayer = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public float DZ
{
get { return _dz; }
set { _dz = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string MZMapProjectionString
{
get { return _mapProjectionString; }
set { _mapProjectionString = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public string ProjectionEastNorthMultiplier
{
get { return _eastNorthMultiplier; }
set { _eastNorthMultiplier = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public List<TransectPoint> TransectPoints
{
get { return _transectPoints; }
set { _transectPoints = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int TransectSpaceStepsNumber
{
get { return _transectSpaceStepsNum; }
set { _transectSpaceStepsNum = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int TimeStepSeconds
{
get { return _timeStepSeconds; }
set { _timeStepSeconds = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int NumberXCells
{
get { return _num_x_cells; }
set { _num_x_cells = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int NumberYCells
{
get { return _num_y_cells; }
set { _num_y_cells = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public int NumberZCells
{
get { return _num_z_cells; }
set { _num_z_cells = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public float DX
{
get { return _dx; }
set { _dx = value; }
}
[CategoryAttribute("Command Settings"), ReadOnlyAttribute(false)]
public float DY
{
get { return _dy; }
set { _dy = value; }
}
}
public class TransectPoint : INotifyPropertyChanged
{
private double _x;
private double _y;
public event PropertyChangedEventHandler PropertyChanged;
public TransectPoint()
{
_x = 0;
_y = 0;
}
public TransectPoint(double x, double y)
{
_x = x;
_y = y;
}
public double X
{
get { return _x; }
set { _x = value;
this.NotifyPropertyChanged("X");
}
}
public double Y
{
get { return _y; }
set { _y = value;
this.NotifyPropertyChanged("Y");
}
}
private void NotifyPropertyChanged(string name)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
}