FrmPrintLabel.cs
4.4 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.CompilerServices;
using System.Threading;
using System.IO;
using System.Runtime.InteropServices;
using OnlineStore.DeviceLibrary;
using log4net;
using System.Reflection;
using UserFromControl;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.Common;
using CodeLibrary;
namespace OnlineStore.XLRStore
{
internal partial class FrmPrintLabel : FrmBase
{
private bool IsLoad = false;
private PrintLabelBean moveBean;
internal FrmPrintLabel(PrintLabelBean moveEquip)
{
this.moveBean = moveEquip;
Control.CheckForIllegalCrossThreadCalls = false;
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (!this.Visible)
{
return;
}
lblWarnMsg.Text = moveBean.WarnMsg;
lblCurrInfo.Text = moveBean.GetMoveStr();
string text = "\r\n" + moveBean.MoveInfo.MoveType + "_" + moveBean.MoveInfo.MoveStep;
lblAgvInfo.Text = text;
}
catch (Exception ex)
{
LogUtil.error(moveBean.Name + "界面定时器出错:", ex);
}
}
private void FrmTest_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
if (this.timer1.Enabled)
{
this.timer1.Enabled = false;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error("", ex);
}
}
private void FrmStoreIOStatus_Load(object sender, EventArgs e)
{
lblWarnMsg.Text = moveBean.WarnMsg;
lblCurrInfo.Text = moveBean.GetMoveStr();
// lblAgvInfo.Text = "AGV " + moveBean.Config.AgvName + " :" + AgvClient.GetAction(moveBean.Config.AgvName);
IsLoad = true;
}
private void FrmIOStatus_Shown(object sender, EventArgs e)
{
timer1.Start();
}
private void button1_Click(object sender, EventArgs e)
{
if (BufferDataManager.LabelInfo != null)
{
int startp = BufferDataManager.LabelInfo.GetPosType();
if (startp.Equals(1))
{
button2_Click(null,null);
}
else
{
button3_Click(null, null);
}
LogUtil.info($"手动清除贴标缓存:{BufferDataManager.LabelInfo.ToStr()}");
CodeManager.DelImg(Name, BufferDataManager.LabelInfo?.LabelParam.BitmapFilename);
BufferDataManager.LabelInfo = null;
}
}
private void button2_Click(object sender, EventArgs e)
{
if (BufferDataManager.AOutStoreInfo != null)
{
BufferDataManager.AOutStoreInfo.Labeled = false;
LogUtil.info($"手动清除A下贴标标记:{BufferDataManager.AOutStoreInfo.ToStr()}");
}
}
private void button3_Click(object sender, EventArgs e)
{
if (BufferDataManager.BOutStoreInfo != null)
{
BufferDataManager.BOutStoreInfo.Labeled = false;
LogUtil.info($"手动清除B下贴标标记:{BufferDataManager.BOutStoreInfo.ToStr()}");
}
}
private void button4_Click(object sender, EventArgs e)
{
moveBean.Reset();
}
//private void btnScanTest_Click(object sender, EventArgs e)
//{
// if (!IsLoad)
// {
// return;
// }
// string camera = moveBean.Config.CameraName;
// List<string> LastCodeList = CodeManager.CameraScan(camera, moveBean.Name.Trim() + "测试");
// string msg = CodeManager.ProcessCode(LastCodeList);
// LogUtil.info(moveBean.Name + "[" + camera + "]扫码测试结果:\r\n" + msg);
// MessageBox.Show(moveBean.Name + "[" + camera + "]扫码测试结果:" + msg);
//}
}
}