Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2540daa0
由
LN
编写于
2020-11-04 13:29:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
a4e50c8e
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
54 行增加
和
22 行删除
source/AssemblyLineClient/FrmFeedingEquip.cs
source/AssemblyLineClient/useControl/AxisMoveControl.Designer.cs
source/AssemblyLineClient/useControl/AxisMoveControl.cs
source/DeviceLibrary/baan/AxisBean.cs
source/DeviceLibrary/deviceLibrary/AXIS/AxisManager.cs
source/DeviceLibrary/deviceLibrary/AXIS/HC/HCAxisManager.cs
source/AssemblyLineClient/FrmFeedingEquip.cs
查看文件 @
2540daa
...
@@ -398,7 +398,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -398,7 +398,7 @@ namespace OnlineStore.AssemblyLine
}
}
else
else
{
{
MessageBox
.
Show
(
"
上料横移机构不在上升端
"
,
"错误"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
MessageBox
.
Show
(
"
升降轴不在P1位置
"
,
"错误"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
}
}
}
}
private
void
btnTrayLocationCylinder_Click
(
object
sender
,
EventArgs
e
)
private
void
btnTrayLocationCylinder_Click
(
object
sender
,
EventArgs
e
)
...
@@ -737,7 +737,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -737,7 +737,7 @@ namespace OnlineStore.AssemblyLine
private
void
btnFeedCylinder_Click
(
object
sender
,
EventArgs
e
)
private
void
btnFeedCylinder_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnFeedCylinder
,
"夹料气缸放松"
,
"夹料气缸夹紧"
,
IO_Type
.
SL_
MoveCylinder_Relax
,
IO_Type
.
SL_Move
Cylinder_Work
);
BtnMove
(
btnFeedCylinder
,
"夹料气缸放松"
,
"夹料气缸夹紧"
,
IO_Type
.
SL_
ClampCylinder_Relax
,
IO_Type
.
SL_Clamp
Cylinder_Work
);
}
}
}
}
...
...
source/AssemblyLineClient/useControl/AxisMoveControl.Designer.cs
查看文件 @
2540daa
...
@@ -99,6 +99,7 @@
...
@@ -99,6 +99,7 @@
this
.
txtAxisDeviceName
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
txtAxisDeviceName
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
lblServerOn
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblServerOn
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
lblAlarmcode
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupAxis
.
SuspendLayout
();
this
.
groupAxis
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
...
@@ -124,6 +125,7 @@
...
@@ -124,6 +125,7 @@
//
//
// groupBox2
// groupBox2
//
//
this
.
groupBox2
.
Controls
.
Add
(
this
.
lblAlarmcode
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
label4
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
label4
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
lblhomeSts
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
lblhomeSts
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
label2
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
label2
);
...
@@ -179,7 +181,7 @@
...
@@ -179,7 +181,7 @@
// label2
// label2
//
//
this
.
label2
.
AutoSize
=
true
;
this
.
label2
.
AutoSize
=
true
;
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
4
17
,
65
);
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
4
22
,
90
);
this
.
label2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
71
,
17
);
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
71
,
17
);
...
@@ -190,7 +192,7 @@
...
@@ -190,7 +192,7 @@
// lblAxEncAcc
// lblAxEncAcc
//
//
this
.
lblAxEncAcc
.
AutoSize
=
true
;
this
.
lblAxEncAcc
.
AutoSize
=
true
;
this
.
lblAxEncAcc
.
Location
=
new
System
.
Drawing
.
Point
(
49
4
,
65
);
this
.
lblAxEncAcc
.
Location
=
new
System
.
Drawing
.
Point
(
49
9
,
90
);
this
.
lblAxEncAcc
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
lblAxEncAcc
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
lblAxEncAcc
.
Name
=
"lblAxEncAcc"
;
this
.
lblAxEncAcc
.
Name
=
"lblAxEncAcc"
;
this
.
lblAxEncAcc
.
Size
=
new
System
.
Drawing
.
Size
(
17
,
17
);
this
.
lblAxEncAcc
.
Size
=
new
System
.
Drawing
.
Size
(
17
,
17
);
...
@@ -935,6 +937,17 @@
...
@@ -935,6 +937,17 @@
//
//
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
//
// lblAlarmcode
//
this
.
lblAlarmcode
.
AutoSize
=
true
;
this
.
lblAlarmcode
.
Location
=
new
System
.
Drawing
.
Point
(
422
,
65
);
this
.
lblAlarmcode
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
lblAlarmcode
.
Name
=
"lblAlarmcode"
;
this
.
lblAlarmcode
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
17
);
this
.
lblAlarmcode
.
TabIndex
=
20
;
this
.
lblAlarmcode
.
Text
=
"错误码:160"
;
this
.
lblAlarmcode
.
Visible
=
false
;
//
// AxisMoveControl
// AxisMoveControl
//
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
@@ -1026,5 +1039,6 @@
...
@@ -1026,5 +1039,6 @@
private
System
.
Windows
.
Forms
.
Label
lblAxisPrfMode
;
private
System
.
Windows
.
Forms
.
Label
lblAxisPrfMode
;
private
System
.
Windows
.
Forms
.
Label
label50
;
private
System
.
Windows
.
Forms
.
Label
label50
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
private
System
.
Windows
.
Forms
.
Label
lblAlarmcode
;
}
}
}
}
source/AssemblyLineClient/useControl/AxisMoveControl.cs
查看文件 @
2540daa
...
@@ -78,7 +78,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -78,7 +78,7 @@ namespace OnlineStore.AssemblyLine
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【绝对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【绝对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
AxisManager
.
instance
.
AbsMove
(
PortName
,
SlvAddr
,
position
,
speed
);
AxisManager
.
instance
.
AbsMove
(
PortName
,
SlvAddr
,
position
,
speed
,
currSelAxis
.
AddSpeed
,
currSelAxis
.
DelSpeed
);
}
}
private
void
btnAxisRMove_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisRMove_Click
(
object
sender
,
EventArgs
e
)
...
@@ -86,7 +86,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -86,7 +86,7 @@ namespace OnlineStore.AssemblyLine
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【相对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【相对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
AxisManager
.
instance
.
RelMove
(
PortName
,
SlvAddr
,
position
,
speed
);
AxisManager
.
instance
.
RelMove
(
PortName
,
SlvAddr
,
position
,
speed
,
currSelAxis
.
AddSpeed
,
currSelAxis
.
DelSpeed
);
}
}
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
...
@@ -292,7 +292,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -292,7 +292,7 @@ namespace OnlineStore.AssemblyLine
return
;
return
;
}
}
//【3】更新界面显示
//【3】更新界面显示
ShowlbSts
(
lblALM
,
sts
.
ALM
);
//报警信号
ShowlbSts
(
lblALM
,
sts
.
ALM
,
true
);
//报警信号
ShowlbSts
(
lblWARN
,
sts
.
WARN
);
//警告信号
ShowlbSts
(
lblWARN
,
sts
.
WARN
);
//警告信号
ShowlbSts
(
lblEMG
,
sts
.
EMG
);
//急停信号
ShowlbSts
(
lblEMG
,
sts
.
EMG
);
//急停信号
ShowlbSts
(
lblSvOn
,
sts
.
ServoOn
);
//使能信号
ShowlbSts
(
lblSvOn
,
sts
.
ServoOn
);
//使能信号
...
@@ -319,15 +319,30 @@ namespace OnlineStore.AssemblyLine
...
@@ -319,15 +319,30 @@ namespace OnlineStore.AssemblyLine
string
homesstr
=
HCBoardManager
.
AxisHomeSts
(
value
);
string
homesstr
=
HCBoardManager
.
AxisHomeSts
(
value
);
lblhomeSts
.
Text
=
homesstr
;
lblhomeSts
.
Text
=
homesstr
;
}
}
private
void
ShowlbSts
(
Label
lbl
,
int
value
)
private
void
ShowlbSts
(
Label
lbl
,
int
value
,
bool
isAlarm
=
false
)
{
{
if
(
value
.
Equals
(
1
))
if
(
value
.
Equals
(
1
))
{
{
lbl
.
BackColor
=
Color
.
Lime
;
if
(
isAlarm
)
{
lbl
.
BackColor
=
Color
.
Red
;
lblAlarmcode
.
Visible
=
true
;
lblAlarmcode
.
ForeColor
=
Color
.
Red
;
lblAlarmcode
.
Text
=
"错误码:"
+
HCBoardManager
.
GetAxErrCode
(
SlvAddr
);
}
else
{
lbl
.
BackColor
=
Color
.
Lime
;
}
}
}
else
if
(
value
.
Equals
(
0
))
else
if
(
value
.
Equals
(
0
))
{
{
lbl
.
BackColor
=
Color
.
LightGray
;
lbl
.
BackColor
=
Color
.
LightGray
;
if
(
isAlarm
)
{
lblAlarmcode
.
Visible
=
false
;
}
}
}
else
else
{
{
...
...
source/DeviceLibrary/baan/AxisBean.cs
查看文件 @
2540daa
...
@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
{
{
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
targetPosition
,
targetSpeed
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
targetPosition
,
targetSpeed
));
Config
.
TargetPosition
=
targetPosition
;
Config
.
TargetPosition
=
targetPosition
;
AxisManager
.
instance
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
AxisManager
.
instance
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPosition
,
targetSpeed
,
Config
.
AddSpeed
,
Config
.
DelSpeed
);
}
}
}
}
...
@@ -166,7 +166,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -166,7 +166,7 @@ namespace OnlineStore.DeviceLibrary
}
}
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"],误差过大,"
+
clearMsg
+
"重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
"],误差过大,"
+
clearMsg
+
"重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
AxisManager
.
instance
.
AbsMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
AxisManager
.
instance
.
AbsMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
,
axis
.
AddSpeed
,
axis
.
DelSpeed
);
MoveInfo
.
CanWhileCount
--;
MoveInfo
.
CanWhileCount
--;
Thread
.
Sleep
(
200
);
Thread
.
Sleep
(
200
);
}
}
...
@@ -243,7 +243,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -243,7 +243,7 @@ namespace OnlineStore.DeviceLibrary
{
{
targetSpeed
=
Config
.
TargetSpeed
*
targetSpeed
;
targetSpeed
=
Config
.
TargetSpeed
*
targetSpeed
;
}
}
AxisManager
.
instance
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPos
,
(
int
)
targetSpeed
);
AxisManager
.
instance
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPos
,
(
int
)
targetSpeed
,
Config
.
AddSpeed
,
Config
.
DelSpeed
);
}
}
public
void
SuddenStop
()
public
void
SuddenStop
()
...
...
source/DeviceLibrary/deviceLibrary/AXIS/AxisManager.cs
查看文件 @
2540daa
...
@@ -50,14 +50,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -50,14 +50,14 @@ namespace OnlineStore.DeviceLibrary
public
abstract
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
);
public
abstract
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
);
public
abstract
void
ServoOn
(
string
portName
,
short
slvAddr
);
public
abstract
void
ServoOn
(
string
portName
,
short
slvAddr
);
public
abstract
void
ServoOff
(
string
portName
,
short
slvAddr
);
public
abstract
void
ServoOff
(
string
portName
,
short
slvAddr
);
public
abstract
void
RelMove
(
string
portName
,
short
slvAddr
,
int
position
,
int
targetSpeed
=
0
,
int
ptpAcc
=
0
,
int
ptpDec
=
0
);
public
abstract
void
RelMove
(
string
portName
,
short
slvAddr
,
int
position
,
int
targetSpeed
,
int
ptpAcc
,
int
ptpDec
);
public
abstract
void
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
);
public
abstract
void
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
);
public
abstract
void
SpeedMove
(
string
portName
,
short
slvAddr
,
int
speed
);
public
abstract
void
SpeedMove
(
string
portName
,
short
slvAddr
,
int
speed
);
public
abstract
void
SuddenStop
(
string
portName
,
short
slvAddr
);
public
abstract
void
SuddenStop
(
string
portName
,
short
slvAddr
);
public
abstract
bool
isInPosition
(
string
portName
,
short
slvAddr
,
int
PPosition
,
int
canErrorCount
,
bool
isLog
=
false
);
public
abstract
bool
isInPosition
(
string
portName
,
short
slvAddr
,
int
PPosition
,
int
canErrorCount
,
bool
isLog
=
false
);
public
abstract
void
AbsMove
(
string
portName
,
short
slvAddr
,
int
targetPosition
,
int
targetSpeed
=
0
,
int
ptpAcc
=
0
,
int
ptpDec
=
0
);
public
abstract
void
AbsMove
(
string
portName
,
short
slvAddr
,
int
targetPosition
,
int
targetSpeed
,
int
ptpAcc
,
int
ptpDec
);
public
abstract
void
AlarmClear
(
string
portName
,
short
slvAddr
);
public
abstract
void
AlarmClear
(
string
portName
,
short
slvAddr
);
public
abstract
int
GetTargetPosition
(
string
portName
,
short
slvAddr
);
public
abstract
int
GetTargetPosition
(
string
portName
,
short
slvAddr
);
...
...
source/DeviceLibrary/deviceLibrary/AXIS/HC/HCAxisManager.cs
查看文件 @
2540daa
...
@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
HCBoardManager
.
CloseCard
();
return
HCBoardManager
.
CloseCard
();
}
}
public
override
void
AbsMove
(
string
portName
,
short
slvAddr
,
int
targetPosition
,
int
targetSpeed
=
0
,
int
ptpAcc
=
0
,
int
ptpDec
=
0
)
public
override
void
AbsMove
(
string
portName
,
short
slvAddr
,
int
targetPosition
,
int
targetSpeed
,
int
ptpAcc
,
int
ptpDec
)
{
{
HCBoardManager
.
AbsMove
((
short
)
slvAddr
,
targetPosition
,
targetSpeed
,
ptpAcc
,
ptpDec
);
HCBoardManager
.
AbsMove
((
short
)
slvAddr
,
targetPosition
,
targetSpeed
,
ptpAcc
,
ptpDec
);
}
}
...
@@ -107,7 +107,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,7 +107,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
HCBoardManager
.
IsInPosition
(
slvAddr
,
PPosition
,
canErrorCount
);
return
HCBoardManager
.
IsInPosition
(
slvAddr
,
PPosition
,
canErrorCount
);
}
}
public
override
void
RelMove
(
string
portName
,
short
slvAddr
,
int
position
,
int
targetSpeed
=
0
,
int
ptpAcc
=
0
,
int
ptpDec
=
0
)
public
override
void
RelMove
(
string
portName
,
short
slvAddr
,
int
position
,
int
targetSpeed
,
int
ptpAcc
,
int
ptpDec
)
{
{
HCBoardManager
.
RelMove
(
slvAddr
,
position
,
targetSpeed
,
ptpAcc
,
ptpDec
);
HCBoardManager
.
RelMove
(
slvAddr
,
position
,
targetSpeed
,
ptpAcc
,
ptpDec
);
}
}
...
@@ -140,13 +140,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -140,13 +140,16 @@ namespace OnlineStore.DeviceLibrary
{
{
countError
=
false
;
countError
=
false
;
bool
isOk
=
HCBoardManager
.
MoveIsEnd
(
axisNo
);
bool
isOk
=
HCBoardManager
.
MoveIsEnd
(
axisNo
);
if
(
HCBoardManager
.
IsInPosition
(
axisNo
,
targetPosition
,
canErrorCount
)
)
if
(
isOk
)
{
{
return
true
;
if
(
HCBoardManager
.
IsInPosition
(
axisNo
,
targetPosition
,
canErrorCount
))
}
{
else
return
true
;
{
}
countError
=
true
;
else
{
countError
=
true
;
}
}
}
return
false
;
return
false
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论