Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
SO1057-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e5296771
由
刘韬
编写于
2024-06-03 17:20:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
AB口一起出库, 入库机构复位时料仓一起复位
1 个父辈
8edc95ae
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
154 行增加
和
124 行删除
source/DeviceLibrary/manager/StoreManager.cs
source/DeviceLibrary/storeBean/XLRStoreBean.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_OutExecute.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_Partial.cs
source/DeviceLibrary/storeBean/inputBean/BatchMoveBean_Partial.cs
source/DeviceLibrary/storeBean/inputBean/InputEquip.cs
source/XLRStoreClient/boxForm/FrmBoxEquip.cs
source/DeviceLibrary/manager/StoreManager.cs
查看文件 @
e529677
...
...
@@ -118,6 +118,26 @@ namespace OnlineStore.DeviceLibrary
//CSVPositionReader<DrawerPosition>.AddCSVFile(drawConfigFile);
XLRStore
=
new
XLRStoreBean
(
Config
,
inputConfig
,
boxConfig
);
//for (int i = 0; i < 60; i++)
//{
// var height = i;
// int LastHeight = 0;
// List<int> heightList = StoreManager.GetTrayList();
// heightList = (from m in heightList orderby m descending select m).ToList<int>();
// float minCha = height;
// foreach (int h in heightList)
// {
// //取差值最小的接近值
// float cha = Math.Abs(h - (height - 4));
// if (cha < minCha)
// {
// LastHeight = h;
// minCha = cha;
// }
// }
// LogUtil.info($"height:{height}, cha:{minCha}, 对应高度:{LastHeight}");
//}
LogUtil
.
info
(
"加载 完成!"
);
return
true
;
}
...
...
source/DeviceLibrary/storeBean/XLRStoreBean.cs
查看文件 @
e529677
...
...
@@ -46,7 +46,6 @@ namespace OnlineStore.DeviceLibrary
Name
=
(
$
" {title}_"
+
" "
).
ToUpper
();
MoveInfo
=
new
DeviceMoveInfo
(
Name
);
List
<
string
>
ioList
=
new
List
<
string
>();
ioList
=
new
List
<
string
>(
DeviceConfig
.
ProIOIpMap
.
Values
);
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip.cs
查看文件 @
e529677
...
...
@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// B面等待出库的队列
/// </summary>
//
public ConcurrentQueue<InOutParam> waitBOutStoreList = new ConcurrentQueue<InOutParam>();
public
ConcurrentQueue
<
InOutParam
>
waitBOutStoreList
=
new
ConcurrentQueue
<
InOutParam
>();
//库位表
public
List
<
string
>
PositionNumList
;
/// <summary>
...
...
@@ -764,7 +764,7 @@ namespace OnlineStore.DeviceLibrary
private
DateTime
errUpperB
=
DateTime
.
Now
;
private
DateTime
errUnderA
=
DateTime
.
Now
;
private
DateTime
errUnderB
=
DateTime
.
Now
;
int
SigLastTime
=
2
;
//5秒
int
SigLastTime
=
7
;
//5秒
protected
override
void
OnTimerProcess
()
{
//if (!runStatus.Equals(RunStatus.Runing))
...
...
@@ -873,7 +873,7 @@ namespace OnlineStore.DeviceLibrary
return
;
}
}
else
//
if (CheckAOutDoor())
else
if
(
CheckAOutDoor
())
{
InOutParam
param
=
null
;
bool
result
=
waitAOutStoreList
.
TryPeek
(
out
param
);
...
...
@@ -885,31 +885,31 @@ namespace OnlineStore.DeviceLibrary
}
}
}
//
if (waitBOutStoreList.Count > 0)//
//
{
//
if (CloseOutStoreCheck)
//
{
//
InOutParam param = null;
//
bool result = waitBOutStoreList.TryDequeue(out param);
//
if (result && param != null)
//
{
//
LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】");
//
StartExecuctOut(param);
//
return;
//
}
//
}
//
else if (CheckBOutDoor())
//
{
//
InOutParam param = null;
//
bool result = waitBOutStoreList.TryDequeue(out param);
//
if (result && param != null)
//
{
//
LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】");
//
StartExecuctOut(param);
//
return;
//
}
//
}
//
}
if
(
waitBOutStoreList
.
Count
>
0
)
//
{
if
(
CloseOutStoreCheck
)
{
InOutParam
param
=
null
;
bool
result
=
waitBOutStoreList
.
TryDequeue
(
out
param
);
if
(
result
&&
param
!=
null
)
{
LogInfo
(
"执行B面排队的出库【"
+
param
.
PosInfo
.
ToStr
()
+
"】"
);
StartExecuctOut
(
param
);
return
;
}
}
else
if
(
CheckBOutDoor
())
{
InOutParam
param
=
null
;
bool
result
=
waitBOutStoreList
.
TryDequeue
(
out
param
);
if
(
result
&&
param
!=
null
)
{
LogInfo
(
"执行B面排队的出库【"
+
param
.
PosInfo
.
ToStr
()
+
"】"
);
StartExecuctOut
(
param
);
return
;
}
}
}
}
catch
(
Exception
ex
)
{
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
查看文件 @
e529677
...
...
@@ -408,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
//判断排队列表中是否已存在
List
<
InOutParam
>
reviceList
=
new
List
<
InOutParam
>();
reviceList
.
AddRange
(
waitAOutStoreList
);
//
reviceList.AddRange(waitBOutStoreList);
reviceList
.
AddRange
(
waitBOutStoreList
);
reviceList
=
(
from
m
in
reviceList
where
m
.
PosInfo
.
PosId
.
Equals
(
posId
)
select
m
).
ToList
<
InOutParam
>();
if
(
reviceList
.
Count
>
0
)
{
...
...
@@ -417,8 +417,8 @@ namespace OnlineStore.DeviceLibrary
}
else
{
waitAOutStoreList
.
Enqueue
(
inoutParam
);
LogUtil
.
info
(
$
"加入出库队列:{inoutParam.PosInfo.ToStr()}"
);
//
waitAOutStoreList.Enqueue(inoutParam);
//
LogUtil.info($"加入出库队列:{inoutParam.PosInfo.ToStr()}");
}
}
...
...
@@ -426,7 +426,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
Name
+
"验证出库【"
+
inoutParam
.
PosInfo
.
ToStr
()
+
"】是否重复出错:"
+
ex
.
ToString
());
}
//
StartExecuctOut(inoutParam);
StartExecuctOut
(
inoutParam
);
}
TimeSpan
span
=
DateTime
.
Now
-
time
;
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
查看文件 @
e529677
...
...
@@ -459,14 +459,14 @@ namespace OnlineStore.DeviceLibrary
inOut
.
PosInfo
.
IsNG
=
true
;
inOut
.
PosInfo
.
NgMsg
=
"验证入库完成失败"
;
LogInfo
(
$
"入库 {MoveInfo.SLog}:验证入库完成失败,将该库位出库[{inOut.PosInfo.ToStr()}][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
//
if (CheckASide())
if
(
CheckASide
())
{
waitAOutStoreList
.
Enqueue
(
inOut
);
}
//
else
//
{
//
waitBOutStoreList.Enqueue(inOut);
//
}
else
{
waitBOutStoreList
.
Enqueue
(
inOut
);
}
}
break
;
case
StepEnum
.
SI_19_InoutBack
:
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_OutExecute.cs
查看文件 @
e529677
...
...
@@ -184,52 +184,52 @@ namespace OnlineStore.DeviceLibrary
break
;
case
StepEnum
.
SO_13_InoutBack
:
//检查另一面是否有出库任务
//
if (MoveInfo.MoveParam.PosInfoBack == null)
//
{
//
if (CheckASide(MoveInfo.MoveParam))
//
{
//
if (waitBOutStoreList.Count > 0 && CheckBOutDoor())
//
{
//
if (waitBOutStoreList.TryDequeue(out InOutParam inOutParam))//B面料叉空且B面出料口无料,有出库任务
//
{
//
MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready);
//
LogInfo($"存储机构-出库 {MoveInfo.SLog}:A面切换到B面,B面取料[{inOutParam.PosInfo.barcode}]");
//
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//
MoveInfo.MoveParam.PosInfoBack = MoveInfo.MoveParam.PosInfo.ToCopy();
//
MoveInfo.MoveParam.PosInfo = inOutParam.PosInfo.ToCopy();
//
MoveInfo.MoveParam.MoveP = new LineMoveP(Config, inOutParam.PosInfo.PosId);
//
PullAxis_Inout_To_Cam();
//
return;
//
}
//
}
//
}
//
else
//
{
//
if (waitAOutStoreList.Count > 0 && CheckAOutDoor())
//
{
//
if (waitAOutStoreList.TryDequeue(out InOutParam inOutParam))
//
{
//
MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready);
//
LogInfo($"存储机构-出库 {MoveInfo.SLog}:B面切换到A面,A面取料[{inOutParam.PosInfo.barcode}]");
//
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//
MoveInfo.MoveParam.PosInfoBack = MoveInfo.MoveParam.PosInfo.ToCopy();
//
MoveInfo.MoveParam.PosInfo = inOutParam.PosInfo.ToCopy();
//
MoveInfo.MoveParam.MoveP = new LineMoveP(Config, inOutParam.PosInfo.PosId);
//
PullAxis_Inout_To_Cam();
//
return;
//
}
//
}
//
}
//
}
//
else//两夹爪都有料
//
{
// if(MoveInfo.MoveParam.PosInfoBack.PlateW==
MoveInfo.MoveParam.PosInfo.PlateW &&
//
MoveInfo.MoveParam.PosInfoBack.PlateH == MoveInfo.MoveParam.PosInfo.PlateH)
//
{
//
MoveInfo.NextMoveStep(StepEnum.SOB_14_GetReels_Ready);
//
return;
//
}
//
}
if
(
MoveInfo
.
MoveParam
.
PosInfoBack
==
null
)
{
if
(
CheckASide
(
MoveInfo
.
MoveParam
))
{
if
(
waitBOutStoreList
.
Count
>
0
&&
CheckBOutDoor
())
{
if
(
waitBOutStoreList
.
TryDequeue
(
out
InOutParam
inOutParam
))
//B面料叉空且B面出料口无料,有出库任务
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
SO_01_PullAxis_Ready
);
LogInfo
(
$
"存储机构-出库 {MoveInfo.SLog}:A面切换到B面,B面取料[{inOutParam.PosInfo.barcode}]"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
MoveParam
.
PosInfoBack
=
MoveInfo
.
MoveParam
.
PosInfo
.
ToCopy
();
MoveInfo
.
MoveParam
.
PosInfo
=
inOutParam
.
PosInfo
.
ToCopy
();
MoveInfo
.
MoveParam
.
MoveP
=
new
LineMoveP
(
Config
,
inOutParam
.
PosInfo
.
PosId
);
PullAxis_Inout_To_Cam
();
return
;
}
}
}
else
{
if
(
waitAOutStoreList
.
Count
>
0
&&
CheckAOutDoor
())
{
if
(
waitAOutStoreList
.
TryDequeue
(
out
InOutParam
inOutParam
))
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
SO_01_PullAxis_Ready
);
LogInfo
(
$
"存储机构-出库 {MoveInfo.SLog}:B面切换到A面,A面取料[{inOutParam.PosInfo.barcode}]"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
MoveParam
.
PosInfoBack
=
MoveInfo
.
MoveParam
.
PosInfo
.
ToCopy
();
MoveInfo
.
MoveParam
.
PosInfo
=
inOutParam
.
PosInfo
.
ToCopy
();
MoveInfo
.
MoveParam
.
MoveP
=
new
LineMoveP
(
Config
,
inOutParam
.
PosInfo
.
PosId
);
PullAxis_Inout_To_Cam
();
return
;
}
}
}
}
else
//两夹爪都有料
{
if
(
MoveInfo
.
MoveParam
.
PosInfoBack
.
PlateW
==
MoveInfo
.
MoveParam
.
PosInfo
.
PlateW
&&
MoveInfo
.
MoveParam
.
PosInfoBack
.
PlateH
==
MoveInfo
.
MoveParam
.
PosInfo
.
PlateH
)
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
SOB_14_GetReels_Ready
);
return
;
}
}
//直接出库,执行该步骤的情况:1.另一个料叉有料;2.另一面有出库任务但出料口有料;3.另一面没有出库任务;
MoveInfo
.
NextMoveStep
(
StepEnum
.
SO_14_GetReels_Ready
);
MoveAxisToP1
();
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_Partial.cs
查看文件 @
e529677
...
...
@@ -1202,35 +1202,35 @@ namespace OnlineStore.DeviceLibrary
{
bool
result
=
false
;
result
=
StartOutstore
(
param
);
return
result
;
//if (!result)
//{
// lock (outStoreObject)
// {
// if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveParam.PosInfo.PosId.Equals(param.PosInfo.PosId))
// {
// LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,【" + MoveInfo.MoveParam.PosInfo.PosId + "】出库执行中");
// return false;
// }
if
(!
result
)
{
lock
(
outStoreObject
)
{
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
)
&&
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
.
Equals
(
param
.
PosInfo
.
PosId
))
{
LogUtil
.
error
(
Name
+
" 出库命令【"
+
param
.
PosInfo
.
ToStr
()
+
"】重复,【"
+
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
+
"】出库执行中"
);
return
false
;
}
// List<InOutParam> reviceList = new List<InOutParam>();
// reviceList.AddRange(waitAOutStoreList);
// //reviceList.AddRange(waitBOutStoreList);
// reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(param.PosInfo.PosId) select m).ToList<InOutParam>();
// if (reviceList.Count == 0)
// {
// //LogInfo(" 执行出库【" + param.PosInfo.ToStr() + "】失败,加入等待队列");
// // if (param.PosInfo.GetPosSide().Equals("A"))
// {
// waitAOutStoreList.Enqueue(param);
// }
// //else if (param.PosInfo.GetPosSide().Equals("B"))
// //{
// // waitBOutStoreList.Enqueue(param);
// //}
// }
// }
//}
List
<
InOutParam
>
reviceList
=
new
List
<
InOutParam
>();
reviceList
.
AddRange
(
waitAOutStoreList
);
reviceList
.
AddRange
(
waitBOutStoreList
);
reviceList
=
(
from
m
in
reviceList
where
m
.
PosInfo
.
PosId
.
Equals
(
param
.
PosInfo
.
PosId
)
select
m
).
ToList
<
InOutParam
>();
if
(
reviceList
.
Count
==
0
)
{
LogInfo
(
" 执行出库【"
+
param
.
PosInfo
.
ToStr
()
+
"】失败,加入等待队列"
);
if
(
param
.
PosInfo
.
GetPosSide
().
Equals
(
"A"
))
{
waitAOutStoreList
.
Enqueue
(
param
);
}
else
if
(
param
.
PosInfo
.
GetPosSide
().
Equals
(
"B"
))
{
waitBOutStoreList
.
Enqueue
(
param
);
}
}
}
}
return
result
;
}
private
DateTime
startOutStoreTime
=
DateTime
.
Now
;
/// <summary>
...
...
source/DeviceLibrary/storeBean/inputBean/BatchMoveBean_Partial.cs
查看文件 @
e529677
...
...
@@ -312,7 +312,12 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB16_SaveHight
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
LastHeight
=
GetHeight
();
int
width
=
7
;
if
(
StoreManager
.
XLRStore
.
inputEquip
.
IOValue
(
IO_Type
.
Feeding_Reel_13_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
width
=
13
;
}
LastHeight
=
GetHeight
(
width
);
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB17_WaitReelLeave
))
{
...
...
@@ -558,7 +563,7 @@ namespace OnlineStore.DeviceLibrary
public
int
EndMovePosition
=
0
;
internal
int
LastHeight
=
0
;
string
[]
cames
;
public
int
GetHeight
()
public
int
GetHeight
(
int
width
=
7
)
{
CodeManager
.
CameraCheckHeight
(
cames
?.
ToList
(),
Name
);
LogUtil
.
info
(
$
"{Name} 采集料盘抓走后的图片,开始计算高度"
);
...
...
@@ -574,6 +579,12 @@ namespace OnlineStore.DeviceLibrary
isLast
=
true
;
}
float
height
=
(
float
)(
1F
*
Math
.
Abs
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
);
//Math.Ceiling
if
(
width
>=
13
)
{
height
=
height
-
2
;
LogUtil
.
info
(
$
"检测为13寸高度-2={height}"
);
}
string
buchongStr
=
""
;
if
(
isLast
)
{
...
...
source/DeviceLibrary/storeBean/inputBean/InputEquip.cs
查看文件 @
e529677
...
...
@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
void
InoutEndEvent
()
{
inoutCnt
++;
if
(
inoutCnt
>
resetCnt
)
if
(
inoutCnt
>
resetCnt
&&
BatchMove_A
.
MoveInfo
.
ShelfNoTray
&&
BatchMove_B
.
MoveInfo
.
ShelfNoTray
)
{
OnlyResetInputAxis
=
true
;
LogUtil
.
info
(
$
"入料机构出入库到达{resetCnt},准备复位"
);
...
...
source/XLRStoreClient/boxForm/FrmBoxEquip.cs
查看文件 @
e529677
...
...
@@ -189,15 +189,15 @@ namespace OnlineStore.XLRStore
text
+=
param
.
PosInfo
.
ToStr
()
+
"\r"
;
}
}
//
List<InOutParam> psB = new List<InOutParam>(boxBean.waitBOutStoreList);
//
if (psB.Count > 0)
//
{
//
text = "B面等待出库列表:\r";
//
foreach (InOutParam param in psB)
//
{
//
text += param.PosInfo.ToStr() + "\r";
//
}
//
}
List
<
InOutParam
>
psB
=
new
List
<
InOutParam
>(
boxBean
.
waitBOutStoreList
);
if
(
psB
.
Count
>
0
)
{
text
=
"B面等待出库列表:\r"
;
foreach
(
InOutParam
param
in
psB
)
{
text
+=
param
.
PosInfo
.
ToStr
()
+
"\r"
;
}
}
}
}
if
(!
lblInstoreList
.
Text
.
Equals
(
text
))
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论