-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathLongTermStatisticsControllerRemover.cs
33 lines (31 loc) · 1.25 KB
/
LongTermStatisticsControllerRemover.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
using DHI.Mike1D.Mike1DDataAccess;
using DHI.Mike1D.Plugins;
namespace Scripts
{
/// <summary>
/// A script, which allows to perform Long Term Statistics (LTS) computations for ordinary HD simulation.
/// <para>
/// The idea is that one prepares an LTS simulation, which has LTS result specifications.
/// Then by removing the use of Mike1DControllerLTS (set the flag <see cref="Mike1DData.UseHDLongTermStatistics"/> to false)
/// a conventional Mike1DController is used, but with LTSModule present, which performs statistics calculations on
/// ordinary HD simulation results.
/// </para>
/// <para>
/// The LTSModule will be enabled if there are LTS result specifications in Mike1DData.
/// </para>
/// </summary>
public class LongTermStatisticsControllerRemover
{
/// <summary>
/// Method called when Mike1DData object has been loaded.
/// </summary>
[Script]
public void Initialize(Mike1DData mike1DData)
{
mike1DData.UseHDLongTermStatistics = false;
// Add LTS result specifications to ordinary MIKE 1D result specifications
foreach (var resultSpecificationLTS in mike1DData.LongTermStatistics.ResultSpecifications)
mike1DData.ResultSpecifications.Add(resultSpecificationLTS);
}
}
}