aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Stubs Collection
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-07-28 18:14:36 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-07-28 18:14:36 +0300
commit04468fbdfcc1eac1b3e31d36d71a60461b437480 (patch)
tree7f53844e80631c1c192cce9c1f675fa197121e92 /Software/Stubs Collection
parent4c98dd0caac146c0c0e40ae7eff5b5e7d52e69cd (diff)
downloadTango-04468fbdfcc1eac1b3e31d36d71a60461b437480.tar.gz
Tango-04468fbdfcc1eac1b3e31d36d71a60461b437480.zip
improve loading, dispensers handling. stubs
Diffstat (limited to 'Software/Stubs Collection')
-rw-r--r--Software/Stubs Collection/stubs/embeddedparametersbuild.cs7
-rw-r--r--Software/Stubs Collection/stubs/file read from machine.cs47
2 files changed, 51 insertions, 3 deletions
diff --git a/Software/Stubs Collection/stubs/embeddedparametersbuild.cs b/Software/Stubs Collection/stubs/embeddedparametersbuild.cs
index e9ee79111..790bd6891 100644
--- a/Software/Stubs Collection/stubs/embeddedparametersbuild.cs
+++ b/Software/Stubs Collection/stubs/embeddedparametersbuild.cs
@@ -113,10 +113,11 @@ byte[] fileBytes = File.ReadAllBytes("C:/temp/EmbParam.cfg");
var config = ConfigurationParameters.Parser.ParseFrom(fileBytes);
-int percent = (int)(config.IDSCleaningStopBeforeSegmentTime);
- stubManager.Write( percent+"% \n");
-
+ stubManager.Write( config);
+/*
+13:46:42.38: Executing script 'embeddedparametersbuild.cs'...
+{ "BreakSensorLimit": 10, "DiagnosticCollectionLimit": 1, "OverHeatCountLimit": 3, "UnderHeatCountLimit": 3, "CloseValveTimeout": 255, "OpenValveTimeout": 255, "InitialDispenserPressure": 1.5, "InitialDispenserTimeout": 60000, "InitialDispenserTimeLag": 100, "DispenserBuildPressureSpeed": 800, "DispenserBuildPressureLimit": 0.9, "DispenserBuildPressureTimeout": 80000, "DispenserBuildPressureLag": 50, "ACHeatersLowerOperationLimit": 995, "ACHeatersUpperOperationLimit": 1005, "DCHeatersLowerOperationLimit": 978, "DCHeatersUpperOperationLimit": 1005, "DispenserPresegmentWFCF": 80, "StartHeatingOnInitSequence": true, "GeneralParameters": [ 1, 1, 1, 1, 800, 1000 ], "CurrentAlarmLowLimit": 0.8, "CurrentAlarmHighLimit": 1.07, "IDSSegmentRefillTimeout": 5000, "IDSPreSegmentBuildupTime": 5000, "IDSCleaningSpeed": 50, "IDSCleaningStopBeforeSegmentTime": 3000, "IDSCleaningStartSprayPreSegmentTime": 1000, "IDSLeftCleaningMotorSpeed": 30, "IDSRightCleaningMotorSpeed": 23, "SwitchToIdleTimeinSeconds": 3600, "IdleDrierTemperature": 80, "IdleHeadTemperature": 80, "PowerOffTemperatureLimit": 50, "IDSPreSegmentWFCFTimeBeforeSegment": 1500 } */
} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/file read from machine.cs b/Software/Stubs Collection/stubs/file read from machine.cs
new file mode 100644
index 000000000..0f5f96c0a
--- /dev/null
+++ b/Software/Stubs Collection/stubs/file read from machine.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)
+{
+
+UploadHardwareConfigurationRequest uploadHardwareConfigurationRequest = new UploadHardwareConfigurationRequest();
+
+
+
+ FileDownloadRequest fileDownloadRequest = new FileDownloadRequest();
+ fileDownloadRequest.Path = "0://SysInfo//GenHwCfg.cfg";
+ FileDownloadResponse response2 = stubManager.Run<FileDownloadResponse>(fileDownloadRequest);
+
+ long chunk_size = response2.MaxChunkLength;
+
+ FileStream fs = new FileStream("C:\\Temp\\GenHwCfg.cfg",FileMode.Open);
+ bool done = 0;
+ while (done = 0)
+ {
+ stubManager.Write("Position "+ fs.Position+ " Length "+ fs.Length +"\n\n");
+ FileChunkDownloadRequest fileChunkDownloadRequest = new FileChunkDownloadRequest();
+ fileChunkDownloadRequest.DownloadID = response2.DownloadID;
+ var response3 = stubManager.Run<FileChunkDownloadResponse>(fileChunkDownloadRequest);
+ byte[] chunk = new byte[response3.buffer.len];
+ fs.Write(response3.buffer.data,chunk.Length);
+ if (response3.buffer.len<chunk_size)
+ done = 1;
+ //Thread.Sleep(2000);
+ }
+ byte[] fileBytes = File.ReadAllBytes("C:\\Temp\\GenHwCfg.cfg");
+
+
+ var config = UploadHardwareConfigurationRequest.Parser.ParseFrom(fileBytes);
+
+ stubManager.Write( config+"% \n");
+
+} \ No newline at end of file