Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/IllustrationPointChildProperty.cs =================================================================== diff -u -rb4d70f02478eef8064cdfb381f99fc2b14e69343 -reea09a6357b41d9773a802b22f921817fda018ef --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/IllustrationPointChildProperty.cs (.../IllustrationPointChildProperty.cs) (revision b4d70f02478eef8064cdfb381f99fc2b14e69343) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/IllustrationPointChildProperty.cs (.../IllustrationPointChildProperty.cs) (revision eea09a6357b41d9773a802b22f921817fda018ef) @@ -33,9 +33,11 @@ using Ringtoets.Common.Forms.Properties; using Ringtoets.Common.Forms.TypeConverters; -namespace Ringtoets.Common.Forms.PropertyClasses { +namespace Ringtoets.Common.Forms.PropertyClasses +{ [TypeConverter(typeof(ExpandableObjectConverter))] - public class IllustrationPointChildProperty : ObjectProperties { + public class IllustrationPointChildProperty : ObjectProperties + { /// /// Creates a new instance of . /// @@ -126,13 +128,7 @@ if (subMechanism != null) { points.Add(new SubMechanismIllustrationPointChildProperty(illustrationPointNode, WindDirection)); - continue; } - - // If type is not supported, throw exception (currently not possible, safeguard for future) - throw new NotSupportedException("IllustrationPointNode is not of a supported type (FaultTree/SubMechanism)"); - - } return points.ToArray(); } Fisheye: Tag eea09a6357b41d9773a802b22f921817fda018ef refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/IllustrationPointProperty.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresOutputProperties.cs =================================================================== diff -u -r83c091ef77a14dc5b4116c628876f49243544aba -reea09a6357b41d9773a802b22f921817fda018ef --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresOutputProperties.cs (.../StructuresOutputProperties.cs) (revision 83c091ef77a14dc5b4116c628876f49243544aba) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresOutputProperties.cs (.../StructuresOutputProperties.cs) (revision eea09a6357b41d9773a802b22f921817fda018ef) @@ -21,10 +21,13 @@ using System; using System.ComponentModel; +using System.Linq; using Core.Common.Base.Data; using Core.Common.Gui.Attributes; +using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; +using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.Properties; @@ -51,19 +54,64 @@ Data = structuresOutput; } + [ReadOnly(true)] [DynamicVisible] - [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_IllustrationPoints))] - [ResourcesDisplayName(typeof(Resources), nameof(Resources.Categories_IllustrationPoints))] - [Description("")] - public IllustrationPointProperty IllustrationPointProperty + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_GoverningWindDirection_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_GoverningWindDirection_Description))] + public string WindDirection { get { - return new IllustrationPointProperty(data.GeneralResult); + return data.GeneralResult.GoverningWindDirection.Name; } } + [ReadOnly(true)] + [DynamicVisible] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_AlphaValues_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_AlphaValues_Description))] + [TypeConverter(typeof(KeyValueExpandableArrayConverter))] + [KeyValueElement(nameof(Stochast.Name), nameof(Stochast.Alpha))] + public Stochast[] AlphaValues + { + get + { + return data.GeneralResult.Stochasts.ToArray(); + } + } + + [ReadOnly(true)] + [DynamicVisible] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Durations_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Durations_Description))] + [TypeConverter(typeof(KeyValueExpandableArrayConverter))] + [KeyValueElement(nameof(Stochast.Name), nameof(Stochast.Duration))] + public Stochast[] Durations + { + get + { + return data.GeneralResult.Stochasts.ToArray(); + } + } + + [ReadOnly(true)] + [DynamicVisible] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.IllustrationPointProperty_IllustrationPoints_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.IllustrationPointProperty_IllustrationPoints_Description))] + [TypeConverter(typeof(ExpandableArrayConverter))] + [KeyValueElement(nameof(FaultTreeIllustrationPointBaseProperty.WindDirection), "")] + public FaultTreeIllustrationPointBaseProperty[] IllustrationPoints + { + get + { + return data.GeneralResult.TopLevelIllustrationPoints.Select(point => new FaultTreeIllustrationPointBaseProperty(point)).ToArray(); + } + } + [PropertyOrder(1)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Result))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.ProbabilityAssessmentOutput_RequiredProbability_Displayname))] @@ -127,7 +175,15 @@ [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { - return propertyName == "IllustrationPointProperty" && data.HasGeneralResult; + if (propertyName == "WindDirection" || + propertyName == "AlphaValues" || + propertyName == "Durations" || + propertyName == "IllustrationPoints") + { + return data.HasGeneralResult; + } + + return false; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -r83c091ef77a14dc5b4116c628876f49243544aba -reea09a6357b41d9773a802b22f921817fda018ef --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 83c091ef77a14dc5b4116c628876f49243544aba) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision eea09a6357b41d9773a802b22f921817fda018ef) @@ -88,7 +88,6 @@ - Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FaultTreeIllustrationPointChildPropertyTest.cs =================================================================== diff -u -r83c091ef77a14dc5b4116c628876f49243544aba -reea09a6357b41d9773a802b22f921817fda018ef --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FaultTreeIllustrationPointChildPropertyTest.cs (.../FaultTreeIllustrationPointChildPropertyTest.cs) (revision 83c091ef77a14dc5b4116c628876f49243544aba) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FaultTreeIllustrationPointChildPropertyTest.cs (.../FaultTreeIllustrationPointChildPropertyTest.cs) (revision eea09a6357b41d9773a802b22f921817fda018ef) @@ -51,9 +51,13 @@ // Setup var illustrationPointNode = new IllustrationPointNode(new FaultTreeIllustrationPoint("N", 1.5, new Stochast[0], CombinationType.And)); var illustrationPointNodeChild = new IllustrationPointNode(new FaultTreeIllustrationPoint("N", 3.5, new Stochast[0], CombinationType.Or)); - var illustrationPointNodeChildren = new[] { illustrationPointNodeChild, illustrationPointNodeChild }; + var illustrationPointNodeChildren = new[] + { + illustrationPointNodeChild, + illustrationPointNodeChild + }; illustrationPointNode.SetChildren(illustrationPointNodeChildren); - + // Call var faultTree = new FaultTreeIllustrationPointChildProperty(illustrationPointNode, "N"); @@ -77,7 +81,6 @@ Assert.AreEqual(faultTree.IllustrationPoints[0].CalculatedProbability, StatisticsConverter.ReliabilityToProbability(3.5)); Assert.AreEqual(faultTree.IllustrationPoints[0].Reliability, 3.5); Assert.AreEqual(faultTree.IllustrationPoints[0].IllustrationPoints.Length, 0); - } [Test] @@ -91,8 +94,6 @@ // Assert Assert.AreEqual(toString, "N"); - } - } } \ No newline at end of file Fisheye: Tag eea09a6357b41d9773a802b22f921817fda018ef refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/IllustrationPointPropertyTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresOutputPropertiesTest.cs =================================================================== diff -u -r83c091ef77a14dc5b4116c628876f49243544aba -reea09a6357b41d9773a802b22f921817fda018ef --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresOutputPropertiesTest.cs (.../StructuresOutputPropertiesTest.cs) (revision 83c091ef77a14dc5b4116c628876f49243544aba) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresOutputPropertiesTest.cs (.../StructuresOutputPropertiesTest.cs) (revision eea09a6357b41d9773a802b22f921817fda018ef) @@ -20,10 +20,12 @@ // All rights reserved. using System; +using System.Collections.Generic; using System.ComponentModel; using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; @@ -41,7 +43,10 @@ private const int probabilityPropertyIndex = 2; private const int reliabilityPropertyIndex = 3; private const int factorOfSafetyPropertyIndex = 4; - private const int illustrationPointPropertyIndex = 5; + private const int windDirectionPropertyIndex = 5; + private const int alphaValuesPropertyIndex = 6; + private const int durationsPropertyIndex = 7; + private const int illustrationPointsPropertyIndex = 8; [Test] public void Constructor_ExpectedValues() @@ -84,8 +89,13 @@ probability, reliability, factorOfSafety); - var generalResult = new TestGeneralResultFaultTreeIllustrationPoint(); - var structuresOutput = new StructuresOutput(probabilityAssessmentOutput); + var topLevelFaultTreeIllustrationPoint = new TopLevelFaultTreeIllustrationPoint(new WindDirection("SSE", 5.0), "closing situation", new IllustrationPointNode(new TestIllustrationPoint())); + + var expectedFaultTreeIllustrationPointBaseProperty = new[] + { + new FaultTreeIllustrationPointBaseProperty(topLevelFaultTreeIllustrationPoint) + }; + var generalResult = new GeneralResult(new WindDirection("SSE", 5.0), new Stochast[0], new List { topLevelFaultTreeIllustrationPoint }); var structuresOutput = new StructuresOutput(probabilityAssessmentOutput); structuresOutput.SetGeneralResult(generalResult); // Call @@ -97,15 +107,21 @@ Assert.AreEqual(ProbabilityFormattingHelper.Format(probability), properties.Probability); Assert.AreEqual(reliability, properties.Reliability, properties.Reliability.GetAccuracy()); Assert.AreEqual(factorOfSafety, properties.FactorOfSafety, properties.FactorOfSafety.GetAccuracy()); - Assert.IsNotNull(properties.IllustrationPointProperty); - Assert.AreEqual("SSE", properties.IllustrationPointProperty.WindDirection); - Assert.AreEqual(0, properties.IllustrationPointProperty.IllustrationPoints.Length); + Assert.AreEqual("SSE", properties.WindDirection); + Assert.IsEmpty(properties.AlphaValues); + Assert.IsEmpty(properties.Durations); + Assert.AreEqual(expectedFaultTreeIllustrationPointBaseProperty[0].WindDirection, properties.IllustrationPoints[0].WindDirection); + Assert.AreEqual(expectedFaultTreeIllustrationPointBaseProperty[0].Reliability, properties.IllustrationPoints[0].Reliability); + Assert.AreEqual(expectedFaultTreeIllustrationPointBaseProperty[0].CalculatedProbability, properties.IllustrationPoints[0].CalculatedProbability); + Assert.AreEqual(expectedFaultTreeIllustrationPointBaseProperty[0].ClosingSituation, properties.IllustrationPoints[0].ClosingSituation); + Assert.AreEqual(expectedFaultTreeIllustrationPointBaseProperty[0].IllustrationPoints, properties.IllustrationPoints[0].IllustrationPoints); } [Test] public void Constructor_HasGeneralResult_PropertiesHaveExpectedAttributesValues() { // Setup + const string illustrationPointsCategoryName = "Illustratiepunten"; var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN); var generalResult = new TestGeneralResultFaultTreeIllustrationPoint(); var structuresOutput = new StructuresOutput(probabilityAssessmentOutput); @@ -116,7 +132,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(9, dynamicProperties.Count); PropertyDescriptor requiredProbabilityProperty = dynamicProperties[requiredProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredProbabilityProperty, @@ -153,10 +169,31 @@ "De veiligheidsfactor voor deze berekening.", true); - PropertyDescriptor illustrationPointProperty = dynamicProperties[illustrationPointPropertyIndex]; + PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, + illustrationPointsCategoryName, + "Maatgevende windrichting", + "De windrichting waarvoor de berekende betrouwbaarheidsindex het laagst is.", + true); + + PropertyDescriptor alphaValuesProperty = dynamicProperties[alphaValuesPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphaValuesProperty, + illustrationPointsCategoryName, + "Alfa's [-]", + "Berekende invloedscoƫfficiƫnten voor alle beschouwde stochasten.", + true); + + PropertyDescriptor durationsProperty = dynamicProperties[durationsPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, + illustrationPointsCategoryName, + "Tijdsduren [min]", + "Tijdsduren waarop de stochasten betrekking hebben.", + true); + + PropertyDescriptor illustrationPointProperty = dynamicProperties[illustrationPointsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(illustrationPointProperty, + illustrationPointsCategoryName, "Illustratiepunten", - "Illustratiepunten", "", true); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -r83c091ef77a14dc5b4116c628876f49243544aba -reea09a6357b41d9773a802b22f921817fda018ef --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 83c091ef77a14dc5b4116c628876f49243544aba) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision eea09a6357b41d9773a802b22f921817fda018ef) @@ -93,7 +93,6 @@ -