Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs =================================================================== diff -u -rc36b47c2e1e8cf948767cca33f80ad735f370ad0 -r7e1401efb8abae242369b43140afcd456e6e529a --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs (.../AssemblyResultPerSectionMapView.Designer.cs) (revision c36b47c2e1e8cf948767cca33f80ad735f370ad0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs (.../AssemblyResultPerSectionMapView.Designer.cs) (revision 7e1401efb8abae242369b43140afcd456e6e529a) @@ -40,11 +40,6 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AssemblyResultPerSectionMapView)); this.riskeerMapControl = new Riskeer.Common.Forms.Views.RiskeerMapControl(); - this.warningPanel = new System.Windows.Forms.Panel(); - this.warningIcon = new System.Windows.Forms.PictureBox(); - this.warningText = new System.Windows.Forms.Label(); - this.warningPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.warningIcon)).BeginInit(); this.SuspendLayout(); // // riskeerMapControl @@ -56,59 +51,19 @@ this.riskeerMapControl.Size = new System.Drawing.Size(562, 150); this.riskeerMapControl.TabIndex = 0; // - // warningPanel - // - this.warningPanel.BackColor = System.Drawing.SystemColors.Info; - this.warningPanel.Controls.Add(this.warningText); - this.warningPanel.Controls.Add(this.warningIcon); - this.warningPanel.Location = new System.Drawing.Point(0, 25); - this.warningPanel.Name = "warningPanel"; - this.warningPanel.Size = new System.Drawing.Size(562, 100); - this.warningPanel.TabIndex = 1; - this.warningPanel.AutoSize = true; - this.warningPanel.Dock = DockStyle.Top; - // - // warningIcon - // - this.warningIcon.Image = global::Riskeer.Common.Forms.Properties.Resources.PencilWarning.ToBitmap(); - this.warningIcon.Location = new System.Drawing.Point(4, 4); - this.warningIcon.MaximumSize = new System.Drawing.Size(16, 16); - this.warningIcon.Name = "warningIcon"; - this.warningIcon.Size = new System.Drawing.Size(16, 16); - this.warningIcon.TabIndex = 0; - this.warningIcon.TabStop = false; - this.warningIcon.SizeMode = PictureBoxSizeMode.StretchImage; - this.warningIcon.Dock = DockStyle.Left; - // - // warningText - // - this.warningText.AutoSize = true; - this.warningText.Location = new System.Drawing.Point(27, 6); - this.warningText.Name = "warningText"; - this.warningText.Size = new System.Drawing.Size(35, 13); - this.warningText.TabIndex = 1; - this.warningText.Text = global::Riskeer.Common.Forms.Properties.Resources.ManualAssemblyWarning_FailureMechanismAssemblyResult_is_based_on_manual_assemblies; - // // AssemblyResultPerSectionMapView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.riskeerMapControl); - this.Controls.Add(this.warningPanel); this.Name = "AssemblyResultPerSectionMapView"; this.Size = new System.Drawing.Size(562, 150); - this.warningPanel.ResumeLayout(false); - this.warningPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.warningIcon)).EndInit(); this.ResumeLayout(false); } #endregion private Riskeer.Common.Forms.Views.RiskeerMapControl riskeerMapControl; - private Panel warningPanel; - private PictureBox warningIcon; - private Label warningText; } } Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs =================================================================== diff -u -r64a560fff80c88b04c926917ba917599ff9107f3 -r7e1401efb8abae242369b43140afcd456e6e529a --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs (.../AssemblyResultPerSectionMapView.cs) (revision 64a560fff80c88b04c926917ba917599ff9107f3) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs (.../AssemblyResultPerSectionMapView.cs) (revision 7e1401efb8abae242369b43140afcd456e6e529a) @@ -27,7 +27,6 @@ using Riskeer.Common.Forms.Factories; using Riskeer.Common.Forms.Views; using Riskeer.Integration.Data; -using Riskeer.Integration.Data.Assembly; using Riskeer.Integration.Forms.Factories; using Riskeer.Integration.Forms.Observers; using Riskeer.Integration.Forms.Properties; @@ -76,7 +75,6 @@ mapDataCollection.Add(assemblyResultsMapData); SetAllMapDataFeatures(); - SetWarningPanel(); riskeerMapControl.SetAllData(mapDataCollection, assessmentSection.BackgroundData); } @@ -111,12 +109,8 @@ private void CreateObservers() { - assessmentSectionResultObserver = new Observer(() => + assessmentSectionResultObserver = new Observer(UpdateAssessmentSectionData) { - UpdateAssessmentSectionData(); - SetWarningPanel(); - }) - { Observable = new AssessmentSectionResultObserver(AssessmentSection) }; } @@ -127,11 +121,6 @@ SetAssemblyResultsMapData(); } - private void SetWarningPanel() - { - warningPanel.Visible = AssessmentSectionHelper.HasManualAssemblyResults(AssessmentSection); - } - private void UpdateAssessmentSectionData() { UpdateAssemblyResultsMapData(); Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs =================================================================== diff -u -rbf8325a96ad94571f35d7e745e30b6e1d634949b -r7e1401efb8abae242369b43140afcd456e6e529a --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision bf8325a96ad94571f35d7e745e30b6e1d634949b) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision 7e1401efb8abae242369b43140afcd456e6e529a) @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using System.Windows.Forms; using Core.Common.Base; @@ -42,14 +41,12 @@ using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; -using Riskeer.Common.Data.TestUtil; using Riskeer.Common.Forms.TestUtil; using Riskeer.Common.Forms.Views; using Riskeer.Integration.Data; using Riskeer.Integration.Data.Assembly; using Riskeer.Integration.Forms.Views; using Riskeer.Integration.Util; -using Riskeer.Piping.Data; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Forms.Test.Views @@ -88,17 +85,12 @@ Assert.IsInstanceOf(view); Assert.IsNull(view.Data); - Assert.AreEqual(2, view.Controls.Count); + Assert.AreEqual(1, view.Controls.Count); IMapControl mapControl = GetMapControl(view); Assert.AreSame(view.Map, mapControl); Assert.AreEqual(DockStyle.Fill, ((Control) view.Map).Dock); - Panel warningPanel = GetWarningPanel(view); - Assert.AreEqual(DockStyle.Top, warningPanel.Dock); - Assert.IsFalse(warningPanel.Visible); - Assert.IsTrue(warningPanel.AutoSize); - Assert.AreSame(assessmentSection, view.AssessmentSection); MapDataCollection mapDataCollection = view.Map.Data; @@ -355,78 +347,6 @@ } } - [Test] - [TestCase(true)] - [TestCase(false)] - public void GivenViewWithVariousManualAssemblyResultConfigurations_WhenShowingView_ThenExpectedWarningSet(bool hasManualAssembly) - { - // Given - AssessmentSection assessmentSection = CreateAssessmentSectionWithReferenceLine(); - PipingFailureMechanism failureMechanism = assessmentSection.Piping; - FailureMechanismTestHelper.AddSections(failureMechanism, 1); - failureMechanism.SectionResultsOld.Single().UseManualAssembly = hasManualAssembly; - - // When - using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) - { - // Then - Panel warningPanel = GetWarningPanel(view); - Assert.AreEqual(hasManualAssembly, warningPanel.Visible); - AssertWarningPanel(warningPanel); - } - } - - [Test] - public void GivenViewWithoutManualAssemblyResults_WhenAssessmentSectionWithManualAssemblyResultsAndNotifiesObservers_ThenExpectedWarningSet() - { - // Given - AssessmentSection assessmentSection = CreateAssessmentSectionWithReferenceLine(); - - using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) - { - Panel warningPanel = GetWarningPanel(view); - - // Precondition - Assert.IsFalse(warningPanel.Visible); - - // When - PipingFailureMechanism failureMechanism = assessmentSection.Piping; - FailureMechanismTestHelper.AddSections(failureMechanism, 1); - failureMechanism.SectionResultsOld.Single().UseManualAssembly = true; - failureMechanism.NotifyObservers(); - - // Then - Assert.IsTrue(warningPanel.Visible); - AssertWarningPanel(warningPanel); - } - } - - [Test] - public void GivenViewWithManualAssemblyResults_WhenAssessmentSectionWithoutManualAssemblyResultsAndNotifiesObservers_ThenExpectedWarningSet() - { - // Given - AssessmentSection assessmentSection = CreateAssessmentSectionWithReferenceLine(); - PipingFailureMechanism failureMechanism = assessmentSection.Piping; - FailureMechanismTestHelper.AddSections(failureMechanism, 1); - failureMechanism.SectionResultsOld.Single().UseManualAssembly = true; - - using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) - { - Panel warningPanel = GetWarningPanel(view); - - // Precondition - Assert.IsTrue(warningPanel.Visible); - AssertWarningPanel(warningPanel); - - // When - failureMechanism.SectionResultsOld.Single().UseManualAssembly = false; - failureMechanism.NotifyObservers(); - - // Then - Assert.IsFalse(warningPanel.Visible); - } - } - private static AssessmentSection CreateAssessmentSection() { var random = new Random(21); @@ -491,27 +411,6 @@ } } - private static Panel GetWarningPanel(AssemblyResultPerSectionMapView view) - { - return (Panel) view.Controls[1]; - } - - private static void AssertWarningPanel(Panel warningPanel) - { - Assert.AreEqual(2, warningPanel.Controls.Count); - - var warningIcon = (PictureBox) warningPanel.Controls.Find("warningIcon", false).Single(); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.PencilWarning.ToBitmap(), warningIcon.Image); - Assert.AreEqual(DockStyle.Left, warningIcon.Dock); - 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); - } - private static IMapControl GetMapControl(AssemblyResultPerSectionMapView view) { var mapControl = (RiskeerMapControl) view.Controls[0];