Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -ra6d8f7c8868a573cb4026770119c5f997039ca2a -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a6d8f7c8868a573cb4026770119c5f997039ca2a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -326,9 +326,9 @@ /// ///Wilt u doorgaan?. /// - public static string ReferenceLineReplacementHandler_Confirm_clear_referenceLine_dependent_data { + public static string ReferenceLineUpdateHandler_Confirm_clear_referenceLine_dependent_data { get { - return ResourceManager.GetString("ReferenceLineReplacementHandler_Confirm_clear_referenceLine_dependent_data", resourceCulture); + return ResourceManager.GetString("ReferenceLineUpdateHandler_Confirm_clear_referenceLine_dependent_data", resourceCulture); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx =================================================================== diff -u -ra6d8f7c8868a573cb4026770119c5f997039ca2a -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision a6d8f7c8868a573cb4026770119c5f997039ca2a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -130,7 +130,7 @@ ..\Resources\Foreshore.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + Na het importeren van een aangepaste ligging van de referentielijn zullen alle geïmporteerde en berekende gegevens van alle toetssporen worden gewist. Wilt u doorgaan? Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj =================================================================== diff -u -rfd01655060482fc2b2a49ca9661fb489ebdc1b80 -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision fd01655060482fc2b2a49ca9661fb489ebdc1b80) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -40,7 +40,7 @@ - + Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -raf799c0543365c3fce39a12d2662403b61611a0b -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision af799c0543365c3fce39a12d2662403b61611a0b) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -324,7 +324,7 @@ }; yield return new PropertyInfo { - CreateInstance = context => new MacroStabilityOutwardsFailureMechanismProperties(context.WrappedData) + CreateInstance = context => new MacroStabilityOutwardsFailureMechanismProperties(context.WrappedData, context.Parent) }; yield return new PropertyInfo { @@ -729,7 +729,7 @@ FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonIOResources.Shape_file_filter_Extension, RingtoetsCommonIOResources.Shape_file_filter_Description), CreateFileImporter = (context, filePath) => new ReferenceLineImporter(context.WrappedData, - new ReferenceLineReplacementHandler(Gui.ViewCommands), + new ReferenceLineUpdateHandler(context.AssessmentSection, Gui.ViewCommands), filePath) }; @@ -740,7 +740,7 @@ Image = RingtoetsCommonFormsResources.SectionsIcon, FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonIOResources.Shape_file_filter_Extension, RingtoetsCommonIOResources.Shape_file_filter_Description), - IsEnabled = context => context.AssessmentSection.ReferenceLine != null, + IsEnabled = context => HasGeometry(context.AssessmentSection.ReferenceLine), CreateFileImporter = (context, filePath) => new FailureMechanismSectionsImporter(context.WrappedData, context.AssessmentSection.ReferenceLine, filePath, @@ -761,7 +761,7 @@ Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = Resources.Foreshore, FileFilterGenerator = CreateForeshoreProfileFileFilterGenerator, - IsEnabled = context => context.ParentAssessmentSection.ReferenceLine != null, + IsEnabled = context => HasGeometry(context.ParentAssessmentSection.ReferenceLine), VerifyUpdates = context => VerifyForeshoreProfileUpdates(context, Resources.RingtoetsPlugin_VerifyForeshoreProfileUpdates_When_importing_ForeshoreProfile_definitions_assigned_to_calculations_output_will_be_cleared_confirm) }; } @@ -771,8 +771,8 @@ yield return new ExportInfo { Name = RingtoetsCommonDataResources.ReferenceLine_DisplayName, - CreateFileExporter = (context, filePath) => new ReferenceLineExporter(context.WrappedData.ReferenceLine, context.WrappedData.Id, filePath), - IsEnabled = context => context.WrappedData.ReferenceLine != null, + CreateFileExporter = (context, filePath) => new ReferenceLineExporter(context.WrappedData, context.AssessmentSection.Id, filePath), + IsEnabled = context => HasGeometry(context.AssessmentSection.ReferenceLine), FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonIOResources.Shape_file_filter_Extension, RingtoetsCommonIOResources.Shape_file_filter_Description) }; @@ -790,7 +790,7 @@ { Name = RingtoetsCommonFormsResources.AssemblyResult_DisplayName, CreateFileExporter = (context, filePath) => new AssemblyExporter(context.WrappedData, filePath), - IsEnabled = context => context.WrappedData.ReferenceLine != null, + IsEnabled = context => HasGeometry(context.WrappedData.ReferenceLine), FileFilterGenerator = new FileFilterGenerator(Resources.AssemblyResult_file_filter_Extension, RingtoetsCommonFormsResources.AssemblyResult_DisplayName) }; @@ -911,9 +911,9 @@ { Text = context => RingtoetsCommonDataResources.ReferenceLine_DisplayName, Image = context => RingtoetsCommonFormsResources.ReferenceLineIcon, - ForeColor = context => context.WrappedData.ReferenceLine == null - ? Color.FromKnownColor(KnownColor.GrayText) - : Color.FromKnownColor(KnownColor.ControlText), + ForeColor = context => HasGeometry(context.WrappedData) + ? Color.FromKnownColor(KnownColor.ControlText) + : Color.FromKnownColor(KnownColor.GrayText), ContextMenuStrip = ReferenceLineContextMenuStrip }; @@ -1292,6 +1292,11 @@ } } + private static bool HasGeometry(ReferenceLine referenceLine) + { + return referenceLine.Points.Any(); + } + #region PropertyInfos private static TopLevelFaultTreeIllustrationPointProperties CreateTopLevelFaultTreeIllustrationPointProperties(SelectedTopLevelFaultTreeIllustrationPoint point) @@ -1674,7 +1679,7 @@ { var childNodes = new List { - new ReferenceLineContext(nodeData), + new ReferenceLineContext(nodeData.ReferenceLine, nodeData), new NormContext(nodeData.FailureMechanismContribution, nodeData), new FailureMechanismContributionContext(nodeData.FailureMechanismContribution, nodeData), new HydraulicBoundaryDatabaseContext(nodeData.HydraulicBoundaryDatabase, nodeData), @@ -1897,7 +1902,7 @@ { new MacroStabilityOutwardsAssemblyCategoriesContext(nodeData, assessmentSection, - () => probabilityAssessmentInput.GetN(probabilityAssessmentInput.SectionLength)), + () => probabilityAssessmentInput.GetN(assessmentSection.ReferenceLine.Length)), new ProbabilityFailureMechanismSectionResultContext( nodeData.SectionResults, nodeData, assessmentSection), nodeData.OutputComments Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs =================================================================== diff -u -r2d600c4298c8c2529ca85e789bc25401efb069f2 -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision 2d600c4298c8c2529ca85e789bc25401efb069f2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -102,10 +102,11 @@ AssertExpectedContributions(composition, assessmentSection); - Assert.IsTrue(assessmentSection.BackgroundData.IsVisible); - Assert.AreEqual(0.0, assessmentSection.BackgroundData.Transparency.Value); - Assert.AreEqual("Bing Maps - Satelliet", assessmentSection.BackgroundData.Name); - var configuration = (WellKnownBackgroundDataConfiguration) assessmentSection.BackgroundData.Configuration; + BackgroundData backgroundData = assessmentSection.BackgroundData; + Assert.IsTrue(backgroundData.IsVisible); + Assert.AreEqual(0.60, backgroundData.Transparency, backgroundData.Transparency.GetAccuracy()); + Assert.AreEqual("Bing Maps - Satelliet", backgroundData.Name); + var configuration = (WellKnownBackgroundDataConfiguration) backgroundData.Configuration; Assert.AreEqual(RingtoetsWellKnownTileSource.BingAerial, configuration.WellKnownTileSource); CollectionAssert.IsEmpty(assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Factories/AssessmentSectionAssemblyMapDataFeaturesFactoryTest.cs =================================================================== diff -u -r3bd5f8c871f1b16716a1946a30cc1e069bcac143 -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Factories/AssessmentSectionAssemblyMapDataFeaturesFactoryTest.cs (.../AssessmentSectionAssemblyMapDataFeaturesFactoryTest.cs) (revision 3bd5f8c871f1b16716a1946a30cc1e069bcac143) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Factories/AssessmentSectionAssemblyMapDataFeaturesFactoryTest.cs (.../AssessmentSectionAssemblyMapDataFeaturesFactoryTest.cs) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -62,16 +62,13 @@ { // Setup var random = new Random(21); - var referenceLine = new ReferenceLine(); - referenceLine.SetGeometry(new[] + + var assessmentSection = new AssessmentSection(random.NextEnumValue()); + assessmentSection.ReferenceLine.SetGeometry(new[] { new Point2D(0, 0), new Point2D(2, 2) }); - var assessmentSection = new AssessmentSection(random.NextEnumValue()) - { - ReferenceLine = referenceLine - }; using (new AssemblyToolCalculatorFactoryConfig()) { @@ -141,16 +138,13 @@ { // Setup var random = new Random(21); - var referenceLine = new ReferenceLine(); - referenceLine.SetGeometry(new[] + + var assessmentSection = new AssessmentSection(random.NextEnumValue()); + assessmentSection.ReferenceLine.SetGeometry(new[] { new Point2D(0, 0), new Point2D(2, 2) }); - var assessmentSection = new AssessmentSection(random.NextEnumValue()) - { - ReferenceLine = referenceLine - }; using (new AssemblyToolCalculatorFactoryConfig()) { Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs =================================================================== diff -u -refb5a7db973f4a0e5b5f0532a594d7fa14159f41 -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision efb5a7db973f4a0e5b5f0532a594d7fa14159f41) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -129,15 +129,13 @@ { // Setup var random = new Random(21); - var referenceLine = new ReferenceLine(); - referenceLine.SetGeometry(new[] + + AssessmentSection assessmentSection = CreateAssessmentSection(); + assessmentSection.ReferenceLine.SetGeometry(new[] { new Point2D(1.0, 2.0), new Point2D(2.0, 1.0) }); - - AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.ReferenceLine = referenceLine; assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] { new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) @@ -267,7 +265,11 @@ }); var assessmentSection = new AssessmentSection(new Random(21).NextEnumValue()); - assessmentSection.ReferenceLine = referenceLine; + assessmentSection.ReferenceLine.SetGeometry(new[] + { + new Point2D(1.0, 2.0), + new Point2D(2.0, 1.0) + }); using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) { @@ -409,16 +411,13 @@ private static AssessmentSection CreateAssessmentSectionWithReferenceLine() { - var referenceLine = new ReferenceLine(); - referenceLine.SetGeometry(new[] + AssessmentSection assessmentSection = CreateAssessmentSection(); + assessmentSection.ReferenceLine.SetGeometry(new[] { new Point2D(1.0, 2.0), new Point2D(2.0, 1.0) }); - AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.ReferenceLine = referenceLine; - return assessmentSection; } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -raf799c0543365c3fce39a12d2662403b61611a0b -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision af799c0543365c3fce39a12d2662403b61611a0b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -65,7 +65,7 @@ - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssemblyResultPerSectionMapViewInfoTest.cs =================================================================== diff -u -raf799c0543365c3fce39a12d2662403b61611a0b -ra199966cb016dd5596430ada947e252d5b6b62e7 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssemblyResultPerSectionMapViewInfoTest.cs (.../AssemblyResultPerSectionMapViewInfoTest.cs) (revision af799c0543365c3fce39a12d2662403b61611a0b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssemblyResultPerSectionMapViewInfoTest.cs (.../AssemblyResultPerSectionMapViewInfoTest.cs) (revision a199966cb016dd5596430ada947e252d5b6b62e7) @@ -130,10 +130,7 @@ private static AssessmentSection CreateAssessmentSection() { var random = new Random(21); - return new AssessmentSection(random.NextEnumValue()) - { - ReferenceLine = new ReferenceLine() - }; + return new AssessmentSection(random.NextEnumValue()); } } } \ No newline at end of file