From acbe2b5dc89212a112ed9eec8f58a54803479f68 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 19 Nov 2020 08:43:47 +0200 Subject: stubs: change sublimation, read main card data --- .../stubs/change sublimation time.cs | 23 ++++++ .../stubs/read and store main card data.cs | 83 ++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 Software/Stubs Collection/stubs/change sublimation time.cs create mode 100644 Software/Stubs Collection/stubs/read and store main card data.cs (limited to 'Software/Stubs Collection') diff --git a/Software/Stubs Collection/stubs/change sublimation time.cs b/Software/Stubs Collection/stubs/change sublimation time.cs new file mode 100644 index 000000000..3292a3b7e --- /dev/null +++ b/Software/Stubs Collection/stubs/change sublimation time.cs @@ -0,0 +1,23 @@ +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 SublimationDuration = 30; +ProgressRequest progressRequest = new ProgressRequest(); +progressRequest.Amount = 0xB26; +progressRequest.Delay = SublimationDuration; + + var response = stubManager.Run(progressRequest); + +} \ No newline at end of file diff --git a/Software/Stubs Collection/stubs/read and store main card data.cs b/Software/Stubs Collection/stubs/read and store main card data.cs new file mode 100644 index 000000000..6655bcb5f --- /dev/null +++ b/Software/Stubs Collection/stubs/read and store main card data.cs @@ -0,0 +1,83 @@ +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.PMR.EmbeddedParameters; +using Tango.Stubs; +using System.IO; +using Tango.PMR.IO; +using Google.Protobuf; + +string[] Main_Card_EEpromAddress = { +"DATA_SIZE", +"DANCER_0", +"DANCER_1", +"DANCER_2", +"DRYER_CENTER", +"DRYER_CYCLES", +"MIDTANK_1_A", +"MIDTANK_1_B", +"MIDTANK_2_A", +"MIDTANK_2_B", +"MIDTANK_3_A", +"MIDTANK_3_B", +"MIDTANK_4_A", +"MIDTANK_4_B", +"MIDTANK_5_A", +"MIDTANK_5_B", +"MIDTANK_6_A", +"MIDTANK_6_B", +"MIDTANK_7_A", +"MIDTANK_7_B", +"MIDTANK_8_A", +"MIDTANK_8_B", +"WINDER_CALIBRATION", +"EMBEDDED_VERSION", +"EEPROM_ALARM_SUPPORT", +"EEPROM_ORIFICE1_ZERO_VALUE", +"EEPROM_ORIFICE3_ZERO_VALUE", +"EEPROM_WASTE_TANK_ZERO_VALUE", +"EEPROM_PULLER_TENSION_POSITION", +"EEPROM_WINDER_TENSION_POSITION", +"EEPROM_INIT_FAILURE_COUNTER", +"DANCER_3", +"DANCER_4", +"EEPROM_PRESSURE_SENSOR_V0_0", +"EEPROM_PRESSURE_SENSOR_V0_1", +"EEPROM_DRIER_LOADING_ARM_ANGLE"}; + + +private const string JSON_FILE_PATH = "C:/temp/maineeprom.json"; +private const string CSV_FILE_PATH = "C:/temp/maineeprom.csv"; +public void OnExecute(StubManager stubManager) +{ + StubReadEmbeddedVersionRequest stubReadEmbeddedVersionRequest = new StubReadEmbeddedVersionRequest(); + var response2 = stubManager.Run(stubReadEmbeddedVersionRequest); + + if ((response2.VerMajor>=1)&&(response2.VerMinor>=5)&&(response2.VerPatch>=2)&&(response2.VerBuild>=2)) + { + MainCardStoredDataRequest mainCardStoredDataRequest = new MainCardStoredDataRequest(); + var response3 = stubManager.Run(mainCardStoredDataRequest); + stubManager.AppendToFile(JSON_FILE_PATH, "MainCardStoredData: "+ response3); + } + else + { + stubManager.AppendToFile(CSV_FILE_PATH, "Address,Name,Data"); + for (int i = 1; i < 36; i++) + { + StubMainCardEEpromReadRequest stubMainCardEEpromReadRequest = new StubMainCardEEpromReadRequest(); + stubMainCardEEpromReadRequest.Address = i; + stubMainCardEEpromReadRequest.Data = 0; + + var response = stubManager.Run(stubMainCardEEpromReadRequest); + stubManager.AppendToFile(CSV_FILE_PATH, response.Address + "," + Main_Card_EEpromAddress[i] +"," + response.Data); + } + } + +} \ No newline at end of file -- cgit v1.3.1