BoardInfo.cs
7.9 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
using URSoldering.Common;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace URSoldering.DeviceLibrary
{
public class BoardInfo
{
/// <summary>
/// 平均焊接时间
/// </summary>
public TimeSpan WeldTime = new TimeSpan(0);
/// <summary>
/// 电路板ID
/// </summary>
public int boardId { get; set; }
public string AoiFileName { get; set; }
/// <summary>
/// 条码
/// </summary>
public string WareCode { get; set; }
///// <summary>
///// 机器人焊接时Z轴的高点
///// </summary>
//public double ZHighValue { get; set; }
/// <summary>
/// 工位编号,夹具编号(每一个程序需要配置四个夹具的位置,防止位置偏差)
/// </summary>
public int StationNum { get; set; }
/// <summary>
/// 料号
/// </summary>
public string PartNumber { get; set; }
/// <summary>
/// 电路板名称
/// </summary>
public string boardName { get; set; }
/// <summary>
/// 宽度
/// </summary>
public int boardWidth { get; set; }
/// <summary>
/// 长度
/// </summary>
public int boardLength { get; set; }
/// <summary>
/// 焊点列表
/// </summary>
public List<WeldPointInfo> pointList { get; set; }
///// <summary>
///// 原点坐标X
///// </summary>
//public double originX { get; set; }
///// <summary>
///// 原点坐标Y
///// </summary>
//public double originY { get; set; }
/// <summary>
/// 图片名称
/// </summary>
public string imgName { get; set; }
/// <summary>
/// 焊接预估时间
/// </summary>
public double planNeedTime { get; set; }
///// <summary>
///// 固定原点的位置,1=左上角,2=左下角,3=右上角,4=右下角
///// </summary>
//public int orgType { get; set; }
/// <summary>
/// 已经焊接次数,每次修改板子都会重置
/// </summary>
public int solderingCount { get; set; }
/// <summary>
/// 焊接的时间,每次修改板子都会重置
/// </summary>
public double solderingTime { get; set; }
/// <summary>
/// 已经焊接次数,不重置
/// </summary>
public int solderCount { get; set; }
/// <summary>
/// 焊接的时间,不重置
/// </summary>
public double solderTime { get; set; }
public Image myImage = null;
public string GetDes()
{
return " 长度:" + boardLength + ",宽度:" + boardWidth + ",焊点数量:" + this.pointList.Count;
}
public Image GetImage()
{
if (myImage == null)
{
string path = ConfigAppSettings.GetValue(Setting_Init.BOARD_IMAGE_PATH);
string imagePath = Application.StartupPath + "/" + path + "/" + imgName;
string defaultImg = ConfigAppSettings.GetValue(Setting_Init.BOARD_IMAGE_DEFAULT);
if (imgName != null && File.Exists(imagePath))
{
System.Drawing.Image img = System.Drawing.Image.FromFile(imagePath);
System.Drawing.Image bmp = new System.Drawing.Bitmap(img);
img.Dispose();
myImage = bmp;
}
else
{
return BoardManager.defaultImage;
}
}
if (myImage == null)
{
return BoardManager.defaultImage;
}
else
{
return myImage;
}
}
//public double getImageOrgX()
//{
// double orgX = originX;
// if (orgType == 2)
// {
// orgX = originX + boardLength;
// }
// else if (orgType == 4)
// {
// orgX = originX + boardLength;
// }
// return orgX;
//}
//public double getImageOrgY()
//{
// double orgY = originY;
// if (orgType == 3)
// {
// orgY = originY - boardWidth;
// }
// else if (orgType == 4)
// {
// orgY = originY - boardWidth;
// }
// return orgY;
//}
}
/// <summary>
/// 焊点信息
/// </summary>
public class WeldPointInfo
{
public WeldPointInfo()
{
isNeedClear = false;
pointType = 0;
}
public WeldPointInfo(int type)
{
this.pointType = type;
}
/// <summary>
/// 焊点编号
/// </summary>
public int pointNum { get; set; }
/// <summary>
/// 焊点名字
/// </summary>
public string pointName { get; set; }
public double RobotX { get; set; }
public double RobotY { get; set; }
public double RobotZ { get; set; }
public double RobotRX { get; set; }
public double RobotRY { get; set; }
public double RobotRZ { get; set; }
/// <summary>
/// 预热温度
/// </summary>
public int preheatTemperature { get; set; }
/// <summary>
/// 预热温度上限
/// </summary>
public int preheatTemperatureMax { get; set; }
/// <summary>
/// 预热温度下限
/// </summary>
public int preheatTemperatureMin { get; set; }
/// <summary>
/// 预热时间(秒)
/// </summary>
public double preheatTime { get; set; }
/// <summary>
/// 焊接温度
/// </summary>
public int weldTemperature { get; set; }
/// <summary>
/// 焊接温度上限
/// </summary>
public int weldTemperatureMax { get; set; }
/// <summary>
/// 焊接温度下限
/// </summary>
public int weldTemperatureMin { get; set; }
/// <summary>
/// 焊接时间(秒)
/// </summary>
public double weldTime { get; set; }
/// <summary>
/// 起始送丝速度
/// </summary>
public double startSendWireSpeed { get; set; }
/// <summary>
/// 起始送丝时间(秒)
/// </summary>
public double startSendWireTime { get; set; }
/// <summary>
/// 送丝速度
/// </summary>
public double sendWireSpeed { get; set; }
/// <summary>
/// 送丝时间(秒)
/// </summary>
public double sendWireTime { get; set; }
/// <summary>
/// 焊点类型,0=普通焊点,必须要焊接,1=中间点,机器人跳转位置使用
/// </summary>
public int pointType { get; set; }
/// <summary>
/// 是否需要清洗烙铁头
/// </summary>
public bool isNeedClear { get; set; }
/// <summary>
/// 清洗时间,毫秒数
/// </summary>
public int ClearTime { get; set; }
public string TypeValue
{
get
{
if (pointType.Equals(0))
{
return "普通焊点";
}
else
{
return "中间点";
}
} set
{
}
}
public URPointValue GetURPoint()
{
URPointValue p = new URPointValue(RobotX, RobotY, RobotZ, RobotRX, RobotRY, RobotRZ);
return p;
}
}
}