Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSquareStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 97338d73
由
LN
编写于
2023-05-25 15:39:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加入库任务队列
1 个父辈
b37b7f38
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
82 行增加
和
33 行删除
source/ACSquareStore/FrmStoreBox.cs
source/DeviceLibrary/acSquareStore/Square_BoxBean.cs
source/DeviceLibrary/acSquareStore/Square_BoxBean_Partial.cs
source/DeviceLibrary/store/KTK_Store.cs
source/ACSquareStore/FrmStoreBox.cs
查看文件 @
97338d7
...
@@ -66,6 +66,8 @@ namespace OnlineStore.ACSquareStore
...
@@ -66,6 +66,8 @@ namespace OnlineStore.ACSquareStore
InitPosDebugBox
();
InitPosDebugBox
();
axisMoveControl1
.
LoadData
(
StoreManager
.
Store
.
moveAxisList
.
ToArray
());
axisMoveControl1
.
LoadData
(
StoreManager
.
Store
.
moveAxisList
.
ToArray
());
tabControl1
.
TabPages
.
Remove
(
tabPage1
);
tabControl1
.
TabPages
.
Remove
(
tabPage1
);
StoreManager
.
CameraA
.
camera_event
+=
CameraA_camera_event
;
LoadOk
=
true
;
LoadOk
=
true
;
}
}
#
region
库位调试
#
region
库位调试
...
@@ -895,8 +897,9 @@ namespace OnlineStore.ACSquareStore
...
@@ -895,8 +897,9 @@ namespace OnlineStore.ACSquareStore
{
{
store
.
autoNext
=
false
;
store
.
autoNext
=
false
;
btnStartAuTo
.
Text
=
"开始自动出入库"
;
btnStartAuTo
.
Text
=
"开始自动出入库"
;
if
(
store
.
waitOutStoreList
.
Count
>
0
)
store
.
waitOutStoreList
.
Clear
();
LogUtil
.
info
(
"停止自动出入库,清空队列中的出库任务"
);
store
.
clearOutList
();
}
}
else
else
{
{
...
...
source/DeviceLibrary/acSquareStore/Square_BoxBean.cs
查看文件 @
97338d7
...
@@ -1049,7 +1049,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1049,7 +1049,7 @@ namespace OnlineStore.DeviceLibrary
try
try
{
{
bool
noInStore
=
waitOutStoreList
.
Count
<=
0
;
bool
noInStore
=
waitOutStoreList
.
Count
<=
0
;
if
(
CurrInOutACount
>=
this
.
Config
.
Box_ResetACount
&&
noInStore
)
if
(
CurrInOutACount
>=
this
.
Config
.
Box_ResetACount
&&
noInStore
)
{
{
if
(
storeRunStatus
<
StoreRunStatus
.
Runing
||
StoreMove
.
MoveType
==
StoreMoveType
.
InStore
||
StoreMove
.
MoveType
==
StoreMoveType
.
OutStore
)
if
(
storeRunStatus
<
StoreRunStatus
.
Runing
||
StoreMove
.
MoveType
==
StoreMoveType
.
InStore
||
StoreMove
.
MoveType
==
StoreMoveType
.
OutStore
)
{
{
...
@@ -1072,28 +1072,40 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1072,28 +1072,40 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
"已经累计出入库"
+
CurrInOutCount
+
"次,需要复位一下前后轴"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"已经累计出入库"
+
CurrInOutCount
+
"次,需要复位一下前后轴"
);
}
}
}
}
// else if (LineConnect.CanStartOut() || IsDebug)
// else if (LineConnect.CanStartOut() || IsDebug)
else
else
{
{
InOutPosInfo
currInOutFixture
=
null
;
InOutPosInfo
currInOutFixture
=
null
;
lock
(
waitOutListLock
)
bool
inOk
=
waitInStoreList
.
TryDequeue
(
out
currInOutFixture
);
//优先执行入库
if
(
inOk
&&
currInOutFixture
!=
null
)
{
{
if
(
waitOutStoreList
.
Count
>
0
&&
CanStarInOut
())
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始执行排队中的入库【"
+
currInOutFixture
.
ToStr
()
+
"】"
);
bool
result
=
StartInStoreMove
(
new
InOutParam
(
currInOutFixture
));
if
(!
result
)
{
{
currInOutFixture
=
waitOutStoreList
[
0
]
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行排队中的入库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,重新加入等待队列"
)
;
waitOutStoreList
.
RemoveAt
(
0
);
AddWaiInInfo
(
currInOutFixture
);
}
}
}
}
if
(
currInOutFixture
!=
null
)
else
{
//出库
{
bool
outOk
=
waitOutStoreList
.
TryDequeue
(
out
currInOutFixture
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始执行排队中的出库【"
+
currInOutFixture
.
ToStr
()
+
"】"
);
bool
result
=
StartOutStoreMove
(
new
InOutParam
(
currInOutFixture
));
if
(
outOk
&&
currInOutFixture
!=
null
)
//bool result = StartOutStoreMove(new InOutParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW));
{
//出库
if
(!
result
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始执行排队中的出库【"
+
currInOutFixture
.
ToStr
()
+
"】"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行排队中的出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,重新加入等待队列"
);
bool
result
=
StartOutStoreMove
(
new
InOutParam
(
currInOutFixture
));
AddWaitOutInfo
(
currInOutFixture
);
//bool result = StartOutStoreMove(new InOutParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW));
if
(!
result
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行排队中的出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,重新加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
}
}
}
}
}
}
...
@@ -1218,7 +1230,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1218,7 +1230,7 @@ namespace OnlineStore.DeviceLibrary
string
plateW
=
data
[
ParamDefine
.
plateW
];
string
plateW
=
data
[
ParamDefine
.
plateW
];
string
plateH
=
data
[
ParamDefine
.
plateH
];
string
plateH
=
data
[
ParamDefine
.
plateH
];
int
door
=
Convert
.
ToInt32
(
data
[
ParamDefine
.
door
]);
int
door
=
Convert
.
ToInt32
(
data
[
ParamDefine
.
door
]);
InOutPosInfo
inoutInfo
=
new
InOutPosInfo
(
message
,
posId
,
plateH
,
plateW
,
door
);
InOutPosInfo
inoutInfo
=
new
InOutPosInfo
(
message
,
posId
,
plateH
,
plateW
,
door
);
//根据发送的posId获取位置列表
//根据发送的posId获取位置列表
ACSquareSPosition
position
=
CSVPositionReader
<
ACSquareSPosition
>.
GetPositon
(
posId
);
ACSquareSPosition
position
=
CSVPositionReader
<
ACSquareSPosition
>.
GetPositon
(
posId
);
...
@@ -1235,11 +1247,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1235,11 +1247,17 @@ namespace OnlineStore.DeviceLibrary
//如果当前正在出入库中,需要记录下来,等待空闲时执行
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:【"
+
inoutInfo
.
ToStr
()
+
"】开始入库!"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:【"
+
inoutInfo
.
ToStr
()
+
"】开始入库!"
);
InOutParam
param
=
new
InOutParam
(
inoutInfo
);
InOutParam
param
=
new
InOutParam
(
inoutInfo
);
StartInStoreMove
(
param
);
bool
result
=
StartInStoreMove
(
param
);
if
(!
result
)
{
AddWaiInInfo
(
inoutInfo
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:【"
+
inoutInfo
.
ToStr
()
+
"】执行失败,加入等待队列 "
);
}
}
}
else
else
{
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:【"
+
inoutInfo
.
ToStr
()
+
"】 正在忙碌中,无法入库!"
);
AddWaiInInfo
(
inoutInfo
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:【"
+
inoutInfo
.
ToStr
()
+
"】 正在忙碌中,无法入库,加入等待队列"
);
}
}
}
}
...
...
source/DeviceLibrary/acSquareStore/Square_BoxBean_Partial.cs
查看文件 @
97338d7
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
@@ -258,7 +259,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -258,7 +259,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 开始入库移动移动
/// 开始入库移动移动
/// </summary>
/// </summary>
public
override
void
StartInStoreMove
(
InOutParam
param
)
public
override
bool
StartInStoreMove
(
InOutParam
param
)
{
{
startInStoreTime
=
DateTime
.
Now
;
startInStoreTime
=
DateTime
.
Now
;
string
posId
=
param
!=
null
?
param
.
PosInfo
.
PosId
:
""
;
string
posId
=
param
!=
null
?
param
.
PosInfo
.
PosId
:
""
;
...
@@ -268,24 +269,24 @@ namespace OnlineStore.DeviceLibrary
...
@@ -268,24 +269,24 @@ namespace OnlineStore.DeviceLibrary
if
(!
LoadParamPosition
(
param
))
if
(!
LoadParamPosition
(
param
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,找不到库位信息"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,找不到库位信息"
);
return
;
return
false
;
}
}
if
(
param
.
PosInfo
.
ShelfType
<=
0
)
if
(
param
.
PosInfo
.
ShelfType
<=
0
)
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,未设置入口位置"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,未设置入口位置"
);
return
;
return
false
;
}
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,货叉物料检测有料"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,货叉物料检测有料"
);
WarnMsg
=
$
"启动入库[{posId}]失败:货叉物料检测有料"
;
WarnMsg
=
$
"启动入库[{posId}]失败:货叉物料检测有料"
;
return
;
return
false
;
}
}
string
doorMsg
=
DoorIsClose
();
string
doorMsg
=
DoorIsClose
();
if
(!
String
.
IsNullOrEmpty
(
doorMsg
))
if
(!
String
.
IsNullOrEmpty
(
doorMsg
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错, "
+
doorMsg
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错, "
+
doorMsg
);
return
;
return
false
;
}
}
clearWarmMsg
(
"启动出库"
);
clearWarmMsg
(
"启动出库"
);
...
@@ -296,6 +297,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -296,6 +297,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
,
param
);
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
,
param
);
//料盘检测
//料盘检测
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_00_TrayCheck
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_00_TrayCheck
);
return
true
;
//if (StoreManager.UseShelfCheck)
//if (StoreManager.UseShelfCheck)
//{
//{
// if (param.PosInfo.ShelfType.Equals(1))
// if (param.PosInfo.ShelfType.Equals(1))
...
@@ -315,6 +317,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -315,6 +317,7 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动【"
+
posId
+
"】入库出错,当前状态,storeStatus="
+
storeRunStatus
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动【"
+
posId
+
"】入库出错,当前状态,storeStatus="
+
storeRunStatus
);
return
false
;
}
}
}
}
private
void
SI_02_Move
()
private
void
SI_02_Move
()
...
@@ -841,8 +844,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -841,8 +844,12 @@ namespace OnlineStore.DeviceLibrary
}
}
#
endregion
#
endregion
public
List
<
InOutPosInfo
>
waitOutStoreList
=
new
List
<
InOutPosInfo
>();
public
ConcurrentQueue
<
InOutPosInfo
>
waitOutStoreList
=
new
ConcurrentQueue
<
InOutPosInfo
>();
public
object
waitOutListLock
=
""
;
public
ConcurrentQueue
<
InOutPosInfo
>
waitInStoreList
=
new
ConcurrentQueue
<
InOutPosInfo
>();
private
void
WaitNoTray
(
StoreMoveStep
step
)
private
void
WaitNoTray
(
StoreMoveStep
step
)
{
{
...
@@ -866,13 +873,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -866,13 +873,34 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
OneWaitCanEndStep
=
true
;
StoreMove
.
OneWaitCanEndStep
=
true
;
}
}
}
}
public
void
AddWaitOutInfo
(
InOutPosInfo
code
)
public
void
AddWaitOutInfo
(
InOutPosInfo
param
)
{
{
lock
(
waitOutListLock
)
List
<
InOutPosInfo
>
list
=
(
from
m
in
waitOutStoreList
where
m
.
PosId
.
Equals
(
param
.
PosId
)
select
m
).
ToList
<
InOutPosInfo
>();
if
(
list
.
Count
>
0
)
{
LogUtil
.
error
(
StoreName
+
"出库【"
+
param
.
ToStr
()
+
"】加入等待队列失败,此库位已存在列表中"
);
}
waitOutStoreList
.
Enqueue
(
param
);
}
public
void
AddWaiInInfo
(
InOutPosInfo
param
)
{
List
<
InOutPosInfo
>
list
=
(
from
m
in
waitInStoreList
where
m
.
PosId
.
Equals
(
param
.
PosId
)
select
m
).
ToList
<
InOutPosInfo
>();
if
(
list
.
Count
>
0
)
{
{
waitOutStoreList
.
Add
(
code
);
LogUtil
.
error
(
StoreName
+
"入库【"
+
param
.
ToStr
()
+
"】加入等待队列失败,此库位已存在列表中"
);
}
}
waitInStoreList
.
Enqueue
(
param
);
}
public
void
clearOutList
()
{
LogUtil
.
info
(
StoreName
+
"重置 waitOutStoreList"
);
waitOutStoreList
=
new
ConcurrentQueue
<
InOutPosInfo
>();
}
}
private
string
autoInoutCode
=
"AUTOINOUT"
;
private
string
autoInoutCode
=
"AUTOINOUT"
;
private
void
InOutEndProcess
(
StoreMoveType
storeMoveType
,
string
posId
)
private
void
InOutEndProcess
(
StoreMoveType
storeMoveType
,
string
posId
)
{
{
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
97338d7
...
@@ -398,7 +398,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -398,7 +398,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 开始入库移动移动
/// 开始入库移动移动
/// </summary>
/// </summary>
public
abstract
void
StartInStoreMove
(
InOutParam
param
);
public
abstract
bool
StartInStoreMove
(
InOutParam
param
);
protected
abstract
void
InStoreProcess
();
protected
abstract
void
InStoreProcess
();
#
endregion
#
endregion
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论