Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Controls/AssessmentSectionAssemblyCategoryGroupControl.cs =================================================================== diff -u -rc36b47c2e1e8cf948767cca33f80ad735f370ad0 -rb260802602d09b9b979e9ef76671e098e8508a52 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Controls/AssessmentSectionAssemblyCategoryGroupControl.cs (.../AssessmentSectionAssemblyCategoryGroupControl.cs) (revision c36b47c2e1e8cf948767cca33f80ad735f370ad0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Controls/AssessmentSectionAssemblyCategoryGroupControl.cs (.../AssessmentSectionAssemblyCategoryGroupControl.cs) (revision b260802602d09b9b979e9ef76671e098e8508a52) @@ -25,26 +25,37 @@ using Riskeer.AssemblyTool.Data; using Riskeer.Common.Forms.Controls; using Riskeer.Common.Forms.Helpers; +using Riskeer.Common.Forms.TypeConverters; namespace Riskeer.Integration.Forms.Controls { /// /// Control to display a . /// - public class AssessmentSectionAssemblyCategoryGroupControl : AssemblyResultControl + public class AssessmentSectionAssemblyCategoryGroupControl : AssemblyResultWithProbabilityControl { + private readonly NoProbabilityValueDoubleConverter converter = new NoProbabilityValueDoubleConverter(); + /// /// Sets the value of on the control. /// - /// The to set on the control. + /// The to set on the control. + /// Thrown when is null. /// Thrown when /// has an invalid value for . /// Thrown when /// is not supported. - public void SetAssemblyResult(AssessmentSectionAssemblyCategoryGroup result) + public void SetAssemblyResult(AssessmentSectionAssemblyResult result) { - GroupLabel.Text = new EnumDisplayWrapper(result).DisplayName; - GroupLabel.BackColor = AssemblyCategoryGroupColorHelper.GetAssessmentSectionAssemblyCategoryGroupColor(result); + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + GroupLabel.Text = new EnumDisplayWrapper(result.AssemblyCategoryGroup).DisplayName; + GroupLabel.BackColor = AssemblyCategoryGroupColorHelper.GetAssessmentSectionAssemblyCategoryGroupColor(result.AssemblyCategoryGroup); + + ProbabilityLabel.Text = converter.ConvertToString(result.Probability); } } } \ No newline at end of file Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -raa156fccb4f43c7f3b4cf119217cebe600e67e84 -rb260802602d09b9b979e9ef76671e098e8508a52 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision aa156fccb4f43c7f3b4cf119217cebe600e67e84) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b260802602d09b9b979e9ef76671e098e8508a52) @@ -100,24 +100,6 @@ } /// - /// Looks up a localized string similar to Toetsoordeel groepen 3 en 4. - /// - public static string AssemblyResultTotalView_FailureMechanismsWithoutProbabilityResultLabel_Text { - get { - return ResourceManager.GetString("AssemblyResultTotalView_FailureMechanismsWithoutProbabilityResultLabel_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Toetsoordeel groepen 1 en 2. - /// - public static string AssemblyResultTotalView_FailureMechanismsWithProbabilityResultLabel_Text { - get { - return ResourceManager.GetString("AssemblyResultTotalView_FailureMechanismsWithProbabilityResultLabel_Text", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Benaderde faalkans [1/jaar]. /// public static string AssemblyResultTotalView_Probability_DisplayName { @@ -127,15 +109,6 @@ } /// - /// Looks up a localized string similar to Veiligheidsoordeel. - /// - public static string AssemblyResultTotalView_TotalResultLabel_Text { - get { - return ResourceManager.GetString("AssemblyResultTotalView_TotalResultLabel_Text", resourceCulture); - } - } - - /// /// Looks up a localized string similar to De resultaten zijn verouderd. Druk op de "Resultaten verversen" knop om opnieuw te berekenen.. /// public static string AssemblyResultView_RefreshAssemblyResultsButton_Warning_Result_is_outdated_Press_Refresh_button_to_recalculate { Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -raa156fccb4f43c7f3b4cf119217cebe600e67e84 -rb260802602d09b9b979e9ef76671e098e8508a52 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision aa156fccb4f43c7f3b4cf119217cebe600e67e84) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision b260802602d09b9b979e9ef76671e098e8508a52) @@ -256,15 +256,6 @@ Benaderde faalkans [1/jaar] - - Veiligheidsoordeel - - - Toetsoordeel groepen 1 en 2 - - - Toetsoordeel groepen 3 en 4 - Toetsspoor Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs =================================================================== diff -u -r0b81b495f2b769885bbb48d84fc1d3ed1bb2721d -rb260802602d09b9b979e9ef76671e098e8508a52 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs (.../AssemblyResultTotalView.Designer.cs) (revision 0b81b495f2b769885bbb48d84fc1d3ed1bb2721d) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs (.../AssemblyResultTotalView.Designer.cs) (revision b260802602d09b9b979e9ef76671e098e8508a52) @@ -42,17 +42,10 @@ this.dataGridViewControl = new Core.Common.Controls.DataGrid.DataGridViewControl(); this.refreshAssemblyResultsButton = new Core.Common.Controls.Forms.EnhancedButton(); this.assemblyResultGroupBox = new System.Windows.Forms.GroupBox(); - this.assemblyResultTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this.totalResultLabel = new System.Windows.Forms.Label(); - this.failureMechanismsWithProbabilityLabel = new System.Windows.Forms.Label(); - this.failureMechanismsWithoutProbabilityLabel = new System.Windows.Forms.Label(); this.totalAssemblyCategoryGroupControl = new AssessmentSectionAssemblyCategoryGroupControl(); - this.failureMechanismsWithProbabilityAssemblyControl = new Riskeer.Common.Forms.Controls.FailureMechanismAssemblyControl(); - this.failureMechanismsWithoutProbabilityAssemblyControl = new Riskeer.Common.Forms.Controls.FailureMechanismAssemblyCategoryGroupControl(); this.refreshButtonPanel = new System.Windows.Forms.Panel(); this.warningProvider = new System.Windows.Forms.ErrorProvider(this.components); this.assemblyResultGroupBox.SuspendLayout(); - this.assemblyResultTableLayoutPanel.SuspendLayout(); this.refreshButtonPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.warningProvider)).BeginInit(); this.SuspendLayout(); @@ -82,71 +75,16 @@ // // assemblyResultGroupBox // - this.assemblyResultGroupBox.Controls.Add(this.assemblyResultTableLayoutPanel); + this.assemblyResultGroupBox.Controls.Add(this.totalAssemblyCategoryGroupControl); this.assemblyResultGroupBox.Dock = System.Windows.Forms.DockStyle.Top; this.assemblyResultGroupBox.Location = new System.Drawing.Point(0, 35); this.assemblyResultGroupBox.Margin = new System.Windows.Forms.Padding(5); this.assemblyResultGroupBox.Name = "assemblyResultGroupBox"; - this.assemblyResultGroupBox.Size = new System.Drawing.Size(789, 110); + this.assemblyResultGroupBox.Size = new System.Drawing.Size(789, 50); this.assemblyResultGroupBox.TabIndex = 1; this.assemblyResultGroupBox.TabStop = false; this.assemblyResultGroupBox.Text = global::Riskeer.Common.Forms.Properties.Resources.CombinedAssembly_DisplayName; // - // assemblyResultTableLayoutPanel - // - this.assemblyResultTableLayoutPanel.AutoSize = true; - this.assemblyResultTableLayoutPanel.ColumnCount = 2; - this.assemblyResultTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.assemblyResultTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.assemblyResultTableLayoutPanel.Controls.Add(this.totalResultLabel, 0, 0); - this.assemblyResultTableLayoutPanel.Controls.Add(this.failureMechanismsWithProbabilityLabel, 0, 1); - this.assemblyResultTableLayoutPanel.Controls.Add(this.failureMechanismsWithoutProbabilityLabel, 0, 2); - this.assemblyResultTableLayoutPanel.Controls.Add(this.totalAssemblyCategoryGroupControl, 1, 0); - this.assemblyResultTableLayoutPanel.Controls.Add(this.failureMechanismsWithProbabilityAssemblyControl, 1, 1); - this.assemblyResultTableLayoutPanel.Controls.Add(this.failureMechanismsWithoutProbabilityAssemblyControl, 1, 2); - this.assemblyResultTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.assemblyResultTableLayoutPanel.Location = new System.Drawing.Point(3, 16); - this.assemblyResultTableLayoutPanel.Name = "assemblyResultTableLayoutPanel"; - this.assemblyResultTableLayoutPanel.RowCount = 3; - this.assemblyResultTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.assemblyResultTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.assemblyResultTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.assemblyResultTableLayoutPanel.Size = new System.Drawing.Size(783, 91); - this.assemblyResultTableLayoutPanel.TabIndex = 0; - // - // totalResultLabel - // - this.totalResultLabel.AutoSize = true; - this.totalResultLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.totalResultLabel.Location = new System.Drawing.Point(3, 0); - this.totalResultLabel.Name = "totalResultLabel"; - this.totalResultLabel.Size = new System.Drawing.Size(81, 30); - this.totalResultLabel.TabIndex = 0; - this.totalResultLabel.Text = global::Riskeer.Integration.Forms.Properties.Resources.AssemblyResultTotalView_TotalResultLabel_Text; - this.totalResultLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // failureMechanismsWithProbabilityLabel - // - this.failureMechanismsWithProbabilityLabel.AutoSize = true; - this.failureMechanismsWithProbabilityLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.failureMechanismsWithProbabilityLabel.Location = new System.Drawing.Point(3, 30); - this.failureMechanismsWithProbabilityLabel.Name = "failureMechanismsWithProbabilityLabel"; - this.failureMechanismsWithProbabilityLabel.Size = new System.Drawing.Size(81, 30); - this.failureMechanismsWithProbabilityLabel.TabIndex = 1; - this.failureMechanismsWithProbabilityLabel.Text = global::Riskeer.Integration.Forms.Properties.Resources.AssemblyResultTotalView_FailureMechanismsWithProbabilityResultLabel_Text; - this.failureMechanismsWithProbabilityLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // failureMechanismsWithoutProbabilityLabel - // - this.failureMechanismsWithoutProbabilityLabel.AutoSize = true; - this.failureMechanismsWithoutProbabilityLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.failureMechanismsWithoutProbabilityLabel.Location = new System.Drawing.Point(3, 60); - this.failureMechanismsWithoutProbabilityLabel.Name = "failureMechanismsWithoutProbabilityLabel"; - this.failureMechanismsWithoutProbabilityLabel.Size = new System.Drawing.Size(81, 31); - this.failureMechanismsWithoutProbabilityLabel.TabIndex = 2; - this.failureMechanismsWithoutProbabilityLabel.Text = global::Riskeer.Integration.Forms.Properties.Resources.AssemblyResultTotalView_FailureMechanismsWithoutProbabilityResultLabel_Text; - this.failureMechanismsWithoutProbabilityLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // totalAssemblyCategoryGroupControl // this.totalAssemblyCategoryGroupControl.AutoSize = true; @@ -156,24 +94,6 @@ this.totalAssemblyCategoryGroupControl.Size = new System.Drawing.Size(690, 24); this.totalAssemblyCategoryGroupControl.TabIndex = 3; // - // failureMechanismsWithProbabilityAssemblyControl - // - this.failureMechanismsWithProbabilityAssemblyControl.AutoSize = true; - this.failureMechanismsWithProbabilityAssemblyControl.Dock = System.Windows.Forms.DockStyle.Left; - this.failureMechanismsWithProbabilityAssemblyControl.Location = new System.Drawing.Point(90, 33); - this.failureMechanismsWithProbabilityAssemblyControl.Name = "failureMechanismsWithProbabilityAssemblyControl"; - this.failureMechanismsWithProbabilityAssemblyControl.Size = new System.Drawing.Size(112, 24); - this.failureMechanismsWithProbabilityAssemblyControl.TabIndex = 4; - // - // failureMechanismsWithoutProbabilityAssemblyControl - // - this.failureMechanismsWithoutProbabilityAssemblyControl.AutoSize = true; - this.failureMechanismsWithoutProbabilityAssemblyControl.Dock = System.Windows.Forms.DockStyle.Left; - this.failureMechanismsWithoutProbabilityAssemblyControl.Location = new System.Drawing.Point(90, 63); - this.failureMechanismsWithoutProbabilityAssemblyControl.Name = "failureMechanismsWithoutProbabilityAssemblyControl"; - this.failureMechanismsWithoutProbabilityAssemblyControl.Size = new System.Drawing.Size(56, 25); - this.failureMechanismsWithoutProbabilityAssemblyControl.TabIndex = 5; - // // refreshButtonPanel // this.refreshButtonPanel.Controls.Add(this.refreshAssemblyResultsButton); @@ -203,8 +123,6 @@ this.Size = new System.Drawing.Size(789, 416); this.assemblyResultGroupBox.ResumeLayout(false); this.assemblyResultGroupBox.PerformLayout(); - this.assemblyResultTableLayoutPanel.ResumeLayout(false); - this.assemblyResultTableLayoutPanel.PerformLayout(); this.refreshButtonPanel.ResumeLayout(false); this.refreshButtonPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.warningProvider)).EndInit(); @@ -217,13 +135,7 @@ private Core.Common.Controls.DataGrid.DataGridViewControl dataGridViewControl; private Core.Common.Controls.Forms.EnhancedButton refreshAssemblyResultsButton; private System.Windows.Forms.GroupBox assemblyResultGroupBox; - private System.Windows.Forms.TableLayoutPanel assemblyResultTableLayoutPanel; - private System.Windows.Forms.Label totalResultLabel; - private System.Windows.Forms.Label failureMechanismsWithProbabilityLabel; - private System.Windows.Forms.Label failureMechanismsWithoutProbabilityLabel; private Controls.AssessmentSectionAssemblyCategoryGroupControl totalAssemblyCategoryGroupControl; - private Riskeer.Common.Forms.Controls.FailureMechanismAssemblyControl failureMechanismsWithProbabilityAssemblyControl; - private Riskeer.Common.Forms.Controls.FailureMechanismAssemblyCategoryGroupControl failureMechanismsWithoutProbabilityAssemblyControl; private System.Windows.Forms.Panel refreshButtonPanel; private System.Windows.Forms.ErrorProvider warningProvider; } Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultTotalView.cs =================================================================== diff -u -r0b81b495f2b769885bbb48d84fc1d3ed1bb2721d -rb260802602d09b9b979e9ef76671e098e8508a52 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 0b81b495f2b769885bbb48d84fc1d3ed1bb2721d) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision b260802602d09b9b979e9ef76671e098e8508a52) @@ -199,42 +199,8 @@ private void UpdateAssemblyResultControls() { UpdateTotalAssemblyCategoryGroupControl(); - UpdateFailureMechanismsWithProbabilityAssemblyControl(); - UpdateFailureMechanismsWithoutProbabilityAssemblyControl(); } - - private void UpdateFailureMechanismsWithoutProbabilityAssemblyControl() - { - failureMechanismsWithoutProbabilityAssemblyControl.ClearAssemblyResult(); - failureMechanismsWithoutProbabilityAssemblyControl.ClearMessages(); - - try - { - failureMechanismsWithoutProbabilityAssemblyControl.SetAssemblyResult( - AssessmentSectionAssemblyFactory.AssembleFailureMechanismsWithoutProbability(AssessmentSection, true)); - } - catch (AssemblyException e) - { - failureMechanismsWithoutProbabilityAssemblyControl.SetError(e.Message); - } - } - - private void UpdateFailureMechanismsWithProbabilityAssemblyControl() - { - failureMechanismsWithProbabilityAssemblyControl.ClearAssemblyResult(); - failureMechanismsWithProbabilityAssemblyControl.ClearMessages(); - - try - { - failureMechanismsWithProbabilityAssemblyControl.SetAssemblyResult( - AssessmentSectionAssemblyFactory.AssembleFailureMechanismsWithProbability(AssessmentSection, true)); - } - catch (AssemblyException e) - { - failureMechanismsWithProbabilityAssemblyControl.SetError(e.Message); - } - } - + private void UpdateTotalAssemblyCategoryGroupControl() { totalAssemblyCategoryGroupControl.ClearAssemblyResult(); @@ -243,7 +209,7 @@ try { totalAssemblyCategoryGroupControl.SetAssemblyResult( - AssessmentSectionAssemblyFactory.AssembleAssessmentSection(AssessmentSection, true)); + AssessmentSectionAssemblyFactory.AssembleAssessmentSection(AssessmentSection)); } catch (AssemblyException e) {