Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3f22a0a2
由
LN
编写于
2020-02-13 14:34:51 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
agv修改
1 个父辈
a55f7b61
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
425 行增加
和
95 行删除
dll/Client.dll
dll/Client.xml
dll/CodeLibrary.dll
source/ACPackingStore/App.config
source/ACPackingStore/FrmBox.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
source/DeviceLibrary/ACPackingStore/PackingStoreBean.cs
source/DeviceLibrary/ACPackingStore/StoreManager.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/device/halcon/CodeManager.cs
source/DeviceLibrary/store/AutoInoutInfo.cs
source/DeviceLibrary/store/StoreStep.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
dll/Client.dll
查看文件 @
3f22a0a
此文件类型无法预览
dll/Client.xml
查看文件 @
3f22a0a
...
...
@@ -199,5 +199,249 @@
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"T:Asa.Client2"
>
<summary>
电脑客户端
</summary>
</member>
<member
name=
"F:Asa.Client2.HEART"
>
<summary>
心跳包,HEART
</summary>
</member>
<member
name=
"F:Asa.Client2.SERVER_OFF"
>
<summary>
服务器关闭,OFF
</summary>
</member>
<member
name=
"F:Asa.Client2.CLIENT_OFF"
>
<summary>
客户端关闭,OFF
</summary>
</member>
<member
name=
"T:Asa.Client2.ActionEvent"
>
<summary>
小车动作事件
</summary>
</member>
<member
name=
"T:Asa.Client2.LogEvent"
>
<summary>
日志事件
</summary>
<param
name=
"s"
></param>
</member>
<member
name=
"E:Asa.Client2.GetRFID"
>
<summary>
服务端发送的RFID
</summary>
</member>
<member
name=
"E:Asa.Client2.Arrive"
>
<summary>
小车到达,仅包装料仓
</summary>
</member>
<member
name=
"E:Asa.Client2.Ready"
>
<summary>
小车已准备,对接完成
</summary>
</member>
<member
name=
"E:Asa.Client2.Log"
>
<summary>
日志
</summary>
</member>
<member
name=
"M:Asa.Client2.#ctor(System.String)"
>
<summary>
电脑客户端
</summary>
<param
name=
"serverIP"
>
服务器IP地址
</param>
</member>
<member
name=
"P:Asa.Client2.IsConn"
>
<summary>
是否连接服务器
</summary>
</member>
<member
name=
"M:Asa.Client2.Connect"
>
<summary>
连接
</summary>
</member>
<member
name=
"M:Asa.Client2.Close"
>
<summary>
关闭
</summary>
</member>
<member
name=
"M:Asa.Client2.SetStatus(System.String,System.String,System.String,Asa.ClientAction,Asa.ClientLevel)"
>
<summary>
设置状态
</summary>
<param
name=
"name"
>
节点名称
</param>
<param
name=
"mark"
>
节点标记
</param>
<param
name=
"rfid"
>
架子RFID
</param>
<param
name=
"action"
></param>
<param
name=
"level"
></param>
</member>
<member
name=
"M:Asa.Client2.Reconnect"
>
<summary>
发送RFID
</summary>
<param
name=
"name"
></param>
<param
name=
"content"
></param>
</member>
<member
name=
"M:Asa.Client2.Splice(Asa.ClientNode)"
>
<summary>
拼接命令
</summary>
<param
name=
"node"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.ListenNet"
>
<summary>
监听线程
</summary>
</member>
<member
name=
"M:Asa.Client2.Resolve"
>
<summary>
分析数据包
</summary>
</member>
<member
name=
"M:Asa.Client2.Send(System.Byte[])"
>
<summary>
发送命令
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.HexBuff(System.Byte[])"
>
<summary>
16进制
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.IsHeart(System.Byte[])"
>
<summary>
是否心跳包
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.IsServerOffline(System.Byte[])"
>
<summary>
是否服务器断开
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"T:Asa.ClientNode"
>
<summary>
客户端的节点
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Name"
>
<summary>
节点名称
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Mark"
>
<summary>
标记,用于包装料仓
</summary>
</member>
<member
name=
"F:Asa.ClientNode.RFID"
>
<summary>
当前架子的RFID
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Action"
>
<summary>
动作
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Level"
>
<summary>
优先级
</summary>
</member>
<member
name=
"M:Asa.ClientNode.#ctor(System.String,System.String,System.String,Asa.ClientAction,Asa.ClientLevel)"
>
<summary>
客户端节点
</summary>
<param
name=
"name"
></param>
<param
name=
"mark"
></param>
<param
name=
"rfid"
></param>
<param
name=
"action"
></param>
<param
name=
"level"
></param>
</member>
<member
name=
"T:Asa.ClientAction"
>
<summary>
客户端的动作
</summary>
</member>
<member
name=
"F:Asa.ClientAction.None"
>
<summary>
没有动作
</summary>
</member>
<member
name=
"F:Asa.ClientAction.MayEnter"
>
<summary>
可以进入料架(包装料仓)
</summary>
</member>
<member
name=
"F:Asa.ClientAction.MayLeave"
>
<summary>
可以出去料架(包装料仓)
</summary>
</member>
<member
name=
"F:Asa.ClientAction.NeedEnter"
>
<summary>
需要进入料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.NeedLeave"
>
<summary>
需要出去料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.FinishEnter"
>
<summary>
完成进入料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.FinishLeave"
>
<summary>
完成出去料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.Arrive"
>
<summary>
小车到达
</summary>
</member>
<member
name=
"F:Asa.ClientAction.Ready"
>
<summary>
小车已准备好
</summary>
</member>
<member
name=
"T:Asa.ClientLevel"
>
<summary>
客户端的优先级
</summary>
</member>
<member
name=
"F:Asa.ClientLevel.Low"
>
<summary>
低
</summary>
</member>
<member
name=
"F:Asa.ClientLevel.Middle"
>
<summary>
中等
</summary>
</member>
<member
name=
"F:Asa.ClientLevel.High"
>
<summary>
高
</summary>
</member>
</members>
</doc>
dll/CodeLibrary.dll
查看文件 @
3f22a0a
此文件类型无法预览
source/ACPackingStore/App.config
查看文件 @
3f22a0a
...
...
@@ -50,6 +50,12 @@
<!--
AGV
调度服务器地址-->
<
add
key
=
"AgvServerIp"
value
=
"192.168.103.22"
/>
<
add
key
=
"CodeCount"
value
=
"2"
/>
<
add
key
=
"Tool_P3_Offset"
value
=
"7000"
/>
<
add
key
=
"Tool_P4_Offset"
value
=
"-2000"
/>
<
add
key
=
"Tool_P5_Offset"
value
=
"-2000"
/>
<
add
key
=
"Tool_P6_Offset"
value
=
"7000"
/>
<
add
key
=
"Tool_TargetSpeed"
value
=
"20"
/>
<
add
key
=
"Tool_TargetPosition"
value
=
"1835000"
/>
<!--检测到料架后自动开始入库-->
<
add
key
=
"AutoShelfInstore"
value
=
"1"
/>
<!--是否启用入料口移门,
1
=启用,
0
=禁用-->
...
...
source/ACPackingStore/FrmBox.cs
查看文件 @
3f22a0a
...
...
@@ -153,6 +153,7 @@ namespace OnlineStore.ACPackingStore
lblTemp
.
Text
=
BoxBean
.
humBean
.
currTempStr
;
lblWarnMsg
.
Text
=
BoxBean
.
GetWarnMsg
();
lblMoveInfo
.
Text
=
BoxBean
.
GetMoveStr
();
lblMoveEquipInfo
.
Text
=
"当前出入库信息:"
//ReadPosistion();
if
(
BoxBean
.
storeRunStatus
>
StoreRunStatus
.
Wait
)
{
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
查看文件 @
3f22a0a
using
OnlineStore.Common
;
using
Asa
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Concurrent
;
...
...
@@ -105,12 +106,12 @@ namespace OnlineStore.DeviceLibrary
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W010_AgvStatus
))
{
string
agvA
=
AgvClient
.
GetAction
(
Config
.
AgvNodeName
);
wait
.
IsEnd
=
agvA
.
Equals
(
wait
.
TargetPosi
tion
);
ClientAction
agvA
=
AgvClient
.
GetAction
(
Config
.
AgvNodeName
);
wait
.
IsEnd
=
((
int
)
agvA
).
Equals
(
wait
.
AgvAc
tion
);
if
(!
wait
.
IsEnd
&&
span
.
TotalSeconds
>
10
)
{
//如果是等待AGV到达,等待有料架信号也算结束
if
(
wait
.
AgvAction
.
Equals
(
AGV
Action
.
Arrive
)
&&
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_01_ReadyShelf
))
if
(
wait
.
AgvAction
.
Equals
(
(
int
)
Client
Action
.
Arrive
)
&&
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_01_ReadyShelf
))
{
if
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
...
...
@@ -123,7 +124,7 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
true
;
}
}
else
if
(
wait
.
AgvAction
.
Equals
(
AGVAction
.
FinishOut
))
else
if
(
wait
.
AgvAction
.
Equals
(
(
int
)
ClientAction
.
FinishLeave
))
{
if
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
LineIn_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
...
...
@@ -286,7 +287,7 @@ namespace OnlineStore.DeviceLibrary
if
(
data
.
RFType
.
Equals
(
"A"
))
{
CurrShelfID
=
data
.
NumStr
();
AgvClient
.
Se
ndRFID
(
Config
.
AgvNodeName
,
CurrShelfID
);
AgvClient
.
Se
tStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
FinishEnter
);
}
}
...
...
@@ -743,8 +744,8 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 通知agv调度准备带料架的agv,等待agv到达或检测到料架信号,进出轴到P1"
);
InOutBackToP1
(
MoveInfo
.
MoveParam
.
MoveP
.
InOut_P1
);
//需要先叫agv到达
AgvClient
.
NeedEnter
(
Config
.
AgvNodeName
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAgvAction
(
AGV
Action
.
Arrive
));
AgvClient
.
NeedEnter
(
Config
.
AgvNodeName
,
MoveInfo
.
MoveParam
.
ShelfPosID
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAgvAction
(
(
int
)
Client
Action
.
Arrive
));
}
else
{
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
查看文件 @
3f22a0a
using
OnlineStore.Common
;
using
Asa
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Concurrent
;
...
...
@@ -164,13 +165,14 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_01_TopDown
);
if
(
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
))
{
InOutStoreLog
(
"送出出库料架:顶升气缸下降"
);
InOutStoreLog
(
"送出出库料架:顶升气缸下降
,清空料架clearPutInRfid["
+
CurrShelfID
+
"]
"
);
}
else
{
InOutStoreLog
(
"送出空料架:顶升气缸下降"
);
InOutStoreLog
(
"送出空料架:顶升气缸下降
,清空料架clearPutInRfid["
+
CurrShelfID
+
"]
"
);
}
CylinderMove
(
MoveInfo
,
IO_Type
.
TopCylinder_Up
,
IO_Type
.
TopCylinder_Down
);
StoreManager
.
clearPutInRfid
(
Name
,
CurrShelfID
);
}
private
void
ShelfOutProcess
()
{
...
...
@@ -201,21 +203,21 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":调用AgvClient.ReadyEmpty,等待Agv到达 ,最多等待1000"
);
AgvClient
.
NeedLeave
(
Config
.
AgvNodeName
);
AgvClient
.
NeedLeave
(
Config
.
AgvNodeName
,
CurrShelfID
);
//等待agv到达
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAgvAction
(
AGV
Action
.
Arrive
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAgvAction
(
(
int
)
Client
Action
.
Arrive
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BS_04_ReadyEmpty
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_05_LineBackRun
);
//agv到达
if
(
AgvClient
.
GetAction
(
Config
.
AgvNodeName
).
Equals
(
AGV
Action
.
Arrive
))
if
(
AgvClient
.
GetAction
(
Config
.
AgvNodeName
).
Equals
(
Client
Action
.
Arrive
))
{
if
(
instoreShelf
)
{
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":agv到达,调用AgvClient.SendRFID【"
+
CurrShelfID
+
"】,调用AgvClient.MayOut,线体开始反转"
);
//TODO AGV到达,发送料架信息,是否需要重新读取?
AgvClient
.
Se
ndRFID
(
Config
.
AgvNodeName
,
CurrShelfID
);
AgvClient
.
Se
tStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
MayLeave
);
}
else
{
...
...
@@ -278,35 +280,36 @@ namespace OnlineStore.DeviceLibrary
#
region
AGV
internal
bool
ProcessAGVAction
(
string
name
,
string
action
)
internal
bool
ProcessAGVAction
(
string
name
,
ClientAction
action
)
{
string
logN
=
name
+
"收到调度【"
+
name
+
"】=【"
+
action
+
"】"
;
//状态处理
if
(
action
.
Equals
(
AGVAction
.
CanEnter
))
{
//判断入口是否可用:入口无料架,缓冲工位无料架,不在入料架处理中
bool
usable
=
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
waitOutStoreList
.
Count
<=
0
&&
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
&&
alarmType
.
Equals
(
StoreAlarmType
.
None
)
&&
IOValue
(
IO_Type
.
LineIn_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
LOW
));
LogUtil
.
info
(
logN
+
":"
+
usable
);
return
usable
;
}
else
if
(
action
.
Equals
(
AGVAction
.
Arrive
))
//if (action.Equals(ClientAction.CanEnter))
//{
// //判断入口是否可用:入口无料架,缓冲工位无料架,不在入料架处理中
// bool usable = (storeRunStatus.Equals(StoreRunStatus.Runing) &&
// waitOutStoreList.Count <= 0 &&
// MoveInfo.MoveType.Equals(StoreMoveType.None) &&
// alarmType.Equals(StoreAlarmType.None)
// && IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW)
// && IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW));
// LogUtil.info(logN + ":" + usable);
// return usable;
//}
//else
if
(
action
.
Equals
(
ClientAction
.
Arrive
))
{
//出库处理中不处理
if
(
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
))
{
return
true
;
}
if
(
IOValue
(
IO_Type
.
LineIn_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LogUtil
.
info
(
logN
+
" ,未检测到:LineIn_Check,不处理"
);
return
false
;
}
//
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW))
//
{
//
LogUtil.info(logN + " ,未检测到:LineIn_Check,不处理");
//
return false;
//
}
//agv到达,开始处理
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
&&
...
...
source/DeviceLibrary/ACPackingStore/PackingStoreBean.cs
查看文件 @
3f22a0a
...
...
@@ -387,7 +387,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
msg
;
}
internal
bool
AGVProcess
(
string
name
,
string
action
)
internal
bool
AGVProcess
(
string
name
,
ClientAction
action
)
{
foreach
(
AC_BOX_Bean
box
in
this
.
BoxMap
.
Values
)
{
...
...
source/DeviceLibrary/ACPackingStore/StoreManager.cs
查看文件 @
3f22a0a
...
...
@@ -368,6 +368,30 @@ namespace OnlineStore.DeviceLibrary
}
return
msg
;
}
private
static
string
Addr_clearPutInRfid
=
"/service/store/qisda/clearPutInRfid"
;
public
static
string
clearPutInRfid
(
string
deviceName
,
string
rfid
)
{
string
msg
=
""
;
try
{
if
(
String
.
IsNullOrEmpty
(
rfid
))
{
return
msg
;
}
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"rfid"
,
rfid
);
//rfid
string
server
=
GetAddr
(
Addr_clearPutInRfid
,
paramMap
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
deviceName
+
"clearPutInRfid 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
}
return
msg
;
}
public
static
int
GetLocByShelfPosID
(
string
shelfId
,
List
<
String
>
shelfPosList
)
{
int
loc
=
-
1
;
...
...
@@ -413,7 +437,7 @@ namespace OnlineStore.DeviceLibrary
}
return
shelfId
;
}
public
static
string
ProcessCode
(
int
LastWidth
,
int
LastHeight
,
List
<
string
>
LastScanCodes
)
public
static
string
ProcessCode
(
int
LastWidth
,
int
LastHeight
,
List
<
string
>
LastScanCodes
)
{
string
message
=
""
;
string
spiltStr
=
"##"
;
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
3f22a0a
...
...
@@ -39,7 +39,7 @@
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="Client, Version=1.0.0.
0
, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Client, Version=1.0.0.
1
, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
...
...
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
3f22a0a
...
...
@@ -11,59 +11,84 @@ namespace OnlineStore.DeviceLibrary
public
class
AgvClient
{
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
static
Client
agvClient
;
public
static
Dictionary
<
string
,
string
>
actionMap
=
new
Dictionary
<
string
,
string
>();
private
static
Asa
.
Client2
agvClient
;
public
static
Dictionary
<
string
,
Asa
.
ClientAction
>
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
public
static
List
<
string
>
NodeList
=
new
List
<
string
>();
private
static
bool
isInit
=
false
;
public
static
void
Init
()
{
try
{
if
(
agvClient
==
null
)
if
(
!
isInit
)
{
agvClient
=
new
Client
(
ServerIp
);
isInit
=
true
;
agvClient
=
new
Asa
.
Client2
(
ServerIp
);
agvClient
.
Log
+=
AgvClient_Log
;
agvClient
.
Arrive
+=
AgvClient_Arrive
;
// agvClient.CanEnter += AgvClient_CanEnter;
agvClient
.
Ready
+=
AgvClient_Ready
;
// agvClient.GetRFID += AgvClient_GetRFID;
}
actionMap
=
new
Dictionary
<
string
,
string
>();
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
foreach
(
string
key
in
NodeList
)
{
actionMap
.
Add
(
key
,
AGVAction
.
None
);
actionMap
.
Add
(
key
,
Asa
.
ClientAction
.
None
);
}
agvClient
.
Connect
();
foreach
(
string
str
in
NodeList
)
{
SetStatus
(
str
);
}
agvClient
.
Log
+=
AgvClient_Log
;
agvClient
.
Arrive
+=
AgvClient_Arrive
;
agvClient
.
CanEnter
+=
AgvClient_CanEnter
;
agvClient
.
Ready
+=
AgvClient_Ready
;
agvClient
.
Connect
(
NodeList
.
ToArray
());
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"初始化agvClient "
+
ServerIp
+
" 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"初始化agvClient "
+
ServerIp
+
" 出错:"
+
ex
.
ToString
());
}
}
private
static
void
AgvClient_Ready
(
string
id
,
byte
[]
content
)
//private static void AgvClient_GetRFID(string name, byte[] content)
//{
// RFIDData data = new RFIDData(content);
// LogUtil.info("收到 AgvClient_GetRFID [" + name + "] [" + data.ToData() + "] ");
//}
public
static
void
SetStatus
(
string
id
,
string
mark
=
""
,
string
shelfId
=
""
,
ClientAction
action
=
ClientAction
.
None
,
ClientLevel
level
=
ClientLevel
.
Low
)
{
UpdateAction
(
id
,
AGVAction
.
Ready
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
StoreManager
.
Store
.
AGVProcess
(
id
,
AGVAction
.
Ready
);
ClientAction
currA
=
GetAction
(
id
);
//相同状态就设置一次
if
(
currA
.
Equals
(
action
))
{
return
;
}
agvClient
.
SetStatus
(
id
,
mark
,
shelfId
,
action
,
level
);
UpdateAction
(
id
,
action
);
}
private
static
void
AgvClient_
CanEnter
(
string
id
,
byte
[]
content
)
private
static
void
AgvClient_
Ready
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGVAction
.
CanEnter
);
UpdateAction
(
id
,
ClientAction
.
Ready
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
StoreManager
.
Store
.
AGVProcess
(
id
,
AGVAction
.
CanEnter
);
StoreManager
.
Store
.
AGVProcess
(
id
,
ClientAction
.
Ready
);
}
//private static void AgvClient_CanEnter(string id, byte[] content)
//{
// UpdateAction(id, ClientAction.CanEnter);
// RFIDData data = new RFIDData(content);
// LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] ");
// StoreManager.Store.AGVProcess(id, ClientAction.CanEnter);
//}
private
static
void
AgvClient_Arrive
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGV
Action
.
Arrive
);
UpdateAction
(
id
,
Client
Action
.
Arrive
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
StoreManager
.
Store
.
AGVProcess
(
id
,
AGV
Action
.
Arrive
);
StoreManager
.
Store
.
AGVProcess
(
id
,
Client
Action
.
Arrive
);
}
...
...
@@ -75,33 +100,48 @@ namespace OnlineStore.DeviceLibrary
}
return
agvClient
.
IsConn
;
}
internal
static
void
SendRFID
(
string
NodeName
,
string
rfid
)
{
agvClient
.
SendRFID
(
NodeName
,
rfid
);
//
internal static void SendRFID(string NodeName, string rfid)
//
{
//
agvClient.SendRFID(NodeName, rfid);
}
internal
static
void
NeedEnter
(
string
NodeName
)
//}
public
static
bool
NeedEnter
(
string
id
,
string
shelfId
)
{
ClientAction
currA
=
GetAction
(
id
);
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
FinishLeave
)
||
currA
.
Equals
(
ClientAction
.
FinishEnter
))
{
agvClient
.
NeedEnter
(
NodeName
);
SetStatus
(
id
,
shelfId
,
shelfId
,
ClientAction
.
NeedEnter
);
return
true
;
}
return
false
;
}
internal
static
void
NeedLeave
(
string
NodeName
)
public
static
bool
NeedLeave
(
string
id
,
string
shelfId
=
""
)
{
agvClient
.
NeedLeave
(
NodeName
);
ClientAction
currA
=
GetAction
(
id
);
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
FinishLeave
)
||
currA
.
Equals
(
ClientAction
.
FinishEnter
))
{
SetStatus
(
id
,
shelfId
,
shelfId
,
ClientAction
.
NeedLeave
);
return
true
;
}
return
false
;
}
internal
static
void
MayEnter
(
string
NodeName
)
internal
static
void
MayEnter
(
string
NodeName
,
string
shelfId
=
""
)
{
agvClient
.
MayEnter
(
NodeName
);
SetStatus
(
NodeName
,
shelfId
,
shelfId
,
ClientAction
.
MayEnter
);
//agvClient.MayEnter(NodeName);
}
internal
static
void
FinishEnter
(
string
NodeName
)
internal
static
void
FinishEnter
(
string
NodeName
,
string
shelfId
=
""
)
{
agvClient
.
FinishEnter
(
NodeName
);
SetStatus
(
NodeName
,
shelfId
,
shelfId
,
ClientAction
.
FinishEnter
);
// agvClient.FinishEnter(NodeName);
}
internal
static
void
MayLeave
(
string
NodeName
)
internal
static
void
MayLeave
(
string
NodeName
,
string
shelfId
=
""
)
{
agvClient
.
MayLeave
(
NodeName
);
SetStatus
(
NodeName
,
shelfId
,
shelfId
,
ClientAction
.
MayLeave
);
// agvClient.MayLeave(NodeName);
}
private
static
void
AgvClient_Log
(
string
s
)
{
try
...
...
@@ -118,15 +158,15 @@ namespace OnlineStore.DeviceLibrary
}
}
public
static
string
GetAction
(
string
NodeName
)
public
static
Asa
.
ClientAction
GetAction
(
string
NodeName
)
{
if
(
actionMap
.
ContainsKey
(
NodeName
))
{
return
actionMap
[
NodeName
];
}
return
A
GV
Action
.
None
;
return
A
sa
.
Client
Action
.
None
;
}
public
static
void
UpdateAction
(
string
name
,
string
action
)
public
static
void
UpdateAction
(
string
name
,
Asa
.
ClientAction
action
)
{
if
(
actionMap
.
ContainsKey
(
name
))
{
...
...
@@ -148,17 +188,17 @@ namespace OnlineStore.DeviceLibrary
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"释放 agvClient "
+
ServerIp
+
" 出错:"
+
ex
.
ToString
());
}
LogUtil
.
error
(
"释放 agvClient "
+
ServerIp
+
" 出错:"
+
ex
.
ToString
());
}
}
public
class
AGVAction
{
public
static
string
None
=
"None"
;
public
static
string
Arrive
=
"Arrive"
;
public
static
string
CanEnter
=
"CanEnter"
;
public
static
string
GetRFID
=
"GetRFID"
;
public
static
string
Ready
=
"Ready"
;
public
static
string
FinishOut
=
"FinishOut"
;
}
//public class AGVAction
//{
// public static string None = "None";
// public static string Arrive = "Arrive";
// public static string CanEnter = "CanEnter";
// public static string GetRFID = "GetRFID";
// public static string Ready = "Ready";
// public static string FinishOut = "FinishOut";
//}
}
source/DeviceLibrary/device/halcon/CodeManager.cs
查看文件 @
3f22a0a
...
...
@@ -215,13 +215,15 @@ namespace OnlineStore.DeviceLibrary
string
r
=
""
;
foreach
(
CodeInfo
c
in
cc
)
{
codeList
.
Add
(
c
.
CodeStr
);
r
=
r
+
"##"
+
c
.
CodeStr
;
string
str
=
CodeManager
.
ReplaceCode
(
c
.
CodeStr
);
codeList
.
Add
(
str
);
r
=
r
+
"##"
+
str
;
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成:"
+
r
);
//}
}
ho_Image
.
Dispose
();
bitmap
.
Dispose
();
}
}
...
...
@@ -258,7 +260,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
p
rivate
static
string
ReplaceCode
(
string
message
)
p
ublic
static
string
ReplaceCode
(
string
message
)
{
message
=
message
.
Trim
();
message
=
message
.
Replace
(
"\r"
,
""
);
...
...
@@ -271,7 +273,12 @@ namespace OnlineStore.DeviceLibrary
List
<
byte
>
newBytes
=
new
List
<
byte
>();
foreach
(
byte
by
in
bytes
)
{
if
(!
by
.
Equals
(
24
))
int
value
=
(
int
)
by
;
if
(
value
.
Equals
(
24
)
||
value
.
Equals
(
30
)
||
value
.
Equals
(
29
)
||
value
.
Equals
(
4
))
{
continue
;
}
if
(!
value
.
Equals
(
24
))
{
newBytes
.
Add
(
by
);
}
...
...
source/DeviceLibrary/store/AutoInoutInfo.cs
查看文件 @
3f22a0a
...
...
@@ -79,6 +79,7 @@ namespace OnlineStore.DeviceLibrary
InOutParam
param
=
new
InOutParam
(
"AAAA"
,
posid
,
shelfPosId
);
param
.
NeedOutShelf
=
false
;
param
.
NeedEnterShelf
=
false
;
//判断是否需要重置
if
(
CurrInOutACount
>=
boxBean
.
Config
.
Box_ResetACount
)
{
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
3f22a0a
...
...
@@ -160,6 +160,9 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
region
料架进入料仓步骤
1000
开始
/// <summary>
/// 通知agv准备带料架agv
/// </summary>
...
...
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
3f22a0a
...
...
@@ -267,7 +267,7 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsHomeMove
=
false
;
return
wait
;
}
public
static
WaitResultInfo
WaitAgvAction
(
string
arrive
)
public
static
WaitResultInfo
WaitAgvAction
(
int
arrive
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
WaitEnum
.
W010_AgvStatus
;
...
...
@@ -372,7 +372,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
bool
IsEnd
{
get
;
set
;
}
public
string
AgvAction
=
""
;
public
int
AgvAction
=
0
;
}
internal
class
WaitEnum
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论