Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 172560bd
由
LN
编写于
2021-02-26 14:05:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
接驳台获取尺寸NG后送料到NG箱。
1 个父辈
0656dc4e
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
62 行增加
和
46 行删除
source/AssemblyLineClient/FrmLineIO.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/model/InOutParam.cs
source/DeviceLibrary/model/TrayInfo.cs
source/AssemblyLineClient/FrmLineIO.cs
查看文件 @
172560b
...
...
@@ -454,7 +454,7 @@ namespace OnlineStore.AssemblyLine
rdbUrg
.
Checked
=
tray
.
InoutPar
.
urgentReel
;
chbSmall
.
Checked
=
tray
.
InoutPar
.
smallReel
;
txtTrayLoc
.
Text
=
tray
.
InoutPar
.
rfidLoc
.
ToString
();
chbInStoNG
.
Checked
=
tray
.
InoutPar
.
I
nStoreNg
;
chbInStoNG
.
Checked
=
tray
.
InoutPar
.
I
sNG
;
}
else
{
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
查看文件 @
172560b
...
...
@@ -896,14 +896,14 @@ namespace OnlineStore.DeviceLibrary
{
//非 1,2,3,4,5,13,14,15,16的入库料需要横移
if
(
tray
.
IsFull
)
{
if
(
tray
.
InOrOutStore
.
Equals
(
1
))
{
//NG料需要横移
if
(
tray
.
InoutPar
.
IsNG
)
{
//NG料需要横移
if
(
tray
.
InoutPar
.
InStoreNg
)
{
return
true
;
}
return
true
;
}
if
(
tray
.
InOrOutStore
.
Equals
(
1
))
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
List
<
int
>
instoreId
=
new
List
<
int
>
{
1
,
2
,
3
,
4
,
5
,
13
,
14
,
15
,
16
};
if
(!
instoreId
.
Contains
(
storeId
))
...
...
@@ -940,16 +940,16 @@ namespace OnlineStore.DeviceLibrary
//NG料直接横移
if
(
tray
.
IsFull
)
{
if
(
tray
.
InoutPar
.
IsNG
)
{
return
true
;
}
if
(
tray
.
InOrOutStore
.
Equals
(
2
)
&&
(!
tray
.
InoutPar
.
cutReel
)
&&
(!
tray
.
InoutPar
.
urgentReel
))
{
return
true
;
}
else
if
(
tray
.
InOrOutStore
.
Equals
(
1
))
{
if
(
tray
.
InoutPar
.
InStoreNg
)
{
return
true
;
}
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
List
<
int
>
instoreId
=
new
List
<
int
>
{
11
,
12
,
23
,
24
};
if
(!
instoreId
.
Contains
(
storeId
))
...
...
@@ -1040,11 +1040,11 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
InOutParam
param
=
trayInfo
.
InoutPar
;
if
(
trayInfo
.
IsFull
&&
trayInfo
.
InoutPar
.
I
nStoreNg
&&
this
.
DeviceID
.
Equals
(
216
))
if
(
trayInfo
.
IsFull
&&
trayInfo
.
InoutPar
.
I
sNG
&&
this
.
DeviceID
.
Equals
(
216
))
{
LogInfo
(
" C1->出料线:NG料"
+
""
+
param
.
ToStr
());
//如果分配了库位,需要调用取消
if
(
trayInfo
.
InoutPar
.
WareCode
!=
""
&&
trayInfo
.
InoutPar
.
PosId
!=
""
)
if
(
trayInfo
.
InoutPar
.
WareCode
!=
""
&&
trayInfo
.
InoutPar
.
PosId
!=
""
&&
trayInfo
.
InOrOutStore
.
Equals
(
1
)
)
{
SServerManager
.
cancelPutInTask
(
Name
,
trayInfo
.
InoutPar
.
WareCode
);
}
...
...
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor_Partial.cs
查看文件 @
172560b
...
...
@@ -337,8 +337,9 @@ namespace OnlineStore.DeviceLibrary
LastWidth
=
0
;
int
robotIndex
=
GetRobotIndex
();
string
code
=
SecondMoveInfo
.
MoveParam
.
WareCode
;
string
result
=
SServerManager
.
GetTraySize
(
Name
,
robotIndex
,
code
,
out
LastWidth
);
OutLog
(
"接驳台托盘["
+
currTrayNum
+
"] ["
+
code
+
"] 获取尺寸【"
+
LastWidth
+
"】【"
+
result
+
"】"
);
bool
isNg
=
false
;
string
result
=
SServerManager
.
GetTraySize
(
Name
,
robotIndex
,
code
,
out
LastWidth
,
out
isNg
);
OutLog
(
"接驳台托盘["
+
currTrayNum
+
"] ["
+
code
+
"] 获取尺寸【"
+
LastWidth
+
"】"
+(
isNg
?
"NG"
:
""
)+
"【"
+
result
+
"】"
);
if
(
LastWidth
>
0
)
{
...
...
@@ -349,6 +350,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
if
(
isNg
)
{
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
,
result
);
LogInfo
(
"更新工单出库料["
+
currTrayNum
+
"] ["
+
code
+
"]为NG料:"
+
result
);
}
JHY_11_TopDown
();
}
}
...
...
@@ -416,7 +422,7 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
InOutParam
inoup
=
trayInfo
.
InoutPar
;
if
(
trayInfo
.
IsFull
&&
trayInfo
.
InoutPar
.
I
nStoreNg
&&
this
.
DeviceID
.
Equals
(
217
))
if
(
trayInfo
.
IsFull
&&
trayInfo
.
InoutPar
.
I
sNG
&&
this
.
DeviceID
.
Equals
(
217
)&&
trayInfo
.
InOrOutStore
.
Equals
(
1
))
{
LogInfo
(
" NG料->NG箱"
+
""
+
inoup
.
ToStr
());
//如果分配了库位,需要调用取消
...
...
@@ -613,7 +619,7 @@ namespace OnlineStore.DeviceLibrary
string
msg
=
SServerManager
.
afterPutCut
(
Name
,
"BN"
,
code
,
""
,
1
,
out
taskData
);
afterPutCutOK
=
true
;
}
else
if
(!
MoveInfo
.
MoveParam
.
I
nStoreNg
)
else
if
(!
MoveInfo
.
MoveParam
.
I
sNG
)
{
int
robotIndex
=
GetRobotIndex
();
OutLog
(
logName
+
MoveInfo
.
SLog
+
",工单料到达接驳台,发送 arrive3fRobotLocation "
);
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
172560b
...
...
@@ -493,12 +493,12 @@ namespace OnlineStore.DeviceLibrary
//判断是否验证成功,如果验证失败,不入库
if
(
LineServer
.
RightInPosId
(
DeviceID
,
cc
.
PosId
))
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
,
cc
.
I
nStoreNg
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
,
cc
.
I
sNG
);
return
true
;
}
else
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
,
cc
.
I
nStoreNg
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
,
cc
.
I
sNG
);
LogUtil
.
error
(
Name
+
"托盘号【"
+
currTrayNum
+
"】入库信息【"
+
cc
.
ToStr
()
+
"】料仓未验证成功,重新发送验证消息"
);
LineServer
.
CheckInStorePos
(
DeviceID
,
cc
);
return
true
;
...
...
@@ -605,13 +605,13 @@ namespace OnlineStore.DeviceLibrary
{
reIndex
=
i
;
currCode
=
cc
;
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
,
cc
.
I
nStoreNg
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
,
cc
.
I
sNG
);
break
;
}
}
if
(
reIndex
>=
0
)
{
if
(
currCode
.
PosId
.
Equals
(
tray
.
InoutPar
.
PosId
)
&&
tray
.
InOrOutStore
.
Equals
(
1
)
&&
tray
.
InoutPar
.
I
nStoreNg
.
Equals
(
false
))
if
(
currCode
.
PosId
.
Equals
(
tray
.
InoutPar
.
PosId
)
&&
tray
.
InOrOutStore
.
Equals
(
1
)
&&
tray
.
InoutPar
.
I
sNG
.
Equals
(
false
))
{
if
(!
LineServer
.
BoxCanInStore
(
DeviceID
))
{
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
172560b
...
...
@@ -63,9 +63,10 @@ namespace OnlineStore.DeviceLibrary
}
return
codeStr
;
}
public
static
string
GetTraySize
(
string
deviceName
,
int
robotIndex
,
string
codeStr
,
out
int
outSize
)
public
static
string
GetTraySize
(
string
deviceName
,
int
robotIndex
,
string
codeStr
,
out
int
outSize
,
out
bool
isNg
)
{
outSize
=
0
;
isNg
=
false
;
string
msg
=
""
;
try
{
...
...
@@ -73,9 +74,10 @@ namespace OnlineStore.DeviceLibrary
{
return
msg
=
deviceName
+
"未扫到条码"
;
}
string
logName
=
$
"GetTraySize [{robotIndex }] [{codeStr}] :"
;
if
(
string
.
IsNullOrEmpty
(
serverAddr
))
{
LogUtil
.
error
(
deviceName
+
"GetTraySize ["
+
robotIndex
+
"] ["
+
codeStr
+
"] :
未找到服务器地址"
);
LogUtil
.
error
(
deviceName
+
$
"{logName}
未找到服务器地址"
);
return
msg
;
}
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
...
...
@@ -84,27 +86,33 @@ namespace OnlineStore.DeviceLibrary
string
server
=
GetAddr
(
Addr_getSize
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
bool
isTimeOut
=
false
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
,
Encoding
.
UTF8
,
5000
,
out
isTimeOut
);
LogUtil
.
info
(
"GetTraySize "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
if
(
isTimeOut
)
{
return
msg
=
"获取尺寸超时"
;
}
//返回: { "code": 0, "msg":"ok", data: 7}
ServerData
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
ServerData
>(
resultStr
);
if
(
serverResult
==
null
)
{
return
msg
=
deviceName
+
" 【"
+
robotIndex
+
"】 条码【 "
+
codeStr
+
"】
没有收到服务器反馈"
;
return
msg
=
"
没有收到服务器反馈"
;
}
else
if
(
serverResult
.
code
.
Equals
(
0
).
Equals
(
false
))
{
// code: 0为正常,其他为异常,
// msg:消息,
return
msg
=
deviceName
+
" 【"
+
robotIndex
+
"】 条码【 "
+
codeStr
+
"】返回:"
+
"["
+
serverResult
.
code
+
"]"
+
serverResult
.
msg
;
//code不是0,直接NG
isNg
=
true
;
return
msg
=
$
" [{ serverResult.code}]:"
+
serverResult
.
msg
;
}
if
(!
serverResult
.
data
.
Equals
(
""
))
{
// data:料盘直径,= 7时升起气缸
outSize
=
Convert
.
ToInt32
(
serverResult
.
data
);
LogUtil
.
info
(
deviceName
+
"【"
+
robotIndex
+
"】 条码【 "
+
codeStr
+
"】,
获得尺寸:"
+
outSize
);
LogUtil
.
info
(
deviceName
+
$
"{ logName}
获得尺寸:"
+
outSize
);
}
}
catch
(
Exception
ex
)
...
...
@@ -115,6 +123,7 @@ namespace OnlineStore.DeviceLibrary
}
public
static
string
UpdateTrayLoc
(
string
deviceName
,
string
barcode
,
string
status
,
string
locInfo
)
{
string
msg
=
""
;
...
...
@@ -449,7 +458,7 @@ namespace OnlineStore.DeviceLibrary
cancelPutInTask
(
deviceName
,
codeStr
);
result
.
Param
=
new
InOutParam
(
0
,
codeStr
,
""
,
height
,
width
,
true
);
result
.
Param
.
rfid
=
rfid
;
result
.
Param
.
I
nStoreNg
=
true
;
result
.
Param
.
I
sNG
=
true
;
result
.
Param
.
NgMsg
=
"没有收到服务器反馈"
;
return
result
;
}
...
...
@@ -475,7 +484,7 @@ namespace OnlineStore.DeviceLibrary
result
.
Msg
=
serverResult
.
msg
;
result
.
Param
=
new
InOutParam
(
0
,
codeStr
,
""
,
height
,
width
,
true
);
result
.
Param
.
rfid
=
rfid
;
result
.
Param
.
I
nStoreNg
=
true
;
result
.
Param
.
I
sNG
=
true
;
result
.
Param
.
NgMsg
=
""
+
serverResult
.
msg
;
return
result
;
}
...
...
@@ -502,7 +511,7 @@ namespace OnlineStore.DeviceLibrary
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
if
(
LineManager
.
Line
.
IsReviceInPosId
(
moveEquip
,
posId
))
{
result
.
Param
.
I
nStoreNg
=
true
;
result
.
Param
.
I
sNG
=
true
;
result
.
Param
.
NgMsg
=
"入库库位重复"
;
result
.
Msg
=
deviceName
+
(
"收到服务器入库命令 "
+
"入库库位重复: "
+
result
.
Param
.
ToStr
()
+
" ,入库失败!"
);
return
result
;
...
...
@@ -511,7 +520,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
result
.
Param
.
I
nStoreNg
=
true
;
result
.
Param
.
I
sNG
=
true
;
result
.
Param
.
NgMsg
=
"未找到料仓["
+
storeId
+
"]"
;
result
.
Msg
=
deviceName
+
(
"收到服务器入库命令 "
+
"未找到料仓["
+
storeId
+
"]: "
+
result
.
Param
.
ToStr
()
+
" ,入库失败!"
);
return
result
;
...
...
@@ -526,7 +535,7 @@ namespace OnlineStore.DeviceLibrary
}
public
static
void
SendPosToStoreCheck
(
string
deviceName
,
InOutParam
param
)
{
if
(
param
==
null
||
param
.
I
nStoreNg
)
if
(
param
==
null
||
param
.
I
sNG
)
{
return
;
}
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
172560b
...
...
@@ -100,10 +100,10 @@ namespace OnlineStore.DeviceLibrary
public
static
void
UpdateInStoreNG
(
int
trayNum
,
bool
isNg
,
string
msg
)
{
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】
InStoreNG
=【"
+
isNg
+
"】NgMsg=【"
+
msg
+
"】"
);
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】
isNg
=【"
+
isNg
+
"】NgMsg=【"
+
msg
+
"】"
);
if
(
TrayInfoMap
.
ContainsKey
(
trayNum
))
{
TrayInfoMap
[
trayNum
].
InoutPar
.
I
nStoreNg
=
isNg
;
TrayInfoMap
[
trayNum
].
InoutPar
.
I
sNG
=
isNg
;
TrayInfoMap
[
trayNum
].
ShowMsg
=
msg
;
TrayInfoMap
[
trayNum
].
LastUpdateTime
=
DateTime
.
Now
;
...
...
@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
"加载到缓存托盘:"
+
tray
.
ToStr
());
TrayInfoMap
.
TryAdd
(
tray
.
TrayNum
,
tray
);
if
(
tray
.
InOrOutStore
.
Equals
(
1
)
&&
tray
.
InoutPar
.
I
nStoreNg
.
Equals
(
false
)
&&
(!
tray
.
InoutPar
.
PosId
.
Equals
(
""
)))
if
(
tray
.
InOrOutStore
.
Equals
(
1
)
&&
tray
.
InoutPar
.
I
sNG
.
Equals
(
false
)
&&
(!
tray
.
InoutPar
.
PosId
.
Equals
(
""
)))
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
if
(
storeId
>
0
&&
LineManager
.
Line
.
MoveEquipMap
.
ContainsKey
(
storeId
))
...
...
@@ -220,7 +220,7 @@ namespace OnlineStore.DeviceLibrary
}
//如果是入库托盘,需要清理入库消息
if
(
tray
.
InOrOutStore
.
Equals
(
1
)
&&
tray
.
InoutPar
.
I
nStoreNg
.
Equals
(
false
)
&&
(!
tray
.
InoutPar
.
PosId
.
Equals
(
""
)))
if
(
tray
.
InOrOutStore
.
Equals
(
1
)
&&
tray
.
InoutPar
.
I
sNG
.
Equals
(
false
)
&&
(!
tray
.
InoutPar
.
PosId
.
Equals
(
""
)))
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
if
(
storeId
>
0
&&
LineManager
.
Line
.
MoveEquipMap
.
ContainsKey
(
storeId
))
...
...
source/DeviceLibrary/model/InOutParam.cs
查看文件 @
172560b
...
...
@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary
this
.
PlateW
=
plateW
;
this
.
PlateH
=
plateH
;
this
.
TrayNumber
=
trayCode
;
this
.
I
nStoreNg
=
instoreNg
;
this
.
I
sNG
=
instoreNg
;
this
.
urgentReel
=
urgentReel
;
this
.
cutReel
=
cutReel
;
...
...
@@ -63,11 +63,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否是入库NG的料盘
/// </summary>
public
bool
I
nStoreNg
=
false
;
public
bool
I
sNG
=
false
;
public
string
NgMsg
=
""
;
public
string
ToStr
()
{
return
$
" [{ TrayNumber }] [{ WareCode }] [{ PosId }] [{ PlateW }x{ PlateH }],
InStoreNg [{ InStoreNg
}],urgentReel [{ urgentReel }],cutReel [{ cutReel }],smallReel [{ smallReel }],rfid [{ rfid }],rfidLoc [{ rfidLoc }]"
;
return
$
" [{ TrayNumber }] [{ WareCode }] [{ PosId }] [{ PlateW }x{ PlateH }],
NG: [{ IsNG
}],urgentReel [{ urgentReel }],cutReel [{ cutReel }],smallReel [{ smallReel }],rfid [{ rfid }],rfidLoc [{ rfidLoc }]"
;
}
public
string
ToShortStr
()
{
...
...
source/DeviceLibrary/model/TrayInfo.cs
查看文件 @
172560b
...
...
@@ -30,17 +30,18 @@ namespace OnlineStore.DeviceLibrary
if
(
InOrOutStore
.
Equals
(
1
))
{
type
=
inoutPar
.
I
nStoreNg
?
"入料失败:"
+
ShowMsg
+
"["
+
inoutPar
.
PosId
+
"]["
+
inoutPar
.
WareCode
+
"] ["
+
inoutPar
.
PlateW
+
"x"
+
inoutPar
.
PlateH
+
"] "
:
"入料:"
+
""
+
inoutPar
.
ToStr
()
+
""
;
type
=
inoutPar
.
I
sNG
?
"入料失败:"
+
ShowMsg
+
"["
+
inoutPar
.
PosId
+
"]["
+
inoutPar
.
WareCode
+
"] ["
+
inoutPar
.
PlateW
+
"x"
+
inoutPar
.
PlateH
+
"] "
:
"入料:"
+
""
+
inoutPar
.
ToStr
()
+
""
;
}
else
if
(
InOrOutStore
.
Equals
(
2
))
{
string
outType
=
"出料:"
;
string
ngstr
=
InoutPar
.
IsNG
?
"NG("
+
InoutPar
.
NgMsg
+
")"
:
""
;
string
outType
=
"出料"
+
ngstr
+
":"
;
if
(
inoutPar
.
urgentReel
)
{
outType
=
"紧急料:"
;
outType
=
"紧急料
"
+
ngstr
+
"
:"
;
}
else
if
(
inoutPar
.
cutReel
)
{
outType
=
"分盘料:"
;
outType
=
"分盘料
"
+
ngstr
+
"
:"
;
}
type
=
outType
+
inoutPar
.
ToStr
();
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论