This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStep5.cs
61 lines (52 loc) · 1.81 KB
/
Step5.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using Newtonsoft.Json.Linq;
namespace M101
{
public class Step5
{
private const string _ACTIV_NAME = "Step5";
private const string _EXE_NAME = "mOverlaps";
private static string _EXE_PATH = Path.Combine(Montage.BIN_PATH, _EXE_NAME);
public JObject Main(JObject args)
{
Action<string> log = (string msg) => Montage.Log(args, $"{_ACTIV_NAME} {msg}");
log("Start");
Montage.ServerURL = args.GetValue("serverURL").ToString();
log("Download");
{
var projected = args.GetValue("projected") as JArray;
var files = new List<KeyValuePair<string, string>>(Montage.RAWS.Length);
files.Add(KeyValuePair.Create(Montage.IMG_TBL, Montage.IMG_TBL));
foreach (var fit in projected)
{
files.Add(KeyValuePair.Create(fit.ToString(), Path.Combine(Montage.PROJ_DIR, fit.ToString())));
}
Montage.Download(files.ToArray()).Wait();
}
log("Run " + _EXE_NAME);
using (var proc = new Process()
{
StartInfo = new ProcessStartInfo()
{
FileName = _EXE_PATH,
Arguments = $"{Montage.IMG_TBL} {Montage.DIFF_TBL}",
RedirectStandardOutput = true
}
})
{
proc.Start();
proc.WaitForExit();
log(proc.StandardOutput.ReadToEnd());
}
log("Upload");
{
Montage.Upload(Montage.DIFF_TBL).Wait();
}
log("Finish");
return args;
}
}
}