Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
URSolderingRobot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0fd67cd7
由
几米阳光
编写于
2019-01-04 09:53:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
坐标转换修改
1 个父辈
3ea74c66
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
87 行增加
和
46 行删除
DeviceLibrary/bean/BoardInfo.cs
URSolderingClient/FrmBoardInfo.Designer.cs
URSolderingClient/FrmBoardInfo.cs
URSolderingClient/FrmBoardInfo.resx
URSolderingClient/FrmBoardList.cs
URSolderingClient/FrmPointInfo.cs
URSolderingClient/FrmSetting.Designer.cs
URSolderingClient/FrmSetting.cs
DeviceLibrary/bean/BoardInfo.cs
查看文件 @
0fd67cd
...
...
@@ -195,6 +195,9 @@ namespace URSoldering.DeviceLibrary
public
double
RobotRY
{
get
;
set
;
}
public
double
RobotRZ
{
get
;
set
;
}
public
int
ImageX
=
-
1
;
public
int
ImageY
=
-
1
;
/// <summary>
/// 预热温度
/// </summary>
...
...
URSolderingClient/FrmBoardInfo.Designer.cs
查看文件 @
0fd67cd
此文件的差异被折叠,
点击展开。
URSolderingClient/FrmBoardInfo.cs
查看文件 @
0fd67cd
...
...
@@ -286,6 +286,9 @@ namespace URSoldering.Client
view
.
Cells
[
Column_pointType
.
Index
].
Value
=
point
.
pointType
;
view
.
Cells
[
Column_isClear
.
Index
].
Value
=
point
.
isNeedClear
.
ToString
();
view
.
Cells
[
Column_ClearTime
.
Index
].
Value
=
point
.
ClearTime
;
view
.
Cells
[
Column_ImageX
.
Index
].
Value
=
point
.
ImageX
;
view
.
Cells
[
Column_ImageY
.
Index
].
Value
=
point
.
ImageY
;
return
view
;
}
private
bool
isRun
=
false
;
...
...
@@ -360,7 +363,7 @@ namespace URSoldering.Client
MessageBox
.
Show
(
"保存失败,焊点Z坐标("
+
point
.
Z
+
")不能低于最低Z点("
+
URRobotControl
.
Robot_LIM_Z
+
")"
);
return
;
}
AddNewPoint
(
point
);
AddNewPoint
(
point
,-
1
,-
1
);
liUpdateTime_LinkClicked
(
null
,
null
);
}
...
...
@@ -780,6 +783,8 @@ namespace URSoldering.Client
point
.
isNeedClear
=
Convert
.
ToBoolean
(
row
.
Cells
[
this
.
Column_isClear
.
Name
].
Value
.
ToString
());
point
.
pointType
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_pointType
.
Name
].
Value
.
ToString
());
point
.
ClearTime
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_ClearTime
.
Name
].
Value
.
ToString
());
point
.
ImageX
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_ImageX
.
Name
].
Value
.
ToString
());
point
.
ImageY
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_ImageY
.
Name
].
Value
.
ToString
());
}
catch
(
Exception
ex
)
{
...
...
@@ -873,8 +878,9 @@ namespace URSoldering.Client
int
pointHight
=
16
;
float
x
,
y
;
GetPicPointByUrPoint
(
weld
.
GetURPoint
(),
out
x
,
out
y
);
LogUtil
.
debug
(
"显示焊点:X【"
+
x
+
"】Y【"
+
y
+
"】,坐标X【"
+
weld
.
RobotX
+
"】坐标Y【"
+
weld
.
RobotY
+
"】"
);
x
=
weld
.
ImageX
;
y
=
weld
.
ImageY
;
LogUtil
.
debug
(
"显示焊点【"
+
weld
.
pointName
+
"】: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
)
{
...
...
@@ -1039,7 +1045,7 @@ namespace URSoldering.Client
URPointValue
point
=
GetUrPointByPicPoint
(
);
LogUtil
.
info
(
"新增焊点:X【"
+
m_MouseDownPoint
.
X
+
"】Y【"
+
m_MouseDownPoint
.
Y
+
"】,坐标 【"
+
point
.
ToShowStr
()
+
"】 "
);
AddNewPoint
(
point
);
AddNewPoint
(
point
,
m_MouseDownPoint
.
X
,
m_MouseDownPoint
.
Y
);
liUpdateTime_LinkClicked
(
null
,
null
);
}
...
...
@@ -1055,13 +1061,13 @@ namespace URSoldering.Client
//判断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
));
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
));
x
=
(
float
)((
point
.
X
-
BPointValue
.
X
)
*
width
/
(
CPointValue
.
X
-
BPointValue
.
X
));
y
=
(
float
)((
point
.
Y
-
CPointValue
.
Y
)
*
height
/
(
BPointValue
.
Y
-
CPointValue
.
Y
));
}
else
{
...
...
@@ -1069,7 +1075,7 @@ namespace URSoldering.Client
y
=
-
1
;
}
}
private
URPointValue
GetUrPointByPicPoint
(
)
private
URPointValue
GetUrPointByPicPoint
()
{
URPointValue
currPoint
=
GetCurrRobotPoint
();
URPointValue
point
=
new
URPointValue
(
0
,
0
,
currPoint
.
Z
,
currPoint
.
RX
,
currPoint
.
RY
,
currPoint
.
RZ
);
...
...
@@ -1082,31 +1088,42 @@ namespace URSoldering.Client
int
width
=
picBoard
.
Width
;
int
height
=
picBoard
.
Height
;
//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;
//}
//判断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
;
}
if
(
APointValue
.
IsValid
()
&&
CPointValue
.
IsValid
()
&&
BPointValue
.
IsValid
())
{
double
x
=
APointValue
.
X
+
m_MouseDownPoint
.
Y
*
(
BPointValue
.
X
-
APointValue
.
X
)
/
height
+
m_MouseDownPoint
.
X
*
(
CPointValue
.
X
-
APointValue
.
X
)
/
width
;
double
y
=
APointValue
.
Y
+
m_MouseDownPoint
.
Y
*
(
BPointValue
.
Y
-
APointValue
.
Y
)
/
height
+
m_MouseDownPoint
.
X
*
(
CPointValue
.
Y
-
APointValue
.
Y
)
/
width
;
point
.
X
=
Math
.
Round
(
x
,
2
);
point
.
Y
=
Math
.
Round
(
y
,
2
);
LogUtil
.
info
(
"图片坐标【"
+
m_MouseDownPoint
.
X
+
","
+
m_MouseDownPoint
.
Y
+
"】宽【"
+
width
+
"】高【"
+
height
+
"】机械臂坐标【"
+
point
.
X
+
","
+
point
.
Y
+
"】"
);
}
return
point
;
}
private
void
AddNewPoint
(
URPointValue
robotP
)
private
void
AddNewPoint
(
URPointValue
robotP
,
int
ImageX
,
int
ImageY
)
{
WeldPointInfo
point
=
new
WeldPointInfo
();
string
name
=
"P"
+
(
dgvList
.
Rows
.
Count
+
1
);
//FrmPointInfo fwpi = new FrmPointInfo(name,robotP);
//DialogResult result = fwpi.ShowDialog();
FrmPointInfo
fwpi
=
new
FrmPointInfo
(
name
,
robotP
);
FrmPointInfo
fwpi
=
new
FrmPointInfo
(
name
,
robotP
,
ImageX
,
ImageY
);
fwpi
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
...
...
URSolderingClient/FrmBoardInfo.resx
查看文件 @
0fd67cd
...
...
@@ -475,6 +475,12 @@
<metadata name="Column_ClearTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_ImageX.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_ImageY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_getPosition.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
...
...
URSolderingClient/FrmBoardList.cs
查看文件 @
0fd67cd
...
...
@@ -236,7 +236,8 @@ namespace URSoldering.Client
int
pointHight
=
16
;
float
x
,
y
;
GetPicPointByUrPoint
(
board
,
weld
.
GetURPoint
(),
out
x
,
out
y
);
x
=
weld
.
ImageX
;
y
=
weld
.
ImageY
;
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
)
...
...
URSolderingClient/FrmPointInfo.cs
查看文件 @
0fd67cd
...
...
@@ -14,6 +14,8 @@ namespace URSoldering.Client
{
public
partial
class
FrmPointInfo
:
FrmBase
{
private
int
ImageX
=
0
;
private
int
ImageY
=
0
;
public
delegate
void
OpClose
(
DialogResult
result
,
WeldPointInfo
point
);
public
event
OpClose
OnCloseEnd
;
public
WeldPointInfo
weldPointInfo
=
new
WeldPointInfo
();
...
...
@@ -24,8 +26,12 @@ namespace URSoldering.Client
cmbPointType
.
SelectedIndex
=
0
;
groupPoint
.
Text
=
"新增焊点"
;
}
public
FrmPointInfo
(
string
name
,
URPointValue
point
)
public
FrmPointInfo
(
string
name
,
URPointValue
point
,
int
imageX
,
int
imageY
)
{
this
.
ImageX
=
imageX
;
this
.
ImageY
=
imageY
;
weldPointInfo
.
ImageX
=
ImageX
;
weldPointInfo
.
ImageY
=
ImageY
;
InitializeComponent
();
this
.
Text
=
"新增焊点"
;
groupPoint
.
Text
=
"新增焊点"
;
...
...
URSolderingClient/FrmSetting.Designer.cs
查看文件 @
0fd67cd
...
...
@@ -52,10 +52,10 @@
this
.
groupBox6
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
markControl
=
new
UserFromControl
.
URRobotMControl
();
this
.
groupBox7
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
txtMarkX
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtMarkY
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtMarkX
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox3
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
...
...
@@ -302,25 +302,10 @@
this
.
groupBox7
.
TabStop
=
false
;
this
.
groupBox7
.
Text
=
"坐标偏移Mark点的图片坐标"
;
//
// txtMarkX
//
this
.
txtMarkX
.
Location
=
new
System
.
Drawing
.
Point
(
51
,
27
);
this
.
txtMarkX
.
Name
=
"txtMarkX"
;
this
.
txtMarkX
.
Size
=
new
System
.
Drawing
.
Size
(
106
,
23
);
this
.
txtMarkX
.
TabIndex
=
7
;
//
// label1
//
this
.
label1
.
AutoSize
=
true
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
17
,
30
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
28
,
17
);
this
.
label1
.
TabIndex
=
6
;
this
.
label1
.
Text
=
"X:"
;
//
// txtMarkY
//
this
.
txtMarkY
.
Location
=
new
System
.
Drawing
.
Point
(
212
,
27
);
this
.
txtMarkY
.
MaxLength
=
10
;
this
.
txtMarkY
.
Name
=
"txtMarkY"
;
this
.
txtMarkY
.
Size
=
new
System
.
Drawing
.
Size
(
106
,
23
);
this
.
txtMarkY
.
TabIndex
=
9
;
...
...
@@ -334,6 +319,23 @@
this
.
label2
.
TabIndex
=
8
;
this
.
label2
.
Text
=
"Y:"
;
//
// txtMarkX
//
this
.
txtMarkX
.
Location
=
new
System
.
Drawing
.
Point
(
51
,
27
);
this
.
txtMarkX
.
MaxLength
=
10
;
this
.
txtMarkX
.
Name
=
"txtMarkX"
;
this
.
txtMarkX
.
Size
=
new
System
.
Drawing
.
Size
(
106
,
23
);
this
.
txtMarkX
.
TabIndex
=
7
;
//
// label1
//
this
.
label1
.
AutoSize
=
true
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
17
,
30
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
28
,
17
);
this
.
label1
.
TabIndex
=
6
;
this
.
label1
.
Text
=
"X:"
;
//
// FrmSetting
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
...
URSolderingClient/FrmSetting.cs
查看文件 @
0fd67cd
...
...
@@ -137,12 +137,18 @@ namespace URSoldering.Client
double
x
=
FormUtil
.
getDoubleValue
(
txtMarkX
);
double
y
=
FormUtil
.
getDoubleValue
(
txtMarkY
);
if
(
x
<=
0
||
y
<=
0
)
if
(
!
txtMarkX
.
Text
.
Equals
(
x
.
ToString
())
)
{
MessageBox
.
Show
(
"请输入正确的Mark的图片
坐标"
);
MessageBox
.
Show
(
"请输入正确的Mark的图片
X坐标"
);
txtMarkX
.
Focus
();
return
;
}
if
(!
txtMarkY
.
Text
.
Equals
(
y
.
ToString
()))
{
MessageBox
.
Show
(
"请输入正确的Mark的图片Y坐标"
);
txtMarkY
.
Focus
();
return
;
}
WeldRobotBean
.
MarkImgPosition
=
new
PositionResult
(
x
,
y
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
MarkDefaultPosition
,
WeldRobotBean
.
MarkImgPosition
.
ToJosonStr
());
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论