// 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 System.Collections.Generic; using System.Drawing; using System.Linq; using Core.Common.Base.Data; using Core.Common.Controls.DataGrid; using Ringtoets.Piping.Primitives; namespace Ringtoets.Piping.Forms.Views { /// /// This class defines a table in which properties of instances /// are shown as rows. /// public class PipingSoilLayerTable : DataGridViewControl { /// /// Creates a new instance of . /// public PipingSoilLayerTable() { AddColumns(); } /// /// Sets the given for which the properties /// are shown in the table. /// /// The collection of layers to show. public void SetData(IEnumerable layers) { SetDataSource(layers?.Select(l => new FormattedPipingSoilLayerRow(l)).ToArray()); } private void AddColumns() { AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.MaterialName), "Naam", true); AddColorColumn(nameof(FormattedPipingSoilLayerRow.Color), "Kleur"); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.Top), "Topniveau [m+NAP]", true); AddCheckBoxColumn(nameof(FormattedPipingSoilLayerRow.IsAquifer), "Is aquifer", true); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.PermeabilityMean), "Doorlatendheid (verwachtingswaarde) [m/s]", true); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.PermeabilityDeviation), "Doorlatendheid (standaardafwijking) [m/s]", true); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.DiameterD70Mean), "d70 (verwachtingswaarde) [m]", true); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.DiameterD70Deviation), "d70 (standaardafwijking) [m]", true); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.BelowPhreaticLevelMean), "Verzadigd gewicht (verwachtingswaarde) [kn/m³]", true); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.BelowPhreaticLevelDeviation), "Verzadigd gewicht (standaardafwijking) [kn/m³]", true); AddTextBoxColumn(nameof(FormattedPipingSoilLayerRow.BelowPhreaticLevelShift), "Verzadigd gewicht (verschuiving) [kn/m³]", true); } private class FormattedPipingSoilLayerRow { public FormattedPipingSoilLayerRow(PipingSoilLayer layer) { MaterialName = layer.MaterialName; Color = layer.Color; Top = new RoundedDouble(2, layer.Top); IsAquifer = layer.IsAquifer; PermeabilityMean = new RoundedDouble(6, layer.PermeabilityMean); PermeabilityDeviation = new RoundedDouble(6, layer.PermeabilityDeviation); DiameterD70Mean = new RoundedDouble(6, layer.DiameterD70Mean); DiameterD70Deviation = new RoundedDouble(6, layer.DiameterD70Deviation); BelowPhreaticLevelMean = new RoundedDouble(2, layer.BelowPhreaticLevelMean); BelowPhreaticLevelDeviation = new RoundedDouble(2, layer.BelowPhreaticLevelDeviation); BelowPhreaticLevelShift = new RoundedDouble(2, layer.BelowPhreaticLevelShift); } /// /// Gets the top level of the . /// public RoundedDouble Top { get; } /// /// Gets a value indicating whether or not the is an aquifer. /// public bool IsAquifer { get; } /// /// Gets the mean of the distrubtion for the volumic weight of the below the phreatic level. /// [kN/m³] /// public RoundedDouble BelowPhreaticLevelMean { get; } /// /// Gets the deviation of the distrubtion for the volumic weight of the below the phreatic level. /// [kN/m³] /// public RoundedDouble BelowPhreaticLevelDeviation { get; } /// /// Gets the shift of the distrubtion for the volumic weight of the below the phreatic level. /// [kN/m³] /// public RoundedDouble BelowPhreaticLevelShift { get; } /// /// Gets the mean of the distribution for the mean diameter of small scale tests applied to different kinds of sand, /// on which the formula of Sellmeijer has been fit. /// [m] /// public RoundedDouble DiameterD70Mean { get; } /// /// Gets the deviation of the distribution for the mean diameter of small scale tests applied to different kinds of sand, /// on which the formula of Sellmeijer has been fit. /// [m] /// public RoundedDouble DiameterD70Deviation { get; } /// /// Gets the mean of the distribution for the the Darcy-speed with which water flows through the aquifer layer. /// [m/s] /// public RoundedDouble PermeabilityMean { get; } /// /// Gets the deviation of the distribution for the Darcy-speed with which water flows through the aquifer layer. /// [m/s] /// public RoundedDouble PermeabilityDeviation { get; } /// /// Gets the name of the material that was assigned to the . /// /// Thrown when is null. public string MaterialName { get; } /// /// Gets the that was used to represent the . /// public Color Color { get; } } } }