Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadResultsforFMFromResultView.cs =================================================================== diff -u -re5886953fdad72364bd9b73092f243c3b88e7bc3 -r7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadResultsforFMFromResultView.cs (.../ReadResultsforFMFromResultView.cs) (revision e5886953fdad72364bd9b73092f243c3b88e7bc3) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadResultsforFMFromResultView.cs (.../ReadResultsforFMFromResultView.cs) (revision 7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d) @@ -15,6 +15,7 @@ using System.Threading; using WinForms = System.Windows.Forms; using Newtonsoft.Json; +using Ranorex_Automation_Helpers.UserCodeCollections; using Ranorex; using Ranorex.Core; @@ -29,7 +30,24 @@ public class ReadResultsforFMFromResultView : ITestModule { + string _ApplyLengthEffect = ""; + [TestVariable("53f3fadb-213a-4cc3-9189-528011840720")] + public string ApplyLengthEffect + { + get { return _ApplyLengthEffect; } + set { _ApplyLengthEffect = value; } + } + + string _N_FM = ""; + [TestVariable("155dec49-5354-46b4-a93e-76f2d8c8f67d")] + public string N_FM + { + get { return _N_FM; } + set { _N_FM = value; } + } + + string _trajectAssessmentInformationString = ""; [TestVariable("9ac12269-a27c-4f0c-9b29-11857490bb77")] public string trajectAssessmentInformationString @@ -73,16 +91,27 @@ var tableResults = repo.RiskeerMainWindow.ContainerMultipleViews.DocumentViewContainerUncached.FM_ResultView.TableFMResultView.Self.As(); var rowsData = tableResults.Rows; var rowHeader = rowsData[0]; - var sectionIndeces = GetColumnIndecesResultView(rowsData[0]); + var sectionColumnIndeces = GetColumnIndecesResultView(rowsData[0]); var currentFMResultInformation = trajectResultInformation.ListFMsResultInformation.Where(fmItem=>fmItem.Label==labelFM).FirstOrDefault(); int rowIndex = 0; rowsData.RemoveAt(0); foreach (var row in rowsData) { var cellsDataInRow = row.Cells.ToList(); - currentFMResultInformation.SectionList[rowIndex].CalculationFailureProbPerSection = GetAccValue(cellsDataInRow[sectionIndeces[0]]); - currentFMResultInformation.SectionList[rowIndex].AssemblyGroup = GetAccValue(cellsDataInRow[sectionIndeces[1]]); + currentFMResultInformation.SectionList[rowIndex].CalculationFailureProbPerSection = GetAccValue(cellsDataInRow[sectionColumnIndeces[1]]); + if (sectionColumnIndeces[0]!=-1) { + currentFMResultInformation.SectionList[rowIndex].CalculationFailureProbPerProfile = GetAccValue(cellsDataInRow[sectionColumnIndeces[0]]); + } else { + var denominatorCalculationFailureProbPerSection = GetAccValue(cellsDataInRow[sectionColumnIndeces[1]]).ToNoGroupSeparator().Substring(2); + var numericCalculationFailureProbPerSection = 1.0 / Double.Parse(denominatorCalculationFailureProbPerSection); + var numericNParemeterFM = Double.Parse(N_FM); //.ToInvariantCultureDecimalSeparator()); + var numericCalculationFailureProbPerProfile = numericCalculationFailureProbPerSection * numericNParemeterFM; + currentFMResultInformation.SectionList[rowIndex].CalculationFailureProbPerProfile = numericCalculationFailureProbPerProfile.ToString(); + } + + + currentFMResultInformation.SectionList[rowIndex].AssemblyGroup = GetAccValue(cellsDataInRow[sectionColumnIndeces[2]]); rowIndex++; } @@ -124,9 +153,10 @@ private List GetColumnIndecesResultView(Row headerRow) { - int indexCalculationFailureProb = GetColumnIndex(headerRow, "Rekenwaarde\r\nfaalkans per vak\r\n[1/jaar]"); + int indexCalculationFailureProbPerProfile = GetColumnIndex(headerRow, "Rekenwaarde\r\nfaalkans per doorsnede\r\n[1/jaar]"); + int indexCalculationFailureProbPerSection = GetColumnIndex(headerRow, "Rekenwaarde\r\nfaalkans per vak\r\n[1/jaar]"); int indexAssemblyGroup = GetColumnIndex(headerRow, "Duidingsklasse"); - return new List{indexCalculationFailureProb, indexAssemblyGroup}; + return new List{indexCalculationFailureProbPerProfile, indexCalculationFailureProbPerSection, indexAssemblyGroup}; } private string GetAccValue(Cell cell) Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSectionsDivisionsFromSectionsView.cs =================================================================== diff -u -r0942373cf0001499af380ba5ea1c5e60d41b2ffe -r7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSectionsDivisionsFromSectionsView.cs (.../ReadSectionsDivisionsFromSectionsView.cs) (revision 0942373cf0001499af380ba5ea1c5e60d41b2ffe) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSectionsDivisionsFromSectionsView.cs (.../ReadSectionsDivisionsFromSectionsView.cs) (revision 7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d) @@ -47,16 +47,6 @@ set { _labelFM = value; } } - - string _groupFM = ""; - [TestVariable("7d468079-12d4-43ac-bd2c-bf6ec1396763")] - public string groupFM - { - get { return _groupFM; } - set { _groupFM = value; } - } - - /// /// Constructs a new instance. /// @@ -79,7 +69,6 @@ var fmAssessmentInformation = new FailureMechanismResultInformation(); fmAssessmentInformation.Label = labelFM; - fmAssessmentInformation.Group = Int32.Parse(groupFM); var repo = global::AutomatedSystemTests.AutomatedSystemTestsRepository.Instance; var rowsSectionsDivisions = repo.RiskeerMainWindow.ContainerMultipleViews.DocumentViewContainerUncached.FMSectionsViewTable.Rows; @@ -178,6 +167,11 @@ public string AssemblyGroup {get; set;} /// + /// Probability associated to the combined assessment of the profile (it exists for some FMs). + /// + public string CalculationFailureProbPerProfile {get; set;} + + /// /// Probability associated to the combined assessment of the section (it exists for some FMs). /// public string CalculationFailureProbPerSection {get; set;} @@ -223,11 +217,6 @@ public string Label{get; set;} /// - /// The group to which the FM belongs. - /// - public int Group {get; set;} - - /// /// The label for the assessment of this FM regarding the entire traject (It, IIt, ..., VIIt) /// public string AssemblyGroup {get; set;} Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ValidateAssemblyTrajectView.cs =================================================================== diff -u -r0942373cf0001499af380ba5ea1c5e60d41b2ffe -r7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ValidateAssemblyTrajectView.cs (.../ValidateAssemblyTrajectView.cs) (revision 0942373cf0001499af380ba5ea1c5e60d41b2ffe) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ValidateAssemblyTrajectView.cs (.../ValidateAssemblyTrajectView.cs) (revision 7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d) @@ -148,15 +148,15 @@ {"VIt", 6}, {"VIIt", 7} }; - int maxLabel = 0; +// int maxLabel = 0; string labelGroup3and4 =""; - var trjAssInfoFMsGroup3and4 = trjAssInfo.ListFMsResultInformation.Where(tai=>tai.Group==3 || tai.Group==4); - foreach (var fmTrjAssInfo in trjAssInfoFMsGroup3and4) { - if (dicAssemblyLabels[fmTrjAssInfo.AssemblyGroup]>maxLabel) { - maxLabel = dicAssemblyLabels[fmTrjAssInfo.AssemblyGroup]; - labelGroup3and4 = fmTrjAssInfo.AssemblyGroup; - } - } + //var trjAssInfoFMsGroup3and4 = trjAssInfo.ListFMsResultInformation.Where(tai=>tai.Group==3 || tai.Group==4); +// foreach (var fmTrjAssInfo in trjAssInfoFMsGroup3and4) { +// if (dicAssemblyLabels[fmTrjAssInfo.AssemblyGroup]>maxLabel) { +// maxLabel = dicAssemblyLabels[fmTrjAssInfo.AssemblyGroup]; +// labelGroup3and4 = fmTrjAssInfo.AssemblyGroup; +// } +// } return labelGroup3and4; } @@ -215,12 +215,12 @@ double productInvProbs = 1; int numberFmsProb = 0; foreach (var assInfo in trjAssInfo.ListFMsResultInformation) { - if (assInfo.Group==1 || assInfo.Group==2) { - string denominator = assInfo.FailureProbability.Substring(2, assInfo.FailureProbability.Length-2); - double currentProb = 1/Double.Parse(denominator, currentCulture); - productInvProbs*= 1- currentProb; - numberFmsProb++; - } +// if (assInfo.Group==1 || assInfo.Group==2) { +// string denominator = assInfo.FailureProbability.Substring(2, assInfo.FailureProbability.Length-2); +// double currentProb = 1/Double.Parse(denominator, currentCulture); +// productInvProbs*= 1- currentProb; +// numberFmsProb++; +// } } if (numberFmsProb==0) { return "1/Oneindig"; @@ -249,7 +249,7 @@ Report.Info("Validation for FM = " + currentFM); Report.Info("Validating group..."); row.Cells[indexGroup].Select(); - Validate.AreEqual(GetAV(row.Cells[indexGroup]), assInfo.Group.ToString()); +// Validate.AreEqual(GetAV(row.Cells[indexGroup]), assInfo.Group.ToString()); Report.Info("Validating assessment label..."); row.Cells[indexAssessmentLabel].Select(); Validate.AreEqual(GetAV(row.Cells[indexAssessmentLabel]), assInfo.AssemblyGroup); Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ValidateFailureProbabilityFMInResultView.cs =================================================================== diff -u -re5886953fdad72364bd9b73092f243c3b88e7bc3 -r7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ValidateFailureProbabilityFMInResultView.cs (.../ValidateFailureProbabilityFMInResultView.cs) (revision e5886953fdad72364bd9b73092f243c3b88e7bc3) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ValidateFailureProbabilityFMInResultView.cs (.../ValidateFailureProbabilityFMInResultView.cs) (revision 7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d) @@ -29,7 +29,24 @@ public class ValidateFailureProbabilityFMInResultView : ITestModule { + string _N_FM = ""; + [TestVariable("197f7939-9789-4254-aca0-d93dded44192")] + public string N_FM + { + get { return _N_FM; } + set { _N_FM = value; } + } + + string _ApplyLengthEffect = ""; + [TestVariable("f6beed93-c034-4010-b334-8d111679a612")] + public string ApplyLengthEffect + { + get { return _ApplyLengthEffect; } + set { _ApplyLengthEffect = value; } + } + + string _labelFM = ""; [TestVariable("d0d431e3-1478-40d4-b8fa-f84bbc8597e7")] public string labelFM @@ -67,9 +84,12 @@ Delay.SpeedFactor = 0; var trajectResultInformation = BuildAssessmenTrajectInformation(trajectAssessmentInformationString); var currentFMResultInformation = trajectResultInformation.ListFMsResultInformation.Where(fmItem=>fmItem.Label==labelFM).FirstOrDefault(); - var repo = global::AutomatedSystemTests.AutomatedSystemTestsRepository.Instance; - var expectedFailureProbFM = CalculateExpectedFailureProbFM(currentFMResultInformation); - var actualFailureProbFM = repo.RiskeerMainWindow.ContainerMultipleViews.DocumentViewContainerUncached.FM_ResultView.FailureProbabilityFM.TextValue; + var actualFailureProbFM = currentFMResultInformation.FailureProbability.ToNoGroupSeparator(); + var expectedDoubleFailureProbFM = CalculateExpectedFailureProbFM(currentFMResultInformation); + var expectedDenominatorFractionFailureProbFM = Convert.ToInt32(1.0/expectedDoubleFailureProbFM); + var expectedFailureProbFM = "1/" + expectedDenominatorFractionFailureProbFM.ToString(); + var comparison = actualFailureProbFM == expectedFailureProbFM; + } @@ -98,9 +118,9 @@ return trajectAssessmentInformation; } - private string CalculateExpectedFailureProbFM(FailureMechanismResultInformation fmResultInfo) + private double CalculateExpectedFailureProbFM(FailureMechanismResultInformation fmResultInfo) { - return Math.Min(PCombin1(fmResultInfo), PCombin2(fmResultInfo)).ToString(); + return Math.Min(PCombin1(fmResultInfo), PCombin2(fmResultInfo)); } private double PCombin1(FailureMechanismResultInformation fmResultInfo) @@ -117,7 +137,12 @@ private double PCombin2(FailureMechanismResultInformation fmResultInfo) { - return 1.0; + var maxPdsn = fmResultInfo.SectionList.Select(sc=>sc.CalculationFailureProbPerProfile). + Select(fraction=>fraction.Substring(2).ToNoGroupSeparator()). + Select(denom=> 1.0/Double.Parse(denom)).Max(); + var probMechanism2 = maxPdsn*Double.Parse(N_FM.ToInvariantCultureDecimalSeparator()); + var kk = 1/probMechanism2; + return probMechanism2; } } Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Script22.rxtst =================================================================== diff -u -re5886953fdad72364bd9b73092f243c3b88e7bc3 -r7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d --- System tests/AutomatedSystemTests/AutomatedSystemTests/Script22.rxtst (.../Script22.rxtst) (revision e5886953fdad72364bd9b73092f243c3b88e7bc3) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Script22.rxtst (.../Script22.rxtst) (revision 7075bfd9f88e616d0cfbb1be4d5e4e244aa3551d) @@ -9,6 +9,26 @@ type="Recording"> + + + + + + + + + dataname="ApplyLengthEffect" + datasourceid="7bcf6b46-895c-4012-8c96-0106901f96a7" + variableid="53f3fadb-213a-4cc3-9189-528011840720" + variablename="ApplyLengthEffect"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1245,6 +1333,20 @@ id="d28c5d6f-c8ab-4c7a-b262-f3ae3e32fc47" name="CloseAssemblyMap"> + + + + + + + + - - @@ -1604,6 +1700,22 @@ id="7bcf6b46-895c-4012-8c96-0106901f96a7" name="LoopFms"> + + + + + + + + + pathToFM + + pathToResultItem @@ -2117,9 +2232,6 @@ pathToReferenceCSVFile - - groupFM - @@ -2129,6 +2241,9 @@ fmLabel + - + - + - + - + - + - + -
+ pathToFM + pathToResultItem @@ -2137,15 +2252,15 @@ pathToReferenceCSVFile - groupFM -
STPH + @TR>@GF>@STPH + @TR>@GF>@STPH>Oordeel>Resultaat @@ -2154,15 +2269,15 @@ X:\script22\reference\@TR_@GF_@STPH_Oordeel_Resultaat.csv - 1 -
GEKB + @TR>@GF>@GEKB + @TR>@GF>@GEKB>Oordeel>Resultaat @@ -2171,15 +2286,15 @@ X:\script22\reference\@TR_@GF_@GEKB_Oordeel_Resultaat.csv - 2 -
STMI + @TR>@GF>@STMI + @TR>@GF>@STMI>Oordeel>Resultaat @@ -2188,15 +2303,15 @@ X:\script22\reference\@TR_@GF_@STMI_Oordeel_Resultaat.csv - 3 -
BSKW + @TR>@GF>@BSKW + @TR>@GF>@BSKW>Oordeel>Resultaat @@ -2205,15 +2320,15 @@ X:\script22\reference\@TR_@GF_@BSKW_Oordeel_Resultaat.csv - 4 -
PKW + @TR>@GF>@PKW + @TR>@GF>@PKW>Oordeel>Resultaat @@ -2222,15 +2337,15 @@ X:\script22\reference\@TR_@GF_@PKW_Oordeel_Resultaat.csv - 5 -
NIEUW + @TR>@SF>Nieuw + @TR>@SF>Nieuw>Oordeel>Resultaat @@ -2239,9 +2354,6 @@ X:\script22\reference\@TR_@SF_Nieuw_Oordeel_Resultaat.csv - 6 -
@@ -2474,6 +2586,9 @@ id="c2dae628-5195-4cc9-8348-296f5a64bbce"> + +