diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-01-27 09:19:11 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-01-27 09:19:11 +0200 |
| commit | ddda6089bff56e80703c8d2dce297919edc58bf1 (patch) | |
| tree | 7702c5cf169124d522eacc7f1a9e0878373baedd /Software/Stubs Collection | |
| parent | 1d4d327571d4c0c9f4e17411551bd4dae1e2aed0 (diff) | |
| parent | bf2f3245339b9fd9148a2ad25b5ba3320e970cc1 (diff) | |
| download | Tango-ddda6089bff56e80703c8d2dce297919edc58bf1.tar.gz Tango-ddda6089bff56e80703c8d2dce297919edc58bf1.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Stubs Collection')
6 files changed, 312 insertions, 0 deletions
diff --git a/Software/Stubs Collection/stubs/midtank calibration/Midtankcalibration.cs b/Software/Stubs Collection/stubs/midtank calibration/Midtankcalibration.cs new file mode 100644 index 000000000..9a82365e1 --- /dev/null +++ b/Software/Stubs Collection/stubs/midtank calibration/Midtankcalibration.cs @@ -0,0 +1,69 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.EmbeddedParameters; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ + +MidTankDataSetupRequest midTankDataSetupRequest = new MidTankDataSetupRequest(); + +MidTankData midTankData = new MidTankData(); +midTankData.MidTankId = 0; +midTankData.InitialOffsetA =2.54414609375 ; +midTankData.SlopeB = 0.915453384418902 ; + +MidTankData midTankData1 = new MidTankData(); +midTankData1.MidTankId = 1; +midTankData1.InitialOffsetA = 2.53565 ; +midTankData1.SlopeB = 0.912075327649828; + +MidTankData midTankData2 = new MidTankData(); +midTankData2.MidTankId = 2; +midTankData2.InitialOffsetA = 2.96895078125 ; +midTankData2.SlopeB = 0.92228512609367; + +MidTankData midTankData3 = new MidTankData(); +midTankData3.MidTankId = 3; +midTankData3.InitialOffsetA = 2.9264703125 ; +midTankData3.SlopeB = 0.939819063852105; + +MidTankData midTankData4 = new MidTankData(); +midTankData4.MidTankId = 4; +midTankData4.InitialOffsetA = 2.614946875 ; +midTankData4.SlopeB = 0.92573937750226; + +MidTankData midTankData5 = new MidTankData(); +midTankData5.MidTankId = 5; +midTankData5.InitialOffsetA = 2.1561578125; +midTankData5.SlopeB = 0; + +MidTankData midTankData6 = new MidTankData(); +midTankData6.MidTankId = 6; +midTankData6.InitialOffsetA = 2.8924859375; +midTankData6.SlopeB = 0.932726089785296; + +MidTankData midTankData7 = new MidTankData(); +midTankData7.MidTankId = 7; +midTankData7.InitialOffsetA = 2.92080625; +midTankData7.SlopeB = 0.919540229; + +midTankDataSetupRequest.MidTankInfo.Add(midTankData); +midTankDataSetupRequest.MidTankInfo.Add(midTankData1); +midTankDataSetupRequest.MidTankInfo.Add(midTankData2); +midTankDataSetupRequest.MidTankInfo.Add(midTankData3); +midTankDataSetupRequest.MidTankInfo.Add(midTankData4); +midTankDataSetupRequest.MidTankInfo.Add(midTankData5); +midTankDataSetupRequest.MidTankInfo.Add(midTankData6); +midTankDataSetupRequest.MidTankInfo.Add(midTankData7); + +var response = stubManager.Run<MidTankDataSetupResponse>(midTankDataSetupRequest); + +}
\ No newline at end of file diff --git a/Software/Stubs Collection/stubs/midtank calibration/read_midtank_calibration.cs b/Software/Stubs Collection/stubs/midtank calibration/read_midtank_calibration.cs new file mode 100644 index 000000000..469772888 --- /dev/null +++ b/Software/Stubs Collection/stubs/midtank calibration/read_midtank_calibration.cs @@ -0,0 +1,37 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ + int i; + + for(i=0;i<8;i++) + { + + var response = stubManager.Run<ProgressResponse>("ProgressRequest" ,0xA, i); + stubManager.Write("\n Initial_Offset_A [#"); + stubManager.Write(i); + stubManager.Write("] = "); + stubManager.WriteLine(response.Progress); + } + + for(i=0;i<8;i++) + { + var response1 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0xB, i); + stubManager.Write("\n Slope_B [#"); + stubManager.Write(i); + stubManager.Write("] = "); + stubManager.WriteLine(response1.Progress); + } + + +}
\ No newline at end of file diff --git a/Software/Stubs Collection/stubs/newWHS/get_A2D_MAX11614.cs b/Software/Stubs Collection/stubs/newWHS/get_A2D_MAX11614.cs new file mode 100644 index 000000000..670732ae0 --- /dev/null +++ b/Software/Stubs Collection/stubs/newWHS/get_A2D_MAX11614.cs @@ -0,0 +1,48 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ +// Request ---- +// Int32 : Amount +// Int32 : Delay + +// Response ---- +// Double : Progress + +//valv1 +var response1 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 0); //ORF1 +//Thread.Sleep(5000); //Sleep for 10 milli. +var response2 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 1); // ORF2 +//Thread.Sleep(5000); //Sleep for 10 milli. +var response3 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 2); // ORF3 +//Thread.Sleep(5000); //Sleep for 10 milli. +var response4 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 3); // VLEV1 +//Thread.Sleep(5000); //Sleep for 10 milli. +var response5 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 4); // VLEV2 not connected +//Thread.Sleep(5000); //Sleep for 10 milli. +var response6 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 5); // GAS_OUT +//Thread.Sleep(5000); //Sleep for 10 milli. +var response7 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 6); // CUR_FAN +//Thread.Sleep(5000); //Sleep for 10 milli. +var response8 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 7); // CUR_VaLV1 +//Thread.Sleep(5000); //Sleep for 10 milli. + stubManager.WriteLineHex(response1.Progress,4); + stubManager.WriteLineHex(response2.Progress,4); + stubManager.WriteLineHex(response3.Progress,4); + stubManager.WriteLineHex(response4.Progress,4); + stubManager.WriteLineHex(response5.Progress,4); + stubManager.WriteLineHex(response6.Progress,4); + stubManager.WriteLineHex(response7.Progress,4); + stubManager.WriteLineHex(response8.Progress,4); + +}
\ No newline at end of file diff --git a/Software/Stubs Collection/stubs/newWHS/set_gas_get_A2D_MAX11614.cs b/Software/Stubs Collection/stubs/newWHS/set_gas_get_A2D_MAX11614.cs new file mode 100644 index 000000000..fad4ac22a --- /dev/null +++ b/Software/Stubs Collection/stubs/newWHS/set_gas_get_A2D_MAX11614.cs @@ -0,0 +1,52 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ +// Request ---- +// Int32 : Amount +// Int32 : Delay + +// Response ---- +// Double : Progress + +//valv1 +//var response1 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 0); //ORF1 +//Thread.Sleep(5000); //Sleep for 10 milli. +//var response2 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 1); // ORF2 +//Thread.Sleep(5000); //Sleep for 10 milli. +//var response3 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 2); // ORF3 +//Thread.Sleep(5000); //Sleep for 10 milli. +//var response4 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 3); // VLEV1 +//Thread.Sleep(5000); //Sleep for 10 milli. +//var response5 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 4); // VLEV2 not connected +//Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EB, 0x401); //ORF1 +stubManager.WriteLine("First response received"); +Thread.Sleep(1000); //Sleep for 1000 milli. +var response6 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 5); // GAS_OUT +stubManager.WriteLine("Second response received"); +//Thread.Sleep(5000); //Sleep for 10 milli. +//var response7 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 6); // CUR_FAN +//Thread.Sleep(5000); //Sleep for 10 milli. +//var response8 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, 7); // CUR_VaLV1 +//Thread.Sleep(5000); //Sleep for 10 milli. +// stubManager.WriteLineHex(response1.Progress,4); +// stubManager.WriteLineHex(response2.Progress,4); +// stubManager.WriteLineHex(response3.Progress,4); +// stubManager.WriteLineHex(response4.Progress,4); +// stubManager.WriteLineHex(response5.Progress,4); + stubManager.WriteLineHex(response6.Progress, 4); +// stubManager.WriteLineHex(response7.Progress,4); +// stubManager.WriteLineHex(response8.Progress,4); + +}
\ No newline at end of file diff --git a/Software/Stubs Collection/stubs/newWHS/test_valv1_valv2_pump.cs b/Software/Stubs Collection/stubs/newWHS/test_valv1_valv2_pump.cs new file mode 100644 index 000000000..c81bdaebd --- /dev/null +++ b/Software/Stubs Collection/stubs/newWHS/test_valv1_valv2_pump.cs @@ -0,0 +1,47 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ +// Request ---- +// Int32 : Amount +// Int32 : Delay + +// Response ---- +// Double : Progress + +//valv1 +var response1 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8501); //valv1_en=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response2 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8401);// valv1_dir=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response3 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8400);// valv1_dir=0 +Thread.Sleep(5000); //Sleep for 10 milli. +var response4 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8500);// valv1_disable + + +// valve 2 +var response5 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8701); //valv2_en=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response6 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8601);// valv2_dir=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response7 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8600);// valv2_dir=0 +Thread.Sleep(5000); //Sleep for 10 milli. +var response8 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8700); //valv2_disable + +//test pump +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x0701);// pump on +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x0700); // pump off + +}
\ No newline at end of file diff --git a/Software/Stubs Collection/stubs/newWHS/test_valv1_valv2_pump_Blower.cs b/Software/Stubs Collection/stubs/newWHS/test_valv1_valv2_pump_Blower.cs new file mode 100644 index 000000000..582a7f7e7 --- /dev/null +++ b/Software/Stubs Collection/stubs/newWHS/test_valv1_valv2_pump_Blower.cs @@ -0,0 +1,59 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ +// Request ---- +// Int32 : Amount +// Int32 : Delay + +// Response ---- +// Double : Progress + +//valv1 +var response1 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8501); //valv1_en=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response2 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8401);// valv1_dir=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response3 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8400);// valv1_dir=0 +Thread.Sleep(5000); //Sleep for 10 milli. +var response4 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8500);// valv1_disable + + +// valve 2 +var response5 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8701); //valv2_en=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response6 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8601);// valv2_dir=1 +Thread.Sleep(5000); //Sleep for 10 milli. +var response7 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8600);// valv2_dir=0 +Thread.Sleep(5000); //Sleep for 10 milli. +var response8 = stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x8700); //valv2_disable + +//test pump +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x0701);// pump on +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E9, 0x0700); // pump off + +// test Blower +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E8, 0x0000);// Blower OFF +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E8, 0x0400);// Blower 1.25v +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E8, 0x0800); // Blower 2.5v +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E8, 0x0C00);// Blower 3.77v +Thread.Sleep(5000); //Sleep for 10 milli. +stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3E8, 0x0FFF); // Blower 5.0v + +}
\ No newline at end of file |
