Index: Ringtoets/Demo/src/Ringtoets.Demo/Commands/AddNewDemoDikeAssessmentSectionCommand.cs =================================================================== diff -u -r80b447a18c4d1abf1b4a7155f863f4faaed45ba6 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Demo/src/Ringtoets.Demo/Commands/AddNewDemoDikeAssessmentSectionCommand.cs (.../AddNewDemoDikeAssessmentSectionCommand.cs) (revision 80b447a18c4d1abf1b4a7155f863f4faaed45ba6) +++ Ringtoets/Demo/src/Ringtoets.Demo/Commands/AddNewDemoDikeAssessmentSectionCommand.cs (.../AddNewDemoDikeAssessmentSectionCommand.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -61,8 +61,8 @@ } var calculation = pipingFailureMechanism.Calculations.First(); - calculation.SurfaceLine = pipingFailureMechanism.SurfaceLines.First(sl => sl.Name == "PK001_0001"); - calculation.SoilProfile = pipingFailureMechanism.SoilProfiles.First(sl => sl.Name == "AD640M00_Segment_36005_1D2"); + calculation.InputParameters.SurfaceLine = pipingFailureMechanism.SurfaceLines.First(sl => sl.Name == "PK001_0001"); + calculation.InputParameters.SoilProfile = pipingFailureMechanism.SoilProfiles.First(sl => sl.Name == "AD640M00_Segment_36005_1D2"); } /// Index: Ringtoets/Demo/test/Ringtoets.Demo.Test/Commands/AddNewDemoDikeAssessmentSectionCommandTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Demo/test/Ringtoets.Demo.Test/Commands/AddNewDemoDikeAssessmentSectionCommandTest.cs (.../AddNewDemoDikeAssessmentSectionCommandTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Demo/test/Ringtoets.Demo.Test/Commands/AddNewDemoDikeAssessmentSectionCommandTest.cs (.../AddNewDemoDikeAssessmentSectionCommandTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -77,32 +77,9 @@ private void AssertCalculationAbleToCalculate(PipingCalculationData calculation) { - Assert.AreEqual(1.0, calculation.UpliftModelFactor, 1e-3); - Assert.AreEqual(1.0, calculation.SellmeijerModelFactor, 1e-3); + PipingInputParameters inputParameters = calculation.InputParameters; + AssertExpectedPipingInputParameters(inputParameters); - Assert.AreEqual(10.0, calculation.WaterVolumetricWeight, 1e-3); - Assert.AreEqual(0.0, calculation.AssessmentLevel, 1e-3); - Assert.AreEqual(0.0, calculation.PiezometricHeadExit, 1e-3); - Assert.AreEqual(0.0, calculation.PiezometricHeadPolder, 1e-3); - Assert.AreEqual(0.3, calculation.SellmeijerReductionFactor, 1e-3); - Assert.AreEqual(16.5, calculation.SandParticlesVolumicWeight, 1e-3); - Assert.AreEqual(0.25, calculation.WhitesDragCoefficient, 1e-3); - Assert.AreEqual(1.33e-6, calculation.WaterKinematicViscosity, 1e-3); - Assert.AreEqual(9.81, calculation.Gravity, 1e-3); - Assert.AreEqual(0.000208, calculation.MeanDiameter70, 1e-3); - Assert.AreEqual(37, calculation.BeddingAngle, 1e-3); - - Assert.AreEqual("PK001_0001", calculation.SurfaceLine.Name); - Assert.AreEqual("AD640M00_Segment_36005_1D2", calculation.SoilProfile.Name); - - Assert.AreEqual(3.666, PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(calculation).GetDesignValue(), 1e-3); - Assert.AreEqual(-1.645, PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(calculation).GetDesignValue(), 1e-3); - Assert.AreEqual(0.011, PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(calculation).GetDesignValue(), 1e-3); - Assert.AreEqual(0.011, PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(calculation).GetDesignValue(), 1e-3); - Assert.AreEqual(0.011, PipingSemiProbabilisticDesignValueFactory.GetDiameter70(calculation).GetDesignValue(), 1e-3); - Assert.AreEqual(2.345, PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(calculation).GetDesignValue(), 1e-3); - Assert.AreEqual(2.345, PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(calculation).GetDesignValue(), 1e-3); - Assert.IsTrue(PipingCalculationService.Validate(calculation)); PipingCalculationService.Calculate(calculation); Assert.IsTrue(calculation.HasOutput); @@ -113,5 +90,34 @@ Assert.AreEqual(0.0016, calculation.Output.SellmeijerFactorOfSafety, 1e-3); Assert.AreEqual(-1.6387, calculation.Output.SellmeijerZValue, 1e-3); } + + private static void AssertExpectedPipingInputParameters(PipingInputParameters inputParameters) + { + Assert.AreEqual(1.0, inputParameters.UpliftModelFactor, 1e-3); + Assert.AreEqual(1.0, inputParameters.SellmeijerModelFactor, 1e-3); + + Assert.AreEqual(10.0, inputParameters.WaterVolumetricWeight, 1e-3); + Assert.AreEqual(0.0, inputParameters.AssessmentLevel, 1e-3); + Assert.AreEqual(0.0, inputParameters.PiezometricHeadExit, 1e-3); + Assert.AreEqual(0.0, inputParameters.PiezometricHeadPolder, 1e-3); + Assert.AreEqual(0.3, inputParameters.SellmeijerReductionFactor, 1e-3); + Assert.AreEqual(16.5, inputParameters.SandParticlesVolumicWeight, 1e-3); + Assert.AreEqual(0.25, inputParameters.WhitesDragCoefficient, 1e-3); + Assert.AreEqual(1.33e-6, inputParameters.WaterKinematicViscosity, 1e-3); + Assert.AreEqual(9.81, inputParameters.Gravity, 1e-3); + Assert.AreEqual(0.000208, inputParameters.MeanDiameter70, 1e-3); + Assert.AreEqual(37, inputParameters.BeddingAngle, 1e-3); + + Assert.AreEqual("PK001_0001", inputParameters.SurfaceLine.Name); + Assert.AreEqual("AD640M00_Segment_36005_1D2", inputParameters.SoilProfile.Name); + + Assert.AreEqual(3.666, PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(inputParameters).GetDesignValue(), 1e-3); + Assert.AreEqual(-1.645, PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(inputParameters).GetDesignValue(), 1e-3); + Assert.AreEqual(0.011, PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(inputParameters).GetDesignValue(), 1e-3); + Assert.AreEqual(0.011, PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(inputParameters).GetDesignValue(), 1e-3); + Assert.AreEqual(0.011, PipingSemiProbabilisticDesignValueFactory.GetDiameter70(inputParameters).GetDesignValue(), 1e-3); + Assert.AreEqual(2.345, PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(inputParameters).GetDesignValue(), 1e-3); + Assert.AreEqual(2.345, PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(inputParameters).GetDesignValue(), 1e-3); + } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingSemiProbabilisticDesignValueFactory.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingSemiProbabilisticDesignValueFactory.cs (.../PipingSemiProbabilisticDesignValueFactory.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingSemiProbabilisticDesignValueFactory.cs (.../PipingSemiProbabilisticDesignValueFactory.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -11,63 +11,63 @@ #region General parameters /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static DesignVariable GetThicknessCoverageLayer(PipingCalculationData pipingData) + public static DesignVariable GetThicknessCoverageLayer(PipingInputParameters parameters) { - return CreateDesignVariable(pipingData.ThicknessCoverageLayer, 0.05); + return CreateDesignVariable(parameters.ThicknessCoverageLayer, 0.05); } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static DesignVariable GetPhreaticLevelExit(PipingCalculationData pipingData) + public static DesignVariable GetPhreaticLevelExit(PipingInputParameters parameters) { - return CreateDesignVariable(pipingData.PhreaticLevelExit, 0.05); + return CreateDesignVariable(parameters.PhreaticLevelExit, 0.05); } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static DesignVariable GetDampingFactorExit(PipingCalculationData pipingData) + public static DesignVariable GetDampingFactorExit(PipingInputParameters parameters) { - return CreateDesignVariable(pipingData.DampingFactorExit, 0.95); + return CreateDesignVariable(parameters.DampingFactorExit, 0.95); } #endregion #region Piping parameters /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static DesignVariable GetSeepageLength(PipingCalculationData pipingData) + public static DesignVariable GetSeepageLength(PipingInputParameters parameters) { - return CreateDesignVariable(pipingData.SeepageLength, 0.05); + return CreateDesignVariable(parameters.SeepageLength, 0.05); } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static DesignVariable GetDiameter70(PipingCalculationData pipingData) + public static DesignVariable GetDiameter70(PipingInputParameters parameters) { - return CreateDesignVariable(pipingData.Diameter70, 0.05); + return CreateDesignVariable(parameters.Diameter70, 0.05); } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static DesignVariable GetDarcyPermeability(PipingCalculationData pipingData) + public static DesignVariable GetDarcyPermeability(PipingInputParameters parameters) { - return CreateDesignVariable(pipingData.DarcyPermeability, 0.95); + return CreateDesignVariable(parameters.DarcyPermeability, 0.95); } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static DesignVariable GetThicknessAquiferLayer(PipingCalculationData pipingData) + public static DesignVariable GetThicknessAquiferLayer(PipingInputParameters parameters) { - return CreateDesignVariable(pipingData.ThicknessAquiferLayer, 0.95); + return CreateDesignVariable(parameters.ThicknessAquiferLayer, 0.95); } #endregion Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationData.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationData.cs (.../PipingCalculationData.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationData.cs (.../PipingCalculationData.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -1,7 +1,6 @@ using Core.Common.Base; using Ringtoets.Common.Placeholder; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Data.Properties; namespace Ringtoets.Piping.Data @@ -18,28 +17,8 @@ { Name = Resources.PipingCalculationData_DefaultName; - // Defaults as they have been defined in 'functional design semi-probabilistic assessments 1209431-008-ZWS-0009 Version 2 Final' - UpliftModelFactor = 1.0; - SellmeijerModelFactor = 1.0; - WaterVolumetricWeight = 10.0; - WhitesDragCoefficient = 0.25; - SandParticlesVolumicWeight = 16.5; - WaterKinematicViscosity = 1.33e-6; - Gravity = 9.81; - MeanDiameter70 = 2.08e-4; - BeddingAngle = 37.0; - SellmeijerReductionFactor = 0.3; - CriticalHeaveGradient = 0.3; - - PhreaticLevelExit = new NormalDistribution(); - DampingFactorExit = new LognormalDistribution { Mean = 1.0 }; - ThicknessCoverageLayer = new LognormalDistribution(); - SeepageLength = new LognormalDistribution(); - Diameter70 = new LognormalDistribution(); - DarcyPermeability = new LognormalDistribution(); - ThicknessAquiferLayer = new LognormalDistribution(); - Comments = new InputPlaceholder(Resources.Comments_DisplayName); + InputParameters = new PipingInputParameters(); CalculationReport = new PlaceholderWithReadonlyName(Resources.CalculationReport_DisplayName); } @@ -49,155 +28,16 @@ public string Name { get; set; } /// - /// Gets or sets the reduction factor Sellmeijer. + /// Gets the user notes for this calculation. /// - public double SellmeijerReductionFactor { get; set; } + public PlaceholderWithReadonlyName Comments { get; private set; } /// - /// Gets or sets the volumetric weight of water. - /// [kN/m³] + /// Gets the input parameters to perform a piping calculation with. /// - public double WaterVolumetricWeight { get; set; } + public PipingInputParameters InputParameters { get; private set; } /// - /// Gets or sets the (lowerbound) volumic weight of sand grain material of a sand layer under water. - /// [kN/m³] - /// - public double SandParticlesVolumicWeight { get; set; } - - /// - /// Gets or sets the White's drag coefficient. - /// - public double WhitesDragCoefficient { get; set; } - - /// - /// Gets or sets the kinematic viscosity of water at 10 degrees Celsius. - /// [m²/s] - /// - public double WaterKinematicViscosity { get; set; } - - /// - /// Gets or sets the gravitational acceleration. - /// [m/s²] - /// - public double Gravity { get; set; } - - /// - /// Gets or sets the mean diameter of small scale tests applied to different kinds of sand, on which the formula of Sellmeijer has been fit. - /// [m] - /// - public double MeanDiameter70 { get; set; } - - /// - /// Gets or sets the angle of the force balance representing the amount in which sand grains resist rolling. - /// [°] - /// - public double BeddingAngle { get; set; } - - /// - /// Gets or sets the calculation value used to account for uncertainty in the model for uplift. - /// - public double UpliftModelFactor { get; set; } - - /// - /// Gets or sets the outside high water level. - /// [m] - /// - public double AssessmentLevel { get; set; } - - /// - /// Gets or sets the piezometric head at the exit point. - /// [m] - /// - public double PiezometricHeadExit { get; set; } - - /// - /// Gets or sets the piezometric head in the hinterland. - /// [m] - /// - public double PiezometricHeadPolder { get; set; } - - /// - /// Gets or sets the calculation value used to account for uncertainty in the model for Sellmeijer. - /// - public double SellmeijerModelFactor { get; set; } - - /// - /// Gets or sets the x coordinate of the exit point. - /// [m] - /// - public double ExitPointXCoordinate { get; set; } - - #region Probabilistic parameters - - /// - /// Gets or sets the phreatic level at the exit point. - /// [m] - /// - public NormalDistribution PhreaticLevelExit { get; set; } - - /// - /// Gets or sets the horizontal distance between entree and exit point. - /// [m] - /// - public LognormalDistribution SeepageLength { get; set; } - - /// - /// Gets or sets the sieve size through which 70% fraction of the grains of the top part of the aquifer passes. - /// [m] - /// - public LognormalDistribution Diameter70 { get; set; } - - /// - /// Gets or sets the Darcy-speed with which water flows through the aquifer layer. - /// [m/s] - /// - public LognormalDistribution DarcyPermeability { get; set; } - - /// - /// Gets or sets the thickness of the aquifer layer. - /// [m] - /// - public LognormalDistribution ThicknessAquiferLayer { get; set; } - - /// - /// Gets or sets the total thickness of the coverage layer at the exit point. - /// [m] - /// - public LognormalDistribution ThicknessCoverageLayer { get; set; } - - /// - /// Gets or sets the damping factor at the exit point. - /// - public LognormalDistribution DampingFactorExit { get; set; } - - #endregion - - #region Constants - - /// - /// Gets or sets the critical exit gradient for heave. - /// - public double CriticalHeaveGradient { get; private set; } - - #endregion - - /// - /// Gets or sets the surface line. - /// - public RingtoetsPipingSurfaceLine SurfaceLine { get; set; } - - /// - /// Gets or sets the profile which contains a 1 dimensional definition of soil layers with properties. - /// - public PipingSoilProfile SoilProfile { get; set; } - - /// - /// Gets or sets , which contains the results of a Piping calculation. - /// - public PipingOutput Output { get; set; } - - /// /// Gets a value indicating whether the has . /// public bool HasOutput @@ -209,9 +49,9 @@ } /// - /// Gets the user notes for this calculation. + /// Gets or sets , which contains the results of a Piping calculation. /// - public PlaceholderWithReadonlyName Comments { get; private set; } + public PipingOutput Output { get; set; } /// /// Gets the calculation report for the calculation that generated . Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInputParameters.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInputParameters.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInputParameters.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,183 @@ +using Core.Common.Base; + +using Ringtoets.Piping.Data.Probabilistics; + +namespace Ringtoets.Piping.Data +{ + /// + /// Class that holds all piping calculation input parameters. + /// + public class PipingInputParameters : Observable + { + /// + /// Initializes a new instance of the class. + /// + public PipingInputParameters() + { + // Defaults as they have been defined in 'functional design semi-probabilistic assessments 1209431-008-ZWS-0009 Version 2 Final' + UpliftModelFactor = 1.0; + SellmeijerModelFactor = 1.0; + WaterVolumetricWeight = 10.0; + WhitesDragCoefficient = 0.25; + SandParticlesVolumicWeight = 16.5; + WaterKinematicViscosity = 1.33e-6; + Gravity = 9.81; + MeanDiameter70 = 2.08e-4; + BeddingAngle = 37.0; + SellmeijerReductionFactor = 0.3; + CriticalHeaveGradient = 0.3; + + PhreaticLevelExit = new NormalDistribution(); + DampingFactorExit = new LognormalDistribution { Mean = 1.0 }; + ThicknessCoverageLayer = new LognormalDistribution(); + SeepageLength = new LognormalDistribution(); + Diameter70 = new LognormalDistribution(); + DarcyPermeability = new LognormalDistribution(); + ThicknessAquiferLayer = new LognormalDistribution(); + } + + /// + /// Gets or sets the reduction factor Sellmeijer. + /// + public double SellmeijerReductionFactor { get; set; } + + /// + /// Gets or sets the volumetric weight of water. + /// [kN/m³] + /// + public double WaterVolumetricWeight { get; set; } + + /// + /// Gets or sets the (lowerbound) volumic weight of sand grain material of a sand layer under water. + /// [kN/m³] + /// + public double SandParticlesVolumicWeight { get; set; } + + /// + /// Gets or sets the White's drag coefficient. + /// + public double WhitesDragCoefficient { get; set; } + + /// + /// Gets or sets the kinematic viscosity of water at 10 degrees Celsius. + /// [m²/s] + /// + public double WaterKinematicViscosity { get; set; } + + /// + /// Gets or sets the gravitational acceleration. + /// [m/s²] + /// + public double Gravity { get; set; } + + /// + /// Gets or sets the mean diameter of small scale tests applied to different kinds of sand, on which the formula of Sellmeijer has been fit. + /// [m] + /// + public double MeanDiameter70 { get; set; } + + /// + /// Gets or sets the angle of the force balance representing the amount in which sand grains resist rolling. + /// [°] + /// + public double BeddingAngle { get; set; } + + /// + /// Gets or sets the calculation value used to account for uncertainty in the model for uplift. + /// + public double UpliftModelFactor { get; set; } + + /// + /// Gets or sets the outside high water level. + /// [m] + /// + public double AssessmentLevel { get; set; } + + /// + /// Gets or sets the piezometric head at the exit point. + /// [m] + /// + public double PiezometricHeadExit { get; set; } + + /// + /// Gets or sets the piezometric head in the hinterland. + /// [m] + /// + public double PiezometricHeadPolder { get; set; } + + /// + /// Gets or sets the calculation value used to account for uncertainty in the model for Sellmeijer. + /// + public double SellmeijerModelFactor { get; set; } + + /// + /// Gets or sets the x coordinate of the exit point. + /// [m] + /// + public double ExitPointXCoordinate { get; set; } + + #region Probabilistic parameters + + /// + /// Gets or sets the phreatic level at the exit point. + /// [m] + /// + public NormalDistribution PhreaticLevelExit { get; set; } + + /// + /// Gets or sets the horizontal distance between entree and exit point. + /// [m] + /// + public LognormalDistribution SeepageLength { get; set; } + + /// + /// Gets or sets the sieve size through which 70% fraction of the grains of the top part of the aquifer passes. + /// [m] + /// + public LognormalDistribution Diameter70 { get; set; } + + /// + /// Gets or sets the Darcy-speed with which water flows through the aquifer layer. + /// [m/s] + /// + public LognormalDistribution DarcyPermeability { get; set; } + + /// + /// Gets or sets the thickness of the aquifer layer. + /// [m] + /// + public LognormalDistribution ThicknessAquiferLayer { get; set; } + + /// + /// Gets or sets the total thickness of the coverage layer at the exit point. + /// [m] + /// + public LognormalDistribution ThicknessCoverageLayer { get; set; } + + /// + /// Gets or sets the damping factor at the exit point. + /// + public LognormalDistribution DampingFactorExit { get; set; } + + #endregion + + #region Constants + + /// + /// Gets or sets the critical exit gradient for heave. + /// + public double CriticalHeaveGradient { get; private set; } + + #endregion + + /// + /// Gets or sets the surface line. + /// + public RingtoetsPipingSurfaceLine SurfaceLine { get; set; } + + /// + /// Gets or sets the profile which contains a 1 dimensional definition of soil layers with properties. + /// + public PipingSoilProfile SoilProfile { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -65,6 +65,7 @@ + Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingCalculationInputsNodePresenter.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingCalculationInputsNodePresenter.cs (.../PipingCalculationInputsNodePresenter.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingCalculationInputsNodePresenter.cs (.../PipingCalculationInputsNodePresenter.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -34,6 +34,12 @@ protected override IEnumerable GetChildNodeObjects(PipingCalculationInputs pipingCalculationInputs, ITreeNode node) { yield return pipingCalculationInputs.PipingData.Comments; + yield return new PipingInputParametersContext + { + WrappedPipingInputParameters = pipingCalculationInputs.PipingData.InputParameters, + AvailablePipingSurfaceLines = pipingCalculationInputs.AvailablePipingSurfaceLines, + AvailablePipingSoilProfiles = pipingCalculationInputs.AvailablePipingSoilProfiles + }; var pipingOutput = pipingCalculationInputs.PipingData.Output; if (pipingOutput != null) { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingInputParametersContextNodePresenter.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingInputParametersContextNodePresenter.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingInputParametersContextNodePresenter.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,20 @@ +using Core.Common.Controls; + +using Ringtoets.Common.Forms.NodePresenters; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Forms.Properties; + +namespace Ringtoets.Piping.Forms.NodePresenters +{ + /// + /// Node presenter for instances. + /// + public class PipingInputParametersContextNodePresenter : RingtoetsNodePresenterBase + { + protected override void UpdateNode(ITreeNode parentNode, ITreeNode node, PipingInputParametersContext nodeData) + { + node.Text = "Invoer"; + node.Image = Resources.PipingInputIcon; + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationInputs.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationInputs.cs (.../PipingCalculationInputs.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationInputs.cs (.../PipingCalculationInputs.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -27,13 +27,13 @@ /// /// Gets or sets the available piping surface lines in order for the user to select - /// one to set . + /// one to set . /// public IEnumerable AvailablePipingSurfaceLines { get; set; } /// /// Gets or sets the available piping soil profiles in order for the user to select - /// one to set . + /// one to set . /// public IEnumerable AvailablePipingSoilProfiles { get; set; } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputParametersContext.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputParametersContext.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputParametersContext.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,55 @@ +using System.Collections.Generic; +using System.Linq; + +using Core.Common.Base; + +using Ringtoets.Piping.Data; + +namespace Ringtoets.Piping.Forms.PresentationObjects +{ + /// + /// A presentation layer object wrapping an instance of + /// and allowing for selecting a surfaceline or soil profile based on data available + /// in a piping failure mechanism. + /// + public class PipingInputParametersContext : IObservable + { + public PipingInputParametersContext() + { + AvailablePipingSurfaceLines = Enumerable.Empty(); + AvailablePipingSoilProfiles = Enumerable.Empty(); + } + + /// + /// Gets or sets the wrapped piping input parameters instance. + /// + public PipingInputParameters WrappedPipingInputParameters { get; set; } + + /// + /// Gets or sets the available piping surface lines in order for the user to select + /// one to set . + /// + public IEnumerable AvailablePipingSurfaceLines { get; set; } + + /// + /// Gets or sets the available piping soil profiles in order for the user to select + /// one to set . + /// + public IEnumerable AvailablePipingSoilProfiles { get; set; } + + public void Attach(IObserver observer) + { + WrappedPipingInputParameters.Attach(observer); + } + + public void Detach(IObserver observer) + { + WrappedPipingInputParameters.Detach(observer); + } + + public void NotifyObservers() + { + WrappedPipingInputParameters.NotifyObservers(); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r71fa16075699948cabba65c56d646e0268fd2b89 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 71fa16075699948cabba65c56d646e0268fd2b89) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -216,6 +216,24 @@ } /// + /// Looks up a localized string similar to Naam van de piping berekening.. + /// + public static string PipingCalculationData_Name_Description { + get { + return ResourceManager.GetString("PipingCalculationData_Name_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Naam. + /// + public static string PipingCalculationData_Name_DisplayName { + get { + return ResourceManager.GetString("PipingCalculationData_Name_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Piping. /// public static string PipingCalculationInputsProperties_DisplayName { @@ -225,511 +243,503 @@ } /// + /// Looks up a localized string similar to Berekening toevoegen. + /// + public static string PipingFailureMechanism_Add_Piping_Calculation { + get { + return ResourceManager.GetString("PipingFailureMechanism_Add_Piping_Calculation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Voeg een nieuwe piping berekening toe aan het faalmechanisme.. + /// + public static string PipingFailureMechanism_Add_Piping_Calculation_Tooltip { + get { + return ResourceManager.GetString("PipingFailureMechanism_Add_Piping_Calculation_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Valideer en voer alle berekeningen binnen het piping faalmechanisme uit.. + /// + public static string PipingFailureMechanism_Calculate_Tooltip { + get { + return ResourceManager.GetString("PipingFailureMechanism_Calculate_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wis de uitvoer van alle berekeningen binnen het faalmechanisme.. + /// + public static string PipingFailureMechanism_Clear_all_output_Tooltip { + get { + return ResourceManager.GetString("PipingFailureMechanism_Clear_all_output_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dijken - Piping. + /// + public static string PipingFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("PipingFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap PipingIcon { + get { + object obj = ResourceManager.GetObject("PipingIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap PipingInputIcon { + get { + object obj = ResourceManager.GetObject("PipingInputIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// /// Looks up a localized string similar to Peil dat gebruikt moet worden in de toetsing.. /// - public static string PipingData_AssessmentLevel_Description { + public static string PipingInputParameters_AssessmentLevel_Description { get { - return ResourceManager.GetString("PipingData_AssessmentLevel_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_AssessmentLevel_Description", resourceCulture); } } /// /// Looks up a localized string similar to Toetspeil. /// - public static string PipingData_AssessmentLevel_DisplayName { + public static string PipingInputParameters_AssessmentLevel_DisplayName { get { - return ResourceManager.GetString("PipingData_AssessmentLevel_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_AssessmentLevel_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Hoek in het krachtenevenwicht die aangeeft hoeveel de korrels weerstand bieden tegen rollen; ook beddingshoek genoemd.. /// - public static string PipingData_BeddingAngle_Description { + public static string PipingInputParameters_BeddingAngle_Description { get { - return ResourceManager.GetString("PipingData_BeddingAngle_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_BeddingAngle_Description", resourceCulture); } } /// /// Looks up a localized string similar to Rolweerstandshoek. /// - public static string PipingData_BeddingAngle_DisplayName { + public static string PipingInputParameters_BeddingAngle_DisplayName { get { - return ResourceManager.GetString("PipingData_BeddingAngle_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_BeddingAngle_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Kritiek verhang met betrekking tot heave.. /// - public static string PipingData_CriticalHeaveGradient_Description { + public static string PipingInputParameters_CriticalHeaveGradient_Description { get { - return ResourceManager.GetString("PipingData_CriticalHeaveGradient_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_CriticalHeaveGradient_Description", resourceCulture); } } /// /// Looks up a localized string similar to Kritiek verhang m.b.t. heave. /// - public static string PipingData_CriticalHeaveGradient_DisplayName { + public static string PipingInputParameters_CriticalHeaveGradient_DisplayName { get { - return ResourceManager.GetString("PipingData_CriticalHeaveGradient_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_CriticalHeaveGradient_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Dempingsfactor relateert respons van stijghoogte bij binnenteen aan buitenwaterstand.. /// - public static string PipingData_DampingFactorExit_Description { + public static string PipingInputParameters_DampingFactorExit_Description { get { - return ResourceManager.GetString("PipingData_DampingFactorExit_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_DampingFactorExit_Description", resourceCulture); } } /// /// Looks up a localized string similar to Dempingsfactor bij uittredepunt. /// - public static string PipingData_DampingFactorExit_DisplayName { + public static string PipingInputParameters_DampingFactorExit_DisplayName { get { - return ResourceManager.GetString("PipingData_DampingFactorExit_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_DampingFactorExit_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Darcy-snelheid waarmee water door de eerste voor doorlatendheid te onderscheiden zandlaag loopt.. /// - public static string PipingData_DarcyPermeability_Description { + public static string PipingInputParameters_DarcyPermeability_Description { get { - return ResourceManager.GetString("PipingData_DarcyPermeability_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_DarcyPermeability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Doorlatendheid aquifer. /// - public static string PipingData_DarcyPermeability_DisplayName { + public static string PipingInputParameters_DarcyPermeability_DisplayName { get { - return ResourceManager.GetString("PipingData_DarcyPermeability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_DarcyPermeability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Zeefmaat waar 70 gewichtsprocent van de korrels uit een zandlaag doorheen gaat. Hier de korreldiameter van het bovenste gedeelte van de aquifer, bepaald zonder fijne fractie (< 63µm).. /// - public static string PipingData_Diameter70_Description { + public static string PipingInputParameters_Diameter70_Description { get { - return ResourceManager.GetString("PipingData_Diameter70_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_Diameter70_Description", resourceCulture); } } /// /// Looks up a localized string similar to 70%-fraktiel van de korreldiameter in de bovenste zandlaag. /// - public static string PipingData_Diameter70_DisplayName { + public static string PipingInputParameters_Diameter70_DisplayName { get { - return ResourceManager.GetString("PipingData_Diameter70_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_Diameter70_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De x-coordinaat van het uittredepunt.. /// - public static string PipingData_ExitPointXCoordinate_Description { + public static string PipingInputParameters_ExitPointXCoordinate_Description { get { - return ResourceManager.GetString("PipingData_ExitPointXCoordinate_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_ExitPointXCoordinate_Description", resourceCulture); } } /// /// Looks up a localized string similar to X-coordinaat uittredepunt. /// - public static string PipingData_ExitPointXCoordinate_DisplayName { + public static string PipingInputParameters_ExitPointXCoordinate_DisplayName { get { - return ResourceManager.GetString("PipingData_ExitPointXCoordinate_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_ExitPointXCoordinate_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Valversnelling. /// - public static string PipingData_Gravity_Description { + public static string PipingInputParameters_Gravity_Description { get { - return ResourceManager.GetString("PipingData_Gravity_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_Gravity_Description", resourceCulture); } } /// /// Looks up a localized string similar to Valversnelling. /// - public static string PipingData_Gravity_DisplayName { + public static string PipingInputParameters_Gravity_DisplayName { get { - return ResourceManager.GetString("PipingData_Gravity_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_Gravity_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to gemiddelde d70 van de in kleine schaalproeven toegepaste zandsoorten, waarop formule van Sellmeijer is gefit.. /// - public static string PipingData_MeanDiameter70_Description { + public static string PipingInputParameters_MeanDiameter70_Description { get { - return ResourceManager.GetString("PipingData_MeanDiameter70_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_MeanDiameter70_Description", resourceCulture); } } /// /// Looks up a localized string similar to Referentie waarde voor 70%-fraktiel in Sellmeijer regel. /// - public static string PipingData_MeanDiameter70_DisplayName { + public static string PipingInputParameters_MeanDiameter70_DisplayName { get { - return ResourceManager.GetString("PipingData_MeanDiameter70_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_MeanDiameter70_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Naam van de piping berekening.. - /// - public static string PipingData_Name_Description { - get { - return ResourceManager.GetString("PipingData_Name_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Naam. - /// - public static string PipingData_Name_DisplayName { - get { - return ResourceManager.GetString("PipingData_Name_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Freatische waterstand bij uittredepunt.. /// - public static string PipingData_PhreaticLevelExit_Description { + public static string PipingInputParameters_PhreaticLevelExit_Description { get { - return ResourceManager.GetString("PipingData_PhreaticLevelExit_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_PhreaticLevelExit_Description", resourceCulture); } } /// /// Looks up a localized string similar to Freatische waterstand bij uittredepunt. /// - public static string PipingData_PhreaticLevelExit_DisplayName { + public static string PipingInputParameters_PhreaticLevelExit_DisplayName { get { - return ResourceManager.GetString("PipingData_PhreaticLevelExit_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_PhreaticLevelExit_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Stijghoogte bij uittredepunt.. /// - public static string PipingData_PiezometricHeadExit_Description { + public static string PipingInputParameters_PiezometricHeadExit_Description { get { - return ResourceManager.GetString("PipingData_PiezometricHeadExit_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_PiezometricHeadExit_Description", resourceCulture); } } /// /// Looks up a localized string similar to Stijghoogte bij uittredepunt. /// - public static string PipingData_PiezometricHeadExit_DisplayName { + public static string PipingInputParameters_PiezometricHeadExit_DisplayName { get { - return ResourceManager.GetString("PipingData_PiezometricHeadExit_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_PiezometricHeadExit_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Stijghoogte in achterland.. /// - public static string PipingData_PiezometricHeadPolder_Description { + public static string PipingInputParameters_PiezometricHeadPolder_Description { get { - return ResourceManager.GetString("PipingData_PiezometricHeadPolder_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_PiezometricHeadPolder_Description", resourceCulture); } } /// /// Looks up a localized string similar to Stijghoogte in achterland. /// - public static string PipingData_PiezometricHeadPolder_DisplayName { + public static string PipingInputParameters_PiezometricHeadPolder_DisplayName { get { - return ResourceManager.GetString("PipingData_PiezometricHeadPolder_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_PiezometricHeadPolder_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Het (ondergedempelde) volumegewicht van zandkorrelmateriaal van een zandlaag.. /// - public static string PipingData_SandParticlesVolumicWeight_Description { + public static string PipingInputParameters_SandParticlesVolumicWeight_Description { get { - return ResourceManager.GetString("PipingData_SandParticlesVolumicWeight_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SandParticlesVolumicWeight_Description", resourceCulture); } } /// /// Looks up a localized string similar to Volumiek gewicht van de zandkorrels onder water. /// - public static string PipingData_SandParticlesVolumicWeight_DisplayName { + public static string PipingInputParameters_SandParticlesVolumicWeight_DisplayName { get { - return ResourceManager.GetString("PipingData_SandParticlesVolumicWeight_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SandParticlesVolumicWeight_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De horizontale afstand tussen intrede- en uittredepunt die het kwelwater ondergronds aflegt voordat het weer aan de oppervlakte komt.. /// - public static string PipingData_SeepageLength_Description { + public static string PipingInputParameters_SeepageLength_Description { get { - return ResourceManager.GetString("PipingData_SeepageLength_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SeepageLength_Description", resourceCulture); } } /// /// Looks up a localized string similar to Kwelweglengte. /// - public static string PipingData_SeepageLength_DisplayName { + public static string PipingInputParameters_SeepageLength_DisplayName { get { - return ResourceManager.GetString("PipingData_SeepageLength_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SeepageLength_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Rekenwaarde om de modelonzekerheid in het model van Sellmeijer in rekening te brengen.. /// - public static string PipingData_SellmeijerModelFactor_Description { + public static string PipingInputParameters_SellmeijerModelFactor_Description { get { - return ResourceManager.GetString("PipingData_SellmeijerModelFactor_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SellmeijerModelFactor_Description", resourceCulture); } } /// /// Looks up a localized string similar to Modelfactor piping toegepast op Sellmeijermodel. /// - public static string PipingData_SellmeijerModelFactor_DisplayName { + public static string PipingInputParameters_SellmeijerModelFactor_DisplayName { get { - return ResourceManager.GetString("PipingData_SellmeijerModelFactor_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SellmeijerModelFactor_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Reductiefactor Sellmeijer.. /// - public static string PipingData_SellmeijerReductionFactor_Description { + public static string PipingInputParameters_SellmeijerReductionFactor_Description { get { - return ResourceManager.GetString("PipingData_SellmeijerReductionFactor_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SellmeijerReductionFactor_Description", resourceCulture); } } /// /// Looks up a localized string similar to Reductiefactor Sellmeijer. /// - public static string PipingData_SellmeijerReductionFactor_DisplayName { + public static string PipingInputParameters_SellmeijerReductionFactor_DisplayName { get { - return ResourceManager.GetString("PipingData_SellmeijerReductionFactor_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SellmeijerReductionFactor_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Het ondergrondprofiel dat voor de piping berekening gebruikt wordt.. /// - public static string PipingData_SoilProfile_Description { + public static string PipingInputParameters_SoilProfile_Description { get { - return ResourceManager.GetString("PipingData_SoilProfile_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SoilProfile_Description", resourceCulture); } } /// /// Looks up a localized string similar to Ondergrondprofiel. /// - public static string PipingData_SoilProfile_DisplayName { + public static string PipingInputParameters_SoilProfile_DisplayName { get { - return ResourceManager.GetString("PipingData_SoilProfile_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SoilProfile_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De dwarsdoorsnede die voor de piping berekening gebruikt wordt.. /// - public static string PipingData_SurfaceLine_Description { + public static string PipingInputParameters_SurfaceLine_Description { get { - return ResourceManager.GetString("PipingData_SurfaceLine_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SurfaceLine_Description", resourceCulture); } } /// /// Looks up a localized string similar to Dwarsdoorsnede. /// - public static string PipingData_SurfaceLine_DisplayName { + public static string PipingInputParameters_SurfaceLine_DisplayName { get { - return ResourceManager.GetString("PipingData_SurfaceLine_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_SurfaceLine_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De dikte van de eerste of bovenste voor doorlatendheid te onderscheiden zandlaag van mogelijk meerdere zandlagen vanaf de cohesieve grondlaag.. /// - public static string PipingData_ThicknessAquiferLayer_Description { + public static string PipingInputParameters_ThicknessAquiferLayer_Description { get { - return ResourceManager.GetString("PipingData_ThicknessAquiferLayer_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_ThicknessAquiferLayer_Description", resourceCulture); } } /// /// Looks up a localized string similar to Dikte watervoerend pakket. /// - public static string PipingData_ThicknessAquiferLayer_DisplayName { + public static string PipingInputParameters_ThicknessAquiferLayer_DisplayName { get { - return ResourceManager.GetString("PipingData_ThicknessAquiferLayer_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_ThicknessAquiferLayer_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Totale deklaagdikte bij uittredepunt.. /// - public static string PipingData_ThicknessCoverageLayer_Description { + public static string PipingInputParameters_ThicknessCoverageLayer_Description { get { - return ResourceManager.GetString("PipingData_ThicknessCoverageLayer_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_ThicknessCoverageLayer_Description", resourceCulture); } } /// /// Looks up a localized string similar to Totale deklaagdikte bij uittredepunt. /// - public static string PipingData_ThicknessCoverageLayer_DisplayName { + public static string PipingInputParameters_ThicknessCoverageLayer_DisplayName { get { - return ResourceManager.GetString("PipingData_ThicknessCoverageLayer_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_ThicknessCoverageLayer_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Rekenwaarde om de modelonzekerheid in het model van opbarsten in rekening te brengen.. /// - public static string PipingData_UpliftModelFactor_Description { + public static string PipingInputParameters_UpliftModelFactor_Description { get { - return ResourceManager.GetString("PipingData_UpliftModelFactor_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_UpliftModelFactor_Description", resourceCulture); } } /// /// Looks up a localized string similar to Modelfactor opbarsten. /// - public static string PipingData_UpliftModelFactor_DisplayName { + public static string PipingInputParameters_UpliftModelFactor_DisplayName { get { - return ResourceManager.GetString("PipingData_UpliftModelFactor_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_UpliftModelFactor_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Kinematische viscositeit van water bij 10º Celsius.. /// - public static string PipingData_WaterKinematicViscosity_Description { + public static string PipingInputParameters_WaterKinematicViscosity_Description { get { - return ResourceManager.GetString("PipingData_WaterKinematicViscosity_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_WaterKinematicViscosity_Description", resourceCulture); } } /// /// Looks up a localized string similar to Kinematische viscositeit van water bij 10º Celsius. /// - public static string PipingData_WaterKinematicViscosity_DisplayName { + public static string PipingInputParameters_WaterKinematicViscosity_DisplayName { get { - return ResourceManager.GetString("PipingData_WaterKinematicViscosity_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_WaterKinematicViscosity_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Volumiek gewicht van water.. /// - public static string PipingData_WaterVolumetricWeight_Description { + public static string PipingInputParameters_WaterVolumetricWeight_Description { get { - return ResourceManager.GetString("PipingData_WaterVolumetricWeight_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_WaterVolumetricWeight_Description", resourceCulture); } } /// /// Looks up a localized string similar to Volumiek gewicht van water. /// - public static string PipingData_WaterVolumetricWeight_DisplayName { + public static string PipingInputParameters_WaterVolumetricWeight_DisplayName { get { - return ResourceManager.GetString("PipingData_WaterVolumetricWeight_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_WaterVolumetricWeight_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Sleepkrachtfactor volgens White.. /// - public static string PipingData_WhitesDragCoefficient_Description { + public static string PipingInputParameters_WhitesDragCoefficient_Description { get { - return ResourceManager.GetString("PipingData_WhitesDragCoefficient_Description", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_WhitesDragCoefficient_Description", resourceCulture); } } /// /// Looks up a localized string similar to Coëfficiënt van White. /// - public static string PipingData_WhitesDragCoefficient_DisplayName { + public static string PipingInputParameters_WhitesDragCoefficient_DisplayName { get { - return ResourceManager.GetString("PipingData_WhitesDragCoefficient_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInputParameters_WhitesDragCoefficient_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Berekening toevoegen. - /// - public static string PipingFailureMechanism_Add_Piping_Calculation { - get { - return ResourceManager.GetString("PipingFailureMechanism_Add_Piping_Calculation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Voeg een nieuwe piping berekening toe aan het faalmechanisme.. - /// - public static string PipingFailureMechanism_Add_Piping_Calculation_Tooltip { - get { - return ResourceManager.GetString("PipingFailureMechanism_Add_Piping_Calculation_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Valideer en voer alle berekeningen binnen het piping faalmechanisme uit.. - /// - public static string PipingFailureMechanism_Calculate_Tooltip { - get { - return ResourceManager.GetString("PipingFailureMechanism_Calculate_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Wis de uitvoer van alle berekeningen binnen het faalmechanisme.. - /// - public static string PipingFailureMechanism_Clear_all_output_Tooltip { - get { - return ResourceManager.GetString("PipingFailureMechanism_Clear_all_output_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Dijken - Piping. - /// - public static string PipingFailureMechanism_DisplayName { - get { - return ResourceManager.GetString("PipingFailureMechanism_DisplayName", resourceCulture); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap PipingIcon { - get { - object obj = ResourceManager.GetObject("PipingIcon", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// /// Looks up a localized string similar to Piping resultaat. /// public static string PipingOutput_DisplayName { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -r71fa16075699948cabba65c56d646e0268fd2b89 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 71fa16075699948cabba65c56d646e0268fd2b89) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -124,139 +124,139 @@ ..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + Peil dat gebruikt moet worden in de toetsing. - + Toetspeil - + Hoek in het krachtenevenwicht die aangeeft hoeveel de korrels weerstand bieden tegen rollen; ook beddingshoek genoemd. - + Rolweerstandshoek - + Kritiek verhang met betrekking tot heave. - + Kritiek verhang m.b.t. heave - + Dempingsfactor relateert respons van stijghoogte bij binnenteen aan buitenwaterstand. - + Dempingsfactor bij uittredepunt - + Darcy-snelheid waarmee water door de eerste voor doorlatendheid te onderscheiden zandlaag loopt. - + Doorlatendheid aquifer - + Zeefmaat waar 70 gewichtsprocent van de korrels uit een zandlaag doorheen gaat. Hier de korreldiameter van het bovenste gedeelte van de aquifer, bepaald zonder fijne fractie (< 63µm). - + 70%-fraktiel van de korreldiameter in de bovenste zandlaag - + De x-coordinaat van het uittredepunt. - + X-coordinaat uittredepunt - + Valversnelling - + Valversnelling - + gemiddelde d70 van de in kleine schaalproeven toegepaste zandsoorten, waarop formule van Sellmeijer is gefit. - + Referentie waarde voor 70%-fraktiel in Sellmeijer regel - + Freatische waterstand bij uittredepunt. - + Freatische waterstand bij uittredepunt - + Stijghoogte bij uittredepunt. - + Stijghoogte bij uittredepunt - + Stijghoogte in achterland. - + Stijghoogte in achterland Piping - + Het (ondergedempelde) volumegewicht van zandkorrelmateriaal van een zandlaag. - + Volumiek gewicht van de zandkorrels onder water - + De horizontale afstand tussen intrede- en uittredepunt die het kwelwater ondergronds aflegt voordat het weer aan de oppervlakte komt. - + Kwelweglengte - + Rekenwaarde om de modelonzekerheid in het model van Sellmeijer in rekening te brengen. - + Modelfactor piping toegepast op Sellmeijermodel - + Reductiefactor Sellmeijer. - + Reductiefactor Sellmeijer - + De dikte van de eerste of bovenste voor doorlatendheid te onderscheiden zandlaag van mogelijk meerdere zandlagen vanaf de cohesieve grondlaag. - + Dikte watervoerend pakket - + Totale deklaagdikte bij uittredepunt. - + Totale deklaagdikte bij uittredepunt - + Rekenwaarde om de modelonzekerheid in het model van opbarsten in rekening te brengen. - + Modelfactor opbarsten - + Kinematische viscositeit van water bij 10º Celsius. - + Kinematische viscositeit van water bij 10º Celsius - + Volumiek gewicht van water. - + Volumiek gewicht van water - + Sleepkrachtfactor volgens White. - + Coëfficiënt van White @@ -352,19 +352,19 @@ Dwarsdoorsnede - + De dwarsdoorsnede die voor de piping berekening gebruikt wordt. - + Dwarsdoorsnede ..\Resources\PlayAll.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + Naam van de piping berekening. - + Naam @@ -388,10 +388,10 @@ Topniveaus - + Het ondergrondprofiel dat voor de piping berekening gebruikt wordt. - + Ondergrondprofiel @@ -469,4 +469,7 @@ Verschoven lognormaal + + ..\Resources\blue-document-list.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingCalculationInputsProperties.cs =================================================================== diff -u -r394db7c1bd905eb7444b9b2c47bcb5111bb63af6 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingCalculationInputsProperties.cs (.../PipingCalculationInputsProperties.cs) (revision 394db7c1bd905eb7444b9b2c47bcb5111bb63af6) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingCalculationInputsProperties.cs (.../PipingCalculationInputsProperties.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -1,25 +1,17 @@ -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing.Design; -using Core.Common.Gui; +using Core.Common.Gui; using Core.Common.Utils; -using Ringtoets.Piping.Calculation.Piping; -using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.Properties; -using Ringtoets.Piping.Forms.TypeConverters; -using Ringtoets.Piping.Forms.UITypeEditors; namespace Ringtoets.Piping.Forms.PropertyClasses { [ResourcesDisplayName(typeof(Resources), "PipingCalculationInputsProperties_DisplayName")] public class PipingCalculationInputsProperties : ObjectProperties { [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_Name_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_Name_Description")] + [ResourcesDisplayName(typeof(Resources), "PipingCalculationData_Name_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingCalculationData_Name_Description")] public string Name { get @@ -32,393 +24,5 @@ data.PipingData.NotifyObservers(); } } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_WaterVolumetricWeight_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_WaterVolumetricWeight_Description")] - public double WaterVolumetricWeight - { - get - { - return data.PipingData.WaterVolumetricWeight; - } - set - { - data.PipingData.WaterVolumetricWeight = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_UpliftModelFactor_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_UpliftModelFactor_Description")] - public double UpliftModelFactor - { - get - { - return data.PipingData.UpliftModelFactor; - } - set - { - data.PipingData.UpliftModelFactor = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_AssessmentLevel_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_AssessmentLevel_Description")] - public double AssessmentLevel - { - get - { - return data.PipingData.AssessmentLevel; - } - set - { - data.PipingData.AssessmentLevel = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_PiezometricHeadExit_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_PiezometricHeadExit_Description")] - public double PiezometricHeadExit - { - get - { - return data.PipingData.PiezometricHeadExit; - } - set - { - data.PipingData.PiezometricHeadExit = value; - data.PipingData.NotifyObservers(); - } - } - - [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_DampingFactorExit_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_DampingFactorExit_Description")] - public DesignVariable DampingFactorExit - { - get - { - return PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(data.PipingData); - } - set - { - data.PipingData.DampingFactorExit = value.Distribution; - data.PipingData.NotifyObservers(); - } - } - - [TypeConverter(typeof(NormalDistributionDesignVariableTypeConverter))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_PhreaticLevelExit_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_PhreaticLevelExit_Description")] - public DesignVariable PhreaticLevelExit - { - get - { - return PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(data.PipingData); - } - set - { - data.PipingData.PhreaticLevelExit = value.Distribution; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_PiezometricHeadPolder_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_PiezometricHeadPolder_Description")] - public double PiezometricHeadPolder - { - get - { - return data.PipingData.PiezometricHeadPolder; - } - set - { - data.PipingData.PiezometricHeadPolder = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_CriticalHeaveGradient_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_CriticalHeaveGradient_Description")] - public double CriticalHeaveGradient - { - get - { - return data.PipingData.CriticalHeaveGradient; - } - } - - [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_ThicknessCoverageLayer_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_ThicknessCoverageLayer_Description")] - public DesignVariable ThicknessCoverageLayer - { - get - { - return PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(data.PipingData); - } - set - { - data.PipingData.ThicknessCoverageLayer = value.Distribution; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_SellmeijerModelFactor_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_SellmeijerModelFactor_Description")] - public double SellmeijerModelFactor - { - get - { - return data.PipingData.SellmeijerModelFactor; - } - set - { - data.PipingData.SellmeijerModelFactor = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_SellmeijerReductionFactor_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_SellmeijerReductionFactor_Description")] - public double SellmeijerReductionFactor - { - get - { - return data.PipingData.SellmeijerReductionFactor; - } - set - { - data.PipingData.SellmeijerReductionFactor = value; - data.PipingData.NotifyObservers(); - } - } - - [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_SeepageLength_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_SeepageLength_Description")] - public DesignVariable SeepageLength - { - get - { - return PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(data.PipingData); - } - set - { - data.PipingData.SeepageLength = value.Distribution; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_SandParticlesVolumicWeight_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_SandParticlesVolumicWeight_Description")] - public double SandParticlesVolumicWeight - { - get - { - return data.PipingData.SandParticlesVolumicWeight; - } - set - { - data.PipingData.SandParticlesVolumicWeight = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_WhitesDragCoefficient_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_WhitesDragCoefficient_Description")] - public double WhitesDragCoefficient - { - get - { - return data.PipingData.WhitesDragCoefficient; - } - set - { - data.PipingData.WhitesDragCoefficient = value; - data.PipingData.NotifyObservers(); - } - } - - [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_Diameter70_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_Diameter70_Description")] - public DesignVariable Diameter70 - { - get - { - return PipingSemiProbabilisticDesignValueFactory.GetDiameter70(data.PipingData); - } - set - { - data.PipingData.Diameter70 = value.Distribution; - data.PipingData.NotifyObservers(); - } - } - - [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_DarcyPermeability_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_DarcyPermeability_Description")] - public DesignVariable DarcyPermeability - { - get - { - return PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(data.PipingData); - } - set - { - data.PipingData.DarcyPermeability = value.Distribution; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_WaterKinematicViscosity_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_WaterKinematicViscosity_Description")] - public double WaterKinematicViscosity - { - get - { - return data.PipingData.WaterKinematicViscosity; - } - set - { - data.PipingData.WaterKinematicViscosity = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_Gravity_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_Gravity_Description")] - public double Gravity - { - get - { - return data.PipingData.Gravity; - } - set - { - data.PipingData.Gravity = value; - data.PipingData.NotifyObservers(); - } - } - - [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_ThicknessAquiferLayer_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_ThicknessAquiferLayer_Description")] - public DesignVariable ThicknessAquiferLayer - { - get - { - return PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(data.PipingData); - } - set - { - data.PipingData.ThicknessAquiferLayer = value.Distribution; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_MeanDiameter70_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_MeanDiameter70_Description")] - public double MeanDiameter70 - { - get - { - return data.PipingData.MeanDiameter70; - } - set - { - data.PipingData.MeanDiameter70 = value; - data.PipingData.NotifyObservers(); - } - } - - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_BeddingAngle_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_BeddingAngle_Description")] - public double BeddingAngle - { - get - { - return data.PipingData.BeddingAngle; - } - set - { - data.PipingData.BeddingAngle = value; - data.PipingData.NotifyObservers(); - } - } - - [Editor(typeof(PipingCalculationInputsSurfaceLineSelectionEditor), typeof(UITypeEditor))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_SurfaceLine_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_SurfaceLine_Description")] - public RingtoetsPipingSurfaceLine SurfaceLine - { - get - { - return data.PipingData.SurfaceLine; - } - set - { - data.PipingData.SurfaceLine = value; - data.PipingData.NotifyObservers(); - } - } - - [Editor(typeof(PipingCalculationInputsSoilProfileSelectionEditor), typeof(UITypeEditor))] - [ResourcesCategory(typeof(Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "PipingData_SoilProfile_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingData_SoilProfile_Description")] - public PipingSoilProfile SoilProfile - { - get - { - return data.PipingData.SoilProfile; - } - set - { - data.PipingData.SoilProfile = value; - data.PipingData.NotifyObservers(); - } - } - - /// - /// Gets the available surface lines on . - /// - public IEnumerable GetAvailableSurfaceLines() - { - return data.AvailablePipingSurfaceLines; - } - - /// - /// Gets the available soil profiles on . - /// - public IEnumerable GetAvailableSoilProfiles() - { - return data.AvailablePipingSoilProfiles; - } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputParametersContextProperties.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputParametersContextProperties.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputParametersContextProperties.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,408 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing.Design; + +using Core.Common.Gui; +using Core.Common.Utils; + +using Ringtoets.Piping.Calculation.Piping; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Forms.Properties; +using Ringtoets.Piping.Forms.TypeConverters; +using Ringtoets.Piping.Forms.UITypeEditors; + +namespace Ringtoets.Piping.Forms.PropertyClasses +{ + public class PipingInputParametersContextProperties : ObjectProperties + { + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_WaterVolumetricWeight_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_WaterVolumetricWeight_Description")] + public double WaterVolumetricWeight + { + get + { + return data.WrappedPipingInputParameters.WaterVolumetricWeight; + } + set + { + data.WrappedPipingInputParameters.WaterVolumetricWeight = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_UpliftModelFactor_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_UpliftModelFactor_Description")] + public double UpliftModelFactor + { + get + { + return data.WrappedPipingInputParameters.UpliftModelFactor; + } + set + { + data.WrappedPipingInputParameters.UpliftModelFactor = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_AssessmentLevel_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_AssessmentLevel_Description")] + public double AssessmentLevel + { + get + { + return data.WrappedPipingInputParameters.AssessmentLevel; + } + set + { + data.WrappedPipingInputParameters.AssessmentLevel = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_PiezometricHeadExit_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_PiezometricHeadExit_Description")] + public double PiezometricHeadExit + { + get + { + return data.WrappedPipingInputParameters.PiezometricHeadExit; + } + set + { + data.WrappedPipingInputParameters.PiezometricHeadExit = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_DampingFactorExit_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_DampingFactorExit_Description")] + public DesignVariable DampingFactorExit + { + get + { + return PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(data.WrappedPipingInputParameters); + } + set + { + data.WrappedPipingInputParameters.DampingFactorExit = value.Distribution; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [TypeConverter(typeof(NormalDistributionDesignVariableTypeConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_PhreaticLevelExit_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_PhreaticLevelExit_Description")] + public DesignVariable PhreaticLevelExit + { + get + { + return PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(data.WrappedPipingInputParameters); + } + set + { + data.WrappedPipingInputParameters.PhreaticLevelExit = value.Distribution; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_PiezometricHeadPolder_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_PiezometricHeadPolder_Description")] + public double PiezometricHeadPolder + { + get + { + return data.WrappedPipingInputParameters.PiezometricHeadPolder; + } + set + { + data.WrappedPipingInputParameters.PiezometricHeadPolder = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_CriticalHeaveGradient_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_CriticalHeaveGradient_Description")] + public double CriticalHeaveGradient + { + get + { + return data.WrappedPipingInputParameters.CriticalHeaveGradient; + } + } + + [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_ThicknessCoverageLayer_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_ThicknessCoverageLayer_Description")] + public DesignVariable ThicknessCoverageLayer + { + get + { + return PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(data.WrappedPipingInputParameters); + } + set + { + data.WrappedPipingInputParameters.ThicknessCoverageLayer = value.Distribution; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_SellmeijerModelFactor_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_SellmeijerModelFactor_Description")] + public double SellmeijerModelFactor + { + get + { + return data.WrappedPipingInputParameters.SellmeijerModelFactor; + } + set + { + data.WrappedPipingInputParameters.SellmeijerModelFactor = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_SellmeijerReductionFactor_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_SellmeijerReductionFactor_Description")] + public double SellmeijerReductionFactor + { + get + { + return data.WrappedPipingInputParameters.SellmeijerReductionFactor; + } + set + { + data.WrappedPipingInputParameters.SellmeijerReductionFactor = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_SeepageLength_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_SeepageLength_Description")] + public DesignVariable SeepageLength + { + get + { + return PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(data.WrappedPipingInputParameters); + } + set + { + data.WrappedPipingInputParameters.SeepageLength = value.Distribution; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_SandParticlesVolumicWeight_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_SandParticlesVolumicWeight_Description")] + public double SandParticlesVolumicWeight + { + get + { + return data.WrappedPipingInputParameters.SandParticlesVolumicWeight; + } + set + { + data.WrappedPipingInputParameters.SandParticlesVolumicWeight = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_WhitesDragCoefficient_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_WhitesDragCoefficient_Description")] + public double WhitesDragCoefficient + { + get + { + return data.WrappedPipingInputParameters.WhitesDragCoefficient; + } + set + { + data.WrappedPipingInputParameters.WhitesDragCoefficient = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_Diameter70_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_Diameter70_Description")] + public DesignVariable Diameter70 + { + get + { + return PipingSemiProbabilisticDesignValueFactory.GetDiameter70(data.WrappedPipingInputParameters); + } + set + { + data.WrappedPipingInputParameters.Diameter70 = value.Distribution; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_DarcyPermeability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_DarcyPermeability_Description")] + public DesignVariable DarcyPermeability + { + get + { + return PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(data.WrappedPipingInputParameters); + } + set + { + data.WrappedPipingInputParameters.DarcyPermeability = value.Distribution; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_WaterKinematicViscosity_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_WaterKinematicViscosity_Description")] + public double WaterKinematicViscosity + { + get + { + return data.WrappedPipingInputParameters.WaterKinematicViscosity; + } + set + { + data.WrappedPipingInputParameters.WaterKinematicViscosity = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_Gravity_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_Gravity_Description")] + public double Gravity + { + get + { + return data.WrappedPipingInputParameters.Gravity; + } + set + { + data.WrappedPipingInputParameters.Gravity = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [TypeConverter(typeof(LognormalDistributionDesignVariableTypeConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_ThicknessAquiferLayer_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_ThicknessAquiferLayer_Description")] + public DesignVariable ThicknessAquiferLayer + { + get + { + return PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(data.WrappedPipingInputParameters); + } + set + { + data.WrappedPipingInputParameters.ThicknessAquiferLayer = value.Distribution; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_MeanDiameter70_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_MeanDiameter70_Description")] + public double MeanDiameter70 + { + get + { + return data.WrappedPipingInputParameters.MeanDiameter70; + } + set + { + data.WrappedPipingInputParameters.MeanDiameter70 = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_BeddingAngle_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_BeddingAngle_Description")] + public double BeddingAngle + { + get + { + return data.WrappedPipingInputParameters.BeddingAngle; + } + set + { + data.WrappedPipingInputParameters.BeddingAngle = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [Editor(typeof(PipingInputParametersContextSurfaceLineSelectionEditor), typeof(UITypeEditor))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_SurfaceLine_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_SurfaceLine_Description")] + public RingtoetsPipingSurfaceLine SurfaceLine + { + get + { + return data.WrappedPipingInputParameters.SurfaceLine; + } + set + { + data.WrappedPipingInputParameters.SurfaceLine = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + [Editor(typeof(PipingInputParametersContextSoilProfileSelectionEditor), typeof(UITypeEditor))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingInputParameters_SoilProfile_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInputParameters_SoilProfile_Description")] + public PipingSoilProfile SoilProfile + { + get + { + return data.WrappedPipingInputParameters.SoilProfile; + } + set + { + data.WrappedPipingInputParameters.SoilProfile = value; + data.WrappedPipingInputParameters.NotifyObservers(); + } + } + + /// + /// Gets the available surface lines on . + /// + public IEnumerable GetAvailableSurfaceLines() + { + return data.AvailablePipingSurfaceLines; + } + + /// + /// Gets the available soil profiles on . + /// + public IEnumerable GetAvailableSoilProfiles() + { + return data.AvailablePipingSoilProfiles; + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Resources/blue-document-list.png =================================================================== diff -u Binary files differ Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj =================================================================== diff -u -rc0e407c65daebe4f446f9414367593eff80af1b2 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision c0e407c65daebe4f446f9414367593eff80af1b2) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -59,20 +59,23 @@ + + True True Resources.resx + @@ -83,9 +86,9 @@ - - - + + + @@ -163,6 +166,7 @@ + Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs =================================================================== diff -u -r6c2deb9f342ef571d0c32764f0dd2c67510dca2e -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs (.../DesignVariableTypeConverter.cs) (revision 6c2deb9f342ef571d0c32764f0dd2c67510dca2e) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs (.../DesignVariableTypeConverter.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -18,7 +18,7 @@ /// Base class for shared implementation of to provide probabilistic /// distributions to the property editor. /// - /// Type of distributionci + /// Type of distribution public abstract class DesignVariableTypeConverter : TypeConverter where T:IDistribution { public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) @@ -102,9 +102,9 @@ // Note: If this type converter is going to be reused for other classes, we // might want to reconsider how we want to propagate IObservable updates! - var pipingCalculationInputProperties = dynamicPropertyBag.WrappedObject as PipingCalculationInputsProperties; - return pipingCalculationInputProperties != null ? - ((PipingCalculationInputs)pipingCalculationInputProperties.Data).PipingData : + var inputParameterContextProperties = dynamicPropertyBag.WrappedObject as PipingInputParametersContextProperties; + return inputParameterContextProperties != null ? + ((PipingInputParametersContext)inputParameterContextProperties.Data).WrappedPipingInputParameters: null; } Fisheye: Tag 4f48ea35b4937263954973396e267934ca7bdb55 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingCalculationInputSelectionEditor.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 4f48ea35b4937263954973396e267934ca7bdb55 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingCalculationInputsSoilProfileSelectionEditor.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 4f48ea35b4937263954973396e267934ca7bdb55 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingCalculationInputsSurfaceLineSelectionEditor.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSelectionEditor.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSelectionEditor.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSelectionEditor.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing.Design; +using System.Linq; +using System.Windows.Forms; +using System.Windows.Forms.Design; +using Core.Common.Utils.PropertyBag.Dynamic; +using Ringtoets.Piping.Forms.PropertyClasses; + +namespace Ringtoets.Piping.Forms.UITypeEditors +{ + /// + /// This class provides a base implementation of and defines a drop down list + /// edit-control used for piping input data. + /// + /// The type of items that populate the list-edit control. + public class PipingInputParametersContextSelectionEditor : UITypeEditor where T : class + { + private IWindowsFormsEditorService editorService; + + public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) + { + return UITypeEditorEditStyle.DropDown; + } + + public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object originalValue) + { + if (provider != null) + { + editorService = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); + } + + if (editorService != null && context != null) + { + // Create editor: + ListBox listBox = CreateSelectionControl(context); + + // Open editor for user to select an item: + editorService.DropDownControl(listBox); + + // Return user selected object, or original value if user did not select anything: + return listBox.SelectedItem ?? originalValue; + } + return base.EditValue(context, provider, originalValue); + } + + /// + /// Gets which member to show of in the dropdown editor. + /// + protected string DisplayMember { private get; set; } + + /// + /// Gets the available options which populate the dropdown editor. + /// + /// The context on which to base the available options. + /// A of objects of type which contains all the available options. + protected virtual IEnumerable GetAvailableOptions(ITypeDescriptorContext context) + { + return Enumerable.Empty(); + } + + /// + /// Gets the current option which should be selected in the dropdown editor. + /// + /// The context on which to base the current option. + /// The object of type which is currently selected. + protected virtual T GetCurrentOption(ITypeDescriptorContext context) + { + return null; + } + + /// + /// Takes a context and from this, obtains the object which populates the dropdown editor. + /// + /// The context from which the object is obtained. + /// The object which' properties populates the dropdown editor. + protected static PipingInputParametersContextProperties GetPropertiesObject(ITypeDescriptorContext context) + { + return (PipingInputParametersContextProperties)((DynamicPropertyBag)context.Instance).WrappedObject; + } + + private ListBox CreateSelectionControl(ITypeDescriptorContext context) + { + var listBox = new ListBox + { + SelectionMode = SelectionMode.One, + DisplayMember = DisplayMember + }; + listBox.SelectedValueChanged += (sender, eventArgs) => editorService.CloseDropDown(); + + foreach (T surfaceLine in GetAvailableOptions(context)) + { + int index = listBox.Items.Add(surfaceLine); + if (ReferenceEquals(GetCurrentOption(context), surfaceLine)) + { + listBox.SelectedIndex = index; + } + } + return listBox; + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSoilProfileSelectionEditor.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSoilProfileSelectionEditor.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSoilProfileSelectionEditor.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using System.ComponentModel; +using Core.Common.Utils.Reflection; +using Ringtoets.Piping.Data; + +namespace Ringtoets.Piping.Forms.UITypeEditors +{ + /// + /// This class defines a drop down list edit-control from which the user can select a + /// from a collection. + /// + public class PipingInputParametersContextSoilProfileSelectionEditor : PipingInputParametersContextSelectionEditor + { + /// + /// Creates a new instance of . + /// + public PipingInputParametersContextSoilProfileSelectionEditor() + { + DisplayMember = TypeUtils.GetMemberName(sl => sl.Name); + } + + protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).GetAvailableSoilProfiles(); + } + + protected override PipingSoilProfile GetCurrentOption(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).SoilProfile; + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSurfaceLineSelectionEditor.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSurfaceLineSelectionEditor.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputParametersContextSurfaceLineSelectionEditor.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using System.ComponentModel; +using Core.Common.Utils.Reflection; +using Ringtoets.Piping.Data; + +namespace Ringtoets.Piping.Forms.UITypeEditors +{ + /// + /// This class defines a drop down list edit-control from which the user can select a + /// from a collection. + /// + public class PipingInputParametersContextSurfaceLineSelectionEditor : PipingInputParametersContextSelectionEditor + { + /// + /// Creates a new instance of . + /// + public PipingInputParametersContextSurfaceLineSelectionEditor() + { + DisplayMember = TypeUtils.GetMemberName(sl => sl.Name); + } + + protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).GetAvailableSurfaceLines(); + } + + protected override RingtoetsPipingSurfaceLine GetCurrentOption(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).SurfaceLine; + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -r0d5ba527995a1b3de4041babb246d675e305d0c1 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 0d5ba527995a1b3de4041babb246d675e305d0c1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -24,6 +24,7 @@ public override IEnumerable GetPropertyInfos() { yield return new PropertyInfo(); + yield return new PropertyInfo(); yield return new PropertyInfo(); yield return new PropertyInfo(); yield return new PropertyInfo(); @@ -35,6 +36,7 @@ { RunActivityAction = Gui.Application.ActivityRunner.Enqueue }; + yield return new PipingInputParametersContextNodePresenter(); yield return new PipingFailureMechanismNodePresenter { RunActivityAction = Gui.Application.ActivityRunner.Enqueue Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -28,7 +28,7 @@ pipingDataLogger.Info(String.Format(Resources.Validation_Subject_0_started_Time_1_, pipingData.Name, DateTimeService.CurrentTimeAsString)); - var validationResults = new PipingCalculation(CreateInputFromData(pipingData)).Validate(); + var validationResults = new PipingCalculation(CreateInputFromData(pipingData.InputParameters)).Validate(); LogMessagesAsError(Resources.Error_in_piping_validation_0, validationResults.ToArray()); pipingDataLogger.Info(String.Format(Resources.Validation_Subject_0_ended_Time_1_, @@ -51,7 +51,7 @@ try { - var pipingResult = new PipingCalculation(CreateInputFromData(pipingData)).Calculate(); + var pipingResult = new PipingCalculation(CreateInputFromData(pipingData.InputParameters)).Calculate(); pipingData.Output = new PipingOutput(pipingResult.UpliftZValue, pipingResult.UpliftFactorOfSafety, @@ -79,33 +79,33 @@ } } - private static PipingCalculationInput CreateInputFromData(PipingCalculationData pipingData) + private static PipingCalculationInput CreateInputFromData(PipingInputParameters inputParameters) { return new PipingCalculationInput( - pipingData.WaterVolumetricWeight, - pipingData.UpliftModelFactor, - pipingData.AssessmentLevel, - pipingData.PiezometricHeadExit, - PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(pipingData).GetDesignValue(), - PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(pipingData).GetDesignValue(), - pipingData.PiezometricHeadPolder, - pipingData.CriticalHeaveGradient, - PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(pipingData).GetDesignValue(), - pipingData.SellmeijerModelFactor, - pipingData.SellmeijerReductionFactor, - PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(pipingData).GetDesignValue(), - pipingData.SandParticlesVolumicWeight, - pipingData.WhitesDragCoefficient, - PipingSemiProbabilisticDesignValueFactory.GetDiameter70(pipingData).GetDesignValue(), - PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(pipingData).GetDesignValue(), - pipingData.WaterKinematicViscosity, - pipingData.Gravity, - PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(pipingData).GetDesignValue(), - pipingData.MeanDiameter70, - pipingData.BeddingAngle, - pipingData.ExitPointXCoordinate, - pipingData.SurfaceLine, - pipingData.SoilProfile + inputParameters.WaterVolumetricWeight, + inputParameters.UpliftModelFactor, + inputParameters.AssessmentLevel, + inputParameters.PiezometricHeadExit, + PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(inputParameters).GetDesignValue(), + PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(inputParameters).GetDesignValue(), + inputParameters.PiezometricHeadPolder, + inputParameters.CriticalHeaveGradient, + PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(inputParameters).GetDesignValue(), + inputParameters.SellmeijerModelFactor, + inputParameters.SellmeijerReductionFactor, + PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(inputParameters).GetDesignValue(), + inputParameters.SandParticlesVolumicWeight, + inputParameters.WhitesDragCoefficient, + PipingSemiProbabilisticDesignValueFactory.GetDiameter70(inputParameters).GetDesignValue(), + PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(inputParameters).GetDesignValue(), + inputParameters.WaterKinematicViscosity, + inputParameters.Gravity, + PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(inputParameters).GetDesignValue(), + inputParameters.MeanDiameter70, + inputParameters.BeddingAngle, + inputParameters.ExitPointXCoordinate, + inputParameters.SurfaceLine, + inputParameters.SoilProfile ); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Piping/PipingSemiProbabilisticDesignValueFactoryTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Piping/PipingSemiProbabilisticDesignValueFactoryTest.cs (.../PipingSemiProbabilisticDesignValueFactoryTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Piping/PipingSemiProbabilisticDesignValueFactoryTest.cs (.../PipingSemiProbabilisticDesignValueFactoryTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -14,41 +14,41 @@ public void GetThicknessCoverageLayer_ValidPipingData_CreateDesignVariableForThicknessCoverageLayer() { // Setup - var pipingData = new PipingCalculationData(); + var inputParameters = new PipingInputParameters(); // Call - var thicknessCoverageLayer = PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(pipingData); + var thicknessCoverageLayer = PipingSemiProbabilisticDesignValueFactory.GetThicknessCoverageLayer(inputParameters); // Assert - Assert.AreSame(pipingData.ThicknessCoverageLayer, thicknessCoverageLayer.Distribution); + Assert.AreSame(inputParameters.ThicknessCoverageLayer, thicknessCoverageLayer.Distribution); Assert.AreEqual(0.05, thicknessCoverageLayer.Percentile); } [Test] public void GetPhreaticLevelExit_ValidPipingData_CreateDesignVariableForPhreaticLevelExit() { // Setup - var pipingData = new PipingCalculationData(); + var inputParameters = new PipingInputParameters(); // Call - var freaticLevelExit = PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(pipingData); + var freaticLevelExit = PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(inputParameters); // Assert - Assert.AreSame(pipingData.PhreaticLevelExit, freaticLevelExit.Distribution); + Assert.AreSame(inputParameters.PhreaticLevelExit, freaticLevelExit.Distribution); Assert.AreEqual(0.05, freaticLevelExit.Percentile); } [Test] public void GetDampingFactorExit_ValidPipingData_CreateDesignVariableForDampingFactorExit() { // Setup - var pipingData = new PipingCalculationData(); + var inputParameters = new PipingInputParameters(); // Call - var dampingFactorExit = PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(pipingData); + var dampingFactorExit = PipingSemiProbabilisticDesignValueFactory.GetDampingFactorExit(inputParameters); // Assert - Assert.AreSame(pipingData.DampingFactorExit, dampingFactorExit.Distribution); + Assert.AreSame(inputParameters.DampingFactorExit, dampingFactorExit.Distribution); Assert.AreEqual(0.95, dampingFactorExit.Percentile); } @@ -60,55 +60,55 @@ public void GetSeepageLength_ValidPipingData_CreateDesignVariableForSeepageLength() { // Setup - var pipingData = new PipingCalculationData(); + var inputParameters = new PipingInputParameters(); // Call - var seepageLength = PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(pipingData); + var seepageLength = PipingSemiProbabilisticDesignValueFactory.GetSeepageLength(inputParameters); // Assert - Assert.AreSame(pipingData.SeepageLength, seepageLength.Distribution); + Assert.AreSame(inputParameters.SeepageLength, seepageLength.Distribution); Assert.AreEqual(0.05, seepageLength.Percentile); } [Test] public void GetDiameter70_ValidPipingData_CreateDesignVariableForDiameter70() { // Setup - var pipingData = new PipingCalculationData(); + var inputParameters = new PipingInputParameters(); // Call - var d70 = PipingSemiProbabilisticDesignValueFactory.GetDiameter70(pipingData); + var d70 = PipingSemiProbabilisticDesignValueFactory.GetDiameter70(inputParameters); // Assert - Assert.AreSame(pipingData.Diameter70, d70.Distribution); + Assert.AreSame(inputParameters.Diameter70, d70.Distribution); Assert.AreEqual(0.05, d70.Percentile); } [Test] public void GetDarcyPermeability_ValidPipingData_CreateDesignVariableForDarcyPermeability() { // Setup - var pipingData = new PipingCalculationData(); + var inputParameters = new PipingInputParameters(); // Call - var darcyPermeability = PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(pipingData); + var darcyPermeability = PipingSemiProbabilisticDesignValueFactory.GetDarcyPermeability(inputParameters); // Assert - Assert.AreSame(pipingData.DarcyPermeability, darcyPermeability.Distribution); + Assert.AreSame(inputParameters.DarcyPermeability, darcyPermeability.Distribution); Assert.AreEqual(0.95, darcyPermeability.Percentile); } [Test] public void GetThicknessAquiferLayer_ValidPipingData_CreateDesignVariableForThicknessAquiferLayer() { // Setup - var pipingData = new PipingCalculationData(); + var inputParameters = new PipingInputParameters(); // Call - var thicknessAquiferLayer = PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(pipingData); + var thicknessAquiferLayer = PipingSemiProbabilisticDesignValueFactory.GetThicknessAquiferLayer(inputParameters); // Assert - Assert.AreSame(pipingData.ThicknessAquiferLayer, thicknessAquiferLayer.Distribution); + Assert.AreSame(inputParameters.ThicknessAquiferLayer, thicknessAquiferLayer.Distribution); Assert.AreEqual(0.95, thicknessAquiferLayer.Percentile); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationDataTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationDataTest.cs (.../PipingCalculationDataTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationDataTest.cs (.../PipingCalculationDataTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -1,10 +1,7 @@ -using System; - -using Core.Common.Base; +using Core.Common.Base; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Piping.Calculation.TestUtil; -using Ringtoets.Piping.Data.Probabilistics; namespace Ringtoets.Piping.Data.Test { @@ -27,53 +24,12 @@ // Assert Assert.AreEqual("Berekening", defaultConstructed.Name); - Assert.IsInstanceOf(defaultConstructed.PhreaticLevelExit); - Assert.AreEqual(0, defaultConstructed.PhreaticLevelExit.Mean); - Assert.AreEqual(1, defaultConstructed.PhreaticLevelExit.StandardDeviation); - - double defaultLogNormalMean = Math.Exp(-0.5); - double defaultLogNormalStandardDev = Math.Sqrt((Math.Exp(1) - 1) * Math.Exp(1)); - Assert.IsInstanceOf(defaultConstructed.DampingFactorExit); - Assert.AreEqual(1, defaultConstructed.DampingFactorExit.Mean); - Assert.AreEqual(defaultLogNormalStandardDev, defaultConstructed.DampingFactorExit.StandardDeviation); - Assert.IsInstanceOf(defaultConstructed.ThicknessCoverageLayer); - Assert.AreEqual(defaultLogNormalMean, defaultConstructed.ThicknessCoverageLayer.Mean); - Assert.AreEqual(defaultLogNormalStandardDev, defaultConstructed.ThicknessCoverageLayer.StandardDeviation); - Assert.IsInstanceOf(defaultConstructed.SeepageLength); - Assert.AreEqual(defaultLogNormalMean, defaultConstructed.SeepageLength.Mean); - Assert.AreEqual(defaultLogNormalStandardDev, defaultConstructed.SeepageLength.StandardDeviation); - Assert.IsInstanceOf(defaultConstructed.Diameter70); - Assert.AreEqual(defaultLogNormalMean, defaultConstructed.Diameter70.Mean); - Assert.AreEqual(defaultLogNormalStandardDev, defaultConstructed.Diameter70.StandardDeviation); - Assert.IsInstanceOf(defaultConstructed.DarcyPermeability); - Assert.AreEqual(defaultLogNormalMean, defaultConstructed.DarcyPermeability.Mean); - Assert.AreEqual(defaultLogNormalStandardDev, defaultConstructed.DarcyPermeability.StandardDeviation); - Assert.IsInstanceOf(defaultConstructed.ThicknessAquiferLayer); - Assert.AreEqual(defaultLogNormalMean, defaultConstructed.ThicknessAquiferLayer.Mean); - Assert.AreEqual(defaultLogNormalStandardDev, defaultConstructed.ThicknessAquiferLayer.StandardDeviation); - - Assert.AreEqual(0, defaultConstructed.PiezometricHeadExit); - Assert.AreEqual(0, defaultConstructed.PiezometricHeadPolder); - Assert.AreEqual(0, defaultConstructed.AssessmentLevel); - Assert.IsNull(defaultConstructed.SurfaceLine); - Assert.IsNull(defaultConstructed.SoilProfile); - - Assert.AreEqual(1.0, defaultConstructed.UpliftModelFactor); - Assert.AreEqual(1, defaultConstructed.SellmeijerModelFactor); - Assert.AreEqual(0.3, defaultConstructed.CriticalHeaveGradient); - Assert.AreEqual(0.3, defaultConstructed.SellmeijerReductionFactor); - Assert.AreEqual(9.81, defaultConstructed.Gravity); - Assert.AreEqual(1.33e-6, defaultConstructed.WaterKinematicViscosity); - Assert.AreEqual(10.0, defaultConstructed.WaterVolumetricWeight); - Assert.AreEqual(16.5, defaultConstructed.SandParticlesVolumicWeight); - Assert.AreEqual(0.25, defaultConstructed.WhitesDragCoefficient); - Assert.AreEqual(37, defaultConstructed.BeddingAngle); - Assert.AreEqual(2.08e-4, defaultConstructed.MeanDiameter70); - Assert.AreEqual("Commentaar", defaultConstructed.Comments.Name); - Assert.AreEqual("Berekeningsverslag", defaultConstructed.CalculationReport.Name); + Assert.IsInstanceOf(defaultConstructed.InputParameters); + Assert.IsFalse(defaultConstructed.HasOutput); Assert.IsNull(defaultConstructed.Output); + Assert.AreEqual("Berekeningsverslag", defaultConstructed.CalculationReport.Name); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputParametersTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputParametersTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputParametersTest.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,67 @@ +using System; + +using Core.Common.Base; + +using NUnit.Framework; + +using Ringtoets.Piping.Data.Probabilistics; + +namespace Ringtoets.Piping.Data.Test +{ + [TestFixture] + public class PipingInputParametersTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var inputParameters = new PipingInputParameters(); + + // Assert + Assert.IsInstanceOf(inputParameters); + + Assert.IsInstanceOf(inputParameters.PhreaticLevelExit); + Assert.AreEqual(0, inputParameters.PhreaticLevelExit.Mean); + Assert.AreEqual(1, inputParameters.PhreaticLevelExit.StandardDeviation); + + double defaultLogNormalMean = Math.Exp(-0.5); + double defaultLogNormalStandardDev = Math.Sqrt((Math.Exp(1) - 1) * Math.Exp(1)); + Assert.IsInstanceOf(inputParameters.DampingFactorExit); + Assert.AreEqual(1, inputParameters.DampingFactorExit.Mean); + Assert.AreEqual(defaultLogNormalStandardDev, inputParameters.DampingFactorExit.StandardDeviation); + Assert.IsInstanceOf(inputParameters.ThicknessCoverageLayer); + Assert.AreEqual(defaultLogNormalMean, inputParameters.ThicknessCoverageLayer.Mean); + Assert.AreEqual(defaultLogNormalStandardDev, inputParameters.ThicknessCoverageLayer.StandardDeviation); + Assert.IsInstanceOf(inputParameters.SeepageLength); + Assert.AreEqual(defaultLogNormalMean, inputParameters.SeepageLength.Mean); + Assert.AreEqual(defaultLogNormalStandardDev, inputParameters.SeepageLength.StandardDeviation); + Assert.IsInstanceOf(inputParameters.Diameter70); + Assert.AreEqual(defaultLogNormalMean, inputParameters.Diameter70.Mean); + Assert.AreEqual(defaultLogNormalStandardDev, inputParameters.Diameter70.StandardDeviation); + Assert.IsInstanceOf(inputParameters.DarcyPermeability); + Assert.AreEqual(defaultLogNormalMean, inputParameters.DarcyPermeability.Mean); + Assert.AreEqual(defaultLogNormalStandardDev, inputParameters.DarcyPermeability.StandardDeviation); + Assert.IsInstanceOf(inputParameters.ThicknessAquiferLayer); + Assert.AreEqual(defaultLogNormalMean, inputParameters.ThicknessAquiferLayer.Mean); + Assert.AreEqual(defaultLogNormalStandardDev, inputParameters.ThicknessAquiferLayer.StandardDeviation); + + Assert.AreEqual(0, inputParameters.PiezometricHeadExit); + Assert.AreEqual(0, inputParameters.PiezometricHeadPolder); + Assert.AreEqual(0, inputParameters.AssessmentLevel); + Assert.IsNull(inputParameters.SurfaceLine); + Assert.IsNull(inputParameters.SoilProfile); + + Assert.AreEqual(1.0, inputParameters.UpliftModelFactor); + Assert.AreEqual(1, inputParameters.SellmeijerModelFactor); + Assert.AreEqual(0.3, inputParameters.CriticalHeaveGradient); + Assert.AreEqual(0.3, inputParameters.SellmeijerReductionFactor); + Assert.AreEqual(9.81, inputParameters.Gravity); + Assert.AreEqual(1.33e-6, inputParameters.WaterKinematicViscosity); + Assert.AreEqual(10.0, inputParameters.WaterVolumetricWeight); + Assert.AreEqual(16.5, inputParameters.SandParticlesVolumicWeight); + Assert.AreEqual(0.25, inputParameters.WhitesDragCoefficient); + Assert.AreEqual(37, inputParameters.BeddingAngle); + Assert.AreEqual(2.08e-4, inputParameters.MeanDiameter70); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -61,6 +61,7 @@ + Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingCalculationInputsNodePresenterTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingCalculationInputsNodePresenterTest.cs (.../PipingCalculationInputsNodePresenterTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingCalculationInputsNodePresenterTest.cs (.../PipingCalculationInputsNodePresenterTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -62,8 +62,7 @@ { PipingData = new PipingCalculationData { - Name = nodeName, - AssessmentLevel = 2.0 + Name = nodeName } }; @@ -90,17 +89,23 @@ PipingData = new PipingCalculationData { Output = new PipingOutput(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) - } + }, + AvailablePipingSurfaceLines = new[]{new RingtoetsPipingSurfaceLine()}, + AvailablePipingSoilProfiles = new[]{new TestPipingSoilProfile()} }; // Call var children = nodePresenter.GetChildNodeObjects(pipingCalculationInputs, nodeMock).OfType().ToArray(); // Assert - Assert.AreEqual(3, children.Length); + Assert.AreEqual(4, children.Length); Assert.AreSame(pipingCalculationInputs.PipingData.Comments, children[0]); - Assert.AreSame(pipingCalculationInputs.PipingData.Output, children[1]); - Assert.AreSame(pipingCalculationInputs.PipingData.CalculationReport, children[2]); + var pipingInputParametersContext = (PipingInputParametersContext)children[1]; + Assert.AreSame(pipingCalculationInputs.PipingData.InputParameters, pipingInputParametersContext.WrappedPipingInputParameters); + CollectionAssert.AreEqual(pipingCalculationInputs.AvailablePipingSurfaceLines, pipingInputParametersContext.AvailablePipingSurfaceLines); + CollectionAssert.AreEqual(pipingCalculationInputs.AvailablePipingSoilProfiles, pipingInputParametersContext.AvailablePipingSoilProfiles); + Assert.AreSame(pipingCalculationInputs.PipingData.Output, children[2]); + Assert.AreSame(pipingCalculationInputs.PipingData.CalculationReport, children[3]); mockRepository.VerifyAll(); // Expect no calls on tree node } @@ -122,8 +127,12 @@ var children = nodePresenter.GetChildNodeObjects(pipingCalculationInputs, nodeMock).OfType().ToArray(); // Assert - Assert.AreEqual(1, children.Length); + Assert.AreEqual(2, children.Length); Assert.AreSame(pipingCalculationInputs.PipingData.Comments, children[0]); + var pipingInputParametersContext = (PipingInputParametersContext)children[1]; + Assert.AreSame(pipingCalculationInputs.PipingData.InputParameters, pipingInputParametersContext.WrappedPipingInputParameters); + CollectionAssert.AreEqual(pipingCalculationInputs.AvailablePipingSurfaceLines, pipingInputParametersContext.AvailablePipingSurfaceLines); + CollectionAssert.AreEqual(pipingCalculationInputs.AvailablePipingSoilProfiles, pipingInputParametersContext.AvailablePipingSoilProfiles); mockRepository.VerifyAll(); // Expect no calls on tree node } @@ -532,29 +541,29 @@ var calculateContextMenuItemIndex = 1; var pipingData = new PipingCalculationData(); var validPipingInput = new TestPipingInput(); - pipingData.AssessmentLevel = validPipingInput.AssessmentLevel; - pipingData.BeddingAngle = validPipingInput.BeddingAngle; - pipingData.DampingFactorExit.Mean = validPipingInput.DampingFactorExit; - pipingData.DarcyPermeability.Mean = validPipingInput.DarcyPermeability; - pipingData.Diameter70.Mean = validPipingInput.Diameter70; - pipingData.ExitPointXCoordinate = validPipingInput.ExitPointXCoordinate; - pipingData.Gravity = validPipingInput.Gravity; - pipingData.MeanDiameter70 = validPipingInput.MeanDiameter70; - pipingData.PhreaticLevelExit.Mean = validPipingInput.PhreaticLevelExit; - pipingData.PiezometricHeadExit = validPipingInput.PiezometricHeadExit; - pipingData.PiezometricHeadPolder = validPipingInput.PiezometricHeadPolder; - pipingData.SandParticlesVolumicWeight = validPipingInput.SandParticlesVolumicWeight; - pipingData.SeepageLength.Mean = validPipingInput.SeepageLength; - pipingData.SellmeijerModelFactor = validPipingInput.SellmeijerModelFactor; - pipingData.SellmeijerReductionFactor = validPipingInput.SellmeijerReductionFactor; - pipingData.ThicknessAquiferLayer.Mean = validPipingInput.ThicknessAquiferLayer; - pipingData.ThicknessCoverageLayer.Mean = validPipingInput.ThicknessCoverageLayer; - pipingData.UpliftModelFactor = validPipingInput.UpliftModelFactor; - pipingData.WaterVolumetricWeight = validPipingInput.WaterVolumetricWeight; - pipingData.WaterKinematicViscosity = validPipingInput.WaterKinematicViscosity; - pipingData.WhitesDragCoefficient = validPipingInput.WhitesDragCoefficient; - pipingData.SurfaceLine = validPipingInput.SurfaceLine; - pipingData.SoilProfile = validPipingInput.SoilProfile; + pipingData.InputParameters.AssessmentLevel = validPipingInput.AssessmentLevel; + pipingData.InputParameters.BeddingAngle = validPipingInput.BeddingAngle; + pipingData.InputParameters.DampingFactorExit.Mean = validPipingInput.DampingFactorExit; + pipingData.InputParameters.DarcyPermeability.Mean = validPipingInput.DarcyPermeability; + pipingData.InputParameters.Diameter70.Mean = validPipingInput.Diameter70; + pipingData.InputParameters.ExitPointXCoordinate = validPipingInput.ExitPointXCoordinate; + pipingData.InputParameters.Gravity = validPipingInput.Gravity; + pipingData.InputParameters.MeanDiameter70 = validPipingInput.MeanDiameter70; + pipingData.InputParameters.PhreaticLevelExit.Mean = validPipingInput.PhreaticLevelExit; + pipingData.InputParameters.PiezometricHeadExit = validPipingInput.PiezometricHeadExit; + pipingData.InputParameters.PiezometricHeadPolder = validPipingInput.PiezometricHeadPolder; + pipingData.InputParameters.SandParticlesVolumicWeight = validPipingInput.SandParticlesVolumicWeight; + pipingData.InputParameters.SeepageLength.Mean = validPipingInput.SeepageLength; + pipingData.InputParameters.SellmeijerModelFactor = validPipingInput.SellmeijerModelFactor; + pipingData.InputParameters.SellmeijerReductionFactor = validPipingInput.SellmeijerReductionFactor; + pipingData.InputParameters.ThicknessAquiferLayer.Mean = validPipingInput.ThicknessAquiferLayer; + pipingData.InputParameters.ThicknessCoverageLayer.Mean = validPipingInput.ThicknessCoverageLayer; + pipingData.InputParameters.UpliftModelFactor = validPipingInput.UpliftModelFactor; + pipingData.InputParameters.WaterVolumetricWeight = validPipingInput.WaterVolumetricWeight; + pipingData.InputParameters.WaterKinematicViscosity = validPipingInput.WaterKinematicViscosity; + pipingData.InputParameters.WhitesDragCoefficient = validPipingInput.WhitesDragCoefficient; + pipingData.InputParameters.SurfaceLine = validPipingInput.SurfaceLine; + pipingData.InputParameters.SoilProfile = validPipingInput.SoilProfile; var observer = mockRepository.StrictMock(); observer.Expect(o => o.UpdateObserver()); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingInputParametersContextNodePresenterTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingInputParametersContextNodePresenterTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingInputParametersContextNodePresenterTest.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,109 @@ +using Core.Common.Controls; +using Core.Common.TestUtils; + +using NUnit.Framework; + +using Rhino.Mocks; + +using Ringtoets.Common.Forms.NodePresenters; +using Ringtoets.Piping.Forms.NodePresenters; +using Ringtoets.Piping.Forms.PresentationObjects; + +using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources; + +namespace Ringtoets.Piping.Forms.Test.NodePresenters +{ + [TestFixture] + public class PipingInputParametersContextNodePresenterTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var nodePresenter = new PipingInputParametersContextNodePresenter(); + + // Assert + Assert.IsInstanceOf>(nodePresenter); + Assert.AreEqual(typeof(PipingInputParametersContext), nodePresenter.NodeTagType); + Assert.IsNull(nodePresenter.TreeView); + } + + [Test] + public void UpdateNode_WithInputParametersData_InitializeNode() + { + // Setup + var mocks = new MockRepository(); + var parentNode = mocks.StrictMock(); + var currentNode = mocks.Stub(); + mocks.ReplayAll(); + + var nodeData = new PipingInputParametersContext(); + + var nodePresenter = new PipingInputParametersContextNodePresenter(); + + // Call + nodePresenter.UpdateNode(parentNode, currentNode, nodeData); + + // Assert + Assert.AreEqual("Invoer", currentNode.Text); + TestHelper.AssertImagesAreEqual(PipingFormsResources.PipingInputIcon, currentNode.Image); + mocks.VerifyAll(); + } + + [Test] + public void CanRenameNode_Always_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var currentNode = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingInputParametersContextNodePresenter(); + + // Call + var isRenameAllowed = nodePresenter.CanRenameNode(currentNode); + + // Assert + Assert.IsFalse(isRenameAllowed); + mocks.VerifyAll(); // Expect no calls on mocks. + } + + [Test] + public void CanRenameNodeTo_Always_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var currentNode = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingInputParametersContextNodePresenter(); + + // Call + var isRenameAllowed = nodePresenter.CanRenameNodeTo(currentNode, "new name"); + + // Assert + Assert.IsFalse(isRenameAllowed); + mocks.VerifyAll(); // Expect no calls on mocks. + } + + [Test] + public void CanRemove_Always_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var currentNode = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodeData = new PipingInputParametersContext(); + + var nodePresenter = new PipingInputParametersContextNodePresenter(); + + // Call + var isRemoveAllowed = nodePresenter.CanRemove(currentNode, nodeData); + + // Assert + Assert.IsFalse(isRemoveAllowed); + mocks.VerifyAll(); // Expect no calls on mocks. + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationInputsTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationInputsTest.cs (.../PipingCalculationInputsTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationInputsTest.cs (.../PipingCalculationInputsTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -22,6 +22,7 @@ Assert.IsInstanceOf(presentationObject); Assert.IsNull(presentationObject.PipingData); CollectionAssert.IsEmpty(presentationObject.AvailablePipingSurfaceLines); + CollectionAssert.IsEmpty(presentationObject.AvailablePipingSoilProfiles); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputParametersContextTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputParametersContextTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputParametersContextTest.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,95 @@ +using Core.Common.Base; + +using NUnit.Framework; + +using Rhino.Mocks; + +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PresentationObjects; + +namespace Ringtoets.Piping.Forms.Test.PresentationObjects +{ + [TestFixture] + public class PipingInputParametersContextTest + { + [Test] + public void DefaultConstructpr_ExpectedValues() + { + // Call + var context = new PipingInputParametersContext(); + + // Assert + Assert.IsInstanceOf(context); + Assert.IsNull(context.WrappedPipingInputParameters); + CollectionAssert.IsEmpty(context.AvailablePipingSurfaceLines); + CollectionAssert.IsEmpty(context.AvailablePipingSoilProfiles); + } + + [Test] + public void NotifyObservers_HasPipingDataAndObserverAttached_NotifyObserver() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + var presentationObject = new PipingInputParametersContext + { + WrappedPipingInputParameters = new PipingInputParameters() + }; + presentationObject.Attach(observer); + + // Call + presentationObject.NotifyObservers(); + + // Assert + mocks.VerifyAll(); + } + + [Test] + public void NotifyObservers_HasPipingDataAndObserverDetached_NoCallsOnObserver() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + mocks.ReplayAll(); + + var presentationObject = new PipingInputParametersContext + { + WrappedPipingInputParameters = new PipingInputParameters() + }; + presentationObject.Attach(observer); + presentationObject.Detach(observer); + + // Call + presentationObject.NotifyObservers(); + + // Assert + mocks.VerifyAll(); // Expect not calls on 'observer' + } + + [Test] + public void PipingDataNotifyObservers_AttachedOnPipingCalculationInputs_ObserverNotified() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + var pipingData = new PipingInputParameters(); + var presentationObject = new PipingInputParametersContext + { + WrappedPipingInputParameters = pipingData + }; + presentationObject.Attach(observer); + + // Call + pipingData.NotifyObservers(); + + // Assert + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingCalculationInputsPropertiesTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingCalculationInputsPropertiesTest.cs (.../PipingCalculationInputsPropertiesTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingCalculationInputsPropertiesTest.cs (.../PipingCalculationInputsPropertiesTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -1,11 +1,9 @@ -using System; -using Core.Common.Base; +using Core.Common.Base; using Core.Common.Gui; using NUnit.Framework; using Rhino.Mocks; -using Ringtoets.Piping.Calculation.TestUtil; + using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.PropertyClasses; @@ -29,22 +27,10 @@ public void GetProperties_WithData_ReturnExpectedValues() { // Setup - var random = new Random(22); - const string name = ""; - var surfaceLine = new RingtoetsPipingSurfaceLine(); - var soilProfile = new PipingSoilProfile(String.Empty,random.NextDouble(), new [] - { - new PipingSoilLayer(random.NextDouble()) - { - IsAquifer = true - } - }); var pipingData = new PipingCalculationData { - Name = name, - SurfaceLine = surfaceLine, - SoilProfile = soilProfile + Name = name }; var properties = new PipingCalculationInputsProperties @@ -57,32 +43,6 @@ // Call & Assert Assert.AreEqual(name, properties.Name); - - Assert.AreSame(pipingData.PhreaticLevelExit, properties.PhreaticLevelExit.Distribution); - Assert.AreSame(pipingData.DampingFactorExit, properties.DampingFactorExit.Distribution); - Assert.AreSame(pipingData.ThicknessCoverageLayer, properties.ThicknessCoverageLayer.Distribution); - Assert.AreSame(pipingData.SeepageLength, properties.SeepageLength.Distribution); - Assert.AreSame(pipingData.Diameter70, properties.Diameter70.Distribution); - Assert.AreSame(pipingData.DarcyPermeability, properties.DarcyPermeability.Distribution); - Assert.AreSame(pipingData.ThicknessAquiferLayer, properties.ThicknessAquiferLayer.Distribution); - - Assert.AreEqual(pipingData.UpliftModelFactor, properties.UpliftModelFactor); - Assert.AreEqual(pipingData.PiezometricHeadExit, properties.PiezometricHeadExit); - Assert.AreEqual(pipingData.PiezometricHeadPolder, properties.PiezometricHeadPolder); - Assert.AreEqual(pipingData.AssessmentLevel, properties.AssessmentLevel); - Assert.AreEqual(pipingData.SellmeijerModelFactor, properties.SellmeijerModelFactor); - - Assert.AreEqual(pipingData.CriticalHeaveGradient, properties.CriticalHeaveGradient); - Assert.AreEqual(pipingData.SellmeijerReductionFactor, properties.SellmeijerReductionFactor); - Assert.AreEqual(pipingData.Gravity, properties.Gravity); - Assert.AreEqual(pipingData.WaterKinematicViscosity, properties.WaterKinematicViscosity); - Assert.AreEqual(pipingData.WaterVolumetricWeight, properties.WaterVolumetricWeight); - Assert.AreEqual(pipingData.SandParticlesVolumicWeight, properties.SandParticlesVolumicWeight); - Assert.AreEqual(pipingData.WhitesDragCoefficient, properties.WhitesDragCoefficient); - Assert.AreEqual(pipingData.BeddingAngle, properties.BeddingAngle); - Assert.AreEqual(pipingData.MeanDiameter70, properties.MeanDiameter70); - Assert.AreSame(surfaceLine, properties.SurfaceLine); - Assert.AreSame(soilProfile, properties.SoilProfile); } [Test] @@ -106,9 +66,9 @@ }; // Call & Assert - const double assessmentLevel = 0.12; - properties.AssessmentLevel = assessmentLevel; - Assert.AreEqual(assessmentLevel, pipingData.AssessmentLevel); + const string newName = "haha"; + properties.Name = newName; + Assert.AreEqual(newName, pipingData.Name); mocks.VerifyAll(); } @@ -118,93 +78,25 @@ // Setup var mocks = new MockRepository(); var projectObserver = mocks.StrictMock(); - int numberProperties = 22; + int numberProperties = 1; projectObserver.Expect(o => o.UpdateObserver()).Repeat.Times(numberProperties); mocks.ReplayAll(); var pipingData = new PipingCalculationData(); pipingData.Attach(projectObserver); - Random random = new Random(22); - - double waterVolumetricWeight = random.NextDouble(); - double upliftModelFactor = random.NextDouble(); - double piezometricHeadExit = random.NextDouble(); - double piezometricHeadPolder = random.NextDouble(); - double sellmeijerModelFactor = random.NextDouble(); - double sellmeijerReductionFactor = random.NextDouble(); - double sandParticlesVolumicWeight = random.NextDouble(); - double whitesDragCoefficient = random.NextDouble(); - double waterKinematicViscosity = random.NextDouble(); - double gravity = random.NextDouble(); - double meanDiameter70 = random.NextDouble(); - double beddingAngle = random.NextDouble(); - - var dampingFactorExit = new LognormalDistribution(); - var phreaticLevelExit = new NormalDistribution(); - var thicknessCoverageLayer = new LognormalDistribution(); - var seepageLength = new LognormalDistribution(); - var diameter70 = new LognormalDistribution(); - var darcyPermeability = new LognormalDistribution(); - var thicknessAquiferLayer = new LognormalDistribution(); - - RingtoetsPipingSurfaceLine surfaceLine = new RingtoetsPipingSurfaceLine(); - PipingSoilProfile soilProfile = new TestPipingSoilProfile(); - // Call new PipingCalculationInputsProperties { - Data = new PipingCalculationInputs() + Data = new PipingCalculationInputs { PipingData = pipingData }, - Name = string.Empty, - WaterVolumetricWeight = waterVolumetricWeight, - UpliftModelFactor = upliftModelFactor, - PiezometricHeadExit = piezometricHeadExit, - DampingFactorExit = new LognormalDistributionDesignVariable(dampingFactorExit), - PhreaticLevelExit = new NormalDistributionDesignVariable(phreaticLevelExit), - PiezometricHeadPolder = piezometricHeadPolder, - ThicknessCoverageLayer = new LognormalDistributionDesignVariable(thicknessCoverageLayer), - SellmeijerModelFactor = sellmeijerModelFactor, - SellmeijerReductionFactor = sellmeijerReductionFactor, - SeepageLength = new LognormalDistributionDesignVariable(seepageLength), - SandParticlesVolumicWeight = sandParticlesVolumicWeight, - WhitesDragCoefficient = whitesDragCoefficient, - Diameter70 = new LognormalDistributionDesignVariable(diameter70), - DarcyPermeability = new LognormalDistributionDesignVariable(darcyPermeability), - WaterKinematicViscosity = waterKinematicViscosity, - Gravity = gravity, - ThicknessAquiferLayer = new LognormalDistributionDesignVariable(thicknessAquiferLayer), - MeanDiameter70 = meanDiameter70, - BeddingAngle = beddingAngle, - SurfaceLine = surfaceLine, - SoilProfile = soilProfile, + Name = string.Empty }; // Assert Assert.AreEqual(string.Empty, pipingData.Name); - Assert.AreEqual(waterVolumetricWeight, pipingData.WaterVolumetricWeight); - Assert.AreEqual(upliftModelFactor, pipingData.UpliftModelFactor); - Assert.AreEqual(piezometricHeadExit, pipingData.PiezometricHeadExit); - Assert.AreEqual(dampingFactorExit, pipingData.DampingFactorExit); - Assert.AreEqual(phreaticLevelExit, pipingData.PhreaticLevelExit); - Assert.AreEqual(piezometricHeadPolder, pipingData.PiezometricHeadPolder); - Assert.AreEqual(thicknessCoverageLayer, pipingData.ThicknessCoverageLayer); - Assert.AreEqual(sellmeijerModelFactor, pipingData.SellmeijerModelFactor); - Assert.AreEqual(sellmeijerReductionFactor, pipingData.SellmeijerReductionFactor); - Assert.AreEqual(seepageLength, pipingData.SeepageLength); - Assert.AreEqual(sandParticlesVolumicWeight, pipingData.SandParticlesVolumicWeight); - Assert.AreEqual(whitesDragCoefficient, pipingData.WhitesDragCoefficient); - Assert.AreEqual(diameter70, pipingData.Diameter70); - Assert.AreEqual(darcyPermeability, pipingData.DarcyPermeability); - Assert.AreEqual(waterKinematicViscosity, pipingData.WaterKinematicViscosity); - Assert.AreEqual(gravity, pipingData.Gravity); - Assert.AreEqual(thicknessAquiferLayer, pipingData.ThicknessAquiferLayer); - Assert.AreEqual(meanDiameter70, pipingData.MeanDiameter70); - Assert.AreEqual(beddingAngle, pipingData.BeddingAngle); - Assert.AreEqual(surfaceLine, pipingData.SurfaceLine); - Assert.AreEqual(soilProfile, pipingData.SoilProfile); mocks.VerifyAll(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputParametersContextPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputParametersContextPropertiesTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputParametersContextPropertiesTest.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,201 @@ +using System; + +using Core.Common.Base; +using Core.Common.Gui; + +using NUnit.Framework; + +using Rhino.Mocks; + +using Ringtoets.Piping.Calculation.TestUtil; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Forms.PropertyClasses; + +namespace Ringtoets.Piping.Forms.Test.PropertyClasses +{ + [TestFixture] + public class PipingInputParametersContextPropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new PipingInputParametersContextProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + var random = new Random(22); + + var surfaceLine = new RingtoetsPipingSurfaceLine(); + var soilProfile = new PipingSoilProfile(String.Empty, random.NextDouble(), new[] + { + new PipingSoilLayer(random.NextDouble()) + { + IsAquifer = true + } + }); + var inputParameters = new PipingInputParameters + { + SurfaceLine = surfaceLine, + SoilProfile = soilProfile + }; + + var properties = new PipingInputParametersContextProperties + { + Data = new PipingInputParametersContext{WrappedPipingInputParameters = inputParameters} + }; + + // Call & Assert + Assert.AreSame(inputParameters.PhreaticLevelExit, properties.PhreaticLevelExit.Distribution); + Assert.AreSame(inputParameters.DampingFactorExit, properties.DampingFactorExit.Distribution); + Assert.AreSame(inputParameters.ThicknessCoverageLayer, properties.ThicknessCoverageLayer.Distribution); + Assert.AreSame(inputParameters.SeepageLength, properties.SeepageLength.Distribution); + Assert.AreSame(inputParameters.Diameter70, properties.Diameter70.Distribution); + Assert.AreSame(inputParameters.DarcyPermeability, properties.DarcyPermeability.Distribution); + Assert.AreSame(inputParameters.ThicknessAquiferLayer, properties.ThicknessAquiferLayer.Distribution); + + Assert.AreEqual(inputParameters.UpliftModelFactor, properties.UpliftModelFactor); + Assert.AreEqual(inputParameters.PiezometricHeadExit, properties.PiezometricHeadExit); + Assert.AreEqual(inputParameters.PiezometricHeadPolder, properties.PiezometricHeadPolder); + Assert.AreEqual(inputParameters.AssessmentLevel, properties.AssessmentLevel); + Assert.AreEqual(inputParameters.SellmeijerModelFactor, properties.SellmeijerModelFactor); + + Assert.AreEqual(inputParameters.CriticalHeaveGradient, properties.CriticalHeaveGradient); + Assert.AreEqual(inputParameters.SellmeijerReductionFactor, properties.SellmeijerReductionFactor); + Assert.AreEqual(inputParameters.Gravity, properties.Gravity); + Assert.AreEqual(inputParameters.WaterKinematicViscosity, properties.WaterKinematicViscosity); + Assert.AreEqual(inputParameters.WaterVolumetricWeight, properties.WaterVolumetricWeight); + Assert.AreEqual(inputParameters.SandParticlesVolumicWeight, properties.SandParticlesVolumicWeight); + Assert.AreEqual(inputParameters.WhitesDragCoefficient, properties.WhitesDragCoefficient); + Assert.AreEqual(inputParameters.BeddingAngle, properties.BeddingAngle); + Assert.AreEqual(inputParameters.MeanDiameter70, properties.MeanDiameter70); + Assert.AreSame(surfaceLine, properties.SurfaceLine); + Assert.AreSame(soilProfile, properties.SoilProfile); + } + + [Test] + public void SetProperties_WithData_UpdateDataAndNotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var projectObserver = mocks.StrictMock(); + projectObserver.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + var inputParameters = new PipingInputParameters(); + inputParameters.Attach(projectObserver); + + var properties = new PipingInputParametersContextProperties + { + Data = new PipingInputParametersContext{WrappedPipingInputParameters = inputParameters} + }; + + // Call & Assert + const double assessmentLevel = 0.12; + properties.AssessmentLevel = assessmentLevel; + Assert.AreEqual(assessmentLevel, inputParameters.AssessmentLevel); + mocks.VerifyAll(); + } + + [Test] + public void SetProperties_IndividualProperties_UpdateDataAndNotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var projectObserver = mocks.StrictMock(); + int numberProperties = 21; + projectObserver.Expect(o => o.UpdateObserver()).Repeat.Times(numberProperties); + mocks.ReplayAll(); + + var inputParameters = new PipingInputParameters(); + inputParameters.Attach(projectObserver); + + Random random = new Random(22); + + double waterVolumetricWeight = random.NextDouble(); + double upliftModelFactor = random.NextDouble(); + double piezometricHeadExit = random.NextDouble(); + double piezometricHeadPolder = random.NextDouble(); + double sellmeijerModelFactor = random.NextDouble(); + double sellmeijerReductionFactor = random.NextDouble(); + double sandParticlesVolumicWeight = random.NextDouble(); + double whitesDragCoefficient = random.NextDouble(); + double waterKinematicViscosity = random.NextDouble(); + double gravity = random.NextDouble(); + double meanDiameter70 = random.NextDouble(); + double beddingAngle = random.NextDouble(); + + var dampingFactorExit = new LognormalDistribution(); + var phreaticLevelExit = new NormalDistribution(); + var thicknessCoverageLayer = new LognormalDistribution(); + var seepageLength = new LognormalDistribution(); + var diameter70 = new LognormalDistribution(); + var darcyPermeability = new LognormalDistribution(); + var thicknessAquiferLayer = new LognormalDistribution(); + + RingtoetsPipingSurfaceLine surfaceLine = new RingtoetsPipingSurfaceLine(); + PipingSoilProfile soilProfile = new TestPipingSoilProfile(); + + // Call + new PipingInputParametersContextProperties + { + Data = new PipingInputParametersContext{WrappedPipingInputParameters = inputParameters}, + WaterVolumetricWeight = waterVolumetricWeight, + UpliftModelFactor = upliftModelFactor, + PiezometricHeadExit = piezometricHeadExit, + DampingFactorExit = new LognormalDistributionDesignVariable(dampingFactorExit), + PhreaticLevelExit = new NormalDistributionDesignVariable(phreaticLevelExit), + PiezometricHeadPolder = piezometricHeadPolder, + ThicknessCoverageLayer = new LognormalDistributionDesignVariable(thicknessCoverageLayer), + SellmeijerModelFactor = sellmeijerModelFactor, + SellmeijerReductionFactor = sellmeijerReductionFactor, + SeepageLength = new LognormalDistributionDesignVariable(seepageLength), + SandParticlesVolumicWeight = sandParticlesVolumicWeight, + WhitesDragCoefficient = whitesDragCoefficient, + Diameter70 = new LognormalDistributionDesignVariable(diameter70), + DarcyPermeability = new LognormalDistributionDesignVariable(darcyPermeability), + WaterKinematicViscosity = waterKinematicViscosity, + Gravity = gravity, + ThicknessAquiferLayer = new LognormalDistributionDesignVariable(thicknessAquiferLayer), + MeanDiameter70 = meanDiameter70, + BeddingAngle = beddingAngle, + SurfaceLine = surfaceLine, + SoilProfile = soilProfile, + }; + + // Assert + Assert.AreEqual(waterVolumetricWeight, inputParameters.WaterVolumetricWeight); + Assert.AreEqual(upliftModelFactor, inputParameters.UpliftModelFactor); + Assert.AreEqual(piezometricHeadExit, inputParameters.PiezometricHeadExit); + Assert.AreEqual(dampingFactorExit, inputParameters.DampingFactorExit); + Assert.AreEqual(phreaticLevelExit, inputParameters.PhreaticLevelExit); + Assert.AreEqual(piezometricHeadPolder, inputParameters.PiezometricHeadPolder); + Assert.AreEqual(thicknessCoverageLayer, inputParameters.ThicknessCoverageLayer); + Assert.AreEqual(sellmeijerModelFactor, inputParameters.SellmeijerModelFactor); + Assert.AreEqual(sellmeijerReductionFactor, inputParameters.SellmeijerReductionFactor); + Assert.AreEqual(seepageLength, inputParameters.SeepageLength); + Assert.AreEqual(sandParticlesVolumicWeight, inputParameters.SandParticlesVolumicWeight); + Assert.AreEqual(whitesDragCoefficient, inputParameters.WhitesDragCoefficient); + Assert.AreEqual(diameter70, inputParameters.Diameter70); + Assert.AreEqual(darcyPermeability, inputParameters.DarcyPermeability); + Assert.AreEqual(waterKinematicViscosity, inputParameters.WaterKinematicViscosity); + Assert.AreEqual(gravity, inputParameters.Gravity); + Assert.AreEqual(thicknessAquiferLayer, inputParameters.ThicknessAquiferLayer); + Assert.AreEqual(meanDiameter70, inputParameters.MeanDiameter70); + Assert.AreEqual(beddingAngle, inputParameters.BeddingAngle); + Assert.AreEqual(surfaceLine, inputParameters.SurfaceLine); + Assert.AreEqual(soilProfile, inputParameters.SoilProfile); + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj =================================================================== diff -u -rc0e407c65daebe4f446f9414367593eff80af1b2 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision c0e407c65daebe4f446f9414367593eff80af1b2) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -56,6 +56,8 @@ + + @@ -65,6 +67,7 @@ + @@ -75,9 +78,9 @@ - - - + + + Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/LognormalDistributionDesignVariableTypeConverterTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/LognormalDistributionDesignVariableTypeConverterTest.cs (.../LognormalDistributionDesignVariableTypeConverterTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/LognormalDistributionDesignVariableTypeConverterTest.cs (.../LognormalDistributionDesignVariableTypeConverterTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -124,21 +124,21 @@ #region Integration tests [Test] - [TestCase(1, TestName = "PipingCalculationInputsPropertiesWrappedInDynamicPropertyBag_WhenSettingNewValue_ThenPipingDataNotifiedObserversOfChange(1)")] - [TestCase(2, TestName = "PipingCalculationInputsPropertiesWrappedInDynamicPropertyBag_WhenSettingNewValue_ThenPipingDataNotifiedObserversOfChange(2)")] - public void GivenContextOfPipingCalculationInputsPropertiesWrappedInDynamicPropertyBag_WhenSettingNewValue_ThenPipingDataNotifiedObserversOfChange(int propertyIndexToChange) + [TestCase(1)] + [TestCase(2)] + public void GivenPipingInputParameterContextPropertiesInDynamicPropertyBag_WhenSettingNewValue_ThenPipingInputParametersUpdatesObservers(int propertyIndexToChange) { // Scenario - var pipingData = new PipingCalculationData(); - var calculationInputs = new PipingCalculationInputs + var inputParameters = new PipingInputParameters(); + var inputParametersContext = new PipingInputParametersContext { - PipingData = pipingData + WrappedPipingInputParameters = inputParameters }; - var calculationInputsProperties = new PipingCalculationInputsProperties + var inputParameterContextProperties = new PipingInputParametersContextProperties { - Data = calculationInputs + Data = inputParametersContext }; - var dynamicPropertyBag = new DynamicPropertyBag(calculationInputsProperties); + var dynamicPropertyBag = new DynamicPropertyBag(inputParameterContextProperties); var mocks = new MockRepository(); var typeDescriptorContextMock = mocks.StrictMock(); @@ -148,9 +148,9 @@ observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); - pipingData.Attach(observer); + inputParameters.Attach(observer); - DesignVariable dampingFactorExit = calculationInputsProperties.DampingFactorExit; + DesignVariable dampingFactorExit = inputParameterContextProperties.DampingFactorExit; var properties = new LognormalDistributionDesignVariableTypeConverter().GetProperties(typeDescriptorContextMock, dampingFactorExit); // Precondition @@ -164,10 +164,10 @@ switch (propertyIndexToChange) { case 1: - Assert.AreEqual(newValue, pipingData.DampingFactorExit.Mean); + Assert.AreEqual(newValue, inputParameters.DampingFactorExit.Mean); break; case 2: - Assert.AreEqual(newValue, pipingData.DampingFactorExit.StandardDeviation); + Assert.AreEqual(newValue, inputParameters.DampingFactorExit.StandardDeviation); break; } mocks.VerifyAll(); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/NormalDistributionDesignVariableTypeConverterTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/NormalDistributionDesignVariableTypeConverterTest.cs (.../NormalDistributionDesignVariableTypeConverterTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/NormalDistributionDesignVariableTypeConverterTest.cs (.../NormalDistributionDesignVariableTypeConverterTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -123,21 +123,21 @@ #region Integration tests [Test] - [TestCase(1, TestName = "PipingCalculationInputsPropertiesWrappedInDynamicPropertyBag_WhenSettingNewValue_ThenPipingDataNotifiedObserversOfChange(1)")] - [TestCase(2, TestName = "PipingCalculationInputsPropertiesWrappedInDynamicPropertyBag_WhenSettingNewValue_ThenPipingDataNotifiedObserversOfChange(2)")] - public void GivenContextOfPipingCalculationInputsPropertiesWrappedInDynamicPropertyBag_WhenSettingNewValue_ThenPipingDataNotifiedObserversOfChange(int propertyIndexToChange) + [TestCase(1)] + [TestCase(2)] + public void GivenPipingInputParameterContextPropertiesInDynamicPropertyBag_WhenSettingNewValue_ThenPipingInputParametersUpdatesObservers(int propertyIndexToChange) { // Scenario - var pipingData = new PipingCalculationData(); - var calculationInputs = new PipingCalculationInputs + var inputParameters = new PipingInputParameters(); + var inputParametersContext = new PipingInputParametersContext { - PipingData = pipingData + WrappedPipingInputParameters = inputParameters }; - var calculationInputsProperties = new PipingCalculationInputsProperties + var inputParameterContextProperties = new PipingInputParametersContextProperties { - Data = calculationInputs + Data = inputParametersContext }; - var dynamicPropertyBag = new DynamicPropertyBag(calculationInputsProperties); + var dynamicPropertyBag = new DynamicPropertyBag(inputParameterContextProperties); var mocks = new MockRepository(); var typeDescriptorContextMock = mocks.StrictMock(); @@ -147,10 +147,10 @@ observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); - pipingData.Attach(observer); + inputParameters.Attach(observer); - DesignVariable designVariable = calculationInputsProperties.PhreaticLevelExit; - var properties = new NormalDistributionDesignVariableTypeConverter().GetProperties(typeDescriptorContextMock, designVariable); + DesignVariable designVariable = inputParameterContextProperties.PhreaticLevelExit; + PropertyDescriptorCollection properties = new NormalDistributionDesignVariableTypeConverter().GetProperties(typeDescriptorContextMock, designVariable); // Precondition Assert.IsNotNull(properties); @@ -163,10 +163,10 @@ switch (propertyIndexToChange) { case 1: - Assert.AreEqual(newValue, pipingData.PhreaticLevelExit.Mean); + Assert.AreEqual(newValue, inputParameters.PhreaticLevelExit.Mean); break; case 2: - Assert.AreEqual(newValue, pipingData.PhreaticLevelExit.StandardDeviation); + Assert.AreEqual(newValue, inputParameters.PhreaticLevelExit.StandardDeviation); break; } mocks.VerifyAll(); Fisheye: Tag 4f48ea35b4937263954973396e267934ca7bdb55 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingCalculationInputSelectionEditorTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 4f48ea35b4937263954973396e267934ca7bdb55 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingCalculationInputSoilProfileSelectionEditorTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 4f48ea35b4937263954973396e267934ca7bdb55 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingCalculationInputsSurfaceLineSelectionEditorTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSelectionEditorTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSelectionEditorTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSelectionEditorTest.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,88 @@ +using System; +using System.ComponentModel; +using System.Drawing.Design; +using System.Windows.Forms.Design; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Piping.Forms.UITypeEditors; + +namespace Ringtoets.Piping.Forms.Test.UITypeEditors +{ + [TestFixture] + public class PipingInputParametersContextSelectionEditorTest + { + [Test] + public void GetEditStyle_Always_ReturnDropDown() + { + // Setup + var editor = new PipingInputParametersContextSelectionEditor(); + + // Call + var editStyle = editor.GetEditStyle(); + + // Assert + Assert.AreEqual(UITypeEditorEditStyle.DropDown, editStyle); + } + + [Test] + public void EditValue_NoProviderNoContext_ReturnsOriginalValue() + { + // Setup + var editor = new PipingInputParametersContextSelectionEditor(); + var someValue = new object(); + + // Call + var result = editor.EditValue(null, null, someValue); + + // Assert + Assert.AreSame(someValue, result); + } + + [Test] + public void EditValue_NoContext_ReturnsOriginalValue() + { + // Setup + var editor = new PipingInputParametersContextSelectionEditor(); + var someValue = new object(); + var mockRepository = new MockRepository(); + var provider = mockRepository.DynamicMock(); + var service = mockRepository.DynamicMock(); + provider.Expect(p => p.GetService(null)).IgnoreArguments().Return(service); + + mockRepository.ReplayAll(); + + // Call + var result = editor.EditValue(null, provider, someValue); + + // Assert + Assert.AreSame(someValue, result); + + mockRepository.VerifyAll(); + } + + [Test] + public void EditValue_Always_ReturnsOriginalValue() + { + // Setup + var editor = new PipingInputParametersContextSelectionEditor(); + var someValue = new object(); + var mockRepository = new MockRepository(); + var provider = mockRepository.DynamicMock(); + var service = mockRepository.DynamicMock(); + var context = mockRepository.DynamicMock(); + + provider.Expect(p => p.GetService(null)).IgnoreArguments().Return(service); + service.Expect(s => s.DropDownControl(null)).IgnoreArguments(); + + mockRepository.ReplayAll(); + + // Call + var result = editor.EditValue(context, provider, someValue); + + // Assert + Assert.AreSame(someValue, result); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSoilProfileSelectionEditorTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSoilProfileSelectionEditorTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSoilProfileSelectionEditorTest.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,101 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms.Design; +using Core.Common.Utils.PropertyBag.Dynamic; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Piping.Calculation.TestUtil; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Forms.PropertyClasses; +using Ringtoets.Piping.Forms.UITypeEditors; + +namespace Ringtoets.Piping.Forms.Test.UITypeEditors +{ + [TestFixture] + public class PipingInputParametersContextSoilProfileSelectionEditorTest + { + [Test] + public void EditValue_NoCurrentItemInAvailableItems_ReturnsOriginalValue() + { + // Setup + var pipingCalculationInputs = new PipingInputParametersContext + { + AvailablePipingSoilProfiles = new[] { new TestPipingSoilProfile() }, + WrappedPipingInputParameters = new PipingInputParameters + { + SoilProfile = new TestPipingSoilProfile() + } + }; + + var properties = new PipingInputParametersContextProperties + { + Data = pipingCalculationInputs + }; + + var editor = new PipingInputParametersContextSoilProfileSelectionEditor(); + var someValue = new object(); + var mockRepository = new MockRepository(); + var provider = mockRepository.DynamicMock(); + var service = mockRepository.DynamicMock(); + var context = mockRepository.DynamicMock(); + var propertyBag = new DynamicPropertyBag(properties); + + provider.Expect(p => p.GetService(null)).IgnoreArguments().Return(service); + service.Expect(s => s.DropDownControl(null)).IgnoreArguments(); + context.Expect(c => c.Instance).Return(propertyBag); + + mockRepository.ReplayAll(); + + // Call + var result = editor.EditValue(context, provider, someValue); + + // Assert + Assert.AreSame(someValue, result); + + mockRepository.VerifyAll(); + } + + [Test] + public void EditValue_WithCurrentItemInAvailableItems_ReturnsCurrentItem() + { + // Setup + var soilProfile = new TestPipingSoilProfile(); + var inputParametersContext = new PipingInputParametersContext + { + AvailablePipingSoilProfiles = new[] { soilProfile }, + WrappedPipingInputParameters = new PipingInputParameters + { + SoilProfile = soilProfile + } + }; + + var properties = new PipingInputParametersContextProperties + { + Data = inputParametersContext + }; + + var editor = new PipingInputParametersContextSoilProfileSelectionEditor(); + var someValue = new object(); + var mockRepository = new MockRepository(); + var provider = mockRepository.DynamicMock(); + var service = mockRepository.DynamicMock(); + var context = mockRepository.DynamicMock(); + var propertyBag = new DynamicPropertyBag(properties); + + provider.Expect(p => p.GetService(null)).IgnoreArguments().Return(service); + service.Expect(s => s.DropDownControl(null)).IgnoreArguments(); + context.Expect(c => c.Instance).Return(propertyBag); + + mockRepository.ReplayAll(); + + // Call + var result = editor.EditValue(context, provider, someValue); + + // Assert + Assert.AreSame(soilProfile, result); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSurfaceLineSelectionEditorTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSurfaceLineSelectionEditorTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputParametersContextSurfaceLineSelectionEditorTest.cs (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -0,0 +1,100 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms.Design; +using Core.Common.Utils.PropertyBag.Dynamic; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Forms.PropertyClasses; +using Ringtoets.Piping.Forms.UITypeEditors; + +namespace Ringtoets.Piping.Forms.Test.UITypeEditors +{ + [TestFixture] + public class PipingInputParametersContextSurfaceLineSelectionEditorTest + { + [Test] + public void EditValue_NoCurrentItemInAvailableItems_ReturnsOriginalValue() + { + // Setup + var inputParametersContext = new PipingInputParametersContext + { + AvailablePipingSurfaceLines = new[] { new RingtoetsPipingSurfaceLine() }, + WrappedPipingInputParameters = new PipingInputParameters + { + SurfaceLine = new RingtoetsPipingSurfaceLine() + } + }; + + var properties = new PipingInputParametersContextProperties + { + Data = inputParametersContext + }; + + var editor = new PipingInputParametersContextSurfaceLineSelectionEditor(); + var someValue = new object(); + var mockRepository = new MockRepository(); + var provider = mockRepository.DynamicMock(); + var service = mockRepository.DynamicMock(); + var context = mockRepository.DynamicMock(); + var propertyBag = new DynamicPropertyBag(properties); + + provider.Expect(p => p.GetService(null)).IgnoreArguments().Return(service); + service.Expect(s => s.DropDownControl(null)).IgnoreArguments(); + context.Expect(c => c.Instance).Return(propertyBag); + + mockRepository.ReplayAll(); + + // Call + var result = editor.EditValue(context, provider, someValue); + + // Assert + Assert.AreSame(someValue, result); + + mockRepository.VerifyAll(); + } + + [Test] + public void EditValue_WithCurrentItemInAvailableItems_ReturnsCurrentItem() + { + // Setup + var surfaceLine = new RingtoetsPipingSurfaceLine(); + var inputParametersContext = new PipingInputParametersContext + { + AvailablePipingSurfaceLines = new[] { surfaceLine }, + WrappedPipingInputParameters = new PipingInputParameters + { + SurfaceLine = surfaceLine + } + }; + + var properties = new PipingInputParametersContextProperties + { + Data = inputParametersContext + }; + + var editor = new PipingInputParametersContextSurfaceLineSelectionEditor(); + var someValue = new object(); + var mockRepository = new MockRepository(); + var provider = mockRepository.DynamicMock(); + var service = mockRepository.DynamicMock(); + var context = mockRepository.DynamicMock(); + var propertyBag = new DynamicPropertyBag(properties); + + provider.Expect(p => p.GetService(null)).IgnoreArguments().Return(service); + service.Expect(s => s.DropDownControl(null)).IgnoreArguments(); + context.Expect(c => c.Instance).Return(propertyBag); + + mockRepository.ReplayAll(); + + // Call + var result = editor.EditValue(context, provider, someValue); + + // Assert + Assert.AreSame(surfaceLine, result); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs =================================================================== diff -u -r279b6419e68e1a68659c8564b8410679a3d9d983 -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision 279b6419e68e1a68659c8564b8410679a3d9d983) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -45,14 +45,20 @@ PropertyInfo[] propertyInfos = guiPlugin.GetPropertyInfos().ToArray(); // assert - Assert.AreEqual(4, propertyInfos.Length); + Assert.AreEqual(5, propertyInfos.Length); var pipingDataProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingCalculationInputs)); Assert.AreEqual(typeof(PipingCalculationInputsProperties), pipingDataProperties.PropertyType); Assert.IsNull(pipingDataProperties.AdditionalDataCheck); Assert.IsNull(pipingDataProperties.GetObjectPropertiesData); Assert.IsNull(pipingDataProperties.AfterCreate); + var pipingInputParametersContextProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingInputParametersContext)); + Assert.AreEqual(typeof(PipingInputParametersContextProperties), pipingInputParametersContextProperties.PropertyType); + Assert.IsNull(pipingInputParametersContextProperties.AdditionalDataCheck); + Assert.IsNull(pipingInputParametersContextProperties.GetObjectPropertiesData); + Assert.IsNull(pipingInputParametersContextProperties.AfterCreate); + var pipingOutputProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingOutput)); Assert.AreEqual(typeof(PipingOutputProperties), pipingOutputProperties.PropertyType); Assert.IsNull(pipingOutputProperties.AdditionalDataCheck); @@ -93,12 +99,13 @@ ITreeNodePresenter[] nodePresenters = guiPlugin.GetProjectTreeViewNodePresenters().ToArray(); // assert - Assert.AreEqual(7, nodePresenters.Length); + Assert.AreEqual(8, nodePresenters.Length); Assert.IsTrue(nodePresenters.Any(np => np is PipingSurfaceLineCollectionNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingSurfaceLineNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingSoilProfileCollectionNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingSoilProfileNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingCalculationInputsNodePresenter)); + Assert.IsTrue(nodePresenters.Any(np => np is PipingInputParametersContextNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingFailureMechanismNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingOutputNodePresenter)); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -55,7 +55,7 @@ { // Setup var invalidPipingData = PipingDataFactory.CreateCalculationWithValidInput(); - invalidPipingData.BeddingAngle = -1; + invalidPipingData.InputParameters.BeddingAngle = -1; // Call Action call = () => PipingCalculationService.Calculate(invalidPipingData); Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/TestHelpers/PipingDataFactory.cs =================================================================== diff -u -re84d6f09851705c41a9ff8f26124c039a36adecf -r4f48ea35b4937263954973396e267934ca7bdb55 --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/TestHelpers/PipingDataFactory.cs (.../PipingDataFactory.cs) (revision e84d6f09851705c41a9ff8f26124c039a36adecf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/TestHelpers/PipingDataFactory.cs (.../PipingDataFactory.cs) (revision 4f48ea35b4937263954973396e267934ca7bdb55) @@ -22,50 +22,53 @@ }); return new PipingCalculationData { - AssessmentLevel = 1.0, - BeddingAngle = 1.0, - DampingFactorExit = + InputParameters = { - Mean = 1.0 - }, - DarcyPermeability = - { - Mean = 1.0 - }, - Diameter70 = - { - Mean = 1.0 - }, - ExitPointXCoordinate = 1.0, - Gravity = 1.0, - MeanDiameter70 = 1.0, - PiezometricHeadExit = 1.0, - PiezometricHeadPolder = 1.0, - PhreaticLevelExit = - { - Mean = 2.0 - }, - SandParticlesVolumicWeight = 1.0, - SeepageLength = - { - Mean = 1.0 - }, - SellmeijerModelFactor = 1.0, - SellmeijerReductionFactor = 1.0, - ThicknessAquiferLayer = - { - Mean = 1.0 - }, - ThicknessCoverageLayer = - { - Mean = 1.0 - }, - UpliftModelFactor = 1.0, - WaterKinematicViscosity = 1.0, - WaterVolumetricWeight = 1.0, - WhitesDragCoefficient = 1.0, - SurfaceLine = new RingtoetsPipingSurfaceLine(), - SoilProfile = soilProfile + AssessmentLevel = 1.0, + BeddingAngle = 1.0, + DampingFactorExit = + { + Mean = 1.0 + }, + DarcyPermeability = + { + Mean = 1.0 + }, + Diameter70 = + { + Mean = 1.0 + }, + ExitPointXCoordinate = 1.0, + Gravity = 1.0, + MeanDiameter70 = 1.0, + PiezometricHeadExit = 1.0, + PiezometricHeadPolder = 1.0, + PhreaticLevelExit = + { + Mean = 2.0 + }, + SandParticlesVolumicWeight = 1.0, + SeepageLength = + { + Mean = 1.0 + }, + SellmeijerModelFactor = 1.0, + SellmeijerReductionFactor = 1.0, + ThicknessAquiferLayer = + { + Mean = 1.0 + }, + ThicknessCoverageLayer = + { + Mean = 1.0 + }, + UpliftModelFactor = 1.0, + WaterKinematicViscosity = 1.0, + WaterVolumetricWeight = 1.0, + WhitesDragCoefficient = 1.0, + SurfaceLine = new RingtoetsPipingSurfaceLine(), + SoilProfile = soilProfile + } }; } }