Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20242OutBound
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 10e6ad23
由
LN
编写于
2023-04-23 08:57:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
b48a0a32
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
121 行增加
和
3 行删除
DeviceLibrary/DeviceLibrary/AxisBean.cs
DeviceLibrary/DeviceLibrary/AxisManager.cs
DeviceLibrary/DeviceLibrary/HC/HCAxisManager.cs
DeviceLibrary/DeviceLibrary/IAxisManager.cs
DeviceLibrary/theMachine/MainMachine_PutReel.cs
TheMachine/FormMain.Designer.cs
TheMachine/FormMain.cs
DeviceLibrary/DeviceLibrary/AxisBean.cs
查看文件 @
10e6ad2
...
...
@@ -248,6 +248,23 @@ namespace DeviceLibrary
LogUtil
.
error
(
msg
);
}
}
else
if
(
AxisManager
.
IsMoveEnd
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
{
int
outCount
=
AxisManager
.
GetActualtPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
//判断是否需要重新运动
if
(
MoveInfo
.
CanWhileCount
>
0
)
{
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"运动结束,但回原点未完成,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
AxisManager
.
HomeMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
axis
.
HomeHighSpeed
,
axis
.
HomeLowSpeed
,
axis
.
HomeAddSpeed
);
MoveInfo
.
CanWhileCount
--;
}
else
{
msg
=
MoveInfo
.
Name
+
" "
+
MoveInfo
.
MoveStep
+
axis
.
DisplayStr
+
"运动结束,但回原点未完成,当前位置"
+
outCount
+
",需要报警"
;
LogUtil
.
error
(
msg
);
}
}
return
false
;
}
...
...
DeviceLibrary/DeviceLibrary/AxisManager.cs
查看文件 @
10e6ad2
...
...
@@ -33,6 +33,11 @@ namespace DeviceLibrary
return
instance
.
IsHomeMoveEnd
(
portName
,
slvAddr
);
}
public
static
bool
IsMoveEnd
(
string
portName
,
short
slvAddr
)
{
return
instance
.
IsMoveEnd
(
portName
,
slvAddr
);
}
public
static
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
)
{
return
instance
.
AbsMoveIsEnd
(
portName
,
axisNo
,
targetPosition
,
canErrorCount
,
out
countError
);
...
...
DeviceLibrary/DeviceLibrary/HC/HCAxisManager.cs
查看文件 @
10e6ad2
...
...
@@ -141,5 +141,10 @@ namespace DeviceLibrary
{
return
HCBoardManager
.
GetAxErrCode
(
slvAddr
);
}
public
bool
IsMoveEnd
(
string
portName
,
short
slvAddr
)
{
return
HCBoardManager
.
MoveIsEnd
(
slvAddr
);
}
}
}
DeviceLibrary/DeviceLibrary/IAxisManager.cs
查看文件 @
10e6ad2
...
...
@@ -20,6 +20,8 @@ namespace DeviceLibrary
bool
IsHomeMoveEnd
(
string
portName
,
short
slvAddr
);
bool
IsMoveEnd
(
string
portName
,
short
slvAddr
);
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
);
void
ServoOn
(
string
portName
,
short
slvAddr
);
void
ServoOff
(
string
portName
,
short
slvAddr
);
...
...
DeviceLibrary/theMachine/MainMachine_PutReel.cs
查看文件 @
10e6ad2
...
...
@@ -27,7 +27,7 @@ namespace DeviceLibrary
{
if
(
CheckWait
(
StoreMoveInfo
))
return
;
//常规上料扫码流程
switch
(
StoreMoveInfo
.
MoveStep
)
{
case
MoveStep
.
Wait
:
...
...
TheMachine/FormMain.Designer.cs
查看文件 @
10e6ad2
...
...
@@ -54,6 +54,10 @@ namespace TheMachine
this
.
btn_IgnoreX09
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_PauseBuzzer
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
btnResetOut1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnResetOut2
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnResetOut3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnResetOut4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
tabc
.
SuspendLayout
();
this
.
tabP1
.
SuspendLayout
();
...
...
@@ -209,6 +213,10 @@ namespace TheMachine
//
// pnl
//
this
.
pnl
.
Controls
.
Add
(
this
.
btnResetOut4
);
this
.
pnl
.
Controls
.
Add
(
this
.
btnResetOut3
);
this
.
pnl
.
Controls
.
Add
(
this
.
btnResetOut2
);
this
.
pnl
.
Controls
.
Add
(
this
.
btnResetOut1
);
this
.
pnl
.
Controls
.
Add
(
this
.
listReelInfo
);
this
.
pnl
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
pnl
.
Controls
.
Add
(
this
.
pictureBox2
);
...
...
@@ -240,7 +248,7 @@ namespace TheMachine
this
.
groupBox1
.
Controls
.
Add
(
this
.
stateView
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
4
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
98
9
,
244
);
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
84
9
,
244
);
this
.
groupBox1
.
TabIndex
=
1
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"运行状态"
;
...
...
@@ -256,7 +264,7 @@ namespace TheMachine
this
.
stateView
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
25
);
this
.
stateView
.
MultiSelect
=
false
;
this
.
stateView
.
Name
=
"stateView"
;
this
.
stateView
.
Size
=
new
System
.
Drawing
.
Size
(
98
3
,
216
);
this
.
stateView
.
Size
=
new
System
.
Drawing
.
Size
(
84
3
,
216
);
this
.
stateView
.
TabIndex
=
0
;
this
.
stateView
.
UseCompatibleStateImageBehavior
=
false
;
//
...
...
@@ -314,6 +322,54 @@ namespace TheMachine
this
.
listView1
.
TabIndex
=
2
;
this
.
listView1
.
UseCompatibleStateImageBehavior
=
false
;
//
// btnResetOut1
//
this
.
btnResetOut1
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnResetOut1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnResetOut1
.
Location
=
new
System
.
Drawing
.
Point
(
862
,
16
);
this
.
btnResetOut1
.
Name
=
"btnResetOut1"
;
this
.
btnResetOut1
.
Size
=
new
System
.
Drawing
.
Size
(
130
,
32
);
this
.
btnResetOut1
.
TabIndex
=
271
;
this
.
btnResetOut1
.
Text
=
"出料口1复位"
;
this
.
btnResetOut1
.
UseVisualStyleBackColor
=
true
;
this
.
btnResetOut1
.
Click
+=
new
System
.
EventHandler
(
this
.
btnResetOut1_Click
);
//
// btnResetOut2
//
this
.
btnResetOut2
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnResetOut2
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnResetOut2
.
Location
=
new
System
.
Drawing
.
Point
(
862
,
55
);
this
.
btnResetOut2
.
Name
=
"btnResetOut2"
;
this
.
btnResetOut2
.
Size
=
new
System
.
Drawing
.
Size
(
130
,
32
);
this
.
btnResetOut2
.
TabIndex
=
272
;
this
.
btnResetOut2
.
Text
=
"出料口2复位"
;
this
.
btnResetOut2
.
UseVisualStyleBackColor
=
true
;
this
.
btnResetOut2
.
Click
+=
new
System
.
EventHandler
(
this
.
btnResetOut2_Click
);
//
// btnResetOut3
//
this
.
btnResetOut3
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnResetOut3
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnResetOut3
.
Location
=
new
System
.
Drawing
.
Point
(
862
,
94
);
this
.
btnResetOut3
.
Name
=
"btnResetOut3"
;
this
.
btnResetOut3
.
Size
=
new
System
.
Drawing
.
Size
(
130
,
32
);
this
.
btnResetOut3
.
TabIndex
=
273
;
this
.
btnResetOut3
.
Text
=
"出料口3复位"
;
this
.
btnResetOut3
.
UseVisualStyleBackColor
=
true
;
this
.
btnResetOut3
.
Click
+=
new
System
.
EventHandler
(
this
.
btnResetOut3_Click
);
//
// btnResetOut4
//
this
.
btnResetOut4
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnResetOut4
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnResetOut4
.
Location
=
new
System
.
Drawing
.
Point
(
862
,
133
);
this
.
btnResetOut4
.
Name
=
"btnResetOut4"
;
this
.
btnResetOut4
.
Size
=
new
System
.
Drawing
.
Size
(
130
,
32
);
this
.
btnResetOut4
.
TabIndex
=
274
;
this
.
btnResetOut4
.
Text
=
"出料口4复位"
;
this
.
btnResetOut4
.
UseVisualStyleBackColor
=
true
;
this
.
btnResetOut4
.
Click
+=
new
System
.
EventHandler
(
this
.
btnResetOut4_Click
);
//
// FormMain
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
...
@@ -368,6 +424,10 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator2
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator3
;
private
System
.
Windows
.
Forms
.
ListView
listReelInfo
;
private
System
.
Windows
.
Forms
.
Button
btnResetOut1
;
private
System
.
Windows
.
Forms
.
Button
btnResetOut4
;
private
System
.
Windows
.
Forms
.
Button
btnResetOut3
;
private
System
.
Windows
.
Forms
.
Button
btnResetOut2
;
}
}
TheMachine/FormMain.cs
查看文件 @
10e6ad2
...
...
@@ -654,5 +654,34 @@ namespace TheMachine
Setting_Init
.
Device_EnableBuzzer
=
AlarmBuzzer
.
Enable
;
}
private
void
outSheftReset
(
string
name
)
{
OutShelfBean
outShelf
=
RobotManage
.
mainMachine
.
getOutShelf
(
name
);
DialogResult
result
=
MessageBox
.
Show
(
"确定复位出料机构"
+
name
+
"?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
,
MessageBoxDefaultButton
.
Button1
);
if
(
result
.
Equals
(
DialogResult
.
OK
))
{
LogUtil
.
info
(
"手动操作:"
+
name
+
"复位"
);
outShelf
.
Reset
();
}
}
private
void
btnResetOut1_Click
(
object
sender
,
EventArgs
e
)
{
outSheftReset
(
"U1"
);
}
private
void
btnResetOut2_Click
(
object
sender
,
EventArgs
e
)
{
outSheftReset
(
"U2"
);
}
private
void
btnResetOut3_Click
(
object
sender
,
EventArgs
e
)
{
outSheftReset
(
"U3"
);
}
private
void
btnResetOut4_Click
(
object
sender
,
EventArgs
e
)
{
outSheftReset
(
"U4"
);
}
}
}
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论