// 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; using Core.Common.Base.Data; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Data.Structures; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; namespace Ringtoets.HeightStructures.Data { /// /// Class that holds all height structures calculation specific input parameters. /// public class HeightStructuresInput : StructuresInputBase { private readonly NormalDistribution levelCrestStructure; private RoundedDouble deviationWaveDirection; /// /// Creates a new instance of the class. /// public HeightStructuresInput() { levelCrestStructure = new NormalDistribution(2); deviationWaveDirection = new RoundedDouble(2); SetDefaultSchematizationProperties(); } #region Hydraulic data /// /// Gets or sets the deviation of the wave direction. /// [degrees] /// public RoundedDouble DeviationWaveDirection { get { return deviationWaveDirection; } set { RoundedDouble newDeviationWaveDirection = value.ToPrecision(deviationWaveDirection.NumberOfDecimalPlaces); if (!double.IsNaN(newDeviationWaveDirection) && (Math.Abs(newDeviationWaveDirection) > 360)) { throw new ArgumentOutOfRangeException("value", RingtoetsCommonDataResources.DeviationWaveDirection_Value_needs_to_be_between_negative_360_and_positive_360); } deviationWaveDirection = newDeviationWaveDirection; } } #endregion #region Schematization /// /// Gets or sets the crest level of the structure. /// [m+NAP] /// public NormalDistribution LevelCrestStructure { get { return levelCrestStructure; } set { levelCrestStructure.Mean = value.Mean; levelCrestStructure.StandardDeviation = value.StandardDeviation; } } #endregion protected override void UpdateStructureParameters() { if (Structure != null) { StructureNormalOrientation = Structure.StructureNormalOrientation; LevelCrestStructure = Structure.LevelCrestStructure; FlowWidthAtBottomProtection = Structure.FlowWidthAtBottomProtection; CriticalOvertoppingDischarge = Structure.CriticalOvertoppingDischarge; WidthFlowApertures = Structure.WidthFlowApertures; FailureProbabilityStructureWithErosion = Structure.FailureProbabilityStructureWithErosion; StorageStructureArea = Structure.StorageStructureArea; AllowedLevelIncreaseStorage = Structure.AllowedLevelIncreaseStorage; } else { SetDefaultSchematizationProperties(); } } private void SetDefaultSchematizationProperties() { LevelCrestStructure = new NormalDistribution { Mean = RoundedDouble.NaN, StandardDeviation = RoundedDouble.NaN }; FailureProbabilityStructureWithErosion = 1.0; } } }