Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Riskeer.MacroStabilityInwards.Forms.csproj =================================================================== diff -u -r1930606f48c2c45ef891fe6e249f9f3924cf3d63 -rd5e6ce84ede6a47f1c90052b1a9f55aedb5e2359 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Riskeer.MacroStabilityInwards.Forms.csproj (.../Riskeer.MacroStabilityInwards.Forms.csproj) (revision 1930606f48c2c45ef891fe6e249f9f3924cf3d63) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Riskeer.MacroStabilityInwards.Forms.csproj (.../Riskeer.MacroStabilityInwards.Forms.csproj) (revision d5e6ce84ede6a47f1c90052b1a9f55aedb5e2359) @@ -36,6 +36,9 @@ True Resources.resx + + UserControl + Fisheye: Tag 6ad9537639f36cc0eaa651730b43c774b3ac3d7f refers to a dead (removed) revision in file `Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosView.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosView.cs =================================================================== diff -u -rb2effabadc11d9de1195ecde3103cb33becbb1c2 -rd5e6ce84ede6a47f1c90052b1a9f55aedb5e2359 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosView.cs (.../MacroStabilityInwardsScenariosView.cs) (revision b2effabadc11d9de1195ecde3103cb33becbb1c2) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosView.cs (.../MacroStabilityInwardsScenariosView.cs) (revision d5e6ce84ede6a47f1c90052b1a9f55aedb5e2359) @@ -18,23 +18,18 @@ // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. - using System; -using System.Collections.Generic; -using System.Linq; -using Core.Common.Base.Geometry; +using System.Windows.Forms; +using Core.Common.Controls.Views; using Riskeer.Common.Data.Calculation; -using Riskeer.Common.Data.FailureMechanism; -using Riskeer.Common.Forms.Views; using Riskeer.MacroStabilityInwards.Data; -using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.MacroStabilityInwards.Forms.Views { /// /// View for configuring macrostability inwards calculation scenarios. /// - public class MacroStabilityInwardsScenariosView : ScenariosView + public partial class MacroStabilityInwardsScenariosView : UserControl, IView { /// /// Creates a new instance of . @@ -45,48 +40,20 @@ /// to get the sections from. /// Thrown when any parameter is null. public MacroStabilityInwardsScenariosView(CalculationGroup calculationGroup, MacroStabilityInwardsFailureMechanism failureMechanism) - : base(calculationGroup, failureMechanism) {} - - protected override MacroStabilityInwardsInput GetCalculationInput(MacroStabilityInwardsCalculationScenario calculationScenario) { - return calculationScenario.InputParameters; - } + if (calculationGroup == null) + { + throw new ArgumentNullException(nameof(calculationGroup)); + } - protected override IEnumerable GetScenarioRows(FailureMechanismSection failureMechanismSection) - { - IEnumerable lineSegments = Math2D.ConvertPointsToLineSegments(failureMechanismSection.Points); - IEnumerable calculations = CalculationGroup - .GetCalculations() - .OfType() - .Where(pc => pc.IsSurfaceLineIntersectionWithReferenceLineInSection(lineSegments)); + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } - MacroStabilityInwardsScenarioConfigurationPerFailureMechanismSection sectionConfiguration = - FailureMechanism.ScenarioConfigurationsPerFailureMechanismSection.Single(c => ReferenceEquals(c.Section, failureMechanismSection)); - return calculations.Select(pc => new MacroStabilityInwardsScenarioRow(pc, FailureMechanism, sectionConfiguration)).ToList(); + InitializeComponent(); } - protected override void InitializeDataGridView() - { - DataGridViewControl.AddCheckBoxColumn( - nameof(MacroStabilityInwardsScenarioRow.IsRelevant), - RiskeerCommonFormsResources.ScenarioView_InitializeDataGridView_In_final_rating - ); - DataGridViewControl.AddTextBoxColumn( - nameof(MacroStabilityInwardsScenarioRow.Contribution), - RiskeerCommonFormsResources.ScenarioView_InitializeDataGridView_Contribution - ); - DataGridViewControl.AddTextBoxColumn( - nameof(MacroStabilityInwardsScenarioRow.Name), - RiskeerCommonFormsResources.ScenarioView_Name_DisplayName - ); - DataGridViewControl.AddTextBoxColumn( - nameof(MacroStabilityInwardsScenarioRow.FailureProbability), - RiskeerCommonFormsResources.ScenarioView_ProfileFailureProbability_DisplayName - ); - DataGridViewControl.AddTextBoxColumn( - nameof(MacroStabilityInwardsScenarioRow.SectionFailureProbability), - RiskeerCommonFormsResources.ScenarioView_SectionFailureProbability_DisplayName - ); - } + public object Data { get; set; } } } \ No newline at end of file Fisheye: Tag 6ad9537639f36cc0eaa651730b43c774b3ac3d7f refers to a dead (removed) revision in file `Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosView.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosViewOld.cs =================================================================== diff -u --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosViewOld.cs (revision 0) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsScenariosViewOld.cs (revision d5e6ce84ede6a47f1c90052b1a9f55aedb5e2359) @@ -0,0 +1,92 @@ +// Copyright (C) Stichting Deltares and State of the Netherlands 2023. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Geometry; +using Riskeer.Common.Data.Calculation; +using Riskeer.Common.Data.FailureMechanism; +using Riskeer.Common.Forms.Views; +using Riskeer.MacroStabilityInwards.Data; +using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; + +namespace Riskeer.MacroStabilityInwards.Forms.Views +{ + /// + /// View for configuring macrostability inwards calculation scenarios. + /// + public class MacroStabilityInwardsScenariosViewOld : ScenariosView + { + /// + /// Creates a new instance of . + /// + /// The + /// to get the calculations from. + /// The + /// to get the sections from. + /// Thrown when any parameter is null. + public MacroStabilityInwardsScenariosViewOld(CalculationGroup calculationGroup, MacroStabilityInwardsFailureMechanism failureMechanism) + : base(calculationGroup, failureMechanism) {} + + protected override MacroStabilityInwardsInput GetCalculationInput(MacroStabilityInwardsCalculationScenario calculationScenario) + { + return calculationScenario.InputParameters; + } + + protected override IEnumerable GetScenarioRows(FailureMechanismSection failureMechanismSection) + { + IEnumerable lineSegments = Math2D.ConvertPointsToLineSegments(failureMechanismSection.Points); + IEnumerable calculations = CalculationGroup + .GetCalculations() + .OfType() + .Where(pc => pc.IsSurfaceLineIntersectionWithReferenceLineInSection(lineSegments)); + + MacroStabilityInwardsScenarioConfigurationPerFailureMechanismSection sectionConfiguration = + FailureMechanism.ScenarioConfigurationsPerFailureMechanismSection.Single(c => ReferenceEquals(c.Section, failureMechanismSection)); + return calculations.Select(pc => new MacroStabilityInwardsScenarioRow(pc, FailureMechanism, sectionConfiguration)).ToList(); + } + + protected override void InitializeDataGridView() + { + DataGridViewControl.AddCheckBoxColumn( + nameof(MacroStabilityInwardsScenarioRow.IsRelevant), + RiskeerCommonFormsResources.ScenarioView_InitializeDataGridView_In_final_rating + ); + DataGridViewControl.AddTextBoxColumn( + nameof(MacroStabilityInwardsScenarioRow.Contribution), + RiskeerCommonFormsResources.ScenarioView_InitializeDataGridView_Contribution + ); + DataGridViewControl.AddTextBoxColumn( + nameof(MacroStabilityInwardsScenarioRow.Name), + RiskeerCommonFormsResources.ScenarioView_Name_DisplayName + ); + DataGridViewControl.AddTextBoxColumn( + nameof(MacroStabilityInwardsScenarioRow.FailureProbability), + RiskeerCommonFormsResources.ScenarioView_ProfileFailureProbability_DisplayName + ); + DataGridViewControl.AddTextBoxColumn( + nameof(MacroStabilityInwardsScenarioRow.SectionFailureProbability), + RiskeerCommonFormsResources.ScenarioView_SectionFailureProbability_DisplayName + ); + } + } +} \ No newline at end of file