Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs
===================================================================
diff -u -rd26a556cd48a6494079d88774977215ee2177274 -re390f6a1553c21ed32ebf3426f35cc0924a9900c
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision d26a556cd48a6494079d88774977215ee2177274)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision e390f6a1553c21ed32ebf3426f35cc0924a9900c)
@@ -132,7 +132,7 @@
#endregion
- private bool ValidProbabilityValue(double probability)
+ private static bool ValidProbabilityValue(double probability)
{
return !double.IsNaN(probability) && probability <= 1 && probability >= 0;
}
@@ -402,7 +402,7 @@
{
UseForeshore = false;
UseBreakWater = false;
- BreakWater = null;
+ BreakWater = GetDefaultBreakWater();
}
else
{
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -ra2c7b86519fdc614e1156b67ace16b5c9f265520 -re390f6a1553c21ed32ebf3426f35cc0924a9900c
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a2c7b86519fdc614e1156b67ace16b5c9f265520)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e390f6a1553c21ed32ebf3426f35cc0924a9900c)
@@ -82,6 +82,24 @@
}
///
+ /// Looks up a localized string similar to De afwijking van de golfrichting..
+ ///
+ public static string DeviationWaveDirection_Description {
+ get {
+ return ResourceManager.GetString("DeviationWaveDirection_Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Afwijking van de golfrichting [°].
+ ///
+ public static string DeviationWaveDirection_DisplayName {
+ get {
+ return ResourceManager.GetString("DeviationWaveDirection_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to De waarde voor de faalkans kon niet geïnterpreteerd worden als een getal..
///
public static string FailureProbabilityStructureWithErosion_Could_not_parse_string_to_double_value {
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Properties/Resources.resx
===================================================================
diff -u -ra2c7b86519fdc614e1156b67ace16b5c9f265520 -re390f6a1553c21ed32ebf3426f35cc0924a9900c
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Properties/Resources.resx (.../Resources.resx) (revision a2c7b86519fdc614e1156b67ace16b5c9f265520)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Properties/Resources.resx (.../Resources.resx) (revision e390f6a1553c21ed32ebf3426f35cc0924a9900c)
@@ -186,4 +186,10 @@
Selecteer kunstwerken
+
+ De afwijking van de golfrichting.
+
+
+ Afwijking van de golfrichting [°]
+
\ No newline at end of file
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresInputContextProperties.cs
===================================================================
diff -u -ra2c7b86519fdc614e1156b67ace16b5c9f265520 -re390f6a1553c21ed32ebf3426f35cc0924a9900c
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresInputContextProperties.cs (.../HeightStructuresInputContextProperties.cs) (revision a2c7b86519fdc614e1156b67ace16b5c9f265520)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresInputContextProperties.cs (.../HeightStructuresInputContextProperties.cs) (revision e390f6a1553c21ed32ebf3426f35cc0924a9900c)
@@ -62,6 +62,7 @@
private const int modelFactorSuperCriticalFlowPropertyIndex = 14;
private const int hydraulicBoundaryLocationPropertyIndex = 15;
private const int stormDurationPropertyIndex = 16;
+ private const int deviationWaveDirectionPropertyIndex = 17;
#region Model settings
@@ -377,6 +378,23 @@
}
}
+ [PropertyOrder(deviationWaveDirectionPropertyIndex)]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_HydraulicData")]
+ [ResourcesDisplayName(typeof(Resources), "DeviationWaveDirection_DisplayName")]
+ [ResourcesDescription(typeof(Resources), "DeviationWaveDirection_Description")]
+ public RoundedDouble DeviationWaveDirection
+ {
+ get
+ {
+ return data.WrappedData.DeviationWaveDirection;
+ }
+ set
+ {
+ data.WrappedData.DeviationWaveDirection = value;
+ data.WrappedData.NotifyObservers();
+ }
+ }
+
#endregion
}
}
\ No newline at end of file
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs
===================================================================
diff -u -r655bf07f2f48502ad49bb0980514db70dbe71704 -re390f6a1553c21ed32ebf3426f35cc0924a9900c
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 655bf07f2f48502ad49bb0980514db70dbe71704)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision e390f6a1553c21ed32ebf3426f35cc0924a9900c)
@@ -492,8 +492,10 @@
Assert.IsNull(input.ForeshoreProfile);
Assert.IsFalse(input.UseForeshore);
- Assert.IsNull(input.BreakWater);
Assert.IsFalse(input.UseBreakWater);
+ BreakWater breakWater = GetDefaultBreakWater();
+ Assert.AreEqual(breakWater.Type, input.BreakWater.Type);
+ AssertAreEqual(breakWater.Height, input.BreakWater.Height);
}
else
{
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs
===================================================================
diff -u -ra2c7b86519fdc614e1156b67ace16b5c9f265520 -re390f6a1553c21ed32ebf3426f35cc0924a9900c
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision a2c7b86519fdc614e1156b67ace16b5c9f265520)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision e390f6a1553c21ed32ebf3426f35cc0924a9900c)
@@ -33,6 +33,7 @@
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.Data.Probabilistics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.Helpers;
using Ringtoets.Common.Forms.PropertyClasses;
using Ringtoets.HeightStructures.Data;
@@ -63,6 +64,7 @@
private const int modelFactorSuperCriticalFlowPropertyIndex = 13;
private const int hydraulicBoundaryLocationPropertyIndex = 14;
private const int stormDurationPropertyIndex = 15;
+ private const int deviationWaveDirectionPropertyIndex = 16;
private MockRepository mockRepository;
@@ -165,6 +167,8 @@
};
AssertLogNormalDistributionVariationProperties(stormDurationProperties, properties.StormDuration);
+ Assert.AreEqual(input.DeviationWaveDirection, properties.DeviationWaveDirection);
+
mockRepository.VerifyAll();
}
@@ -257,6 +261,8 @@
};
AssertLogNormalDistributionVariationProperties(stormDurationProperties, properties.StormDuration);
+ Assert.AreEqual(input.DeviationWaveDirection, properties.DeviationWaveDirection);
+
mockRepository.VerifyAll();
}
@@ -265,7 +271,7 @@
{
// Setup
var observerMock = mockRepository.StrictMock();
- const int numberProperties = 5;
+ const int numberProperties = 6;
observerMock.Expect(o => o.UpdateObserver()).Repeat.Times(numberProperties);
var hydraulicBoundaryLocation = CreateValidHydraulicBoundaryLocation();
var assessmentSectionMock = mockRepository.Stub();
@@ -283,24 +289,29 @@
};
var random = new Random(100);
- var newStructureNormalOrientation = new RoundedDouble(2, random.NextDouble());
+ double newStructureNormalOrientation = random.NextDouble();
HeightStructure newHeightStructure = CreateValidHeightStructure();
ForeshoreProfile newForeshoreProfile = CreateValidForeshoreProfile();
+ double newDeviationWaveDirection = random.NextDouble();
// Call
properties.HeightStructure = newHeightStructure;
- properties.StructureNormalOrientation = newStructureNormalOrientation;
+ properties.StructureNormalOrientation = (RoundedDouble) newStructureNormalOrientation;
properties.FailureProbabilityStructureWithErosion = "1e-2";
properties.HydraulicBoundaryLocation = hydraulicBoundaryLocation;
properties.ForeshoreProfile = newForeshoreProfile;
+ properties.DeviationWaveDirection = (RoundedDouble) newDeviationWaveDirection;
// Assert
Assert.AreSame(newHeightStructure, properties.HeightStructure);
- Assert.AreEqual(newStructureNormalOrientation, properties.StructureNormalOrientation);
+ Assert.AreEqual(newStructureNormalOrientation, properties.StructureNormalOrientation,
+ properties.StructureNormalOrientation.GetAccuracy());
Assert.AreEqual(0.01, input.FailureProbabilityStructureWithErosion);
Assert.AreEqual("1/100", properties.FailureProbabilityStructureWithErosion);
Assert.AreSame(hydraulicBoundaryLocation, properties.HydraulicBoundaryLocation);
Assert.AreSame(newForeshoreProfile, properties.ForeshoreProfile);
+ Assert.AreEqual(newDeviationWaveDirection, properties.DeviationWaveDirection,
+ properties.DeviationWaveDirection.GetAccuracy());
mockRepository.VerifyAll();
}
@@ -411,7 +422,7 @@
{
new BrowsableAttribute(true)
});
- Assert.AreEqual(16, dynamicProperties.Count);
+ Assert.AreEqual(17, dynamicProperties.Count);
PropertyDescriptor heightStructureProperty = dynamicProperties[heightStructurePropertyIndex];
Assert.IsFalse(heightStructureProperty.IsReadOnly);
@@ -511,6 +522,11 @@
Assert.AreEqual("Stormduur [uur]", stormDurationProperty.DisplayName);
Assert.AreEqual("De duur van de storm.", stormDurationProperty.Description);
+ PropertyDescriptor deviationWaveDirectionProperty = dynamicProperties[deviationWaveDirectionPropertyIndex];
+ Assert.AreEqual("Hydraulische gegevens", deviationWaveDirectionProperty.Category);
+ Assert.AreEqual("Afwijking van de golfrichting [°]", deviationWaveDirectionProperty.DisplayName);
+ Assert.AreEqual("De afwijking van de golfrichting.", deviationWaveDirectionProperty.Description);
+
mockRepository.VerifyAll();
}