CIDebugControl.cs
2.0 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
using OnlineStore;
using DeviceLibrary;
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;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine.device
{
public partial class CIDebugControl : UserControl
{
public CIDebugControl()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (!TrayStop.DeviceList.ContainsKey("CI"))
return;
string status = "";
if (TrayStop.DeviceList["CI"].IOValue(IO_Type.CI_Count_Finished).Equals(IO_VALUE.HIGH))
{
status = "Ready";
}
else
{
status = "Counting";
}
label_status.Text = status;
}
private void btn_start_Click(object sender, EventArgs e)
{
if (TrayStop.DeviceList["CI"].IOValue(IO_Type.CI_Count_Finished).Equals(IO_VALUE.HIGH))
{
if (VJCounter.CheckConnect())
{
VJCounter.SendBarcode(txt_barcode.Text.Trim());
Thread.Sleep(500);
TrayStop.DeviceList["CI"].IOMove(IO_Type.CI_Start, IO_VALUE.HIGH, 1000);
LogUtil.info("手动点击开始点料");
}
else {
MessageBox.Show(crc.GetString("Res0117.c9f109fe","未成功连接VJ点料机"));
}
}
else
{
MessageBox.Show(crc.GetString("Res0118.f955ef4e","点料机没有准备好,不能启动."));
}
}
private void cb_manualcount_CheckedChanged(object sender, EventArgs e)
{
CI.DeviceList["CI"].ManualCount = cb_manualcount.Checked;
}
}
}