Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
URSolderingRobot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3f9f31b3
由
几米阳光
编写于
2018-11-27 14:05:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
坐标偏移功能。离线编程功能。
1 个父辈
c5a1d21e
全部展开
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
376 行增加
和
159 行删除
Common/Setting_Init.cs
DeviceLibrary/Robot/MoveType.cs
DeviceLibrary/Robot/soldering/WeldRobotBean.cs
DeviceLibrary/Robot/soldering/WeldRobotBean_Partial.cs
DeviceLibrary/Robot/soldering/WeldStepBean.cs
DeviceLibrary/bean/AOIDataResult.cs
DeviceLibrary/deviceLibrary/jbc/SolderingManager.cs
DeviceLibrary/deviceLibrary/urRobot/URRobotControl.cs
URSolderingClient/App.config
URSolderingClient/FrmBoardInfo.Designer.cs
URSolderingClient/FrmBoardInfo.cs
URSolderingClient/FrmBoardList.cs
URSolderingClient/FrmSetting.Designer.cs
URSolderingClient/FrmSetting.cs
URSolderingClient/FrmWork.cs
URSolderingClient/记录.txt
Common/Setting_Init.cs
查看文件 @
3f9f31b
...
...
@@ -102,7 +102,19 @@ namespace URSoldering.Common
public
static
string
HasSoldering
=
"HasSoldering"
;
public
static
string
Config_Pwd
=
"Config_Pwd"
;
public
static
string
ZUpLiftValue
=
"ZUpLiftValue"
;
/// <summary>
/// Mark点的基准信息,从AOI获取的坐标
/// </summary>
public
static
string
MarkDefaultPosition
=
"MarkDefaultPosition"
;
/// <summary>
/// 坐标转换系数,AOI获取图片的1像素对应实际多少毫米
/// </summary>
public
static
string
PositionChangeValue
=
"PositionChangeValue"
;
/// <summary>
/// 坐标偏移的AOI节点名称
/// </summary>
public
static
string
OffSetNodeName
=
"OffSetNodeName"
;
}
}
DeviceLibrary/Robot/MoveType.cs
查看文件 @
3f9f31b
...
...
@@ -60,7 +60,23 @@ namespace URSoldering.DeviceLibrary
wait
.
IsEnd
=
false
;
return
wait
;
}
/// <summary>
/// 等待坐标偏移
/// </summary>
/// <returns></returns>
public
static
WaitResultInfo
WaitOffSet
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
7
;
wait
.
IsEnd
=
false
;
return
wait
;
}
public
static
WaitResultInfo
WaitAoiEnd
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
8
;
wait
.
IsEnd
=
false
;
return
wait
;
}
public
string
ToStr
()
{
if
(
WaitType
==
1
)
...
...
@@ -73,7 +89,7 @@ namespace URSoldering.DeviceLibrary
}
else
if
(
WaitType
==
3
)
{
return
"等待机器人
运动结束"
+
UrPoint
.
ToShowStr
()
;
return
"等待机器人
移动到位【"
+
UrPoint
.
ToShowStr
()+
"】"
;
}
else
if
(
WaitType
==
4
)
{
...
...
@@ -86,6 +102,14 @@ namespace URSoldering.DeviceLibrary
{
return
"等待机器人连接完成"
;
}
else
if
(
WaitType
==
7
)
{
return
"等待坐标偏移完成"
;
}
else
if
(
WaitType
==
8
)
{
return
"等待AOI检测完成"
;
}
else
{
return
"Wait位置类型:WaitType=【"
+
WaitType
+
"】"
;
...
...
@@ -137,6 +161,8 @@ namespace URSoldering.DeviceLibrary
/// 机器人坐标
/// </summary>
public
URPointValue
UrPoint
{
get
;
set
;
}
}
public
enum
MoveType
{
...
...
@@ -204,9 +230,13 @@ namespace URSoldering.DeviceLibrary
/// </summary>
W14_AOICheck
=
14
,
/// <summary>
/// AOI检测完成
/// </summary>
W15_AOIEnd
=
15
,
/// <summary>
/// 清洗完成
/// </summary>
W1
5_ClearEnd
=
15
,
W1
6_ClearEnd
=
16
,
///// <summary>
///// 送丝下降
///// </summary>
...
...
@@ -231,6 +261,10 @@ namespace URSoldering.DeviceLibrary
/// 等待3秒后识别位置进行坐标偏移
/// </summary>
W31_WaitToPositionOffset
=
31
,
/// <summary>
/// 坐标偏移完成
/// </summary>
W32_PositionOffsetEnd
=
32
,
Home_Reset
=
100
,
/// <summary>
...
...
DeviceLibrary/Robot/soldering/WeldRobotBean.cs
查看文件 @
3f9f31b
...
...
@@ -74,6 +74,7 @@ namespace URSoldering.DeviceLibrary
RobotMin
=
LoadPoint
(
Setting_Init
.
Soldering_RobotMin
);
RobotMax
=
LoadPoint
(
Setting_Init
.
Soldering_RobotMax
);
MarkPoint
=
LoadPoint
(
Setting_Init
.
Soldering_MarkPoint
);
LoadMarkInfo
();
}
private
static
URPointValue
LoadPoint
(
string
configStr
)
...
...
DeviceLibrary/Robot/soldering/WeldRobotBean_Partial.cs
查看文件 @
3f9f31b
此文件的差异被折叠,
点击展开。
DeviceLibrary/Robot/soldering/WeldStepBean.cs
查看文件 @
3f9f31b
...
...
@@ -24,6 +24,16 @@ namespace URSoldering.DeviceLibrary
PointTime
=
null
;
OneWaitOk
=
false
;
}
public
void
PositionOffSet
(
double
x
,
double
y
)
{
for
(
int
i
=
0
;
i
<
weldPointList
.
Count
;
i
++)
{
string
oldPosition
=
weldPointList
[
i
].
GetURPoint
().
ToShowStr
();
weldPointList
[
i
].
RobotX
+=
x
;
weldPointList
[
i
].
RobotY
+=
y
;
LogUtil
.
info
(
weldPointList
[
i
].
pointName
+
"坐标偏移:偏移前【"
+
oldPosition
+
"】偏移后【"
+
weldPointList
[
i
].
GetURPoint
().
ToShowStr
()
+
"】"
);
}
}
/// <summary>
/// 焊接的板子信息
/// </summary>
...
...
@@ -102,27 +112,45 @@ namespace URSoldering.DeviceLibrary
NewWeld
(
type
);
this
.
currBoard
=
board
;
CurrPointIndex
=
0
;
//if (pointType.Equals(0))
//{
weldPointList
=
board
.
pointList
;
//}
//else
//{
// weldPointList = (from m in board.pointList where m.pointType.Equals(pointType) && m.pointType.Equals(0) select m).ToList<WeldPointInfo>();
//}
if
(
weldPointList
.
Count
<=
0
)
//需要把拍照点放到第一个
WeldPointInfo
photoPoint
=
null
;
foreach
(
WeldPointInfo
p
in
board
.
pointList
)
{
if
(!
URRobotControl
.
PointIsValid
(
p
.
GetURPoint
()))
{
LogUtil
.
error
(
"【"
+
board
.
boardName
+
"】的焊点【"
+
p
.
pointName
+
"】坐标无效,无法开始焊接"
);
return
false
;
}
foreach
(
WeldPointInfo
p
in
weldPointList
)
if
(
p
.
pointType
.
Equals
(
3
)
)
{
if
(!
URRobotControl
.
PointIsValid
(
p
.
GetURPoint
()))
photoPoint
=
p
;
}
else
{
weldPointList
.
Add
(
p
);
}
}
if
(
weldPointList
.
Count
<=
0
)
{
LogUtil
.
error
(
"【"
+
board
.
boardName
+
"】的焊点【"
+
p
.
pointName
+
"】坐标无效,无法开始焊接"
);
return
false
;
}
if
(
photoPoint
!=
null
)
{
weldPointList
.
Add
(
photoPoint
);
}
//weldPointList = board.pointList;
//foreach(WeldPointInfo p in weldPointList)
//{
// if (!URRobotControl.PointIsValid(p.GetURPoint()))
// {
// LogUtil.error("【"+ board .boardName+ "】的焊点【"+p.pointName+"】坐标无效,无法开始焊接");
// return false;
// }
//}
CurrPoint
=
weldPointList
[
CurrPointIndex
];
PointTime
=
new
PointWeldTime
();
ResetCount
=
0
;
...
...
DeviceLibrary/bean/AOIDataResult.cs
查看文件 @
3f9f31b
...
...
@@ -2,17 +2,19 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
URSoldering.Common
;
namespace
URSoldering.DeviceLibrary
{
/// <summary>
/// 从AOI获取的基准点坐标信息
/// </summary>
public
class
PositionResult
{
public
PositionResult
(
double
x
,
double
y
,
int
type
,
WeldPointInfo
point
)
public
PositionResult
(
double
x
,
double
y
)
{
this
.
DataX
=
x
;
this
.
DataY
=
y
;
this
.
DataType
=
type
;
this
.
PointInfo
=
point
;
}
/// <summary>
/// 位置X
...
...
@@ -22,13 +24,16 @@ namespace URSoldering.DeviceLibrary
/// 位置Y
/// </summary>
public
double
DataY
=
0
;
/// <summary>
/// 数据类型,1=少锡,2=多锡
/// </summary>
public
int
DataType
=
0
;
/// <summary>
/// 拍照点、基准点坐标
/// </summary>
public
WeldPointInfo
PointInfo
=
null
;
public
string
ToJosonStr
()
{
string
jsonStr
=
JsonHelper
.
SerializeObject
(
this
);
return
jsonStr
;
}
public
static
PositionResult
ToObject
(
string
json
)
{
return
JsonHelper
.
DeserializeJsonToObject
<
PositionResult
>(
json
);
}
}
}
DeviceLibrary/deviceLibrary/jbc/SolderingManager.cs
查看文件 @
3f9f31b
...
...
@@ -196,12 +196,19 @@ namespace URSoldering.DeviceLibrary
byte
[]
minTemp
=
parseCommand
(
"RMIT"
,
out
isOk
);
return
getReviceTemp
(
minTemp
);
}
internal
static
void
Init
(
object
jBC_SerialPort
,
object
jBC_EquipmentPort
)
public
static
bool
IsRightTemp
(
int
temperature
,
int
minTemp
,
int
maxTemp
)
{
int
temp
=
SolderingManager
.
queryActualTemp
();
if
(
temperature
!=
temp
&&
(
temp
<
minTemp
))
//if (wait.Temperature != temp && (temp < wait.TemperatureMin || temp > wait.TemperatureMax))
{
throw
new
NotImplementedException
();
return
false
;
}
else
{
return
true
;
}
}
public
static
int
ReadPortError
()
{
if
(
IsRun
)
...
...
DeviceLibrary/deviceLibrary/urRobot/URRobotControl.cs
查看文件 @
3f9f31b
...
...
@@ -615,6 +615,20 @@ namespace URSoldering.DeviceLibrary
public
double
RY
{
get
;
set
;
}
public
double
RZ
{
get
;
set
;
}
/// <summary>
/// 坐标是否有效
/// </summary>
/// <returns></returns>
public
bool
IsValid
()
{
if
(
X
.
Equals
(
0
)
&&
Y
.
Equals
(
0
)
&&
Z
.
Equals
(
0
)
&&
RX
.
Equals
(
0
)
&&
RY
.
Equals
(
0
)
&&
RZ
.
Equals
(
0
))
{
return
false
;
}
return
true
;
}
public
string
ToShowStr
()
{
return
"[X: "
+
X
+
",Y: "
+
Y
+
",Z: "
+
Z
+
",RX: "
+
RX
+
",RY:"
+
RY
+
",RZ:"
+
RZ
+
"]"
;
...
...
@@ -630,8 +644,6 @@ namespace URSoldering.DeviceLibrary
{
return
JsonHelper
.
DeserializeJsonToObject
<
URPointValue
>(
json
);
}
}
}
public
struct
URStatus
{
...
...
@@ -657,6 +669,7 @@ namespace URSoldering.DeviceLibrary
/// </summary>
public
static
string
SFETY_POWER_OFF
=
"POWER_OFF"
;
}
}
URSolderingClient/App.config
查看文件 @
3f9f31b
...
...
@@ -56,6 +56,12 @@
<
add
key
=
"Soldering_RobotMax"
value
=
"{"UpdateTime":"2018-07-28T14:37:09.4700739+08:00","X":0.0,"Y":0.0,"Z":0.0,"RX":0.0,"RY":0.0,"RZ":0.0}"
/>
<
add
key
=
"Soldering_MarkPoint"
value
=
"{"UpdateTime":"2018-07-28T14:37:09.4700739+08:00","X":0.0,"Y":0.0,"Z":0.0,"RX":0.0,"RY":0.0,"RZ":0.0}"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<!--坐标偏移
Mark
点的图像默认坐标-->
<
add
key
=
"MarkDefaultPosition"
value
=
"{"DataX":0.0,"DataY":0.0}"
/>
<!--坐标偏移坐标转换系数,图片的
1
像素对应实际多少毫米-->
<
add
key
=
"PositionChangeValue"
value
=
"1"
/>
<!--坐标偏移
AOI
检测的分支名称-->
<
add
key
=
"OffSetNodeName"
value
=
"坐标偏移"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"defaultAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
URSolderingClient/FrmBoardInfo.Designer.cs
查看文件 @
3f9f31b
...
...
@@ -369,7 +369,6 @@
this
.
dgvPoint
.
Location
=
new
System
.
Drawing
.
Point
(
1080
,
85
);
this
.
dgvPoint
.
MultiSelect
=
false
;
this
.
dgvPoint
.
Name
=
"dgvPoint"
;
this
.
dgvPoint
.
ReadOnly
=
true
;
this
.
dgvPoint
.
RowHeadersWidth
=
5
;
this
.
dgvPoint
.
RowTemplate
.
Height
=
23
;
this
.
dgvPoint
.
SelectionMode
=
System
.
Windows
.
Forms
.
DataGridViewSelectionMode
.
FullRowSelect
;
...
...
@@ -1153,7 +1152,7 @@
//
this
.
cmbAoiFile
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cmbAoiFile
.
FormattingEnabled
=
true
;
this
.
cmbAoiFile
.
Location
=
new
System
.
Drawing
.
Point
(
3
4
0
,
23
);
this
.
cmbAoiFile
.
Location
=
new
System
.
Drawing
.
Point
(
3
5
0
,
23
);
this
.
cmbAoiFile
.
Name
=
"cmbAoiFile"
;
this
.
cmbAoiFile
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
25
);
this
.
cmbAoiFile
.
TabIndex
=
269
;
...
...
@@ -1161,7 +1160,7 @@
// label9
//
this
.
label9
.
AutoSize
=
true
;
this
.
label9
.
Location
=
new
System
.
Drawing
.
Point
(
2
5
6
,
28
);
this
.
label9
.
Location
=
new
System
.
Drawing
.
Point
(
2
6
6
,
28
);
this
.
label9
.
Name
=
"label9"
;
this
.
label9
.
Size
=
new
System
.
Drawing
.
Size
(
78
,
17
);
this
.
label9
.
TabIndex
=
268
;
...
...
@@ -1179,7 +1178,7 @@
//
this
.
label25
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
label25
.
AutoSize
=
true
;
this
.
label25
.
Location
=
new
System
.
Drawing
.
Point
(
7
6
8
,
28
);
this
.
label25
.
Location
=
new
System
.
Drawing
.
Point
(
7
8
8
,
28
);
this
.
label25
.
Name
=
"label25"
;
this
.
label25
.
Size
=
new
System
.
Drawing
.
Size
(
42
,
17
);
this
.
label25
.
TabIndex
=
37
;
...
...
@@ -1189,7 +1188,7 @@
//
this
.
label24
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
label24
.
AutoSize
=
true
;
this
.
label24
.
Location
=
new
System
.
Drawing
.
Point
(
6
3
1
,
28
);
this
.
label24
.
Location
=
new
System
.
Drawing
.
Point
(
6
5
1
,
28
);
this
.
label24
.
Name
=
"label24"
;
this
.
label24
.
Size
=
new
System
.
Drawing
.
Size
(
36
,
17
);
this
.
label24
.
TabIndex
=
36
;
...
...
@@ -1209,7 +1208,7 @@
this
.
btnSave
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
btnSave
.
FlatAppearance
.
BorderSize
=
0
;
this
.
btnSave
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnSave
.
Location
=
new
System
.
Drawing
.
Point
(
9
27
,
16
);
this
.
btnSave
.
Location
=
new
System
.
Drawing
.
Point
(
9
39
,
16
);
this
.
btnSave
.
Name
=
"btnSave"
;
this
.
btnSave
.
Size
=
new
System
.
Drawing
.
Size
(
117
,
41
);
this
.
btnSave
.
TabIndex
=
40
;
...
...
@@ -1220,7 +1219,7 @@
// txtBoardLength
//
this
.
txtBoardLength
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
txtBoardLength
.
Location
=
new
System
.
Drawing
.
Point
(
5
7
6
,
25
);
this
.
txtBoardLength
.
Location
=
new
System
.
Drawing
.
Point
(
5
9
6
,
25
);
this
.
txtBoardLength
.
MaxLength
=
8
;
this
.
txtBoardLength
.
Name
=
"txtBoardLength"
;
this
.
txtBoardLength
.
Size
=
new
System
.
Drawing
.
Size
(
53
,
23
);
...
...
@@ -1231,7 +1230,7 @@
//
this
.
label4
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
label4
.
AutoSize
=
true
;
this
.
label4
.
Location
=
new
System
.
Drawing
.
Point
(
69
1
,
28
);
this
.
label4
.
Location
=
new
System
.
Drawing
.
Point
(
71
1
,
28
);
this
.
label4
.
Name
=
"label4"
;
this
.
label4
.
Size
=
new
System
.
Drawing
.
Size
(
20
,
17
);
this
.
label4
.
TabIndex
=
5
;
...
...
@@ -1241,7 +1240,7 @@
//
this
.
label3
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
label3
.
AutoSize
=
true
;
this
.
label3
.
Location
=
new
System
.
Drawing
.
Point
(
5
5
4
,
28
);
this
.
label3
.
Location
=
new
System
.
Drawing
.
Point
(
5
7
4
,
28
);
this
.
label3
.
Name
=
"label3"
;
this
.
label3
.
Size
=
new
System
.
Drawing
.
Size
(
20
,
17
);
this
.
label3
.
TabIndex
=
3
;
...
...
@@ -1250,7 +1249,7 @@
// txtBoardWidth
//
this
.
txtBoardWidth
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
txtBoardWidth
.
Location
=
new
System
.
Drawing
.
Point
(
7
1
3
,
25
);
this
.
txtBoardWidth
.
Location
=
new
System
.
Drawing
.
Point
(
7
3
3
,
25
);
this
.
txtBoardWidth
.
MaxLength
=
8
;
this
.
txtBoardWidth
.
Name
=
"txtBoardWidth"
;
this
.
txtBoardWidth
.
Size
=
new
System
.
Drawing
.
Size
(
53
,
23
);
...
...
@@ -1306,41 +1305,42 @@
//
// Col_ID
//
this
.
Col_ID
.
HeaderText
=
"
固定点
"
;
this
.
Col_ID
.
HeaderText
=
"
位置
"
;
this
.
Col_ID
.
Name
=
"Col_ID"
;
this
.
Col_ID
.
ReadOnly
=
true
;
this
.
Col_ID
.
Width
=
90
;
this
.
Col_ID
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortable
;
this
.
Col_ID
.
Width
=
120
;
//
// Col_X
//
this
.
Col_X
.
DataPropertyName
=
"RobotX"
;
this
.
Col_X
.
HeaderText
=
"X"
;
this
.
Col_X
.
Name
=
"Col_X"
;
this
.
Col_X
.
ReadOnly
=
tru
e
;
this
.
Col_X
.
Width
=
68
;
this
.
Col_X
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortabl
e
;
this
.
Col_X
.
Width
=
75
;
//
// Col_Y
//
this
.
Col_Y
.
DataPropertyName
=
"RobotY"
;
this
.
Col_Y
.
HeaderText
=
"Y"
;
this
.
Col_Y
.
Name
=
"Col_Y"
;
this
.
Col_Y
.
ReadOnly
=
tru
e
;
this
.
Col_Y
.
Width
=
68
;
this
.
Col_Y
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortabl
e
;
this
.
Col_Y
.
Width
=
75
;
//
// Col_Z
//
this
.
Col_Z
.
DataPropertyName
=
"RobotZ"
;
this
.
Col_Z
.
HeaderText
=
"Z"
;
this
.
Col_Z
.
Name
=
"Col_Z"
;
this
.
Col_Z
.
ReadOnly
=
tru
e
;
this
.
Col_Z
.
Width
=
68
;
this
.
Col_Z
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortabl
e
;
this
.
Col_Z
.
Width
=
75
;
//
// Col_RX
//
this
.
Col_RX
.
DataPropertyName
=
"RobotRX"
;
this
.
Col_RX
.
HeaderText
=
"RX"
;
this
.
Col_RX
.
Name
=
"Col_RX"
;
this
.
Col_RX
.
ReadOnly
=
tru
e
;
this
.
Col_RX
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortabl
e
;
this
.
Col_RX
.
Width
=
75
;
//
// Col_RY
...
...
@@ -1348,7 +1348,7 @@
this
.
Col_RY
.
DataPropertyName
=
"RobotRY"
;
this
.
Col_RY
.
HeaderText
=
"RY"
;
this
.
Col_RY
.
Name
=
"Col_RY"
;
this
.
Col_RY
.
ReadOnly
=
tru
e
;
this
.
Col_RY
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortabl
e
;
this
.
Col_RY
.
Width
=
75
;
//
// Col_RZ
...
...
@@ -1356,7 +1356,7 @@
this
.
Col_RZ
.
DataPropertyName
=
"RobotRZ"
;
this
.
Col_RZ
.
HeaderText
=
"RZ"
;
this
.
Col_RZ
.
Name
=
"Col_RZ"
;
this
.
Col_RZ
.
ReadOnly
=
tru
e
;
this
.
Col_RZ
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortabl
e
;
this
.
Col_RZ
.
Width
=
75
;
//
// Col_Update
...
...
@@ -1378,6 +1378,7 @@
this
.
Col_Move
.
Text
=
"移动测试"
;
this
.
Col_Move
.
ToolTipText
=
"移动测试"
;
this
.
Col_Move
.
UseColumnTextForLinkValue
=
true
;
this
.
Col_Move
.
Width
=
75
;
//
// FrmBoardInfo
//
...
...
URSolderingClient/FrmBoardInfo.cs
查看文件 @
3f9f31b
...
...
@@ -243,10 +243,10 @@ namespace URSoldering.Client
}
}
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点A"
,
updateBoardInfo
.
APointValue
));
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点B"
,
updateBoardInfo
.
BPointValue
));
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点C"
,
updateBoardInfo
.
CPointValue
));
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点D"
,
updateBoardInfo
.
DPointValue
));
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点A
(左上角)
"
,
updateBoardInfo
.
APointValue
));
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点B
(左下角)
"
,
updateBoardInfo
.
BPointValue
));
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点C
(右上角)
"
,
updateBoardInfo
.
CPointValue
));
dgvPoint
.
Rows
.
Add
(
setFPoint
(
null
,
"固定点D
(右下角)
"
,
updateBoardInfo
.
DPointValue
));
}
private
DataGridViewRow
setPointInfo
(
DataGridViewRow
view
,
WeldPointInfo
point
)
{
...
...
@@ -806,10 +806,9 @@ namespace URSoldering.Client
{
openFileDialog1
.
Tag
=
true
;
picBoard
.
Image
=
Image
.
FromFile
(
openFileDialog1
.
FileName
);
if
(
this
.
txtBoardWidth
.
Text
.
Trim
()
!=
""
&&
this
.
txtBoardLength
.
Text
.
Trim
()
!=
""
)
{
loadPictureBoxSize
();
}
}
}
...
...
@@ -817,6 +816,10 @@ namespace URSoldering.Client
//private float imageXiShu = 1;
private
void
loadPictureBoxSize
()
{
if
(
this
.
txtBoardWidth
.
Text
.
Trim
()
==
""
||
this
.
txtBoardLength
.
Text
.
Trim
()
==
""
)
{
return
;
}
picBoard
.
SizeMode
=
PictureBoxSizeMode
.
StretchImage
;
int
width
=
0
;
int
height
=
0
;
...
...
@@ -860,28 +863,31 @@ namespace URSoldering.Client
int
index
=
0
;
foreach
(
WeldPointInfo
weld
in
pointList
)
{
//float x = (float)Math.Abs(weld.PositionX - orgX) * imageXiShu;
//float y = (float)Math.Abs(weld.PositionY - orgY) * imageXiShu;
int
pointHight
=
16
;
float
x
,
y
;
GetPicPointByUrPoint
(
weld
.
GetURPoint
(),
out
x
,
out
y
);
//LogUtil.debug("显示焊点:X【" + x + "】Y【" + y + "】,坐标X【" + weld.PositionX + "】坐标Y【" + weld.Position
Y + "】");
//
g.FillEllipse(Brushes.Red, x - pointHight / 2, y - pointHight / 2, pointHight, pointHight);
//
if (index > 0)
//
{
// Pen p = new Pen(Color.Red, 2
);
LogUtil
.
debug
(
"显示焊点:X【"
+
x
+
"】Y【"
+
y
+
"】,坐标X【"
+
weld
.
RobotX
+
"】坐标Y【"
+
weld
.
Robot
Y
+
"】"
);
g
.
FillEllipse
(
Brushes
.
Red
,
x
-
pointHight
/
2
,
y
-
pointHight
/
2
,
pointHight
,
pointHight
);
if
(
index
>
0
)
{
Pen
p
=
new
Pen
(
Color
.
Red
,
1
);
//
//中间点
//
float xCenter = (preX + x) / 2;
//
float yCenter = (preY + y) / 2;
//
System.Drawing.Drawing2D.AdjustableArrowCap lineCap = new System.Drawing.Drawing2D.AdjustableArrowCap(6, 8, true);
// Pen RedPen = new Pen(Color.Red, 2
);
//
RedPen.CustomEndCap = lineCap;
//中间点
float
xCenter
=
(
preX
+
x
)
/
2
;
float
yCenter
=
(
preY
+
y
)
/
2
;
System
.
Drawing
.
Drawing2D
.
AdjustableArrowCap
lineCap
=
new
System
.
Drawing
.
Drawing2D
.
AdjustableArrowCap
(
6
,
8
,
true
);
Pen
RedPen
=
new
Pen
(
Color
.
Red
,
1
);
RedPen
.
CustomEndCap
=
lineCap
;
// grfx.DrawLine(RedPen, preX, preY, xCenter, yCenter);
// grfx.DrawLine(p, preX, preY, x, y);
//}
//preX = x;
//preY = y;
//index++;
grfx
.
DrawLine
(
RedPen
,
preX
,
preY
,
xCenter
,
yCenter
);
grfx
.
DrawLine
(
p
,
preX
,
preY
,
x
,
y
);
}
//写字
g
.
DrawString
(
weld
.
pointName
,
new
Font
(
"Arial "
,
8
,
FontStyle
.
Regular
),
Brushes
.
Red
,
x
-
pointHight
/
2
,
y
+
pointHight
/
2
+
2
);
preX
=
x
;
preY
=
y
;
index
++;
}
grfx
.
SmoothingMode
=
SmoothingMode
.
HighQuality
;
...
...
@@ -897,11 +903,8 @@ namespace URSoldering.Client
private
void
dgvList_CellValueChanged
(
object
sender
,
DataGridViewCellEventArgs
e
)
{
if
(
this
.
txtBoardWidth
.
Text
.
Trim
()
!=
""
&&
this
.
txtBoardLength
.
Text
.
Trim
()
!=
""
)
{
loadPictureBoxSize
();
}
}
private
void
txtOriginX_TextChanged
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -1019,9 +1022,75 @@ namespace URSoldering.Client
private
void
保存焊点
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
if
(
m_MouseDownPoint
==
null
||
m_MouseDownPoint
.
X
==
0
||
m_MouseDownPoint
.
Y
==
0
)
{
MessageBox
.
Show
(
"请点击要保存的焊点"
);
return
;
}
double
x
=
0
;
double
y
=
0
;
URPointValue
point
=
GetUrPointByPicPoint
(
);
LogUtil
.
info
(
"新增焊点:X【"
+
m_MouseDownPoint
.
X
+
"】Y【"
+
m_MouseDownPoint
.
Y
+
"】,坐标 【"
+
point
.
ToShowStr
()
+
"】 "
);
AddNewPoint
(
point
);
liUpdateTime_LinkClicked
(
null
,
null
);
}
private
void
GetPicPointByUrPoint
(
URPointValue
point
,
out
float
x
,
out
float
y
)
{
int
width
=
picBoard
.
Width
;
int
height
=
picBoard
.
Height
;
URPointValue
APointValue
=
GetFRowPoint
(
0
);
URPointValue
BPointValue
=
GetFRowPoint
(
1
);
URPointValue
CPointValue
=
GetFRowPoint
(
2
);
URPointValue
DPointValue
=
GetFRowPoint
(
3
);
//判断AD点是否有效
if
(
APointValue
.
IsValid
()
&&
DPointValue
.
IsValid
())
{
x
=
(
float
)((
point
.
X
-
APointValue
.
X
)
*
width
/
(
DPointValue
.
X
-
APointValue
.
X
));
y
=
(
float
)((
point
.
Y
-
APointValue
.
Y
)
*
height
/
(
DPointValue
.
Y
-
APointValue
.
Y
));
}
else
if
(
BPointValue
.
IsValid
()
&&
CPointValue
.
IsValid
())
{
x
=
(
float
)((
point
.
X
-
BPointValue
.
X
)
*
width
/
(
CPointValue
.
X
-
BPointValue
.
X
));
y
=
(
float
)((
point
.
Y
-
CPointValue
.
Y
)
*
height
/
(
BPointValue
.
Y
-
CPointValue
.
Y
));
}
else
{
x
=
-
1
;
y
=
-
1
;
}
}
private
URPointValue
GetUrPointByPicPoint
(
)
{
URPointValue
currPoint
=
GetCurrRobotPoint
();
URPointValue
point
=
new
URPointValue
(
0
,
0
,
currPoint
.
Z
,
currPoint
.
RX
,
currPoint
.
RY
,
currPoint
.
RZ
);
URPointValue
APointValue
=
GetFRowPoint
(
0
);
URPointValue
BPointValue
=
GetFRowPoint
(
1
);
URPointValue
CPointValue
=
GetFRowPoint
(
2
);
URPointValue
DPointValue
=
GetFRowPoint
(
3
);
int
width
=
picBoard
.
Width
;
int
height
=
picBoard
.
Height
;
//判断AD点是否有效
if
(
APointValue
.
IsValid
()
&&
DPointValue
.
IsValid
())
{
double
x
=
APointValue
.
X
+
m_MouseDownPoint
.
X
*
(
DPointValue
.
X
-
APointValue
.
X
)
/
width
;
double
y
=
APointValue
.
Y
+
m_MouseDownPoint
.
Y
*(
DPointValue
.
Y
-
APointValue
.
Y
)
/
height
;
point
.
X
=
x
;
point
.
Y
=
y
;
}
else
if
(
BPointValue
.
IsValid
()
&&
CPointValue
.
IsValid
())
{
double
x
=
BPointValue
.
X
+
m_MouseDownPoint
.
X
*
(
CPointValue
.
X
-
BPointValue
.
X
)
/
width
;
double
y
=
CPointValue
.
Y
+
m_MouseDownPoint
.
Y
*
(
BPointValue
.
Y
-
CPointValue
.
Y
)
/
height
;
point
.
X
=
x
;
point
.
Y
=
y
;
}
return
point
;
}
private
void
AddNewPoint
(
URPointValue
robotP
)
{
...
...
URSolderingClient/FrmBoardList.cs
查看文件 @
3f9f31b
...
...
@@ -7,6 +7,8 @@ using System.Drawing;
using
System.Linq
;
using
System.Reflection
;
using
System.Windows.Forms
;
using
URSoldering.Common
;
using
System.Drawing.Drawing2D
;
namespace
URSoldering.Client
{
...
...
@@ -160,7 +162,32 @@ namespace URSoldering.Client
MessageBox
.
Show
(
"请选择程序!"
);
}
}
private
void
GetPicPointByUrPoint
(
BoardInfo
boardInfo
,
URPointValue
point
,
out
float
x
,
out
float
y
)
{
int
width
=
picBoard
.
Width
;
int
height
=
picBoard
.
Height
;
URPointValue
APointValue
=
boardInfo
.
APointValue
;
URPointValue
BPointValue
=
boardInfo
.
BPointValue
;
URPointValue
CPointValue
=
boardInfo
.
CPointValue
;
URPointValue
DPointValue
=
boardInfo
.
DPointValue
;
//判断AD点是否有效
if
(
APointValue
.
IsValid
()
&&
DPointValue
.
IsValid
())
{
x
=
(
float
)((
point
.
X
-
APointValue
.
X
)
*
width
/
(
DPointValue
.
X
-
APointValue
.
X
));
y
=
(
float
)((
point
.
Y
-
APointValue
.
Y
)
*
height
/
(
DPointValue
.
Y
-
APointValue
.
Y
));
}
else
if
(
BPointValue
.
IsValid
()
&&
CPointValue
.
IsValid
())
{
x
=
(
float
)((
point
.
X
-
BPointValue
.
X
)
*
width
/
(
CPointValue
.
X
-
BPointValue
.
X
));
y
=
(
float
)((
point
.
Y
-
CPointValue
.
Y
)
*
height
/
(
BPointValue
.
Y
-
CPointValue
.
Y
));
}
else
{
x
=
-
1
;
y
=
-
1
;
}
}
private
void
loadPictureBoxSize
(
BoardInfo
board
)
{
picBoard
.
SizeMode
=
PictureBoxSizeMode
.
StretchImage
;
...
...
@@ -194,38 +221,47 @@ namespace URSoldering.Client
picBoard
.
Image
=
board
.
GetImage
();
picBoard
.
Refresh
();
//int orgType = board.orgType;
//double orgX = board.getImageOrgX();
//double orgY = board.getImageOrgY();
//Graphics grfx = picBoard.CreateGraphics();
//float preX = 0;
//float preY = 0;
//int index = 0;
//foreach (WeldPointInfo weld in pointList)
//{
//float x = (float)Math.Abs(weld.PositionX - orgX) * picBoard.Width / width - pointHight / 2;
//float y = (float)Math.Abs(weld.PositionY - orgY) * picBoard.Width / width - pointHight / 2;
//g.FillEllipse(Brushes.Red, x - pointHight / 2, y - pointHight / 2, pointHight, pointHight);
//if (index > 0)
//{
// Pen p = new Pen(Color.Red, 2);
// //中间点
// float xCenter = (preX + x) / 2;
// float yCenter = (preY + y) / 2;
// System.Drawing.Drawing2D.AdjustableArrowCap lineCap = new System.Drawing.Drawing2D.AdjustableArrowCap(6, 8, true);
// Pen RedPen = new Pen(Color.Red, 2);
// RedPen.CustomEndCap = lineCap;
// grfx.DrawLine(RedPen, preX, preY, xCenter, yCenter);
// grfx.DrawLine(p, preX, preY, x, y);
//}
//preX = x;
//preY = y;
//index++;
//g.FillEllipse(Brushes.Red, x, y, pointHight, pointHight);
//}
Graphics
grfx
=
picBoard
.
CreateGraphics
();
float
preX
=
0
;
float
preY
=
0
;
int
index
=
0
;
foreach
(
WeldPointInfo
weld
in
pointList
)
{
int
pointHight
=
16
;
float
x
,
y
;
GetPicPointByUrPoint
(
board
,
weld
.
GetURPoint
(),
out
x
,
out
y
);
LogUtil
.
debug
(
"显示焊点:X【"
+
x
+
"】Y【"
+
y
+
"】,坐标X【"
+
weld
.
RobotX
+
"】坐标Y【"
+
weld
.
RobotY
+
"】"
);
g
.
FillEllipse
(
Brushes
.
Red
,
x
-
pointHight
/
2
,
y
-
pointHight
/
2
,
pointHight
,
pointHight
);
if
(
index
>
0
)
{
Pen
p
=
new
Pen
(
Color
.
Red
,
1
);
//中间点
float
xCenter
=
(
preX
+
x
)
/
2
;
float
yCenter
=
(
preY
+
y
)
/
2
;
System
.
Drawing
.
Drawing2D
.
AdjustableArrowCap
lineCap
=
new
System
.
Drawing
.
Drawing2D
.
AdjustableArrowCap
(
6
,
8
,
true
);
Pen
RedPen
=
new
Pen
(
Color
.
Red
,
1
);
RedPen
.
CustomEndCap
=
lineCap
;
grfx
.
DrawLine
(
RedPen
,
preX
,
preY
,
xCenter
,
yCenter
);
grfx
.
DrawLine
(
p
,
preX
,
preY
,
x
,
y
);
}
//写字
g
.
DrawString
(
weld
.
pointName
,
new
Font
(
"Arial "
,
10
,
FontStyle
.
Bold
),
Brushes
.
Red
,
x
-
pointHight
/
2
,
y
+
pointHight
/
2
+
2
);
preX
=
x
;
preY
=
y
;
index
++;
}
grfx
.
SmoothingMode
=
SmoothingMode
.
HighQuality
;
g
.
DrawString
(
"A "
,
new
Font
(
"Arial "
,
10
,
FontStyle
.
Bold
),
Brushes
.
White
,
3
,
3
);
g
.
DrawString
(
"B "
,
new
Font
(
"Arial "
,
10
,
FontStyle
.
Bold
),
Brushes
.
White
,
3
,
picBoard
.
Height
-
20
);
g
.
DrawString
(
"C "
,
new
Font
(
"Arial "
,
10
,
FontStyle
.
Bold
),
Brushes
.
White
,
picBoard
.
Width
-
18
,
0
);
g
.
DrawString
(
"D "
,
new
Font
(
"Arial "
,
10
,
FontStyle
.
Bold
),
Brushes
.
White
,
picBoard
.
Width
-
18
,
picBoard
.
Height
-
20
);
//
g.Dispose();
g
.
Dispose
();
}
private
void
FrmBoardList_Shown
(
object
sender
,
EventArgs
e
)
...
...
URSolderingClient/FrmSetting.Designer.cs
查看文件 @
3f9f31b
此文件的差异被折叠,
点击展开。
URSolderingClient/FrmSetting.cs
查看文件 @
3f9f31b
...
...
@@ -38,6 +38,9 @@ namespace URSoldering.Client
clear1Control
.
ShowPoint
(
WeldRobotBean
.
Clear1Point
);
homeControl
.
ShowPoint
(
WeldRobotBean
.
HomePoint
);
markControl
.
ShowPoint
(
WeldRobotBean
.
MarkPoint
);
txtMarkX
.
Text
=
WeldRobotBean
.
MarkImgPosition
.
DataX
.
ToString
();
txtMarkY
.
Text
=
WeldRobotBean
.
MarkImgPosition
.
DataY
.
ToString
();
}
private
void
saveValue
()
...
...
@@ -132,6 +135,18 @@ namespace URSoldering.Client
// return;
//}
int
x
=
FormUtil
.
GetIntValue
(
txtMarkX
);
int
y
=
FormUtil
.
GetIntValue
(
txtMarkY
);
if
(
x
<=
0
||
y
<=
0
)
{
MessageBox
.
Show
(
"请输入正确的Mark的图片坐标"
);
txtMarkX
.
Focus
();
return
;
}
WeldRobotBean
.
MarkImgPosition
=
new
PositionResult
(
x
,
y
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
MarkDefaultPosition
,
WeldRobotBean
.
MarkImgPosition
.
ToJosonStr
());
WeldRobotBean
.
UpdateOrgPoint
(
homeP
);
WeldRobotBean
.
UpdateClear1Point
(
clear1P
);
WeldRobotBean
.
UpdateClear2Point
(
clear2P
);
...
...
@@ -150,8 +165,9 @@ namespace URSoldering.Client
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Soldering_RobotMax
,
maxP
.
ToJosonStr
());
URPointValue
markPoint
=
markControl
.
GetPoint
();
WeldRobotBean
.
MarkPoint
=
markPoint
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Soldering_MarkPoint
,
markPoint
.
ToJosonStr
());
WeldRobotBean
.
UpdateMarkPoint
(
markPoint
);
//WeldRobotBean.MarkPoint = markPoint;
//ConfigAppSettings.SaveValue(Setting_Init.Soldering_MarkPoint, markPoint.ToJosonStr());
MessageBox
.
Show
(
"保存成功,需要重启之后才能生效!"
);
this
.
Close
();
...
...
URSolderingClient/FrmWork.cs
查看文件 @
3f9f31b
...
...
@@ -684,10 +684,7 @@ namespace URSoldering.Client
axCKVisionCtrl1
.
Execute
(
num
);
axCKVisionCtrl1
.
ZoomView
(
2
);
axCKVisionCtrl1
.
Redraw
();
Thread
.
Sleep
(
1000
);
axCKVisionCtrl1
.
Execute
(
num
);
axCKVisionCtrl1
.
ZoomView
(
2
);
axCKVisionCtrl1
.
Redraw
();
return
true
;
}
catch
(
Exception
ex
)
...
...
@@ -730,29 +727,34 @@ namespace URSoldering.Client
}
}
private
List
<
PositionResult
>
RunPositionOffset
(
)
private
List
<
PositionResult
>
RunPositionOffset
()
{
List
<
PositionResult
>
pointList
=
new
List
<
PositionResult
>();
try
{
this
.
label1
.
Text
=
"视觉坐标偏移"
;
lblCodeResult
.
Visible
=
false
;
RunAOI
(
0
);
RunAOI
(
2
);
Thread
.
Sleep
(
100
);
string
shaoxi
=
"坐标偏移"
;
int
result1
=
CKResult
(
shaoxi
,
10
);
if
(!
result1
.
Equals
(
1
))
string
nodeName
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
OffSetNodeName
);
if
(
nodeName
.
Equals
(
""
))
{
nodeName
=
"坐标偏移"
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
OffSetNodeName
,
nodeName
);
}
int
result1
=
CKResult
(
nodeName
,
10
);
if
(
result1
.
Equals
(
1
))
{
pointList
=
GetPhotoResult
(
shaoxi
,
100
);
pointList
=
GetPhotoResult
(
nodeName
,
100
);
}
string
resultList
=
""
;
if
(
pointList
.
Count
<=
0
)
{
lblAOIResult
.
Text
=
shaoxi
+
"未识别到焊点"
;
lblAOIResult
.
Text
=
nodeName
+
"未识别到焊点"
;
}
else
{
lblAOIResult
.
Text
=
shaoxi
+
"识别结果:"
;
lblAOIResult
.
Text
=
nodeName
+
"识别结果:"
;
foreach
(
PositionResult
result
in
pointList
)
{
lblAOIResult
.
Text
+=
" X:"
+
result
.
DataX
+
",Y:"
+
result
.
DataY
+
";"
;
...
...
@@ -794,8 +796,6 @@ namespace URSoldering.Client
for
(
int
i
=
0
;
i
<
num
;
i
++)
{
double
x
=
0
,
y
=
0
;
if
(
name
.
Equals
(
"少锡"
))
{
objValue
=
new
VariantWrapper
(
value
);
if
(
axCKVisionCtrl1
.
GetValue
(
idTool
,
102
,
i
,
ref
objValue
)
==
true
)
{
...
...
@@ -808,24 +808,7 @@ namespace URSoldering.Client
result
=
objValue
.
ToString
();
y
=
Convert
.
ToDouble
(
result
);
}
aOIDataResults
.
Add
(
new
PositionResult
(
x
,
y
,
1
,
point
));
}
else
{
objValue
=
new
VariantWrapper
(
value
);
if
(
axCKVisionCtrl1
.
GetValue
(
idTool
,
103
,
i
,
ref
objValue
)
==
true
)
{
result
=
objValue
.
ToString
();
x
=
Convert
.
ToDouble
(
result
);
}
objValue
=
new
VariantWrapper
(
value
);
if
(
axCKVisionCtrl1
.
GetValue
(
idTool
,
104
,
i
,
ref
objValue
)
==
true
)
{
result
=
objValue
.
ToString
();
y
=
Convert
.
ToDouble
(
result
);
}
aOIDataResults
.
Add
(
new
PositionResult
(
x
,
y
,
2
,
point
));
}
aOIDataResults
.
Add
(
new
PositionResult
(
x
,
y
));
}
}
catch
(
Exception
ex
)
...
...
URSolderingClient/记录.txt
查看文件 @
3f9f31b
...
...
@@ -37,16 +37,22 @@ AOI检测NG时,红灯亮,等到下次开始焊接时清理红灯。
20181022
需要修改内容:
坐标偏移功能
1.增加一个整体的mark点,保存机械臂坐标
2.每个电路板需要配置拍照点
3.流程修改:焊接之前,先去拍照点,拍照识别,取出坐标后进行整体坐标偏移,然后再焊接。
AOI程序修改:分支1是左边偏移功能。分支2是AOI检测功能。
图片上自动编程功能:
图片上要显示四个点:ABCD
需要配置AC点或者BD点作为固定点
点击图片,直接增加焊点,可以自动算出XY坐标
坐标偏移功能
1.增加一个整体的mark点,需要配置 机械臂坐标 和 图片对应坐标,偏移时根据此Mark点的图片坐标对机械臂坐标进行偏移。
2.每个程序需要配置一个拍照点 , 焊接之前,先去拍照点,拍照识别Mark点,取出坐标后进行坐标偏移,然后再根据偏移后的坐标进行焊接。
3.AOI程序需要修改:分支2是坐标偏移功能。分支1是AOI检测功能。
自动编程功能:
1.程序编辑界面:每个程序都要配置AC点或者BD点作为固定点,也可以四个固定点都配置。
2.增加焊点时,点击图片对应位置新增焊点 ,会自动算出新焊点XY的坐标
20181126增加配置
更新程序后需要在URSolderingClient.exe.config增加配置:
<!--坐标偏移Mark点的图像默认坐标-->
<add key="MarkDefaultPosition" value="{"DataX":0.0,"DataY":0.0}" />
<!--坐标偏移坐标转换系数,图片的1像素对应实际多少毫米-->
<add key="PositionChangeValue" value="1" />
<!--坐标偏移AOI检测的分支名称-->
<add key="OffSetNodeName" value="坐标偏移"/>
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论