From d83b497fa0512fc327b3cb17caf9d0b4d852d7f4 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Tue, 1 Dec 2015 22:03:53 +0100 Subject: [PATCH] Problems with 'standrohre' test results (parts) and test names in BenchControlPanel fixed, version 1.6.149. --- ResultsBrowser/Program.cs | 6 ++++- .../BenchControl/StateMachine.cs | 2 +- TestBenchFramework/Program.cs | 6 ++++- TestBenchFramework/Properties/AssemblyInfo.cs | 4 +-- TestBenchFramework/TestProgressControls.cs | 12 ++------- .../UiControls/BenchControlPanel.cs | 26 ++++++++++++++++--- .../UiControls/TestProgressCtrl.cs | 12 +++------ TestBenchFramework/Utils.cs | 26 +++++++++++++++++++ 8 files changed, 67 insertions(+), 27 deletions(-) diff --git a/ResultsBrowser/Program.cs b/ResultsBrowser/Program.cs index 6cbe72beb..bad936ad9 100644 --- a/ResultsBrowser/Program.cs +++ b/ResultsBrowser/Program.cs @@ -32,7 +32,11 @@ namespace ResultsBrowser public static DatabaseSettings CurrentBench; const string SQLiteDbFName = "SQLite.db"; -#if DN100 || MUNICH || BADGER_VELKA_TRAT +#if MUNICH + public const int WMsCount = 3; + public const int LineSize = 1; + public const int CompoundWMsCount = 1; +#elif DN100 || BADGER_VELKA_TRAT public const int WMsCount = 3; public const int LineSize = 3; public const int CompoundWMsCount = 1; diff --git a/TestBenchFramework/BenchControl/StateMachine.cs b/TestBenchFramework/BenchControl/StateMachine.cs index 91f476b3b..55735669c 100644 --- a/TestBenchFramework/BenchControl/StateMachine.cs +++ b/TestBenchFramework/BenchControl/StateMachine.cs @@ -387,7 +387,7 @@ namespace TBF.BenchControl { foreach (var test in Tests) { - if (test.Name.Equals(TBF.UiBridge.Bridge.SelectedTestName)) return test; + if (Utils.TestTitle(test, 1).Equals(UiBridge.Bridge.SelectedTestName)) return test; } } return null; diff --git a/TestBenchFramework/Program.cs b/TestBenchFramework/Program.cs index 925b01457..e0a0c2826 100644 --- a/TestBenchFramework/Program.cs +++ b/TestBenchFramework/Program.cs @@ -39,7 +39,11 @@ namespace TBF public static DatabaseSettings CurrentBench; const string SQLiteDbFName = "SQLite.db"; -#if DN100 || MUNICH || BADGER_VELKA_TRAT +#if MUNICH + public const int WMsCount = 3; + public const int LineSize = 1; + public const int CompoundWMsCount = 1; +#elif DN100 || BADGER_VELKA_TRAT public const int WMsCount = 3; public const int LineSize = 3; public const int CompoundWMsCount = 1; diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 924c88931..8479b7f13 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.6.148.1")] -[assembly: AssemblyFileVersion("1.6.148.1")] +[assembly: AssemblyVersion("1.6.149.1")] +[assembly: AssemblyFileVersion("1.6.149.1")] diff --git a/TestBenchFramework/TestProgressControls.cs b/TestBenchFramework/TestProgressControls.cs index 2bd73105e..d6179494e 100644 --- a/TestBenchFramework/TestProgressControls.cs +++ b/TestBenchFramework/TestProgressControls.cs @@ -74,18 +74,10 @@ namespace TBF progresses = new List(); foreach (var test in args.Procedure.Tests) { - /// Single test - if (test.Repeats == 1) - { - UiControls.TestProgressCtrl prgrs = new UiControls.TestProgressCtrl(test.Id, test.Name); - progresses.Add(prgrs); - parent.Controls.Add(prgrs); - continue; - } - /// More test repetitions for (int i = 1; i <= test.Repeats; i++) { - UiControls.TestProgressCtrl prgrs = new UiControls.TestProgressCtrl(test.Id, test.Name, i, test.Repeats); + UiControls.TestProgressCtrl prgrs = + new UiControls.TestProgressCtrl(test.Id, Utils.TestTitle(test, i), i, test.Repeats); progresses.Add(prgrs); parent.Controls.Add(prgrs); } diff --git a/TestBenchFramework/UiControls/BenchControlPanel.cs b/TestBenchFramework/UiControls/BenchControlPanel.cs index fdb8d9439..36467b22f 100644 --- a/TestBenchFramework/UiControls/BenchControlPanel.cs +++ b/TestBenchFramework/UiControls/BenchControlPanel.cs @@ -129,7 +129,13 @@ namespace TBF.UiControls Program.MainWnd.CurrentProcedure = procedures[0]; testComboBox.Items.Clear(); - foreach (var test in procedures[0].Tests) testComboBox.Items.Add(test.Name); + foreach (var test in procedures[0].Tests) + { + for (int i = 1; i <= test.Repeats; i++) + { + testComboBox.Items.Add(Utils.TestTitle(test, i)); + } + } if (testComboBox.Items.Contains(oriTestName)) { @@ -138,8 +144,22 @@ namespace TBF.UiControls } else if (procedures[0].Tests.Count > 0) { - testComboBox.Text = procedures[0].Tests[0].Name; - TestName = procedures[0].Tests[0].Name; + Entities.Test test = procedures[0].Tests[0]; + string title; + if (test.Repeats == 1) + { + if (test.Part == 0) + title = test.Name; /// Single test + else + title = string.Format("{0} ({1})", test.Name, test.Part); /// A part of a single test + } + else + { + title = string.Format("{0} ({1}/{2})", test.Name, 1, test.Repeats); /// More test repetitions + } + + testComboBox.Text = title; + TestName = title; } else { diff --git a/TestBenchFramework/UiControls/TestProgressCtrl.cs b/TestBenchFramework/UiControls/TestProgressCtrl.cs index 1dab63b9c..b820bb956 100644 --- a/TestBenchFramework/UiControls/TestProgressCtrl.cs +++ b/TestBenchFramework/UiControls/TestProgressCtrl.cs @@ -52,19 +52,13 @@ namespace TBF.UiControls this.TestResult = UiControls.TestProgressCtrl.Result.NotDone; } - public TestProgressCtrl(int testId, string testName, int repetitionNr, int testRepeats) + public TestProgressCtrl(int testId, string title, int repetitionNr, int testRepeats) : this() { this.testId = testId; - this.testName = testName; + this.testName = title; this.repetitionNr = repetitionNr; - this.Title = testName + string.Format(" ({0}/{1})", repetitionNr, testRepeats); - } - - public TestProgressCtrl(int testId, string testName) - : this(testId, testName, 1, 1) - { - this.Title = testName; + this.Title = title; } private void TestProgressCtrl_Click(object sender, System.EventArgs e) diff --git a/TestBenchFramework/Utils.cs b/TestBenchFramework/Utils.cs index a7d2c519f..da2c7745f 100644 --- a/TestBenchFramework/Utils.cs +++ b/TestBenchFramework/Utils.cs @@ -270,6 +270,32 @@ namespace TBF return wmPartSize; } + /// + /// Return test title for a given test and repetition number + /// + /// Test entity + /// 1 .. Nr. repetitions + /// Test title (string) + public static string TestTitle(Entities.Test test, int repetitonNr) + { + if (test.Repeats == 1) + { + if (test.Part == 0) + { + return test.Name; /// Single test + } + else + { + return string.Format("{0} ({1})", test.Name, test.Part); /// A part of a single test + } + } + else + { + /// More test repetitions + return string.Format("{0} ({1}/{2})", test.Name, repetitonNr, test.Repeats); + } + } + /// /// Converts float number to a string with the specified number of valid digits ///