Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO827-AutoScanAndLabel
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6d9325f0
由
张东亮
编写于
2022-09-06 12:16:50 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
AGV界面添加
1 个父辈
1c2795a4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
53 行增加
和
37 行删除
AutoScanAndLabel/UC/AgvControl.Designer.cs
AutoScanAndLabel/UC/AgvControl.cs
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/ElectricGripper.cs
AutoScanAndLabel/UC/AgvControl.Designer.cs
查看文件 @
6d9325f
...
...
@@ -53,7 +53,6 @@ namespace AutoScanAndLabel.UC
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtMoveLSTId
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnSave
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
checkBox1
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
groupBox_right
.
SuspendLayout
();
this
.
groupBox_left
.
SuspendLayout
();
...
...
@@ -190,7 +189,7 @@ namespace AutoScanAndLabel.UC
this
.
groupBox3
.
Size
=
new
System
.
Drawing
.
Size
(
636
,
219
);
this
.
groupBox3
.
TabIndex
=
5
;
this
.
groupBox3
.
TabStop
=
false
;
this
.
groupBox3
.
Text
=
"
任务编号设置
"
;
this
.
groupBox3
.
Text
=
"
手动发送任务
"
;
//
// label7
//
...
...
@@ -220,6 +219,7 @@ namespace AutoScanAndLabel.UC
//
// txtLeaveId
//
this
.
txtLeaveId
.
Enabled
=
false
;
this
.
txtLeaveId
.
Location
=
new
System
.
Drawing
.
Point
(
459
,
81
);
this
.
txtLeaveId
.
Name
=
"txtLeaveId"
;
this
.
txtLeaveId
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
23
);
...
...
@@ -236,6 +236,7 @@ namespace AutoScanAndLabel.UC
//
// txtEnterId
//
this
.
txtEnterId
.
Enabled
=
false
;
this
.
txtEnterId
.
Location
=
new
System
.
Drawing
.
Point
(
459
,
29
);
this
.
txtEnterId
.
Name
=
"txtEnterId"
;
this
.
txtEnterId
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
23
);
...
...
@@ -252,6 +253,7 @@ namespace AutoScanAndLabel.UC
//
// txtMoveRSTId
//
this
.
txtMoveRSTId
.
Enabled
=
false
;
this
.
txtMoveRSTId
.
Location
=
new
System
.
Drawing
.
Point
(
166
,
81
);
this
.
txtMoveRSTId
.
Name
=
"txtMoveRSTId"
;
this
.
txtMoveRSTId
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
23
);
...
...
@@ -268,6 +270,7 @@ namespace AutoScanAndLabel.UC
//
// txtMoveLSTId
//
this
.
txtMoveLSTId
.
Enabled
=
false
;
this
.
txtMoveLSTId
.
Location
=
new
System
.
Drawing
.
Point
(
166
,
32
);
this
.
txtMoveLSTId
.
Name
=
"txtMoveLSTId"
;
this
.
txtMoveLSTId
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
23
);
...
...
@@ -282,16 +285,6 @@ namespace AutoScanAndLabel.UC
this
.
label4
.
TabIndex
=
1
;
this
.
label4
.
Text
=
"移动到左侧的任务编号:"
;
//
// btnSave
//
this
.
btnSave
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
316
);
this
.
btnSave
.
Name
=
"btnSave"
;
this
.
btnSave
.
Size
=
new
System
.
Drawing
.
Size
(
122
,
45
);
this
.
btnSave
.
TabIndex
=
6
;
this
.
btnSave
.
Text
=
"保存"
;
this
.
btnSave
.
UseVisualStyleBackColor
=
true
;
this
.
btnSave
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSave_Click
);
//
// checkBox1
//
this
.
checkBox1
.
AutoSize
=
true
;
...
...
@@ -299,7 +292,7 @@ namespace AutoScanAndLabel.UC
this
.
checkBox1
.
Name
=
"checkBox1"
;
this
.
checkBox1
.
Size
=
new
System
.
Drawing
.
Size
(
82
,
18
);
this
.
checkBox1
.
TabIndex
=
7
;
this
.
checkBox1
.
Text
=
"
参数设置
"
;
this
.
checkBox1
.
Text
=
"
手动操作
"
;
this
.
checkBox1
.
UseVisualStyleBackColor
=
true
;
this
.
checkBox1
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
checkBox1_CheckedChanged
);
//
...
...
@@ -307,7 +300,6 @@ namespace AutoScanAndLabel.UC
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
Controls
.
Add
(
this
.
checkBox1
);
this
.
Controls
.
Add
(
this
.
btnSave
);
this
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
Controls
.
Add
(
this
.
groupBox2
);
this
.
Controls
.
Add
(
this
.
groupBox_left
);
...
...
@@ -345,7 +337,6 @@ namespace AutoScanAndLabel.UC
private
System
.
Windows
.
Forms
.
Label
label5
;
private
System
.
Windows
.
Forms
.
TextBox
txtEnterId
;
private
System
.
Windows
.
Forms
.
Label
label6
;
private
System
.
Windows
.
Forms
.
Button
btnSave
;
private
System
.
Windows
.
Forms
.
CheckBox
checkBox1
;
private
System
.
Windows
.
Forms
.
Label
lblMissionResult
;
private
System
.
Windows
.
Forms
.
Label
lblMissionRunstate
;
...
...
AutoScanAndLabel/UC/AgvControl.cs
查看文件 @
6d9325f
...
...
@@ -23,7 +23,7 @@ namespace AutoScanAndLabel.UC
serverIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
STD_IP
);
AGVManager
.
Connect
(
serverIp
);
load
();
groupBox2
.
Text
=
$
"AGV状态[{serverIp}
]"
;
groupBox2
.
Text
=
"AGV状态"
+
"["
+
serverIp
+
"
]"
;
AGVManager
.
Register
(
MissionStateChanged
);
endit
(
false
);
}
...
...
@@ -34,30 +34,31 @@ namespace AutoScanAndLabel.UC
}
private
void
load
()
{
txtEnterId
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ShelfInAGV
);
txtLeaveId
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ShelfOutAGV
);
txtMoveLSTId
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
LStation
);
txtMoveRSTId
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
RStation
);
txtEnterId
.
Text
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
ShelfInAGV
,
"1"
);
txtLeaveId
.
Text
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
ShelfOutAGV
,
"2"
);
txtMoveLSTId
.
Text
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
LStation
,
"3"
);
txtMoveRSTId
.
Text
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
RStation
,
"4"
);
}
private
void
save
()
{
Config
AppSettings
.
SaveValue
(
Setting_Init
.
ShelfInAGV
,
txtEnterId
.
Text
);
Config
AppSettings
.
SaveValue
(
Setting_Init
.
ShelfOutAGV
,
txtLeaveId
.
Text
);
Config
AppSettings
.
SaveValue
(
Setting_Init
.
LStation
,
$
"{txtMoveLSTId.Text}"
);
Config
AppSettings
.
SaveValue
(
Setting_Init
.
RStation
,
$
"{txtMoveRSTId.Text}"
);
Config
Helper
.
Config
.
Set
(
Setting_Init
.
ShelfInAGV
,
txtEnterId
.
Text
);
Config
Helper
.
Config
.
Set
(
Setting_Init
.
ShelfOutAGV
,
txtLeaveId
.
Text
);
Config
Helper
.
Config
.
Set
(
Setting_Init
.
LStation
,
txtMoveLSTId
.
Text
);
Config
Helper
.
Config
.
Set
(
Setting_Init
.
RStation
,
txtMoveRSTId
.
Text
);
}
MissionState
curState
;
private
void
MissionStateChanged
(
MissionState
state
)
{
curState
=
state
;
if
(!
this
.
IsHandleCreated
)
return
;
this
.
Invoke
(
new
Action
(()
=>
{
try
{
lblCurMissionId
.
Text
=
$
"当前任务编号:{state.MissionId}"
;
lblCurRunMissionId
.
Text
=
$
"运行任务编号:{state.RunMissionId}"
;
lblMissionRunstate
.
Text
=
$
"任务运行状态:{state.MissionRunState}"
;
lblMissionResult
.
Text
=
$
"任务运行结果:{state.MissionResult}"
;
lblCurMissionId
.
Text
=
"当前任务编号:"
+
state
.
MissionId
;
lblCurRunMissionId
.
Text
=
"运行任务编号:"
+
state
.
RunMissionId
;
lblMissionRunstate
.
Text
=
"任务运行状态:"
+
state
.
MissionRunState
;
lblMissionResult
.
Text
=
"任务运行结果:"
+
state
.
MissionResult
;
}
catch
{
...
...
@@ -76,6 +77,7 @@ namespace AutoScanAndLabel.UC
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
RightEnd_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
//请求AGV代码放这里
RequestRight
();
//等待agv到位
RobotManage
.
mainMachine
.
RightMoveInfo
.
NewMove
(
MoveStep
.
R40_InShelf
);
//等待agv到位后执行,启动进入
...
...
@@ -102,6 +104,7 @@ namespace AutoScanAndLabel.UC
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
RightEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
//请求AGV代码放这里
RequestRight
();
//等待agv到位
RobotManage
.
mainMachine
.
RightMoveInfo
.
NewMove
(
MoveStep
.
R30_OutShelf
);
//等待agv到位后执行,启动料串离开
Task
.
Run
(()
=>
...
...
@@ -116,7 +119,30 @@ namespace AutoScanAndLabel.UC
else
MessageBox
.
Show
(
"当前没有料串不能请求取料串"
);
}
private
void
RequestLeft
()
{
int
.
TryParse
(
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
LStation
,
"3"
),
out
int
val
);
AGVManager
.
AddMission
(
val
);
}
private
void
RequestRight
()
{
int
.
TryParse
(
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
RStation
,
"4"
),
out
int
val
);
AGVManager
.
AddMission
(
val
);
}
private
void
ShelfEnterAgv
()
{
int
.
TryParse
(
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
ShelfInAGV
,
"4"
),
out
int
val
);
AGVManager
.
AddMission
(
val
);
}
private
void
ShelfOutAgv
()
{
int
.
TryParse
(
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
ShelfOutAGV
,
"4"
),
out
int
val
);
AGVManager
.
AddMission
(
val
);
}
private
bool
WaitMissionOk
(
uint
missionId
)
{
return
curState
!=
null
&&
curState
.
RunMissionId
.
Equals
(
missionId
)
&&
curState
.
MissionResult
.
Equals
(
MissionResult
.
任务执行成功
);
}
private
void
button_Leftleavefull_Click
(
object
sender
,
EventArgs
e
)
{
if
(!
RobotManage
.
isRunning
)
...
...
@@ -127,7 +153,9 @@ namespace AutoScanAndLabel.UC
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
//请求AGV代码放这里
RequestLeft
();
//等待agv到位
RobotManage
.
mainMachine
.
LeftMoveInfo
.
NewMove
(
MoveStep
.
L50_OutShelf
);
//等待agv到位后执行,启动料串离开
Task
.
Run
(()
=>
{
...
...
@@ -152,6 +180,7 @@ namespace AutoScanAndLabel.UC
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
//请求AGV代码放这里
RequestLeft
();
//等待agv到位
RobotManage
.
mainMachine
.
LeftMoveInfo
.
NewMove
(
MoveStep
.
L60_InShelf
);
//等待agv到位后执行,启动进入
Task
.
Run
(()
=>
...
...
@@ -167,11 +196,6 @@ namespace AutoScanAndLabel.UC
MessageBox
.
Show
(
"当前有料串不能请求进入料串"
);
}
private
void
btnSave_Click
(
object
sender
,
EventArgs
e
)
{
save
();
}
private
void
checkBox1_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
endit
(
checkBox1
.
Checked
);
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
6d9325f
...
...
@@ -52,7 +52,7 @@
</Reference>
<Reference Include="RmaxisV2, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\
..\增广夹爪\RmaxisV2
\bin\Debug\RmaxisV2.dll</HintPath>
<HintPath>..\
AutoScanAndLabel
\bin\Debug\RmaxisV2.dll</HintPath>
</Reference>
<Reference Include="SdkApi.Core">
<HintPath>..\dll\SdkApi.Core.dll</HintPath>
...
...
DeviceLibrary/DeviceLibrary/ElectricGripper.cs
查看文件 @
6d9325f
using
Neotel
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
System
;
...
...
@@ -10,7 +11,7 @@ namespace DeviceLibrary
{
public
class
ElectricGripper
{
private
Neotel
.
Rmaxis
axis
;
private
Rmaxis
axis
;
public
Enum
GripperType
=
GripperTypeE
.
None
;
int
clampTimes
=
0
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论