From 45869401ad5be56e6873e0bf67ec37400ed13423 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Thu, 20 Apr 2017 11:00:41 +0200 Subject: [PATCH] BatchNr of restored session fixed, ver. 2.12.544 --- .../BenchControl/Sequences/MainSeq.cs | 22 +++++++++++-------- .../Forms/PreviousResultCtrl.cs | 4 ++-- TestBenchFramework/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs index 00114620c..a4b64eb87 100644 --- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -234,14 +234,14 @@ namespace TBF.BenchControl.Sequences /// Procedure selected at this point, a new batch was started /// StateMachine.LoadProcedureParams(StateMachine.Procedure); - Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Enable STOP button + int newBatchNr = Program.LocalSettings.BatchNr; + log.FatalFormat("New measurement session started: batch = {0}, procedure = {1}", newBatchNr, StateMachine.Procedure.Name); if (selection == Selection.RestoreBatch) { BatchRslts = RestoreBatchResults(TBF.UiBridge.Bridge.BatchNr, /// Original batch number - Program.LocalSettings.BatchNr, /// New batch number - StateMachine.Procedure); + newBatchNr); /// New batch number } else if (selection == Selection.Custom) { @@ -254,7 +254,7 @@ namespace TBF.BenchControl.Sequences } } - BatchRslts = CreateNewBatchResults(Program.LocalSettings.BatchNr, StateMachine.Procedure); + BatchRslts = CreateNewBatchResults(newBatchNr, StateMachine.Procedure); for (int i = StateMachine.Procedure.Tests.Count - 1; i >= 0; i--) { @@ -266,7 +266,7 @@ namespace TBF.BenchControl.Sequences } else { - BatchRslts = CreateNewBatchResults(Program.LocalSettings.BatchNr, StateMachine.Procedure); + BatchRslts = CreateNewBatchResults(newBatchNr, StateMachine.Procedure); } @@ -897,11 +897,13 @@ namespace TBF.BenchControl.Sequences summaryResults.Info(TestResult2CsvLine(tr)); } - Program.LocalSettings.BatchNr++; Program.LocalSettings.Save(); - log.FatalFormat("BatchNr = {0} (incremented)", Program.LocalSettings.BatchNr); + log.FatalFormat("Measurement session saved: batch = {0}, procedure = {1}, next batch nr. = {2}", + ProcessData.BatchRslts.Batch.BatchNr, + ProcessData.BatchRslts.Batch.ProcedureName, + Program.LocalSettings.BatchNr); if (simultWithEvacuationCount > 0) { @@ -1356,9 +1358,11 @@ namespace TBF.BenchControl.Sequences /// New unique batch number /// Reloaded procedure /// - Results.BatchResults RestoreBatchResults(int oriBatchNr, int newBatchNr, Procedure procedure) + Results.BatchResults RestoreBatchResults(int oriBatchNr, int newBatchNr) { - return Results.BatchResults.FromBatch(Results.DB.LoadBatch(oriBatchNr)); + Batch batch = Results.DB.LoadBatch(oriBatchNr); + batch.BatchNr = newBatchNr; + return Results.BatchResults.FromBatch(batch); } diff --git a/TestBenchFramework/Forms/PreviousResultCtrl.cs b/TestBenchFramework/Forms/PreviousResultCtrl.cs index c89565e79..338ff01c8 100644 --- a/TestBenchFramework/Forms/PreviousResultCtrl.cs +++ b/TestBenchFramework/Forms/PreviousResultCtrl.cs @@ -53,12 +53,12 @@ namespace TBF.Forms sentCheckBox.Text = Strings.Printed; sentCheckBox.Checked = Sent; sendReloadButton.Enabled = true; /// 'Print again' function always available - sendReloadButton.Text = reloadEn ? Strings.Reload : Strings.Print_again; + sendReloadButton.Text = reloadEn ? Strings.Restore : Strings.Print_again; #elif ORACLE_DB sentCheckBox.Text = Strings.Sent; sentCheckBox.Checked = Sent; sendReloadButton.Enabled = reloadEn || !Sent; - sendReloadButton.Text = reloadEn ? Strings.Reload : Strings.Save_again; + sendReloadButton.Text = reloadEn ? Strings.Restore : Strings.Save_again; #else sentCheckBox.Visible = false; sendReloadButton.Enabled = reloadEn; diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index fb9a5b9c2..e1f3418b3 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.12.543.1")] -[assembly: AssemblyFileVersion("2.12.543.1")] +[assembly: AssemblyVersion("2.12.544.1")] +[assembly: AssemblyFileVersion("2.12.544.1")]