diff --git a/Results/Properties/AssemblyInfo.cs b/Results/Properties/AssemblyInfo.cs index 2d06f77e5..440539a72 100644 --- a/Results/Properties/AssemblyInfo.cs +++ b/Results/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.18.887.0")] -[assembly: AssemblyFileVersion("2.18.887.0")] +[assembly: AssemblyVersion("2.18.888.0")] +[assembly: AssemblyFileVersion("2.18.888.0")] diff --git a/TBF/BenchControl/TestMethods/GrabImage/Component.cs b/TBF/BenchControl/TestMethods/GrabImage/Component.cs index 4b7ae9b88..097e66131 100644 --- a/TBF/BenchControl/TestMethods/GrabImage/Component.cs +++ b/TBF/BenchControl/TestMethods/GrabImage/Component.cs @@ -12,7 +12,7 @@ namespace TBF.BenchControl.TestMethods.GrabImage public class Component : ComponentBase, GenericDevices.ITestMethod { private static readonly ILog log = LogManager.GetLogger(typeof(Component)); - public override string ToString() { return string.Format("TestMethods.LiveStream({0})", Cfg.ToString(1)); } + public override string ToString() { return string.Format("TestMethods.GrabImage({0})", Cfg.ToString(1)); } public bool CanTest(MetersKind meters) { return true; } public bool DoTransitions() { return false; } diff --git a/TBF/BenchControl/TestMethods/SensitivityTest/TestMethod.cs b/TBF/BenchControl/TestMethods/SensitivityTest/TestMethod.cs index 9264aab5a..a49e202d7 100644 --- a/TBF/BenchControl/TestMethods/SensitivityTest/TestMethod.cs +++ b/TBF/BenchControl/TestMethods/SensitivityTest/TestMethod.cs @@ -12,7 +12,7 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest public class TestMethod : ComponentBase, GenericDevices.ITestMethod { private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); - public override string ToString() { return string.Format("TestMethods.CombinedWithDetection({0})", Cfg.ToString(1)); } + public override string ToString() { return string.Format("TestMethods.SensitivityTest({0})", Cfg.ToString(1)); } readonly TestMethodCfg testMethodCfg; diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs index 0b2f75473..cda87a632 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs @@ -15,8 +15,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication { private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData"); - - public override string ToString() { return string.Format("TestMethods.Adjustment({0})", Cfg.ToString(1)); } + + public override string ToString() { return string.Format("TestMethods.iPerlCommunication({0})", Cfg.ToString(1)); } public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; } public bool DoTransitions() { return false; } diff --git a/TBF/MainWnd.cs b/TBF/MainWnd.cs index 1edb123e0..27928bebe 100644 --- a/TBF/MainWnd.cs +++ b/TBF/MainWnd.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Metering Systems +/// Copyright (c) 2013-2018 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -17,6 +17,8 @@ namespace TBF { static readonly ILog log = LogManager.GetLogger(typeof(MainWnd)); + const string ProcSeparator = " "; /// string separating procedure number and procedure name + public UiControls.BenchControlPanel BenchControlPanel; public string ProcedureName; public Procedure CurrentProcedure; @@ -445,7 +447,8 @@ namespace TBF /// public void ReloadProcedures() { - ReloadProcedures(procedureComboBox.Text.Substring(procedureComboBox.Text.IndexOf(" ") + 2)); + int separPos = procedureComboBox.Text.IndexOf(ProcSeparator); + ReloadProcedures((separPos >= 0) ? procedureComboBox.Text.Substring(separPos + ProcSeparator.Length) : string.Empty); } public void ReloadProcedures(string procedureNameToSelect) @@ -497,9 +500,9 @@ namespace TBF private void procedureComboBox_SelectedIndexChanged(object sender, EventArgs e) { - int ix = procedureComboBox.Text.IndexOf(" "); + int ix = procedureComboBox.Text.IndexOf(ProcSeparator); int procNr = int.Parse(procedureComboBox.Text.Substring(0, ix)); - string procName = procedureComboBox.Text.Substring(ix + 2); + string procName = procedureComboBox.Text.Substring(ix + ProcSeparator.Length); UpdateProcedure(procNr, procName); } diff --git a/TBF/ProcedureDlg.cs b/TBF/ProcedureDlg.cs index 6d4c1d6c2..9fd16abf0 100644 --- a/TBF/ProcedureDlg.cs +++ b/TBF/ProcedureDlg.cs @@ -395,7 +395,7 @@ namespace TBF void RefreshGeneralTab() { procNameTextBox.Text = LoadedProcedure.Name; - Text = string.Format("{0} '{1}'", Strings.Procedure, LoadedProcedure.Name); + Text = string.Format("{0} {1} {2}", Strings.Procedure, LoadedProcedure.ItemNr + 1, LoadedProcedure.Name); descriptionTextBox.Text = LoadedProcedure.Description; createdByTextBox.Text = LoadedProcedure.CreationUser; @@ -455,7 +455,7 @@ namespace TBF void UpdateFromGeneralTab() { LoadedProcedure.Name = procNameTextBox.Text; - Text = string.Format("{0} '{1}'", Strings.Procedure, LoadedProcedure.Name); + Text = string.Format("{0} {1} {2}", Strings.Procedure, LoadedProcedure.ItemNr + 1, LoadedProcedure.Name); LoadedProcedure.Description = descriptionTextBox.Text; LoadedProcedure.Watermeters = watermetersTextBox.Text; diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 3c0b5ada2..0d674e837 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.18.887.0")] -[assembly: AssemblyFileVersion("2.18.887.0")] +[assembly: AssemblyVersion("2.18.890.0")] +[assembly: AssemblyFileVersion("2.18.890.0")] diff --git a/TBF/UiControls/ProceduresCtrl.cs b/TBF/UiControls/ProceduresCtrl.cs index b83c1d941..345404ea6 100644 --- a/TBF/UiControls/ProceduresCtrl.cs +++ b/TBF/UiControls/ProceduresCtrl.cs @@ -243,7 +243,7 @@ namespace TBF.UiControls transaction.Commit(); SelectedItems[0].Tag = modifiedProcedure; - MessageBox.Show(string.Format(Strings.Procedure_0_modified, modifiedProcedure.Name), + MessageBox.Show(string.Format(Strings.Procedure_0_modified, string.Format(" {0} '{1}' ", modifiedProcedure.ItemNr + 1, modifiedProcedure.Name)), Strings.Confirmation, MessageBoxButtons.OK, MessageBoxIcon.Information); diff --git a/TBF/UiControls/TestParamsCtrl.cs b/TBF/UiControls/TestParamsCtrl.cs index 0baf9160e..b8078336e 100644 --- a/TBF/UiControls/TestParamsCtrl.cs +++ b/TBF/UiControls/TestParamsCtrl.cs @@ -63,25 +63,9 @@ namespace TBF.UiControls public void Initialize() { - IParamsProvider sampleToCreateHeader = null; + IParamsProvider sampleToCreateHeader; - /// For each test (with an appropriate method in case of ITestMethod-s) - foreach (var test in parent.LoadedProcedure.Tests) - { - if ((cmpnt.Cfg.GetTestParams() != null) && - (!(cmpnt is BenchControl.GenericDevices.ITestMethod) || (test.Method == cmpnt.Cfg.Name))) - { - /// Load ComponentTest entity or create it if it does not exist - IParamsProvider testParams = cmpnt.Cfg.CreateTestParams(test); - if (sampleToCreateHeader == null) sampleToCreateHeader = testParams; - testParamsProviders.Add(testParams); - } - else - { - /// In case of ITestMethod: Insert null for a test without an appropriate method. - testParamsProviders.Add(null); - } - } + testParamsProviders = GetTestParamsProviders(parent.LoadedProcedure.Tests, out sampleToCreateHeader); /// Create the header if (sampleToCreateHeader != null) @@ -106,6 +90,32 @@ namespace TBF.UiControls RedrawAll(); } + IList GetTestParamsProviders(IList tests, out IParamsProvider sampleToCreateHeader) + { + IList result = new List(); + sampleToCreateHeader = null; + + /// For each test (with an appropriate method in case of ITestMethod-s) + foreach (var test in tests) + { + if ((cmpnt.Cfg.GetTestParams() != null) && + (!(cmpnt is BenchControl.GenericDevices.ITestMethod) || (test.Method == cmpnt.Cfg.Name))) + { + /// Load ComponentTest entity or create it if it does not exist + IParamsProvider testParams = cmpnt.Cfg.CreateTestParams(test); + if (sampleToCreateHeader == null) sampleToCreateHeader = testParams; + result.Add(testParams); + } + else + { + /// In case of ITestMethod: Insert null for a test without an appropriate method. + result.Add(null); + } + } + + return result; + } + private void listViewEx_SubItemClicked(object sender, Results.Forms.SubItemEventArgs e) { int itemNr = showTestsColumn ? (e.SubItem - 1) : e.SubItem; @@ -160,7 +170,9 @@ namespace TBF.UiControls public void RedrawAll() { - listViewEx.Items.Clear(); + IParamsProvider dummy; + testParamsProviders = GetTestParamsProviders(parent.LoadedProcedure.Tests, out dummy); + listViewEx.Items.Clear(); for (int i = 0; i < testParamsProviders.Count && i < parent.LoadedProcedure.Tests.Count; i++) { DrawOne(testParamsProviders[i], parent.LoadedProcedure.Tests[i].Name);