From 9bd2cd2634e29dad6069f3a890e0fef54e794e94 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Tue, 17 Jul 2018 12:16:52 +0200 Subject: [PATCH] Error message after a wrong test or procedure parameter, ver. 2.18.969 --- .../CombinedWithDetectionSeq.cs | 12 ++++++++---- TBF/Properties/AssemblyInfo.cs | 4 ++-- TBF/UiControls/ProcedureParamsCtrl.cs | 9 ++++++++- TBF/UiControls/TestParamsCtrl.cs | 19 +++++++++++++------ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index 1dac53c27..f242678e8 100644 --- a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -253,7 +253,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection Bridge.OnError(this, Strings.Flow_adjustment_failed); goto stopTest; } - } + if (e.Contains(Event.Next)) goto init_flow_set; + } while (!e.Contains(Event.FlowReached)); @@ -263,9 +264,12 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection case Event.UiCmdStop: goto stopTest; } - //==================================== - // Find the switching flow - //==================================== + + init_flow_set: + + //==================================== + // Find the switching flow + //==================================== /// Allocate detection buffers double[] flowsForDetection = new double[DetectionBufferSize]; /// in [m3/h] diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 2d3f001e3..48f5661a1 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.968.0")] -[assembly: AssemblyFileVersion("2.18.968.0")] +[assembly: AssemblyVersion("2.18.969.0")] +[assembly: AssemblyFileVersion("2.18.969.0")] diff --git a/TBF/UiControls/ProcedureParamsCtrl.cs b/TBF/UiControls/ProcedureParamsCtrl.cs index 8a3370f20..423f66885 100644 --- a/TBF/UiControls/ProcedureParamsCtrl.cs +++ b/TBF/UiControls/ProcedureParamsCtrl.cs @@ -152,7 +152,14 @@ namespace TBF.UiControls { (e.Item.Tag as IParamsProvider).UpdateParam(e.SubItem - nrFixedColumns, e.DisplayText); } - } + else + { + MessageBox.Show(message); + e.DisplayText = e.Item.SubItems[e.SubItem].Text; + e.Cancel = true; + return; /// NOK + } + } public void RedrawAll() diff --git a/TBF/UiControls/TestParamsCtrl.cs b/TBF/UiControls/TestParamsCtrl.cs index 986e160db..c9a12f27e 100644 --- a/TBF/UiControls/TestParamsCtrl.cs +++ b/TBF/UiControls/TestParamsCtrl.cs @@ -158,10 +158,17 @@ namespace TBF.UiControls string message; int itemNr = showTestsColumn ? (e.SubItem - 1) : e.SubItem; - if ((e.Item.Tag as IParamsProvider).ValidateParam(itemNr, e.DisplayText, out message)) - { - (e.Item.Tag as IParamsProvider).UpdateParam(itemNr, e.DisplayText); - } + if ((e.Item.Tag as IParamsProvider).ValidateParam(itemNr, e.DisplayText, out message)) + { + (e.Item.Tag as IParamsProvider).UpdateParam(itemNr, e.DisplayText); + } + else + { + MessageBox.Show(message); + e.DisplayText = e.Item.SubItems[e.SubItem].Text; + e.Cancel = true; + return; /// NOK + } } public void RedrawAll() @@ -203,11 +210,11 @@ namespace TBF.UiControls { if (test.Method == cmpnt.Cfg.Name) { - IParamsProvider testParams = cmpnt.Cfg.CreateTestParamsProvider(); /// Load or create ComponentTest entity + IParamsProvider testParams = cmpnt.Cfg.CreateTestParamsProvider(); /// Load or create ComponentTest entity if (testParams != null) { var writer = new System.IO.StringWriter(); - testParams.GetSerializer().Serialize(writer, testParams); /// Serialize this class with parameters + testParams.GetSerializer().Serialize(writer, testParams); /// Serialize this class with parameters ComponentTest entity = new ComponentTest(test.Method, writer.ToString(), test); entity.SetParamsProvider(testParams);