Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1053_CycleLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 45ed6db8
由
刘韬
编写于
2023-07-13 10:25:28 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
9afa759d
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
114 行增加
和
42 行删除
DeviceLibrary/VirtuallyStore/VStore.cs
DeviceLibrary/theMachine/TrayManager.cs
DeviceLibrary/theMachine/sub/MI.cs
DeviceLibrary/theMachine/sub/TransplantMove.cs
DeviceLibrary/theMachine/sub/TrayStop.cs
RemoteSheardObject/TheLine.cs
TheMachine/Program.cs
TheMachine/TrayManagerControl.cs
TheMachine/device/CIDebugControl.cs
DeviceLibrary/VirtuallyStore/VStore.cs
查看文件 @
45ed6db
...
...
@@ -54,8 +54,11 @@ namespace DeviceLibrary
public
volatile
bool
TerminalError
=
false
;
DateTime
LastStatusTime
=
DateTime
.
Now
;
int
LastStatusCode
=
0
;
/// <summary>
/// 最后报错重试时间
/// </summary>
public
DateTime
LastProcessErrorTime
=
DateTime
.
Now
;
public
int
LastProcessErrorTimes
=
0
;
internal
void
VTowerProcess
()
{
if
(!
TowerInfo
.
Enable
)
{
ServerCM
.
storeStatus
=
StoreStatus
.
None
;
...
...
@@ -86,11 +89,18 @@ namespace DeviceLibrary
if
(
ti
.
StatusCode
==
26
&&
ti
.
StatusText
==
"Ready"
)
{
ServerCM
.
storeStatus
=
StoreStatus
.
StoreOnline
;
if
(
RTStoreStatus
==
RTStoreStatus
.
OutMoveExecute
)
{
LastProcessErrorTimes
=
0
;
if
(
RTStoreStatus
==
RTStoreStatus
.
OutMoveExecute
)
{
TheLine
.
emptyOut
(
CurrentTerminalReelID
);
TheLine
.
UpdateLocInfo
(
""
,
CurrentTerminalReelID
,
TheLine
.
LineStatusE
.
BOXDOOR_NOREEL
,
CID
);
VLog
.
Info
(
"检测到料盘空出 reelid:"
+
CurrentTerminalReelID
);
VLog
.
Info
(
"检测到料盘空出 reelid:"
+
CurrentTerminalReelID
);
}
if
(
RTStoreStatus
==
RTStoreStatus
.
OutStoreReady
&&
(
DateTime
.
Now
-
LastStatusTime
).
TotalSeconds
<
2
)
{
TheLine
.
emptyOut
(
CurrentTerminalReelID
);
TheLine
.
UpdateLocInfo
(
""
,
CurrentTerminalReelID
,
TheLine
.
LineStatusE
.
BOXDOOR_NOREEL
,
CID
);
VLog
.
Info
(
"检测到料盘空出2秒内消失 reelid:"
+
CurrentTerminalReelID
);
}
if
(
RTStoreStatus
!=
RTStoreStatus
.
LockToInStore
&&
RTStoreStatus
!=
RTStoreStatus
.
LockToOutStore
&&
RTStoreStatus
!=
RTStoreStatus
.
InStoreReady
)
...
...
@@ -107,7 +117,7 @@ namespace DeviceLibrary
RTStoreStatus
=
RTStoreStatus
.
LockToOutStore
;
if
(!
ServerCM
.
BeginOutStore
(
jobInfo
.
Clone
(),
VLog
))
{
Msg
.
add
(
crc
.
GetString
(
"Res0105.f3331370"
,
"发送出库指令失败"
)
+
":"
+
jobInfo
.
WareNum
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0105.f3331370"
,
"发送出库指令失败"
)
+
":"
+
jobInfo
.
WareNum
,
MsgLevel
.
alarm
);
RTStoreStatus
=
RTStoreStatus
.
Ready
;
}
CurrentTerminalReelID
=
jobInfo
.
WareNum
;
...
...
@@ -127,7 +137,7 @@ namespace DeviceLibrary
}
else
if
((
DateTime
.
Now
-
LastStatusTime
).
TotalSeconds
>
30
)
{
if
(
InStoreJobInfo
!=
null
)
CurrentTerminalReelID
=
InStoreJobInfo
.
WareNum
;
if
(
RTStoreStatus
==
RTStoreStatus
.
InStoreReady
)
...
...
@@ -145,7 +155,7 @@ namespace DeviceLibrary
Msg
.
add
(
$
"TerminalError:"
+
crc
.
GetString
(
"Res0099.42525c5f"
,
"入库超时"
),
MsgLevel
.
alarm
);
}
else
if
(
RTStoreStatus
==
RTStoreStatus
.
LockToOutStore
)
{
{
VLog
.
Error
(
$
"出库超时出错,没有检测到出库信息,RTStoreStatus={RTStoreStatus}:"
+
CurrentTerminalReelID
);
CurrentTowerStatusText
=
"出库错误,没有执行出库过程"
;
Msg
.
add
(
$
"TerminalError:"
+
"出库超时"
,
MsgLevel
.
alarm
);
...
...
@@ -155,9 +165,13 @@ namespace DeviceLibrary
VLog
.
Error
(
$
"未知状态超时,RTStoreStatus={RTStoreStatus}:"
+
InStoreJobInfo
?.
ToStr
());
Msg
.
add
(
$
"TerminalError:"
+
"料仓状态异常"
,
MsgLevel
.
warning
);
}
}
}
else
if
(
ti
.
StatusCode
==
6015
||
ti
.
StatusText
==
"Reel already loaded."
)
//料盘已在库内
{
TerminalError
=
true
;
}
else
if
(
ti
.
StatusCode
==
1031
||
ti
.
StatusCode
==
1030
)
//分配库位,入库过程
{
ServerCM
.
storeStatus
=
StoreStatus
.
InStoreExecute
;
...
...
@@ -167,6 +181,12 @@ namespace DeviceLibrary
}
else
if
(
ti
.
StatusCode
==
1032
)
//料仓已经检测到料盘
{
if
(
TerminalError
&&
RTStoreStatus
==
RTStoreStatus
.
InStoreError
)
{
CurrentTowerStatusText
=
"6015-Reel already loaded."
;
VLog
.
Info
(
"料仓异常状态 TerminalError=true"
);
return
;
}
if
((
DateTime
.
Now
-
LastStatusTime
).
TotalSeconds
>
30
)
{
RTStoreStatus
=
RTStoreStatus
.
InStoreDataTimeOut
;
...
...
@@ -203,6 +223,7 @@ namespace DeviceLibrary
{
VLog
.
Info
(
"出库物料已到舱门口:"
+
CurrentTerminalReelID
);
OutStoreEnd
(
CurrentTerminalReelID
,
CID
);
LastStatusTime
=
DateTime
.
Now
;
}
...
...
@@ -219,17 +240,21 @@ namespace DeviceLibrary
else
if
(
ti
.
StatusCode
==
0
||
ti
.
StatusCode
==
18
)
{
RTStoreStatus
=
RTStoreStatus
.
Offline
;
TerminalError
=
false
;
ServerCM
.
storeStatus
=
StoreStatus
.
None
;
}
else
if
(
ti
.
StatusCode
>=
310000
)
{
if
(
RTStoreStatus
!=
RTStoreStatus
.
InStoreError
)
LastProcessErrorTime
=
DateTime
.
Now
.
AddSeconds
(
10
);
if
(
RTStoreStatus
!=
RTStoreStatus
.
InStoreError
)
{
LastProcessErrorTime
=
DateTime
.
Now
.
AddSeconds
(
10
);
LastProcessErrorTimes
=
0
;
}
LastProcessErrorTimes
++;
Msg
.
add
(
$
"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}"
,
MsgLevel
.
warning
);
RTStoreStatus
=
RTStoreStatus
.
InStoreError
;
ServerCM
.
storeStatus
=
StoreStatus
.
InStoreFaild
;
//CurrentTowerStatusText = $"{ti.StatusText}-{ti.OnlineStatus}";
//InStoreJobInfo = null;
}
...
...
@@ -237,6 +262,7 @@ namespace DeviceLibrary
{
RTStoreStatus
=
RTStoreStatus
.
Busy
;
ServerCM
.
storeStatus
=
StoreStatus
.
None
;
TerminalError
=
false
;
//VLog.Info($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}");
Msg
.
add
(
$
"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}"
,
MsgLevel
.
alarm
);
}
...
...
@@ -293,7 +319,7 @@ namespace DeviceLibrary
int
.
TryParse
(
sn
.
Substring
(
2
),
out
h
);
}
//boxStatus.data.Add("capacity", "7X8=1000;7X12=345;13X32=100;");
capacity
+=
$
"{w}X{h}={ti.Slots[i].Slots_free};"
;
capacity
+=
$
"{w}X{h}={ti.Slots[i].Slots_free
- ti.Slots[i].Slots_used
};"
;
SlotsInfo
[
$
"{w}X{h}"
]
=
$
"{ti.Slots[i].Slots_used}/{ti.Slots[i].Slots_free}"
;
}
ServerCM
.
capacity
=
capacity
;
...
...
@@ -330,7 +356,7 @@ namespace DeviceLibrary
return
crc
.
GetString
(
"Res0068"
,
"入库中"
)
+
" Barcode:"
+
InStoreJobInfo
?.
WareNum
;
if
(
RTStoreStatus
==
RTStoreStatus
.
InStoreError
)
return
crc
.
GetString
(
"Res0069"
,
"入库出错,物料NG"
)
+
"
Barcode:"
+
InStoreJobInfo
?.
WareNum
;
return
crc
.
GetString
(
"Res0069"
,
"入库出错,物料NG"
)
+
"LT:"
+
LastProcessErrorTimes
+
",
Barcode:"
+
InStoreJobInfo
?.
WareNum
;
if
(
RTStoreStatus
==
RTStoreStatus
.
Error
)
return
CurrentTowerStatusText
;
...
...
DeviceLibrary/theMachine/TrayManager.cs
查看文件 @
45ed6db
...
...
@@ -38,16 +38,30 @@ namespace DeviceLibrary
Traylist
[
rfid
].
LastAddr
=
addr
;
Traylist
[
rfid
].
Destination
=
TrayManager
.
AddrDesc
[
Traylist
[
rfid
].
DestinationAddr
];
Traylist
[
rfid
].
LastPosition
=
TrayManager
.
AddrDesc
[
Traylist
[
rfid
].
LastAddr
];
if
(
Traylist
[
rfid
].
TrayType
==
TrayTypeE
.
MTP1
&&
(
addr
==
16
||
addr
==
20
||
addr
==
5
||
addr
==
3
))
Traylist
[
rfid
].
HasLoadCheck
+=
reelcheck
==
0
?
-
1
:
1
;
else
if
(
Traylist
[
rfid
].
TrayType
==
TrayTypeE
.
MTP2
)
Traylist
[
rfid
].
HasLoadCheck
+=
reelcheck
==
0
?
-
1
:
1
;
//
if (Traylist[rfid].TrayType == TrayTypeE.MTP1 && (addr == 16 || addr == 20 || addr == 5 || addr == 3))
// Traylist[rfid].HasLoadCheck = reelcheck == 0 ? false : true
;
//
else if (Traylist[rfid].TrayType == TrayTypeE.MTP2)
// Traylist[rfid].HasLoadCheck = reelcheck == 0 ? false : true
;
trayInfo
=
Traylist
[
rfid
];
//Statistics();
}
return
true
;
}
public
static
void
SetTrayError
(
string
rfid
)
{
lock
(
Traylist
)
{
if
(
Traylist
.
ContainsKey
(
rfid
))
{
LogUtil
.
info
(
$
"SetTrayError:{rfid},{Traylist[rfid].TrayParam?.ToStr()}"
);
Traylist
[
rfid
].
IsLoadError
=
true
;
}
else
{
LogUtil
.
info
(
$
"SetTrayError:{rfid} 托盘信息不存在"
);
}
}
}
/// <summary>
/// 设置托盘物料信息
/// </summary>
...
...
@@ -73,7 +87,6 @@ namespace DeviceLibrary
Traylist
[
rfid
].
LoadType
=
(
TrayTypeE
)
Enum
.
Parse
(
typeof
(
TrayTypeE
),
requestLoadInfo
.
TrayType
);
Traylist
[
rfid
].
TrayParam
=
requestLoadInfo
.
LoadParam
.
clone
();
Traylist
[
rfid
].
DestinationAddr
=
GetAddrByGroupName
(
requestLoadInfo
.
DeviceGroupName
);
Traylist
[
rfid
].
HasLoadCheck
=
1
;
LogUtil
.
info
(
"设置托盘信息:"
+
rfid
+
","
+
requestLoadInfo
.
DeviceGroupName
+
","
+
Traylist
[
rfid
].
LoadType
+
","
+
Traylist
[
rfid
].
TrayParam
.
ToStr
()
);
}
SaveTrayInfo
();
...
...
@@ -115,10 +128,7 @@ namespace DeviceLibrary
return
false
;
}
}
public
static
bool
TestTrayRequest
(
string
deviceGroupName
)
{
return
TrayRequest
.
ContainsKey
(
deviceGroupName
);
}
public
static
void
ClearTrayRequest
(
string
deviceGroupName
)
{
lock
(
TrayRequest
)
...
...
@@ -350,12 +360,18 @@ namespace DeviceLibrary
public
int
DestinationAddr
=-
1
;
public
int
LastAddr
=-
1
;
public
string
LastPosition
;
/// <summary>
/// 逻辑是否有物料
/// </summary>
public
bool
HasLoad
{
get
=>
LoadType
!=
TrayTypeE
.
None
;
}
public
TrayTypeE
LoadType
=
TrayTypeE
.
None
;
public
TrayTypeE
TrayType
;
public
DateTime
LastUpdateTime
;
public
ReelParam
TrayParam
;
public
int
HasLoadCheck
=
0
;
/// <summary>
/// 物料状态与实际是否相符
/// </summary>
public
bool
IsLoadError
=
false
;
public
DirectionE
Direction
{
get
=>
(
Destination
==
StoreCID
.
AMH_ML5_1
||
Destination
==
StoreCID
.
AMH_ML5_2
)
?
DirectionE
.
Out
:
DirectionE
.
In
;
}
public
bool
isOnline
=
true
;
public
void
SetToEmpty
()
{
...
...
@@ -363,7 +379,7 @@ namespace DeviceLibrary
LoadType
=
TrayTypeE
.
None
;
DestinationAddr
=
-
1
;
TrayParam
=
new
ReelParam
();
HasLoadCheck
=
0
;
IsLoadError
=
false
;
}
}
...
...
DeviceLibrary/theMachine/sub/MI.cs
查看文件 @
45ed6db
...
...
@@ -160,7 +160,7 @@ namespace DeviceLibrary
return
;
}
//判断有无出库任务
var
testInStoreError
=
VStoreCollection
.
VStoreList
.
Values
.
Where
(
vs
=>
vs
.
TowerInfo
.
DeviceGroupName
==
GroupName
).
ToList
().
Find
(
vs
=>
DateTime
.
Now
>
vs
.
LastProcessErrorTime
&&
(
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreError
||
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreDataTimeOut
||
vs
.
TerminalError
));
var
testInStoreError
=
VStoreCollection
.
VStoreList
.
Values
.
Where
(
vs
=>
vs
.
TowerInfo
.
DeviceGroupName
==
GroupName
).
ToList
().
Find
(
vs
=>
DateTime
.
Now
>
vs
.
LastProcessErrorTime
&&
vs
.
LastProcessErrorTimes
<
4
&&
(
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreError
||
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreDataTimeOut
||
vs
.
TerminalError
));
var
hasoutjob
=
false
;
if
(
testInStoreError
!=
null
)
hasoutjob
=
true
;
...
...
@@ -254,7 +254,7 @@ namespace DeviceLibrary
}
break
;
case
MoveStep
.
MI_50
:
var
InStoreError
=
VStoreCollection
.
VStoreList
.
Values
.
Where
(
vs
=>
vs
.
TowerInfo
.
DeviceGroupName
==
GroupName
).
ToList
().
Find
(
vs
=>
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreError
||
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreDataTimeOut
||
vs
.
TerminalError
);
var
InStoreError
=
VStoreCollection
.
VStoreList
.
Values
.
Where
(
vs
=>
vs
.
TowerInfo
.
DeviceGroupName
==
GroupName
).
ToList
().
Find
(
vs
=>
DateTime
.
Now
>
vs
.
LastProcessErrorTime
&&
vs
.
LastProcessErrorTimes
<
4
&&
(
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreError
||
vs
.
RTStoreStatus
==
RTStoreStatus
.
InStoreDataTimeOut
||
vs
.
TerminalError
)
);
if
(
InStoreError
!=
null
)
{
var
result
=
TheLine
.
GetReelSize
<
ResultData
>(
InStoreError
.
CurrentTerminalReelID
);
...
...
@@ -353,10 +353,14 @@ namespace DeviceLibrary
CurrntOutReadyStore
.
RTStoreStatus
=
RTStoreStatus
.
Busy
;
}
MoveInfo
.
log
(
$
"机器人抓取状态:MI_Robot_Reel_Check:{IOValue(IO_Type.MI_Robot_Reel_Check)}, MI_Robot_Clamp_Check:{IOValue(IO_Type.MI_Robot_Clamp_Check)}"
);
if
(
(
MoveInfo
.
MoveParam
.
IsNg
||
CurrntOutReadyStore
.
TerminalError
)
&&
IOValue
(
IO_Type
.
MI_Robot_Reel_Check
).
Equals
(
IO_VALUE
.
LOW
)
if
(
IOValue
(
IO_Type
.
MI_Robot_Reel_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
MI_Robot_Clamp_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
MoveInfo
.
log
(
"机器人抓取NG料后发现夹爪上没有料,流程结束处理"
);
if
(
MoveInfo
.
MoveParam
.
IsNg
||
CurrntOutReadyStore
.
TerminalError
)
{
MoveInfo
.
log
(
"机器人抓取NG料后发现夹爪上没有料,流程结束处理"
);
}
else
MoveInfo
.
log
(
"机器人抓取正常出库物料后发现夹爪上没有料,流程结束处理"
);
CurrntOutReadyStore
.
TerminalError
=
false
;
RoboMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
...
...
@@ -371,9 +375,9 @@ namespace DeviceLibrary
remoteLoad
.
RequestLoadInfo
.
DeviceGroupName
=
GroupName
;
TrayManager
.
SetTrayRequest
(
remoteLoad
);
}
TheLine
.
emptyOut
(
Curr
ntOutReadyStore
.
CurrentTerminalReelID
);
TheLine
.
UpdateLocInfo
(
""
,
Curr
ntOutReadyStore
.
CurrentTerminalReelID
,
TheLine
.
LineStatusE
.
BOXDOOR_NOREEL
,
CurrntOutReadyStore
.
CID
);
MoveInfo
.
log
(
"检测到夹爪空抓 reelid:"
+
Curr
ntOutReadyStore
.
CurrentTerminalReelID
);
TheLine
.
emptyOut
(
Curr
entJobInfo
.
WareNum
);
TheLine
.
UpdateLocInfo
(
""
,
Curr
entJobInfo
.
WareNum
,
TheLine
.
LineStatusE
.
BOXDOOR_NOREEL
,
CurrntOutReadyStore
.
CID
);
MoveInfo
.
log
(
"检测到夹爪空抓 reelid:"
+
Curr
entJobInfo
.
WareNum
);
return
;
}
if
(!
MoveInfo
.
MoveParam
.
IsNg
&&
IOValue
(
IO_Type
.
MI_Robot_Reel_Check
).
Equals
(
IO_VALUE
.
LOW
)
...
...
DeviceLibrary/theMachine/sub/TransplantMove.cs
查看文件 @
45ed6db
...
...
@@ -190,8 +190,11 @@ namespace DeviceLibrary
}
}
else
{
Msg
.
add
(
crc
.
GetString
(
"Res0034"
,
"托盘没有检测到物料"
),
MsgLevel
.
alarm
);
{
TrayManager
.
SetTrayError
(
CurrrentRFID
);
MoveInfo
.
log
(
"托盘没有检测到物料"
);
Msg
.
add
(
crc
.
GetString
(
"Res0034"
,
"托盘没有检测到物料"
),
MsgLevel
.
alarm
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TransplantMove_04
);
return
;
}
...
...
@@ -221,14 +224,15 @@ namespace DeviceLibrary
MoveInfo
.
log
(
$
"出库托盘与 {GroupName} 通讯失败,放行托盘"
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TransplantMove_04
);
SRec
.
error
(
crc
.
GetString
(
"Res0024"
,
"物料横移"
),
GroupName
,
crc
.
GetString
(
"Res0030"
,
"空托盘"
),
crc
.
GetString
(
"Res0033"
,
"料仓当前不可用,放行托盘"
),
CurrrentRFID
,
MoveInfo
.
MoveParam
.
ToStr
());
}
}
else
{
TrayManager
.
SetTrayError
(
CurrrentRFID
);
MoveInfo
.
log
(
$
"托盘标记为空托盘,但检测到物料"
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TransplantMove_04
);
Msg
.
add
(
crc
.
GetString
(
"Res0036"
,
"托盘标记为空托盘,但检测到物料"
),
MsgLevel
.
warning
);
return
;
}
}
}
else
MoveInfo
.
NextMoveStep
(
MoveStep
.
TransplantMove_04
);
...
...
DeviceLibrary/theMachine/sub/TrayStop.cs
查看文件 @
45ed6db
...
...
@@ -202,7 +202,10 @@ namespace DeviceLibrary
else
if
(
trayInfo
.
DestinationAddr
==
DeviceGroup
.
addr_1
&&
trayInfo
.
HasLoad
)
{
if
(
IOValue
(
IO_Type
.
MI_Reel_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
TrayManager
.
SetTrayError
(
CurrrentRFID
);
Msg
.
add
(
crc
.
GetString
(
"Res0034"
,
"托盘没有检测到物料"
),
MsgLevel
.
alarm
);
MoveInfo
.
log
(
"托盘没有检测到物料"
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TrayStop_04
);
return
;
}
var
cid
=
trayInfo
.
TrayParam
.
PosID
;
...
...
@@ -262,7 +265,10 @@ namespace DeviceLibrary
{
if
(
IOValue
(
IO_Type
.
MI_Reel_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
TrayManager
.
SetTrayError
(
CurrrentRFID
);
Msg
.
add
(
crc
.
GetString
(
"Res0034"
,
"托盘没有检测到物料"
),
MsgLevel
.
alarm
);
MoveInfo
.
log
(
"托盘没有检测到物料"
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TrayStop_04
);
return
;
}
//有物料
...
...
RemoteSheardObject/TheLine.cs
查看文件 @
45ed6db
...
...
@@ -38,6 +38,8 @@ namespace RemoteSheardObject
public
static
bool
emptyOut
(
string
barcode
)
{
//料盘空出后直接结束任务
return
true
;
if
(
barcode
.
Count
(
c
=>
c
==
'#'
)
==
3
)
{
barcode
=
barcode
.
Split
(
'#'
)[
1
].
Substring
(
1
);
...
...
@@ -243,7 +245,13 @@ namespace RemoteSheardObject
}
}
}
/// <summary>
/// 料仓离线后二次重新获取物料库位
/// </summary>
/// <param name="reelParam"></param>
/// <param name="traytype"></param>
/// <param name="msg"></param>
/// <returns></returns>
public
static
ReelParam
Regetposid
(
ReelParam
reelParam
,
string
traytype
,
out
string
msg
)
{
msg
=
""
;
...
...
@@ -255,14 +263,14 @@ namespace RemoteSheardObject
try
{
Dictionary
<
string
,
string
>
nameValue
=
new
Dictionary
<
string
,
string
>();
nameValue
.
Add
(
"code"
,
reelParam
.
WareC
ode
);
nameValue
.
Add
(
"code"
,
barc
ode
);
nameValue
.
Add
(
"preCid"
,
reelParam
.
cid
);
if
(
reelParam
.
PlateW
==
13
&&
reelParam
.
PlateH
<
44
)
nameValue
.
Add
(
"cids"
,
"AMH-SBDH3-2,AMH-SBSH1,AMH-SBSH2,AMH-SBDH2-1,AMH-SBDH2-2,AMH-SBDH1-1,AMH-SBDH1-2,003040,003048,003039,003043,003035,003036,003041,003042"
);
else
//不包含 AMH-SBDH3-1
nameValue
.
Add
(
"cids"
,
"AMH-SBDH3-1,AMH-SBDH3-2,AMH-SBSH1,AMH-SBSH2,AMH-SBDH2-1,AMH-SBDH2-2,AMH-SBDH1-1,AMH-SBDH1-2,003040,003048,003039,003043,003035,003036,003041,003042"
);
var
data
=
SubmitPostData
(
"/service/store/robotBox/
empty
PosForPutin"
,
nameValue
);
var
data
=
SubmitPostData
(
"/service/store/robotBox/
renew
PosForPutin"
,
nameValue
);
msg
+=
"Regetposid code: "
+
reelParam
.
WareCode
+
",preCid: "
+
reelParam
.
cid
+
",cids:"
+
nameValue
[
"cids"
]
+
",Result: "
+
data
+
"\r\n"
;
emptyPosForPutin
result
=
JsonConvert
.
DeserializeObject
<
emptyPosForPutin
>(
data
);
...
...
@@ -294,7 +302,7 @@ namespace RemoteSheardObject
reelParam
.
SubCID
=
result
.
cid
;
reelParam
.
WareCode
=
micode
;
reelParam
.
PosID
=
result
.
pos
;
reelParam
.
PosID
=
result
.
cid
;
reelParam
.
cid
=
mid
;
//RobotManage.SendTrayRequest("003039", micode, "AMH-MI1");
//RobotManage.SendTrayRequest(result.cid, micode, mid);
...
...
TheMachine/Program.cs
查看文件 @
45ed6db
...
...
@@ -76,8 +76,14 @@ namespace TheMachine
AppDomain
.
CurrentDomain
.
UnhandledException
+=
CurrentDomain_UnhandledException
;
Environment
.
CurrentDirectory
=
Application
.
StartupPath
;
XmlConfigurator
.
Configure
();
//VStoreCollection vStoreCollection = new VStoreCollection();
//vStoreCollection.UploadCarrierInformationData();
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
Application
.
Run
(
new
Form1
());
...
...
TheMachine/TrayManagerControl.cs
查看文件 @
45ed6db
...
...
@@ -148,7 +148,7 @@ namespace TheMachine
if
(
ti
.
HasLoad
&&
ti
.
TrayParam
.
IsNg
)
{
listView1
.
Items
[
ti
.
RFID
].
ForeColor
=
Color
.
Orange
;
}
if
(
ti
.
HasLoad
&&
ti
.
HasLoadCheck
<
0
)
if
(
ti
.
IsLoadError
)
listView1
.
Items
[
ti
.
RFID
].
ForeColor
=
Color
.
Red
;
}
...
...
TheMachine/device/CIDebugControl.cs
查看文件 @
45ed6db
...
...
@@ -23,6 +23,8 @@ namespace TheMachine.device
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
if
(!
TrayStop
.
DeviceList
.
ContainsKey
(
"CI"
))
return
;
string
status
=
""
;
if
(
TrayStop
.
DeviceList
[
"CI"
].
IOValue
(
IO_Type
.
CI_Count_Finished
).
Equals
(
IO_VALUE
.
HIGH
))
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论