DeviceStatus.cs
3.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
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TSA_V.DeviceLibrary
{
public class DeviceStatus
{
public string Version = "2.1.1";
/// <summary>
/// 设备状态
///0=未启动
///1=复位中
///2=待机状态
///3=工作忙碌中
/// </summary>
public int CurrStatus = 0;
/// <summary>
/// 设备警告或错误信息
/// </summary>
public string WarnMsg = "";
public OpInfo workInfo;
}
public class OpInfo
{
public int ID = 0;
/// <summary>
/// 程序名称
/// </summary>
public string ProName = "";
/// <summary>
/// 程序类型
/// </summary>
public string ProType = "";
/// <summary>
/// 实时条码
/// </summary>
public string BarCode = "";
/// <summary>
/// 板子宽度(显示的长度→)
/// </summary>
public int BoardWidth = 0;
/// <summary>
/// 板子高度(显示的高度↑)
/// </summary>
public int BoardLength = 0;
/// <summary>
/// 插装完成板子的AOI结果,NG或OK,如果设备未包含AOI功能,结果默认为OK
/// </summary>
public string AoiResult = "OK";
/// <summary>
/// 组装元器件列表
/// </summary>
public List<OpPointInfo> pointList { get; set; }
public static OpInfo GetOpInfo(BoardInfo board, int maxIndex = -1)
{
//maxIndex=-1,没有oplist
OpInfo op = new OpInfo();
op.ProName = board.boardName;
op.ProType = board.boardCode;
op.BoardWidth = board.boardWidth;
op.BoardLength = board.boardLength;
op.pointList = new List<OpPointInfo>();
if (maxIndex>0)
{
int index = 0;
List<SMTPointInfo> list = board.GetSmtList();
foreach (SMTPointInfo sm in list)
{
if (maxIndex > 0 && index > maxIndex)
{
break;
}
op.pointList.Add(new OpPointInfo(sm.TagNo, sm.PN));
index++;
}
}
return op;
}
}
public class OpPointInfo
{
public int ID = 0;
/// <summary>
/// 物料编号
/// </summary>
public string PartNum = "";
/// <summary>
///点位名称
/// </summary>
public string PointName = "";
public OpPointInfo(string pn, string name)
{
PartNum = pn;
PointName = name;
}
}
public class JsonParam
{
public JsonParam (DeviceStatus param)
{
this.json = param;
}
public DeviceStatus json;
}
}