From cd1bee1018844d32bd63a6c8a1e8f49ed97acee0 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Tue, 27 Mar 2018 10:47:31 +0200 Subject: [PATCH] IControlCom : Interface uses uint[8] filterConstants (Juzna Afrika, Genesis), ver. 2.18.861 --- TBF/BenchControl/Elde/ControlBoardDev.cs | 5 ++++- TBF/BenchControl/Elde/ControlComSim.cs | 8 +++---- TBF/BenchControl/Elde/ControlComWrap.cs | 28 ++++++++++++++---------- TBF/BenchControl/Elde/IControlCom.cs | 2 +- TBF/Properties/AssemblyInfo.cs | 4 ++-- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/TBF/BenchControl/Elde/ControlBoardDev.cs b/TBF/BenchControl/Elde/ControlBoardDev.cs index 8a968e06b..412031692 100644 --- a/TBF/BenchControl/Elde/ControlBoardDev.cs +++ b/TBF/BenchControl/Elde/ControlBoardDev.cs @@ -430,11 +430,14 @@ namespace TBF.BenchControl.Elde { if (DebugLevel == DebugMode.Simulate) return; + uint filter = Convert.ToUInt32(filterConstant); + /// if (sendCommandFlag) { controlCom.SendCommand(cmd, refNr, (benchModelRoute & routeMask), totalRefPulses, massRefPulses, testMethods, - filterConstant, FMFreq, regConst, shortImp, stopDevs); + new uint[] { filter, filter, filter, filter, filter, filter, filter, filter }, + FMFreq, regConst, shortImp, stopDevs); } controlCom.RunDeviceAfter(); diff --git a/TBF/BenchControl/Elde/ControlComSim.cs b/TBF/BenchControl/Elde/ControlComSim.cs index a8ad11be0..cdc54867c 100644 --- a/TBF/BenchControl/Elde/ControlComSim.cs +++ b/TBF/BenchControl/Elde/ControlComSim.cs @@ -113,7 +113,7 @@ namespace TBF.BenchControl.Elde int totalRefPulses; int massRefPulses; TestMethods testMethods; - float filterConstant; + uint[] filterConstants; float[] FMFreq; int regConst; int shortImp; @@ -174,7 +174,7 @@ namespace TBF.BenchControl.Elde /// What to stop public void SendCommand(Command cmd, int refFlowmtrNr, UInt128 route, int totalRefPulses, int massRefPulses, TestMethods testMethods, - float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) + uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) { log.InfoFormat("SendCommand(Cmd={0},Ref#={1},Route={2} {3} {4} {5},TotalPls={6},MassPls={7},TstM={8},filt={9},FM=[{10}{11}{12}{13}{14}{15}],Reg={16},ShrtImp={17},Stop={18})", cmd, refFlowmtrNr, /// 0, 1 @@ -182,7 +182,7 @@ namespace TBF.BenchControl.Elde ((route >> 32) & 0xFFFF).ToString("X4"), /// 3 ((route >> 16) & 0xFFFF).ToString("X4"), /// 4 (route & 0xFFFF).ToString("X4"), /// 5 - totalRefPulses, massRefPulses, testMethods, filterConstant, /// 6, 7, 8, 9 + totalRefPulses, massRefPulses, testMethods, filterConstants, /// 6, 7, 8, 9 fmFreq[0].ToString(), /// 10 (fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "", /// 11 (fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "", /// 12 @@ -212,7 +212,7 @@ namespace TBF.BenchControl.Elde this.totalRefPulses = totalRefPulses; this.massRefPulses = massRefPulses; this.testMethods = testMethods; - this.filterConstant = filterConstant; + this.filterConstants = filterConstants; this.FMFreq = fmFreq; this.regConst = regConst; this.shortImp = shortImp; diff --git a/TBF/BenchControl/Elde/ControlComWrap.cs b/TBF/BenchControl/Elde/ControlComWrap.cs index fc10cd37c..cc3da501f 100644 --- a/TBF/BenchControl/Elde/ControlComWrap.cs +++ b/TBF/BenchControl/Elde/ControlComWrap.cs @@ -280,37 +280,37 @@ namespace TBF.BenchControl.Elde /// Route: 64-bit installation specific number /// Test duration as a number of reference flow meter pulses /// See ControlBoard.TestMethods enum - /// 0 = No filtering (0..255) + /// 0 = No filtering (0..255) /// Freq.inverter control (not applicable in DT100, Munich) /// Coefficient used to control the regulation valve (1..100) /// 0 = default value, 1 = spec. processing of very short pulses /// What to stop public void SendCommand(Command cmd, int refFlowMeterNr, UInt128 route, int totalRefPulses, int massRefPulses, TestMethods testMethods, - float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) + uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) { if (Program.MainWnd.InvokeRequired) { /// When SendCommand(...) called from the worker thread object[] args = new object[] { cmd, refFlowMeterNr, route, totalRefPulses, massRefPulses, - testMethods, filterConstant, fmFreq, regConst, shortImp, stopDevs }; + testMethods, filterConstants, fmFreq, regConst, shortImp, stopDevs }; Program.MainWnd.Invoke((SendCommandDlgt)DoSendCommand, args); /// Component was created in UI thread - use Invoke() } else { /// When SendCommand(...) called from the UI thread DoSendCommand(cmd, refFlowMeterNr, route, totalRefPulses, massRefPulses, testMethods, - filterConstant, fmFreq, regConst, shortImp, stopDevs); + filterConstants, fmFreq, regConst, shortImp, stopDevs); } } /// delegate void SendCommandDlgt(Command cmd, int refFlowmtrNr, UInt128 route, int totalRefPulses, int massRefPulses, TestMethods testMethods, - float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs); + uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs); /// private void DoSendCommand(Command cmd, int refFlowMeterNr, UInt128 route, int totalRefPulses, int massRefPulses, TestMethods testMethods, - float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) + uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) { //TBF.UiBridge.Bridge.OnLog(this, string.Format("{0} SendCommand({1}, {2}, {3}, {4}, {5}, {6}, [{7},{8}], {9}, {10}, {11})\r\n", // DateTime.Now.ToLongTimeString(), @@ -352,7 +352,7 @@ namespace TBF.BenchControl.Elde cmd, /// 0 refFlowMeterNr, /// 1 Utils.RouteToStr(route), /// 2 - totalRefPulses, massRefPulses, testMethods, filterConstant, /// 3, 4, 5, 6 + totalRefPulses, massRefPulses, testMethods, filterConstants, /// 3, 4, 5, 6 fmFreq[0].ToString(), /// 7 (fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "", /// 8 (fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "", /// 9 @@ -363,18 +363,22 @@ namespace TBF.BenchControl.Elde #if DN100 || MUNICH ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods, - filterConstant, fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs); + Convert.ToSingle(filterConstants[0]), fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs); #elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods, - filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); + Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); #elif GENESIS || BERLIN || SLM_150 || PETERSBURG_200 uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses }; ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods, - filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); -#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 + Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); +#elif JUZNA_AFRIKA_50 uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses }; ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods, - filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); + filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); +#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT + uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses }; + ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods, + Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); #endif log.InfoFormat("DoSendCommand() Route = {0}", Utils.RouteToStr(route)); diff --git a/TBF/BenchControl/Elde/IControlCom.cs b/TBF/BenchControl/Elde/IControlCom.cs index 748f11857..ff306071b 100644 --- a/TBF/BenchControl/Elde/IControlCom.cs +++ b/TBF/BenchControl/Elde/IControlCom.cs @@ -68,7 +68,7 @@ namespace TBF.BenchControl.Elde /// 0 = default value, 1 = spec. processing of very short pulses /// What to stop void SendCommand(Command cmd, int refNr, UInt128 route, int totalRefPulses, int massRefPulses, TestMethods testMethods, - float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs); + uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs); /// /// Control of regulating valves. diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 2dd786814..953ab987e 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.860.0")] -[assembly: AssemblyFileVersion("2.18.860.0")] +[assembly: AssemblyVersion("2.18.861.0")] +[assembly: AssemblyFileVersion("2.18.861.0")]