diff --git a/Results/Entities/WaterMeter.cs b/Results/Entities/WaterMeter.cs index 5ebed0984..8fae42994 100644 --- a/Results/Entities/WaterMeter.cs +++ b/Results/Entities/WaterMeter.cs @@ -252,7 +252,9 @@ namespace Results.Entities break; } } - +#if ORACLE_DB + if (Utils.MaxTestIndex != 0 && (Pruefindex % 100) > Utils.MaxTestIndex) passed = false; +#endif return passed; } diff --git a/Results/Forms/OneWMResultsColumnsCtrl.cs b/Results/Forms/OneWMResultsColumnsCtrl.cs index 03b3469dd..d730892ed 100644 --- a/Results/Forms/OneWMResultsColumnsCtrl.cs +++ b/Results/Forms/OneWMResultsColumnsCtrl.cs @@ -79,18 +79,18 @@ namespace Results.Forms return; } - /// Update background color + /// Update background color and caption string message = string.Empty; - UpdateBkColor(wMtr.GetColorOfResults(false, out message)); - - /// Update caption #if ORACLE_DB + bool maxRepeatsExceeded = (Utils.MaxTestIndex != 0 && (wMtr.Pruefindex % 100) > Utils.MaxTestIndex); + UpdateBkColor(wMtr.GetColorOfResults(maxRepeatsExceeded, out message)); tBox.Text = caption = string.Format("{0} ({1}) {2} {3}", wMtr.WMPosition, wMtr.Pruefindex == 0 ? "?" : string.Format("{0}x", wMtr.Pruefindex % 100), (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), message); #else + UpdateBkColor(wMtr.GetColorOfResults(false, out message)); tBox.Text = caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr); #endif diff --git a/Results/Forms/OneWMResultsRowsCtrl.cs b/Results/Forms/OneWMResultsRowsCtrl.cs index 01f17a42d..9f0905369 100644 --- a/Results/Forms/OneWMResultsRowsCtrl.cs +++ b/Results/Forms/OneWMResultsRowsCtrl.cs @@ -91,21 +91,21 @@ namespace Results.Forms return; } - /// Update background color + /// Update background color and caption string message = string.Empty; - UpdateBkColor(wMtr.GetColorOfResults(false, out message)); - - /// Update caption #if ORACLE_DB + bool maxRepeatsExceeded = (Utils.MaxTestIndex != 0 && (wMtr.Pruefindex % 100) > Utils.MaxTestIndex); + UpdateBkColor(wMtr.GetColorOfResults(maxRepeatsExceeded, out message)); tBox.Text = caption = string.Format("{0} ({1}) {2} {3}", wMtr.WMPosition, wMtr.Pruefindex == 0 ? "?" : string.Format("{0}x", wMtr.Pruefindex % 100), (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), message); #else + UpdateBkColor(wMtr.GetColorOfResults(false, out message)); tBox.Text = caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr); #endif - + UpdateWMPos(wMtr.WMPosition); /// Update test results diff --git a/Results/Utils.cs b/Results/Utils.cs index 6e351fd16..4fa018bbc 100644 --- a/Results/Utils.cs +++ b/Results/Utils.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2016-2021 Sensus Slovensko a.s. +/// Copyright (c) 2016-2022 Sensus Slovensko a.s. /// using System; using System.Text; @@ -9,6 +9,8 @@ namespace Results { public static class Utils { + public static int MaxTestIndex = 0; + public static string GetTestName(string name, int repeats, int repetitionNr) { return Common.Utils.GetTestName(name, repeats, repetitionNr); diff --git a/TBF/Rig/StateMachine.cs b/TBF/Rig/StateMachine.cs index 200262bd3..54154a8c6 100644 --- a/TBF/Rig/StateMachine.cs +++ b/TBF/Rig/StateMachine.cs @@ -235,8 +235,17 @@ namespace TBF.Rig foreach (var cmpnt in components) { if (cmpnt is Elde.ControlBoardDev) ControlBoard = cmpnt as Elde.ControlBoardDev; - if (cmpnt is IBenchInfo) ProcessData.BenchInfo = cmpnt as IBenchInfo; - if (cmpnt is IErrorFlags) ProcessData.ErrorFlagsComp = cmpnt as IErrorFlags; + + if (cmpnt is IBenchInfo) + { + ProcessData.BenchInfo = cmpnt as IBenchInfo; + if (cmpnt is TBF.Rig.DataContainers.BenchInfo.iPerl.Component) + { + Results.Utils.MaxTestIndex = (cmpnt as TBF.Rig.DataContainers.BenchInfo.iPerl.Component).MaxTestIndex; + } + } + + if (cmpnt is IErrorFlags) ProcessData.ErrorFlagsComp = cmpnt as IErrorFlags; if (cmpnt is IStatisticsMonitoring) ProcessData.StatisticsMonitoringComp = cmpnt as IStatisticsMonitoring; if ((cmpnt is Output.DB.SensusOracle.Database) && (ProcessData.OracleDB == null)) diff --git a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs index db3d84b8a..01f7a1a3a 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs @@ -754,7 +754,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication meterRslt.VolumeStart = oriMeterRslt.VolumeStart; meterRslt.VolumeEnd = oriMeterRslt.VolumeEnd; #if ORACLE_DB - if (ProcessData.BatchRslts.Batch.WaterMeters[i].Pruefindex == 1) + if ((ProcessData.BatchRslts.Batch.WaterMeters[i].Pruefindex % 100) == 1) { meterRslt.Passed = (oriMeterRslt.Error >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin() && oriMeterRslt.Error <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());