Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenarioRow.cs
===================================================================
diff -u -r1f76045f08612f7b8259c460771c7cdbdb5447a7 -r86f7f85e5485e3566223ebf44e46625503f511b3
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenarioRow.cs (.../GrassCoverErosionInwardsScenarioRow.cs) (revision 1f76045f08612f7b8259c460771c7cdbdb5447a7)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenarioRow.cs (.../GrassCoverErosionInwardsScenarioRow.cs) (revision 86f7f85e5485e3566223ebf44e46625503f511b3)
@@ -20,7 +20,7 @@
// All rights reserved.
using System;
-using Riskeer.Common.Forms;
+using Riskeer.Common.Forms.Views;
using Riskeer.GrassCoverErosionInwards.Data;
namespace Riskeer.GrassCoverErosionInwards.Forms.Views
@@ -29,44 +29,32 @@
/// Container of a ,
/// which takes care of the representation of properties in a grid.
///
- internal class GrassCoverErosionInwardsScenarioRow : IScenarioRow
+ public class GrassCoverErosionInwardsScenarioRow : ScenarioRow
{
- private readonly GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult;
-
///
- /// Initializes a new instance of the class.
+ /// Creates a new instance of .
///
- /// The section result.
- /// Thrown when is null.
- public GrassCoverErosionInwardsScenarioRow(GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult)
- {
- if (sectionResult == null)
- {
- throw new ArgumentNullException(nameof(sectionResult));
- }
+ /// The this row contains.
+ /// Thrown when is null.
+ internal GrassCoverErosionInwardsScenarioRow(GrassCoverErosionInwardsCalculationScenario calculationScenario)
+ : base(calculationScenario) {}
- this.sectionResult = sectionResult;
- }
-
- public string Name
+ public override double FailureProbability
{
get
{
- return sectionResult.Section.Name;
+ if (CalculationScenario.HasOutput)
+ {
+ return CalculationScenario.Output.OvertoppingOutput.Reliability;
+ }
+
+ return double.NaN;
}
}
- public GrassCoverErosionInwardsCalculation Calculation
+ public override void Update()
{
- get
- {
- return sectionResult.Calculation;
- }
- set
- {
- sectionResult.Calculation = value;
- sectionResult.NotifyObservers();
- }
+
}
}
}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.Designer.cs
===================================================================
diff -u -r1f76045f08612f7b8259c460771c7cdbdb5447a7 -r86f7f85e5485e3566223ebf44e46625503f511b3
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.Designer.cs (.../GrassCoverErosionInwardsScenariosView.Designer.cs) (revision 1f76045f08612f7b8259c460771c7cdbdb5447a7)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.Designer.cs (.../GrassCoverErosionInwardsScenariosView.Designer.cs) (revision 86f7f85e5485e3566223ebf44e46625503f511b3)
@@ -19,7 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using Riskeer.Common.Forms;
namespace Riskeer.GrassCoverErosionInwards.Forms.Views
{
@@ -38,33 +37,8 @@
///
private void InitializeComponent()
{
- this.scenarioSelectionControl = new Riskeer.Common.Forms.ScenarioSelectionControl();
- this.SuspendLayout();
- //
- // scenarioSelectionControl
- //
- this.scenarioSelectionControl.AutoScroll = true;
- this.scenarioSelectionControl.Dock = System.Windows.Forms.DockStyle.Fill;
- this.scenarioSelectionControl.Location = new System.Drawing.Point(0, 0);
- this.scenarioSelectionControl.Name = "scenarioSelectionControl";
- this.scenarioSelectionControl.Size = new System.Drawing.Size(160, 160);
- this.scenarioSelectionControl.TabIndex = 0;
- //
- // GrassCoverErosionInwardsScenariosView
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.AutoScroll = true;
- this.Controls.Add(this.scenarioSelectionControl);
- this.MinimumSize = new System.Drawing.Size(160, 160);
- this.Name = "GrassCoverErosionInwardsScenariosView";
- this.Size = new System.Drawing.Size(160, 160);
- this.ResumeLayout(false);
-
}
#endregion
-
- private ScenarioSelectionControl scenarioSelectionControl;
}
}
Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs
===================================================================
diff -u -r5e2b491ac504c3e9079f28df27d384333d43c988 -r86f7f85e5485e3566223ebf44e46625503f511b3
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision 5e2b491ac504c3e9079f28df27d384333d43c988)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision 86f7f85e5485e3566223ebf44e46625503f511b3)
@@ -22,28 +22,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Windows.Forms;
-using Core.Common.Base;
-using Core.Common.Controls.Views;
+using Core.Common.Base.Geometry;
using Riskeer.Common.Data.Calculation;
+using Riskeer.Common.Data.FailureMechanism;
+using Riskeer.Common.Forms.Views;
using Riskeer.GrassCoverErosionInwards.Data;
-using Riskeer.GrassCoverErosionInwards.Util;
namespace Riskeer.GrassCoverErosionInwards.Forms.Views
{
///
- /// View for configuring scenarios for the grass cover erosion inwards failure mechanism.
- /// Shows a grid view where for each failure mechanism section, a calculation within the section
- /// can be selected.
+ /// View for configuring grass cover erosion inwards scenarios.
///
- public partial class GrassCoverErosionInwardsScenariosView : UserControl, IView
+ public partial class GrassCoverErosionInwardsScenariosView : ScenariosView
{
- private readonly RecursiveObserver calculationInputObserver;
- private readonly RecursiveObserver calculationGroupObserver;
- private readonly Observer failureMechanismObserver;
- private readonly GrassCoverErosionInwardsFailureMechanism failureMechanism;
- private CalculationGroup data;
-
///
/// Creates a new instance of .
///
@@ -53,86 +44,20 @@
/// Thrown when any parameter
/// is null.
public GrassCoverErosionInwardsScenariosView(CalculationGroup calculationGroup, GrassCoverErosionInwardsFailureMechanism failureMechanism)
- {
- if (calculationGroup == null)
- {
- throw new ArgumentNullException(nameof(calculationGroup));
- }
+ : base(calculationGroup, failureMechanism) {}
- if (failureMechanism == null)
- {
- throw new ArgumentNullException(nameof(failureMechanism));
- }
-
- data = calculationGroup;
- this.failureMechanism = failureMechanism;
-
- InitializeComponent();
-
- failureMechanismObserver = new Observer(UpdateDataGridViewDataSource)
- {
- Observable = failureMechanism
- };
-
- // The concat is needed to observe the input of calculations in child groups.
- calculationInputObserver = new RecursiveObserver(
- UpdateDataGridViewDataSource, cg => cg.Children.Concat