HYControl.cs
2.3 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine
{
public partial class HYControl : UserControl, Idevicetab
{
public HYControl()
{
InitializeComponent();
if (DesignMode)
return;
this.Tag = "not";
crc.OpenResourceLog = true;
crc.LanguageChangeEvent += (s,o)=> crc.LanguageProcess(this);
crc.CurrLanguage = Setting_Init.Device_Default_Language;
}
public void Init(string devicetype)
{
this.devicetype = devicetype;
foreach (var c in this.Controls) {
if (!(c is CylinderButton))
continue;
var cc = (c as CylinderButton);
cc.DeviceType = devicetype;
if (!RobotManage.Config.DOList[devicetype].ContainsKey(cc.IO_HIGH))
cc.Visible = false;
}
ioControl1.Init(RobotManage.Config, devicetype);
if (!RobotManage.Config.DOList[devicetype].ContainsKey(IO_Type.Ls_A_LineRun)) {
btn_linerun.Visible = false;
btn_linerev.Visible = false;
btn_linestop.Visible = false;
}
crc.LanguageProcess(this);
}
string devicetype = "root";
private void btn_linerun_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Ls_A_LineRwd, IO_VALUE.LOW, devicetype);
IOManager.IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.HIGH, devicetype);
}
private void btn_linerev_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Ls_A_LineRwd, IO_VALUE.HIGH, devicetype);
IOManager.IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.HIGH, devicetype);
}
private void btn_linestop_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Ls_A_LineRwd, IO_VALUE.LOW, devicetype);
IOManager.IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.LOW, devicetype);
}
}
}