Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionRow.cs =================================================================== diff -u -r7d3513bd9fed2d5a0381255640a5c3f31a0a6175 -r5a3fc9f0024b4ecd76b7e521a8df95c9aa432760 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionRow.cs (.../FailureMechanismSectionRow.cs) (revision 7d3513bd9fed2d5a0381255640a5c3f31a0a6175) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionRow.cs (.../FailureMechanismSectionRow.cs) (revision 5a3fc9f0024b4ecd76b7e521a8df95c9aa432760) @@ -21,8 +21,6 @@ using System; using Core.Common.Base.Data; -using Core.Common.Base.Geometry; -using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Common.Forms.Views @@ -50,6 +48,8 @@ } Name = section.Name; + SectionStart = new RoundedDouble(2, sectionStart); + SectionEnd = new RoundedDouble(2, sectionEnd); Length = new RoundedDouble(2, section.Length); } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionsView.cs =================================================================== diff -u -r7d3513bd9fed2d5a0381255640a5c3f31a0a6175 -r5a3fc9f0024b4ecd76b7e521a8df95c9aa432760 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionsView.cs (.../FailureMechanismSectionsView.cs) (revision 7d3513bd9fed2d5a0381255640a5c3f31a0a6175) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionsView.cs (.../FailureMechanismSectionsView.cs) (revision 5a3fc9f0024b4ecd76b7e521a8df95c9aa432760) @@ -107,7 +107,18 @@ /// protected virtual void SetDataGridViewControlData() { - failureMechanismSectionsDataGridViewControl.SetDataSource(sections.Select(section => new FailureMechanismSectionRow(section, 0, 0)).ToArray()); + var rows = new List(); + double startDistance = 0; + foreach (FailureMechanismSection section in sections) + { + double endDistance = startDistance + section.Length; + + rows.Add(new FailureMechanismSectionRow(section, startDistance, endDistance)); + + startDistance = endDistance; + } + + failureMechanismSectionsDataGridViewControl.SetDataSource(rows); } private void HandleFailureMechanismSectionsChange() Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionRowTest.cs =================================================================== diff -u -r7d3513bd9fed2d5a0381255640a5c3f31a0a6175 -r5a3fc9f0024b4ecd76b7e521a8df95c9aa432760 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionRowTest.cs (.../FailureMechanismSectionRowTest.cs) (revision 7d3513bd9fed2d5a0381255640a5c3f31a0a6175) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionRowTest.cs (.../FailureMechanismSectionRowTest.cs) (revision 5a3fc9f0024b4ecd76b7e521a8df95c9aa432760) @@ -63,8 +63,10 @@ Assert.AreEqual(section.Name, sectionRow.Name); Assert.AreEqual(2, sectionRow.Length.NumberOfDecimalPlaces); Assert.AreEqual(section.Length, sectionRow.Length, sectionRow.Length.GetAccuracy()); - Assert.AreEqual(0.0, sectionRow.SectionStart); - Assert.AreEqual(0.0, sectionRow.SectionEnd); + Assert.AreEqual(2, sectionRow.SectionStart.NumberOfDecimalPlaces); + Assert.AreEqual(sectionStart, sectionRow.SectionStart, sectionRow.SectionStart.GetAccuracy()); + Assert.AreEqual(2, sectionRow.SectionEnd.NumberOfDecimalPlaces); + Assert.AreEqual(sectionEnd, sectionRow.SectionEnd, sectionRow.SectionEnd.GetAccuracy()); } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionsViewTest.cs =================================================================== diff -u -rbd4c3f207fb9181e32fa15d5faaf643366d6326a -r5a3fc9f0024b4ecd76b7e521a8df95c9aa432760 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionsViewTest.cs (.../FailureMechanismSectionsViewTest.cs) (revision bd4c3f207fb9181e32fa15d5faaf643366d6326a) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionsViewTest.cs (.../FailureMechanismSectionsViewTest.cs) (revision 5a3fc9f0024b4ecd76b7e521a8df95c9aa432760) @@ -237,15 +237,25 @@ { Assert.AreEqual(sections.Length, sectionsDataGridViewControl.Rows.Count); + double sectionStart = 0; for (var i = 0; i < sectionsDataGridViewControl.Rows.Count; i++) { FailureMechanismSection section = sections[i]; DataGridViewCellCollection rowCells = sectionsDataGridViewControl.Rows[i].Cells; Assert.AreEqual(section.Name, rowCells[nameColumnIndex].Value); + var sectionStartValue = (RoundedDouble) rowCells[sectionStartColumnIndex].Value; + Assert.AreEqual(sectionStart, sectionStartValue, sectionStartValue.GetAccuracy()); + + double sectionEnd = sectionStart + section.Length; + var sectionEndValue = (RoundedDouble) rowCells[sectionEndColumnIndex].Value; + Assert.AreEqual(sectionEnd, sectionEndValue, sectionEndValue.GetAccuracy()); + var sectionLength = (RoundedDouble) rowCells[lengthColumnIndex].Value; Assert.AreEqual(section.Length, sectionLength, sectionLength.GetAccuracy()); + + sectionStart = sectionEnd; } }