Batch.SaveTime introduced, Batch.EndTime calculation modified.

This commit is contained in:
Milan Hanajik
2023-03-30 10:04:14 +02:00
parent b9e8eeab00
commit cf626d7b91
7 changed files with 71 additions and 40 deletions
+13 -1
View File
@@ -1252,7 +1252,19 @@ namespace TBF.Rig.Sequences
///
/// Update batch results, determine whether watermeters passed all required tests
///
BatchRslts.Batch.EndTime = DateTime.Now; /// Set cycle end time
/// Determine the end of the last test and save it as the batch end time
DateTime lastTestEndTime = DateTime.MinValue;
if (BatchRslts.Batch.TestRslts != null)
{
foreach (var tr in BatchRslts.Batch.TestRslts)
{
if (tr.EndTime > lastTestEndTime) lastTestEndTime = tr.EndTime;
}
}
BatchRslts.Batch.EndTime = lastTestEndTime;
BatchRslts.Batch.SaveTime = DateTime.Now;
Results.Utils.GetCounterStates(BatchRslts.Batch, Program.LocalSettings.Counters); /// Update counters
/// Remove results of internal tests
for (int i = BatchRslts.Batch.TestRslts.Count - 1; i >= 0; i--)