Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -rdc2c591a6e3796a05d1bbb7f9a4b3d64a977bc30 -rf92e96460e30bba4a1f1cdc9a3c3d6ac51c8b959 --- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision dc2c591a6e3796a05d1bbb7f9a4b3d64a977bc30) +++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision f92e96460e30bba4a1f1cdc9a3c3d6ac51c8b959) @@ -56,6 +56,7 @@ private readonly IEnumerable> calculationScenarios; private readonly ClosingStructuresFailureMechanism failureMechanism; private readonly IAssessmentSection assessmentSection; + private FailureMechanismSectionAssemblyCategoryGroup simpleAssemblyCategoryGroup; private FailureMechanismSectionAssemblyCategoryGroup detailedAssemblyCategoryGroup; private FailureMechanismSectionAssemblyCategoryGroup tailorMadeAssemblyCategoryGroup; Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -rf92e96460e30bba4a1f1cdc9a3c3d6ac51c8b959 --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs (.../StabilityPointStructuresFailureMechanismResultView.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs (.../StabilityPointStructuresFailureMechanismResultView.cs) (revision f92e96460e30bba4a1f1cdc9a3c3d6ac51c8b959) @@ -98,6 +98,7 @@ { return new StabilityPointStructuresFailureMechanismSectionResultRow( sectionResult, + FailureMechanism.Calculations.Cast>(), FailureMechanism, assessmentSection, new StabilityPointStructuresFailureMechanismSectionResultRow.ConstructionProperties Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r28b6108a15ec0f8f224dcd71ffbea353f639d053 -rf92e96460e30bba4a1f1cdc9a3c3d6ac51c8b959 --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision 28b6108a15ec0f8f224dcd71ffbea353f639d053) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision f92e96460e30bba4a1f1cdc9a3c3d6ac51c8b959) @@ -20,11 +20,14 @@ // All rights reserved. using System; +using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using Core.Common.Controls.DataGrid; using Riskeer.AssemblyTool.Data; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.Exceptions; +using Riskeer.Common.Data.Structures; using Riskeer.Common.Forms.Helpers; using Riskeer.Common.Forms.TypeConverters; using Riskeer.Common.Forms.Views; @@ -51,6 +54,7 @@ private readonly int combinedAssemblyProbabilityIndex; private readonly int manualAssemblyProbabilityIndex; + private readonly IEnumerable> calculationScenarios; private readonly StabilityPointStructuresFailureMechanism failureMechanism; private readonly IAssessmentSection assessmentSection; @@ -64,6 +68,7 @@ /// /// The to wrap /// so that it can be displayed as a row. + /// All calculation scenarios in the failure mechanism. /// The failure mechanism the result belongs to. /// The assessment section the result belongs to. /// /// The property values required to create an instance of @@ -72,11 +77,17 @@ /// Thrown when /// is a valid value, but unsupported. internal StabilityPointStructuresFailureMechanismSectionResultRow(StabilityPointStructuresFailureMechanismSectionResult sectionResult, + IEnumerable> calculationScenarios, StabilityPointStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection, ConstructionProperties constructionProperties) : base(sectionResult) { + if (calculationScenarios == null) + { + throw new ArgumentNullException(nameof(calculationScenarios)); + } + if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); @@ -92,6 +103,7 @@ throw new ArgumentNullException(nameof(constructionProperties)); } + this.calculationScenarios = calculationScenarios; this.failureMechanism = failureMechanism; this.assessmentSection = assessmentSection; @@ -119,10 +131,7 @@ /// is a valid value, but unsupported. public SimpleAssessmentValidityOnlyResultType SimpleAssessmentResult { - get - { - return SectionResult.SimpleAssessmentResult; - } + get => SectionResult.SimpleAssessmentResult; set { SectionResult.SimpleAssessmentResult = value; @@ -137,10 +146,7 @@ /// is a valid value, but unsupported. public DetailedAssessmentProbabilityOnlyResultType DetailedAssessmentResult { - get - { - return SectionResult.DetailedAssessmentResult; - } + get => SectionResult.DetailedAssessmentResult; set { SectionResult.DetailedAssessmentResult = value; @@ -152,13 +158,7 @@ /// Gets the value representing the detailed assessment probability. /// [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] - public double DetailedAssessmentProbability - { - get - { - return SectionResult.GetDetailedAssessmentProbability(failureMechanism, assessmentSection); - } - } + public double DetailedAssessmentProbability => SectionResult.GetDetailedAssessmentProbability(calculationScenarios, failureMechanism, assessmentSection); /// /// Gets or sets the value representing the tailor made assessment result. @@ -167,10 +167,7 @@ /// is a valid value, but unsupported. public TailorMadeAssessmentProbabilityCalculationResultType TailorMadeAssessmentResult { - get - { - return SectionResult.TailorMadeAssessmentResult; - } + get => SectionResult.TailorMadeAssessmentResult; set { SectionResult.TailorMadeAssessmentResult = value; @@ -188,10 +185,7 @@ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] public double TailorMadeAssessmentProbability { - get - { - return SectionResult.TailorMadeAssessmentProbability; - } + get => SectionResult.TailorMadeAssessmentProbability; set { SectionResult.TailorMadeAssessmentProbability = value; @@ -202,46 +196,22 @@ /// /// Gets the simple assembly category group. /// - public string SimpleAssemblyCategoryGroup - { - get - { - return FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(simpleAssemblyCategoryGroup); - } - } + public string SimpleAssemblyCategoryGroup => FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(simpleAssemblyCategoryGroup); /// /// Gets the detailed assembly category group. /// - public string DetailedAssemblyCategoryGroup - { - get - { - return FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(detailedAssemblyCategoryGroup); - } - } + public string DetailedAssemblyCategoryGroup => FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(detailedAssemblyCategoryGroup); /// /// Gets the tailor made assembly category group. /// - public string TailorMadeAssemblyCategoryGroup - { - get - { - return FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(tailorMadeAssemblyCategoryGroup); - } - } + public string TailorMadeAssemblyCategoryGroup => FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(tailorMadeAssemblyCategoryGroup); /// /// Gets the combined assembly category group. /// - public string CombinedAssemblyCategoryGroup - { - get - { - return FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(combinedAssemblyCategoryGroup); - } - } + public string CombinedAssemblyCategoryGroup => FailureMechanismSectionAssemblyCategoryGroupHelper.GetCategoryGroupDisplayName(combinedAssemblyCategoryGroup); /// /// Gets the combined assembly probability. @@ -257,10 +227,7 @@ /// is a valid value, but unsupported. public bool UseManualAssembly { - get - { - return SectionResult.UseManualAssembly; - } + get => SectionResult.UseManualAssembly; set { SectionResult.UseManualAssembly = value; @@ -278,10 +245,7 @@ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] public double ManualAssemblyProbability { - get - { - return SectionResult.ManualAssemblyProbability; - } + get => SectionResult.ManualAssemblyProbability; set { SectionResult.ManualAssemblyProbability = value; @@ -306,9 +270,10 @@ } else { - ColumnStateDefinitions[detailedAssessmentProbabilityIndex].ErrorText = FailureMechanismSectionResultRowHelper.GetDetailedAssessmentError( - DetailedAssessmentProbability, - SectionResult.Calculation); + ColumnStateDefinitions[detailedAssessmentProbabilityIndex].ErrorText = FailureMechanismSectionResultRowHelper.GetDetailedAssessmentProbabilityError( + SectionResult.GetCalculationScenarios(calculationScenarios).ToArray(), + scenarios => SectionResult.GetTotalContribution(scenarios), + scenarios => SectionResult.GetDetailedAssessmentProbability(scenarios, failureMechanism, assessmentSection)); } } @@ -364,6 +329,7 @@ { detailedAssemblyCategoryGroup = StabilityPointStructuresFailureMechanismAssemblyFactory.AssembleDetailedAssessment( SectionResult, + calculationScenarios, failureMechanism, assessmentSection).Group; } @@ -397,6 +363,7 @@ FailureMechanismSectionAssembly combinedAssembly = StabilityPointStructuresFailureMechanismAssemblyFactory.AssembleCombinedAssessment( SectionResult, + calculationScenarios, failureMechanism, assessmentSection);