// Copyright (C) Stichting Deltares 2017. 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 System.ComponentModel;
using System.Drawing;
using Core.Common.Utils;
using Ringtoets.Common.Data.Probabilistics;
using Ringtoets.MacroStabilityInwards.Primitives;
using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
namespace Ringtoets.MacroStabilityInwards.Forms.Views
{
///
/// This class defines a formatted version of an object.
///
public class MacroStabilityInwardsFormattedSoilLayerDataRow
{
///
/// Creates a new instance of .
///
/// The to format.
/// Thrown when
/// is null.
public MacroStabilityInwardsFormattedSoilLayerDataRow(IMacroStabilityInwardsSoilLayerData layerData)
{
if (layerData == null)
{
throw new ArgumentNullException(nameof(layerData));
}
MaterialName = layerData.MaterialName;
Color = layerData.Color;
IsAquifer = layerData.IsAquifer;
AbovePhreaticLevel = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetAbovePhreaticLevel(layerData));
BelowPhreaticLevel = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetBelowPhreaticLevel(layerData));
ShearStrengthModel = layerData.ShearStrengthModel;
Cohesion = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetCohesion(layerData));
FrictionAngle = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetFrictionAngle(layerData));
ShearStrengthRatio = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetShearStrengthRatio(layerData));
StrengthIncreaseExponent = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetStrengthIncreaseExponent(layerData));
UsePop = layerData.UsePop;
Pop = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetPop(layerData));
}
///
/// Gets a value indicating whether or not the is an aquifer.
///
public bool IsAquifer { get; }
///
/// Gets the name of the material that was assigned to the .
///
public string MaterialName { get; }
///
/// Gets the that was used to represent the .
///
public Color Color { get; }
///
/// Gets the formatted design variable for .
///
public string AbovePhreaticLevel { get; }
///
/// Gets the formatted design variable for .
///
public string BelowPhreaticLevel { get; }
///
/// Gets the type.
///
[TypeConverter(typeof(EnumTypeConverter))]
public MacroStabilityInwardsShearStrengthModel ShearStrengthModel { get; }
///
/// Gets the formatted design variable for .
///
public string Cohesion { get; }
///
/// Gets the formatted design variable for .
///
public string FrictionAngle { get; }
///
/// Gets the formatted design variable for .
///
public string ShearStrengthRatio { get; }
///
/// Gets the formatted design variable for .
///
public string StrengthIncreaseExponent { get; }
///
/// Gets a value indicating whether or not the is using POP.
///
public bool UsePop { get; }
///
/// Gets the formatted design variable for .
///
public string Pop { get; }
private static string FormatVariationCoefficientDesignVariable(VariationCoefficientDesignVariable designVariable)
{
return string.Format(RingtoetsCommonFormsResources.VariationCoefficientDesignVariable_0_Mean_is_1_CoefficientOfVariation_is_2,
designVariable.GetDesignValue(),
designVariable.Distribution.Mean,
designVariable.Distribution.CoefficientOfVariation);
}
}
}