Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
URSolderingRobot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cdfce4a6
由
几米阳光
编写于
2019-01-03 09:21:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
坐标偏移模块修改
1 个父辈
7f428025
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
81 行增加
和
72 行删除
Common/util/ConfigAppSettings.cs
DeviceLibrary/Robot/soldering/WeldRobotBean_Partial.cs
DeviceLibrary/Robot/soldering/WeldStepBean.cs
DeviceLibrary/bean/BoardInfo.cs
URSolderingClient/FrmSendWire.Designer.cs
URSolderingClient/FrmSendWire.cs
URSolderingClient/FrmSendWire.resx
URSolderingClient/FrmSetting.cs
URSolderingClient/FrmWork.cs
URSolderingClient/记录.txt
Common/util/ConfigAppSettings.cs
查看文件 @
cdfce4a
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -24,7 +24,6 @@ namespace URSoldering.Common
return
false
;
}
private
static
int
seq
=
1
;
public
static
int
nextSeq
()
...
...
@@ -37,9 +36,7 @@ namespace URSoldering.Common
Interlocked
.
Increment
(
ref
seq
);
return
seq
;
}
public
static
string
GetValue
(
string
keyStr
,
string
storeStr
)
{
string
key
=
keyStr
+
storeStr
;
...
...
@@ -64,10 +61,8 @@ namespace URSoldering.Common
return
GetNumValue
(
keyStr
);
}
else
{
{
Decimal
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
{
Decimal
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
return
a
;
}
...
...
@@ -81,11 +76,10 @@ namespace URSoldering.Common
return
GetIntValue
(
keyStr
);
}
else
{
{
Int32
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
}
return
a
;
{
Int32
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
return
a
;
}
/// <summary>
/// 获取文件的绝对路径
...
...
@@ -121,10 +115,8 @@ namespace URSoldering.Common
return
a
;
}
else
{
{
Decimal
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
{
Decimal
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
return
a
;
}
...
...
@@ -139,10 +131,11 @@ namespace URSoldering.Common
}
else
{
{
Int32
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
}
return
a
;
Int32
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
return
a
;
}
public
static
void
SaveValue
(
string
key
,
int
value
)
{
...
...
@@ -226,12 +219,12 @@ namespace URSoldering.Common
LogUtil
.
error
(
LOGGER
,
"SetValue保存配置出错:AppKey="
+
AppKey
+
",AppValue="
+
AppValue
+
","
+
ex
.
StackTrace
);
}
}
public
static
void
SaveValue
(
string
key
,
bool
value
)
{
int
intValue
=
value
?
1
:
0
;
SaveValue
(
key
,
intValue
.
ToString
());
}
}
}
DeviceLibrary/Robot/soldering/WeldRobotBean_Partial.cs
查看文件 @
cdfce4a
...
...
@@ -323,7 +323,7 @@ namespace URSoldering.DeviceLibrary
x
=
(
pianyiPosition
.
DataX
-
MarkImgPosition
.
DataX
)
*
MarkChangeValue
;
y
=
(
pianyiPosition
.
DataY
-
MarkImgPosition
.
DataY
)
*
MarkChangeValue
;
WeldLog
(
"找到偏移点,开始进行偏移 X【"
+
y
+
"】Y【"
+
y
+
"】"
);
WeldLog
(
"找到偏移点,开始进行偏移 X【"
+
x
+
"】Y【"
+
y
+
"】"
);
WeldMoveStep
.
PositionOffSet
(
x
,
y
);
}
}
...
...
DeviceLibrary/Robot/soldering/WeldStepBean.cs
查看文件 @
cdfce4a
...
...
@@ -28,10 +28,21 @@ namespace URSoldering.DeviceLibrary
{
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
()
+
"】"
);
if
(
weldPointList
[
i
].
pointType
.
Equals
(
3
))
{
LogUtil
.
info
(
weldPointList
[
i
].
pointName
+
"是拍照点,不需要坐标偏移"
);
}
else
if
(
weldPointList
[
i
].
pointType
.
Equals
(
1
))
{
LogUtil
.
info
(
weldPointList
[
i
].
pointName
+
"是中间点,不需要坐标偏移"
);
}
else
{
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>
...
...
@@ -98,13 +109,13 @@ namespace URSoldering.DeviceLibrary
WeldStartTime
=
DateTime
.
Now
;
WaitList
=
new
List
<
WaitResultInfo
>();
CurrPointIndex
=
0
;
ResetCount
=
0
;
ResetCount
=
0
;
}
/// <summary>
/// 开始焊接
/// </summary>
/// <param name="pointType">焊点类型,0=所有 </param>
public
bool
NewWeld
(
MoveType
type
,
BoardInfo
board
)
public
bool
NewWeld
(
MoveType
type
,
BoardInfo
board
)
{
IsSlowSendWire
=
false
;
StartPointIndex
=
0
;
...
...
@@ -113,44 +124,23 @@ namespace URSoldering.DeviceLibrary
this
.
currBoard
=
board
;
CurrPointIndex
=
0
;
//
需要把拍照点放到第一个
WeldPointInfo
photoPoint
=
null
;
foreach
(
WeldPointInfo
p
in
board
.
pointList
)
//
安装配置顺序加入
weldPointList
=
new
List
<
WeldPointInfo
>()
;
foreach
(
WeldPointInfo
p
in
board
.
pointList
)
{
if
(!
URRobotControl
.
PointIsValid
(
p
.
GetURPoint
()))
{
{
LogUtil
.
error
(
"【"
+
board
.
boardName
+
"】的焊点【"
+
p
.
pointName
+
"】坐标无效,无法开始焊接"
);
return
false
;
}
if
(
p
.
pointType
.
Equals
(
3
))
{
photoPoint
=
p
;
}
else
{
weldPointList
.
Add
(
p
);
}
WeldPointInfo
newP
=
p
.
Clone
();
weldPointList
.
Add
(
newP
);
}
if
(
weldPointList
.
Count
<=
0
)
{
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/BoardInfo.cs
查看文件 @
cdfce4a
...
...
@@ -292,5 +292,10 @@ namespace URSoldering.DeviceLibrary
return
p
;
}
public
WeldPointInfo
Clone
()
{
return
(
WeldPointInfo
)
this
.
MemberwiseClone
();
}
}
}
URSolderingClient/FrmSendWire.Designer.cs
查看文件 @
cdfce4a
...
...
@@ -28,6 +28,7 @@
/// </summary>
private
void
InitializeComponent
()
{
this
.
components
=
new
System
.
ComponentModel
.
Container
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
txtRevice
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnSend
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -50,6 +51,7 @@
this
.
label8
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnOpenSold
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
groupBox1
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -285,6 +287,11 @@
this
.
lblMsg
.
TabIndex
=
283
;
this
.
lblMsg
.
Text
=
"急停未开"
;
//
// timer1
//
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// FrmSendWire
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
...
@@ -294,6 +301,7 @@
this
.
Controls
.
Add
(
this
.
lblMsg
);
this
.
Name
=
"FrmSendWire"
;
this
.
Text
=
"送丝机调试"
;
this
.
FormClosed
+=
new
System
.
Windows
.
Forms
.
FormClosedEventHandler
(
this
.
FrmSendWire_FormClosed
);
this
.
Load
+=
new
System
.
EventHandler
(
this
.
FrmSendWire_Load
);
this
.
groupBox1
.
ResumeLayout
(
false
);
this
.
groupBox1
.
PerformLayout
();
...
...
@@ -326,5 +334,6 @@
private
System
.
Windows
.
Forms
.
TextBox
txtRevice
;
private
System
.
Windows
.
Forms
.
Button
btnSend
;
private
System
.
Windows
.
Forms
.
TextBox
txtSend
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
}
}
\ No newline at end of file
URSolderingClient/FrmSendWire.cs
查看文件 @
cdfce4a
...
...
@@ -73,17 +73,7 @@ namespace URSoldering.Client
{
this
.
Close
();
}
private
void
timer2_Tick
(
object
sender
,
EventArgs
e
)
{
if
(
RobotBean
.
KNDIOValue
(
IO_Type
.
SuddenStop_Single
).
Equals
(
IO_VALUE
.
LOW
))
{
lblMsg
.
Text
=
"急停未开"
;
}
else
{
lblMsg
.
Text
=
""
;
}
}
private
void
btnReadError_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -117,6 +107,7 @@ namespace URSoldering.Client
{
formStatus
(
false
);
}
timer1
.
Start
();
}
private
void
btnReadError_Click_1
(
object
sender
,
EventArgs
e
)
...
...
@@ -152,5 +143,22 @@ namespace URSoldering.Client
txtRevice
.
Text
=
rawMsg
;
}
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
if
(
RobotBean
.
KNDIOValue
(
IO_Type
.
SuddenStop_Single
).
Equals
(
IO_VALUE
.
LOW
))
{
lblMsg
.
Text
=
"急停未开"
;
}
else
{
lblMsg
.
Text
=
""
;
}
}
private
void
FrmSendWire_FormClosed
(
object
sender
,
FormClosedEventArgs
e
)
{
timer1
.
Stop
();
}
}
}
URSolderingClient/FrmSendWire.resx
查看文件 @
cdfce4a
...
...
@@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
URSolderingClient/FrmSetting.cs
查看文件 @
cdfce4a
...
...
@@ -135,8 +135,8 @@ namespace URSoldering.Client
// return;
//}
int
x
=
FormUtil
.
GetInt
Value
(
txtMarkX
);
int
y
=
FormUtil
.
GetInt
Value
(
txtMarkY
);
double
x
=
FormUtil
.
getDouble
Value
(
txtMarkX
);
double
y
=
FormUtil
.
getDouble
Value
(
txtMarkY
);
if
(
x
<=
0
||
y
<=
0
)
{
MessageBox
.
Show
(
"请输入正确的Mark的图片坐标"
);
...
...
URSolderingClient/FrmWork.cs
查看文件 @
cdfce4a
...
...
@@ -534,6 +534,7 @@ namespace URSoldering.Client
lblAOIResult
.
Visible
=
false
;
lblCodeResult
.
Visible
=
false
;
StartRun
();
WeldRobotBean
.
StartWeld
();
}
private
void
StartRun
()
{
...
...
URSolderingClient/记录.txt
查看文件 @
cdfce4a
...
...
@@ -68,7 +68,7 @@ AOI检测NG时,红灯亮,等到下次开始焊接时清理红灯。
拍照点不需要坐标偏移
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论