Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Properties/Resources.Designer.cs =================================================================== diff -u -r053dd67c20af818cb73350a950dd436a70046938 -r3c24fd855caa295ba80f887e5da167e43513f66e --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 053dd67c20af818cb73350a950dd436a70046938) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3c24fd855caa295ba80f887e5da167e43513f66e) @@ -1,7 +1,28 @@ -//------------------------------------------------------------------------------ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -104,6 +125,25 @@ } /// + /// Looks up a localized string similar to "TrajectID;""Variabele"";""TimeIntegrationSchemeID""" + ///"205;""Toetspeil"";1" + ///"205;""Q"";1" + ///"205;""Hs"";2" + ///"205;""Tp"";3" + ///"205;""Tm-1,0"";1" + ///"205;""HBN"";1" + ///"205;""Gras"";1" + ///"205;""KwHoogte"";1" + ///"205;""KwSluiten"";2" + ///"205;""KwPuntconstructies"";2". + /// + internal static string HydraulicModelsSettings { + get { + return ResourceManager.GetString("HydraulicModelsSettings", resourceCulture); + } + } + + /// /// Looks up a localized string similar to "TrajectID";"MechanismID";"SubMechanismID";"Rekenmethode";"FORM_StartMethod";"FORM_NrIterations";"FORM_RelaxationFactor";"FORM_EpsBeta";"FORM_EpsHOH";"FORM_EpsZFunc";"Ds_StartMethod";"Ds_Min";"Ds_Max";"Ds_VarCoefficient";"NI_UMin";"NI_Umax";"NI_NumberSteps" ///"205";1;1;1;4;50;0.15;0.01;0.01;0.01;2;20000;100000;0.1;-6;6;25 ///"205";11;11;1;4;50;0.15;0.01;0.01;0.01;2;20000;100000;0.1;-6;6;25 Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Properties/Resources.resx =================================================================== diff -u -r053dd67c20af818cb73350a950dd436a70046938 -r3c24fd855caa295ba80f887e5da167e43513f66e --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Properties/Resources.resx (.../Resources.resx) (revision 053dd67c20af818cb73350a950dd436a70046938) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Properties/Resources.resx (.../Resources.resx) (revision 3c24fd855caa295ba80f887e5da167e43513f66e) @@ -131,4 +131,7 @@ ..\Resources\DesignTables.csv;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\HydraulicModelsSettingsTest.csv;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Providers/HydraulicModelsSettingsProvider.cs =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Providers/HydraulicModelsSettingsProvider.cs (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Providers/HydraulicModelsSettingsProvider.cs (revision 3c24fd855caa295ba80f887e5da167e43513f66e) @@ -0,0 +1,117 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; +using Ringtoets.HydraRing.Calculation.Data; +using Ringtoets.HydraRing.Calculation.Data.Settings; +using Ringtoets.HydraRing.Calculation.IO; +using Ringtoets.HydraRing.Calculation.Properties; + +namespace Ringtoets.HydraRing.Calculation.Providers +{ + /// + /// Provider of . + /// + internal class HydraulicModelsSettingsProvider + { + private readonly IDictionary> fileHydraulicModelsSettings; + private IDictionary defaultHydraulicModelsSettings; + + /// + /// Creates a new instance of . + /// + public HydraulicModelsSettingsProvider() + { + InitializeDefaultHydraulicModelsSettings(); + + fileHydraulicModelsSettings = new HydraulicModelsSettingsCsvReader(Resources.HydraulicModelsSettings).ReadSettings(); + } + + /// + /// Gets based on the provided failure mechanism type and ring id. + /// + /// The to obtain the for. + /// The ring id to obtain the for. + /// The corresponding to the provided failure mechanism type and ring id. + public HydraulicModelsSetting GetHydraulicModelsSetting(HydraRingFailureMechanismType failureMechanismType, string ringId) + { + if (fileHydraulicModelsSettings.ContainsKey(failureMechanismType) && + ringId != null && + fileHydraulicModelsSettings[failureMechanismType].ContainsKey(ringId)) + { + return fileHydraulicModelsSettings[failureMechanismType][ringId]; + } + + return defaultHydraulicModelsSettings[failureMechanismType]; + } + + private void InitializeDefaultHydraulicModelsSettings() + { + defaultHydraulicModelsSettings = new Dictionary + { + { + HydraRingFailureMechanismType.AssessmentLevel, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.WaveHeight, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.WavePeakPeriod, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.WaveSpectralPeriod, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.QVariant, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.DikesOvertopping, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.DikesHeight, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.DikesPiping, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.StructuresOvertopping, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.StructuresClosure, + new HydraulicModelsSetting(1) + }, + { + HydraRingFailureMechanismType.StructuresStructuralFailure, + new HydraulicModelsSetting(1) + } + }; + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Resources/HydraulicModelsSettingsTest.csv =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Resources/HydraulicModelsSettingsTest.csv (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Resources/HydraulicModelsSettingsTest.csv (revision 3c24fd855caa295ba80f887e5da167e43513f66e) @@ -0,0 +1,11 @@ +"TrajectID;""Variabele"";""TimeIntegrationSchemeID""" +"205;""Toetspeil"";1" +"205;""Q"";1" +"205;""Hs"";2" +"205;""Tp"";3" +"205;""Tm-1,0"";1" +"205;""HBN"";1" +"205;""Gras"";1" +"205;""KwHoogte"";1" +"205;""KwSluiten"";2" +"205;""KwPuntconstructies"";2" \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj =================================================================== diff -u -r636e1d35674a3feabd03b6312875c52df5647751 -r3c24fd855caa295ba80f887e5da167e43513f66e --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 636e1d35674a3feabd03b6312875c52df5647751) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 3c24fd855caa295ba80f887e5da167e43513f66e) @@ -76,6 +76,7 @@ + @@ -128,6 +129,7 @@ + Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/packages.config =================================================================== diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -r3c24fd855caa295ba80f887e5da167e43513f66e --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/packages.config (.../packages.config) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/packages.config (.../packages.config) (revision 3c24fd855caa295ba80f887e5da167e43513f66e) @@ -1,4 +1,5 @@  +