RobotManage.cs
1.2 KB
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
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
public static class RobotManage
{
public static MainMachine mainMachine;
public static Robot_Config Config;
public static bool IsLoadOk = false;
static string baseDir = Application.StartupPath;
static Thread mainThread;
static RobotManage() {
CodeManager.LoadConfig();
string configFile = Path.Combine(baseDir, "config\\Config.csv");
Config = new Robot_Config(0, "", configFile);
Config = (Robot_Config)CSVConfigReader.LoadConfig(Config);
mainMachine = new MainMachine(RobotManage.Config);
if (!IOManager.ConnectionIOList(new List<string>())) {
IsLoadOk = false;
return;
}
IsLoadOk = true;
}
static void Start() {
mainThread = new Thread(new ThreadStart(mainMachine.Run));
mainThread.Start();
GC.KeepAlive(mainThread);
}
}
}