Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs =================================================================== diff -u -r65c7c0f4f403bc191c724051feadc4d5555f1af3 -r87681c3390edf7a795589748aeaa84fc9fe5317e --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs (.../AssemblyResultPerSectionMapView.Designer.cs) (revision 65c7c0f4f403bc191c724051feadc4d5555f1af3) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs (.../AssemblyResultPerSectionMapView.Designer.cs) (revision 87681c3390edf7a795589748aeaa84fc9fe5317e) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2018. All rights reserved. +// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of Ringtoets. // @@ -66,18 +66,20 @@ // ringtoetsMapControl // this.ringtoetsMapControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.ringtoetsMapControl.Location = new System.Drawing.Point(3, 22); + this.ringtoetsMapControl.Location = new System.Drawing.Point(3, 16); this.ringtoetsMapControl.Name = "ringtoetsMapControl"; - this.ringtoetsMapControl.Size = new System.Drawing.Size(556, 125); + this.ringtoetsMapControl.Size = new System.Drawing.Size(556, 131); this.ringtoetsMapControl.TabIndex = 0; // // warningPanel // this.warningPanel.AutoSize = true; + this.warningPanel.BackColor = System.Drawing.SystemColors.Info; this.warningPanel.Controls.Add(this.warningIcon); this.warningPanel.Controls.Add(this.warningText); this.warningPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.warningPanel.Location = new System.Drawing.Point(3, 3); + this.warningPanel.Location = new System.Drawing.Point(0, 0); + this.warningPanel.Margin = new System.Windows.Forms.Padding(0); this.warningPanel.Name = "warningPanel"; this.warningPanel.Size = new System.Drawing.Size(556, 13); this.warningPanel.TabIndex = 1; @@ -90,6 +92,7 @@ this.warningIcon.Name = "warningIcon"; this.warningIcon.Size = new System.Drawing.Size(16, 16); this.warningIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.warningIcon.Image = global::Ringtoets.Common.Forms.Properties.Resources.PencilWarning.ToBitmap(); this.warningIcon.TabIndex = 1; this.warningIcon.TabStop = false; // Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs =================================================================== diff -u -r148f6854c91a98582289906bc322ed36b6d3813c -r87681c3390edf7a795589748aeaa84fc9fe5317e --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs (.../AssemblyResultPerSectionMapView.cs) (revision 148f6854c91a98582289906bc322ed36b6d3813c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs (.../AssemblyResultPerSectionMapView.cs) (revision 87681c3390edf7a795589748aeaa84fc9fe5317e) @@ -46,7 +46,7 @@ private readonly MapLineData referenceLineMapData; private readonly MapPointData hydraulicBoundaryLocationsMapData; - private Observer assessmentSectionObserver; + private Observer assessmentSectionResultObserver; private Observer hydraulicBoundaryLocationsObserver; private RecursiveObserver, HydraulicBoundaryLocationCalculation> waterLevelCalculationsForFactorizedSignalingNormObserver; private RecursiveObserver, HydraulicBoundaryLocationCalculation> waterLevelCalculationsForSignalingNormObserver; @@ -71,7 +71,6 @@ } InitializeComponent(); - InitializeWarningPanel(); AssessmentSection = assessmentSection; @@ -111,7 +110,7 @@ { if (disposing) { - assessmentSectionObserver.Dispose(); + assessmentSectionResultObserver.Dispose(); waterLevelCalculationsForFactorizedSignalingNormObserver.Dispose(); waterLevelCalculationsForSignalingNormObserver.Dispose(); waterLevelCalculationsForLowerLimitNormObserver.Dispose(); @@ -130,7 +129,7 @@ private void CreateObservers() { - assessmentSectionObserver = new Observer(() => + assessmentSectionResultObserver = new Observer(() => { UpdateAssessmentSectionData(); SetWarningPanel(); @@ -162,11 +161,6 @@ }; } - private void InitializeWarningPanel() - { - warningIcon.Image = RingtoetsCommonFormsResources.PencilWarning.ToBitmap(); - } - private void SetAllMapDataFeatures() { SetReferenceLineMapData(); @@ -176,13 +170,7 @@ private void SetWarningPanel() { - if (AssessmentSectionHelper.HasManualAssemblyResults(AssessmentSection)) - { - warningPanel.Visible = true; - return; - } - - warningPanel.Visible = false; + warningPanel.Visible = AssessmentSectionHelper.HasManualAssemblyResults(AssessmentSection); } private void UpdateAssessmentSectionData() Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs =================================================================== diff -u -r148f6854c91a98582289906bc322ed36b6d3813c -r87681c3390edf7a795589748aeaa84fc9fe5317e --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision 148f6854c91a98582289906bc322ed36b6d3813c) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision 87681c3390edf7a795589748aeaa84fc9fe5317e) @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; using System.Windows.Forms; using Core.Common.Base; @@ -143,7 +144,7 @@ { // Setup var random = new Random(21); - + AssessmentSection assessmentSection = CreateAssessmentSectionWithReferenceLine(); assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] { @@ -278,7 +279,7 @@ observers[assemblyResultsIndex].Expect(obs => obs.UpdateObserver()); mocks.ReplayAll(); - var referenceLineMapData = (MapLineData)map.Data.Collection.ElementAt(referenceLineIndex); + var referenceLineMapData = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapFeaturesTestHelper.AssertReferenceLineMetaData(assessmentSection.ReferenceLine, assessmentSection, referenceLineMapData.Features); @@ -437,7 +438,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void GivenViewWithManualAssemblyResults_WhenShowingView_ThenExpectedWarningSet(bool hasManualAssembly) + public void GivenViewWithVariousManualAssemblyResultConfigurations_WhenShowingView_ThenExpectedWarningSet(bool hasManualAssembly) { // Given AssessmentSection assessmentSection = CreateAssessmentSectionWithReferenceLine(); @@ -464,9 +465,10 @@ using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) { - // Precondition var layoutPanel = (TableLayoutPanel) view.Controls[0]; var warningPanel = (Panel) layoutPanel.GetControlFromPosition(0, 0); + + // Precondition Assert.IsFalse(warningPanel.Visible); // When @@ -492,9 +494,10 @@ using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) { - // Precondition var layoutPanel = (TableLayoutPanel) view.Controls[0]; var warningPanel = (Panel) layoutPanel.GetControlFromPosition(0, 0); + + // Precondition Assert.IsTrue(warningPanel.Visible); AssertWarningPanel(warningPanel); @@ -582,6 +585,7 @@ Assert.AreEqual(16, warningIcon.MaximumSize.Height); Assert.AreEqual(16, warningIcon.MaximumSize.Width); Assert.AreEqual(PictureBoxSizeMode.StretchImage, warningIcon.SizeMode); + Assert.AreEqual(SystemColors.Info, warningPanel.BackColor); var warningText = (Label) warningPanel.Controls.Find("warningText", false).Single(); Assert.AreEqual("Toetsoordeel is (deels) gebaseerd op handmatig overschreven toetsoordelen.", warningText.Text);