blob: a43354785057ba2b26e04fe9a1a4e82b9a01d25c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
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;
using Google.Protobuf;
using Tango.PMR.EmbeddedParameters;
using System.IO;
using Tango.PMR.IO;
public void OnExecute(StubManager stubManager)
{
ConfigurationParameters configurationParameters = new ConfigurationParameters();
Thread.Sleep(1000);
stubManager.Write("\n\n Loading file from machine");
FileDownloadRequest fileDownloadRequest = new FileDownloadRequest();
fileDownloadRequest.FileName = "SYSINFO//EmbParam.cfg";
FileDownloadResponse response2 = stubManager.Run<FileDownloadResponse>(fileDownloadRequest);
Thread.Sleep(1000);
long chunk_size = response2.MaxChunkLength;
string Download_Id = response2.DownloadID;
//FileStream fs = new FileStream("C:/temp/EmbParam.cfg",FileMode.Open);
stubManager.Write("Position "+ response2.DownloadID+ " Length "+ response2.MaxChunkLength +"\n\n");
FileChunkDownloadRequest fileChunkDownloadRequest = new FileChunkDownloadRequest();
fileChunkDownloadRequest.DownloadID = response2.DownloadID;
var response3 = stubManager.Run<FileChunkDownloadResponse>(fileChunkDownloadRequest);
var config = ConfigurationParameters.Parser.ParseFrom(response3.Buffer);
stubManager.Write( config);
}
|