Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7bbe83b1
由
张东亮
编写于
2022-07-31 11:55:50 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
20220730 进仓门口连续流入托盘问题处理
1 个父辈
6595b475
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
246 行增加
和
143 行删除
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Shunt.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
7bbe83b
...
@@ -365,7 +365,6 @@ namespace OnlineStore.AssemblyLine
...
@@ -365,7 +365,6 @@ namespace OnlineStore.AssemblyLine
MessageBox
.
Show
(
lineBean
.
Name
+
"当前状态:"
+
lineBean
.
runStatus
+
",不能启动!"
);
MessageBox
.
Show
(
lineBean
.
Name
+
"当前状态:"
+
lineBean
.
runStatus
+
",不能启动!"
);
return
;
return
;
}
}
RFIDManager
.
ClearAllBuff
();
LogUtil
.
info
(
"点击 开始启动"
);
LogUtil
.
info
(
"点击 开始启动"
);
startTimer
.
Interval
=
300
;
startTimer
.
Interval
=
300
;
startTimer
.
Elapsed
+=
timer_Elapsed
;
startTimer
.
Elapsed
+=
timer_Elapsed
;
...
@@ -447,7 +446,6 @@ namespace OnlineStore.AssemblyLine
...
@@ -447,7 +446,6 @@ namespace OnlineStore.AssemblyLine
MessageBox
.
Show
(
lineBean
.
Name
+
"流水线未启动,无法复位"
);
MessageBox
.
Show
(
lineBean
.
Name
+
"流水线未启动,无法复位"
);
return
;
return
;
}
}
RFIDManager
.
ClearAllBuff
();
LogUtil
.
info
(
lineBean
.
Name
+
"点击:复位"
);
LogUtil
.
info
(
lineBean
.
Name
+
"点击:复位"
);
lineBean
.
Reset
();
lineBean
.
Reset
();
}
}
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
7bbe83b
...
@@ -68,12 +68,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -68,12 +68,12 @@ namespace OnlineStore.DeviceLibrary
}
}
this
.
alarmType
=
alarmType
;
this
.
alarmType
=
alarmType
;
if
(
alarmType
.
Equals
(
LineAlarmType
.
SuddenStop
)
||
alarmType
.
Equals
(
LineAlarmType
.
NoAirCheck
)
if
(
alarmType
.
Equals
(
LineAlarmType
.
SuddenStop
)
||
alarmType
.
Equals
(
LineAlarmType
.
NoAirCheck
)
||
alarmType
.
Equals
(
LineAlarmType
.
AxisAlarm
)||
alarmType
.
Equals
(
LineAlarmType
.
AxisMoveError
))
||
alarmType
.
Equals
(
LineAlarmType
.
AxisAlarm
)
||
alarmType
.
Equals
(
LineAlarmType
.
AxisMoveError
))
{
{
if
(
baseConfig
.
DType
.
Equals
(
DeviceType
.
FeedingEquip
))
if
(
baseConfig
.
DType
.
Equals
(
DeviceType
.
FeedingEquip
))
{
{
//如果是入料机构,轴报警是直接停止并自动切换为调试模式,防止托盘卡
//如果是入料机构,轴报警是直接停止并自动切换为调试模式,防止托盘卡
LogInfo
(
"报警类型:"
+
alarmType
+
",自动停止运行并切换为调试模式,防止托盘卡 "
);
LogInfo
(
"报警类型:"
+
alarmType
+
",自动停止运行并切换为调试模式,防止托盘卡 "
);
LineManager
.
Line
.
FeedingEquipMap
[
DeviceID
].
ChangeDebug
(
true
);
LineManager
.
Line
.
FeedingEquipMap
[
DeviceID
].
ChangeDebug
(
true
);
StopRun
();
StopRun
();
}
}
...
@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
public
virtual
void
CheckAlarmProcess
(
LineMoveInfo
moveInfo
,
LineAlarmType
alarmType
)
public
virtual
void
CheckAlarmProcess
(
LineMoveInfo
moveInfo
,
LineAlarmType
alarmType
)
{
{
}
}
...
@@ -142,13 +142,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -142,13 +142,13 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
TimeSpan
span
=
DateTime
.
Now
-
lastProTimer
;
//
TimeSpan span = DateTime.Now - lastProTimer;
if
(
isInPro
&&
span
.
TotalSeconds
<
TimerMaxSeconds
)
//
if (isInPro && span.TotalSeconds < TimerMaxSeconds)
{
//
{
return
;
//
return;
}
//
}
isInPro
=
true
;
//
isInPro = true;
lastProTimer
=
DateTime
.
Now
;
//
lastProTimer = DateTime.Now;
try
try
{
{
if
(
IsDebug
&&
runStatus
<=
LineRunStatus
.
Wait
)
if
(
IsDebug
&&
runStatus
<=
LineRunStatus
.
Wait
)
...
@@ -168,7 +168,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -168,7 +168,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
Name
+
"TimerProcess出错:"
,
ex
);
LogUtil
.
error
(
Name
+
"TimerProcess出错:"
,
ex
);
}
}
isInPro
=
false
;
//
isInPro = false;
}
}
finally
finally
{
{
...
@@ -191,7 +191,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -191,7 +191,7 @@ namespace OnlineStore.DeviceLibrary
return
;
return
;
}
}
//若BOX和出料都没有在等待Io的过程中则此Io超时异常可能已经处理过
//若BOX和出料都没有在等待Io的过程中则此Io超时异常可能已经处理过
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
SecondMoveInfo
.
IsInWait
.
Equals
(
false
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
SecondMoveInfo
.
IsInWait
.
Equals
(
false
))
{
{
LogUtil
.
info
(
Name
+
"清理信号超时报警【"
+
WarnMsg
+
"】 "
);
LogUtil
.
info
(
Name
+
"清理信号超时报警【"
+
WarnMsg
+
"】 "
);
alarmType
=
LineAlarmType
.
None
;
alarmType
=
LineAlarmType
.
None
;
...
@@ -201,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -201,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"IOTimeOutProcess出错:"
,
ex
);
LogUtil
.
error
(
"IOTimeOutProcess出错:"
,
ex
);
}
}
}
}
...
@@ -226,6 +226,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -226,6 +226,8 @@ namespace OnlineStore.DeviceLibrary
isNoAirCheck
=
false
;
isNoAirCheck
=
false
;
preTrayNum
=
0
;
preTrayNum
=
0
;
currTrayNum
=
0
;
currTrayNum
=
0
;
StopReadRfid
();
ClearAllBuff
();
}
}
public
void
ChangeDebug
(
bool
isDebug
)
public
void
ChangeDebug
(
bool
isDebug
)
{
{
...
@@ -339,7 +341,149 @@ namespace OnlineStore.DeviceLibrary
...
@@ -339,7 +341,149 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
30
);
Thread
.
Sleep
(
30
);
}
}
}
}
#
region
获取
rfid
缓存功能
internal
ConcurrentQueue
<
RFIDBuff
>
RfidBuff
=
new
ConcurrentQueue
<
RFIDBuff
>();
internal
bool
pauseReadRfid
=
true
;
//internal Thread readBuffRfidThread;
internal
System
.
Timers
.
Timer
readBuffRfidTimer
;
internal
void
StartReadRfid
()
{
pauseReadRfid
=
false
;
}
internal
void
StopReadRfid
()
{
pauseReadRfid
=
true
;
}
internal
bool
UpdateTrayNumFromBuff
()
{
trayCount
++;
//此处先对托盘号进行验证
preTrayNum
=
currTrayNum
;
if
(!
TrayManager
.
HasCheck1
(
DeviceID
))
{
currTrayNum
=
TrayManager
.
Move5TrayNum
;
LogUtil
.
LOGGER
.
Info
(
Name
+
" ["
+
trayCount
+
"] IP ["
+
RFIDManager
.
GetRFIP
(
DeviceID
)
+
"] ["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"] 使用横移分流2缓存托盘号 Move5TrayNum "
);
}
else
{
currTrayNum
=
GetTrayBuffNum
(
DeviceID
);
LogUtil
.
LOGGER
.
Info
(
Name
+
" ["
+
trayCount
+
"] IP ["
+
RFIDManager
.
GetRFIP
(
DeviceID
)
+
"] ["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"]"
);
if
(
preTrayNum
.
Equals
(
currTrayNum
)
&&
currTrayNum
>
0
)
{
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" "
+
Name
+
"托盘号出现错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],连续两个托盘号一样"
;
LogUtil
.
error
(
Name
+
"托盘号错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],连续两个托盘号一样"
);
}
else
if
(!
TrayManager
.
CheckIsRightNum
(
currTrayNum
,
preTrayNum
))
{
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" "
+
Name
+
"托盘号出现错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],托盘号不连续"
;
LogUtil
.
error
(
Name
+
"托盘号错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],托盘号不连续"
);
}
}
return
true
;
}
object
locReadRfid
=
new
object
();
internal
void
ReadRfidBuff
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
Monitor
.
TryEnter
(
locReadRfid
))
{
string
ip
=
RFIDManager
.
GetRFIP
(
DeviceID
);
try
{
//while (true)
{
if
(
pauseReadRfid
)
{
return
;
}
if
(
RfidBuff
.
Count
>
2
)
{
LogUtil
.
debug
(
$
"[{Name}][{ip}]RFID缓存数量大于2个,强制清除队列缓存:{JsonHelper.SerializeObject(RfidBuff)}"
);
ClearAllBuff
();
}
//获取盘号
RFIDData
data
=
RFIDManager
.
ReadRFID
(
ip
,
true
);
if
(
data
.
Num
==
0
)
return
;
RFIDBuff
rFIDBuff
=
new
RFIDBuff
()
{
FIDData
=
data
};
int
idx
=
RfidBuff
.
ToList
().
FindIndex
(
s
=>
s
.
TrayNum
.
Equals
(
rFIDBuff
.
TrayNum
));
if
(
idx
==
-
1
)
{
RfidBuff
.
Enqueue
(
rFIDBuff
);
LogUtil
.
debug
(
$
"[{Name}][{ip}]RFID加入缓存:{JsonHelper.SerializeObject(rFIDBuff)}"
);
}
Thread
.
Sleep
(
50
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"【{Name}】【{ip}】ReadRfidBuff 出错"
,
ex
);
}
finally
{
Monitor
.
Exit
(
locReadRfid
);
}
}
}
RFIDData
getFirstTrayNum
(
string
ip
)
{
if
(
RfidBuff
!=
null
&&
RfidBuff
.
TryDequeue
(
out
RFIDBuff
rFID
))
{
LogUtil
.
debug
(
$
"[{Name}][{ip}]取第一个RFID:{JsonHelper.SerializeObject(rFID)}"
);
return
rFID
.
FIDData
;
}
else
return
new
RFIDData
();
}
internal
void
ClearAllBuff
()
{
if
(
RfidBuff
.
Count
>
0
)
{
RfidBuff
=
new
ConcurrentQueue
<
RFIDBuff
>();
LogUtil
.
debug
(
$
"[{Name}]清除所有RFID缓存"
);
}
}
int
DefaultTrayNum
=
RFIDManager
.
DefaultTrayNum
;
private
int
GetTrayBuffNum
(
int
subType
)
{
if
(
DefaultTrayNum
>
0
)
{
return
DefaultTrayNum
;
}
if
(
subType
.
Equals
(
104
))
{
return
LineManager
.
Line
.
Sw23TrayNum
;
}
else
if
(
subType
.
Equals
(
101
))
{
return
LineManager
.
Line
.
Sw41TrayNum
;
}
string
ip
=
RFIDManager
.
GetRFIP
(
subType
);
RFIDData
data
;
data
=
getFirstTrayNum
(
ip
);
if
(
data
!=
null
)
{
if
(
data
.
RFType
.
Equals
(
'E'
))
{
return
data
.
Num
;
}
else
if
(
data
.
RFType
>
0
)
{
LogUtil
.
error
(
"RFID [ "
+
ip
+
" ] 读到数据 "
+
data
.
NumStr
()
+
" 返回盘号 0"
);
}
else
{
LogUtil
.
debug
(
"RFID [ "
+
ip
+
" ] 读到数据 "
+
data
.
NumStr
()
+
" 返回盘号 0"
);
}
return
0
;
}
return
0
;
}
#
endregion
internal
bool
UpdateTrayNum
()
internal
bool
UpdateTrayNum
()
{
{
trayCount
++;
trayCount
++;
...
@@ -388,7 +532,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -388,7 +532,7 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
axis
.
Config
.
BreakOnDO
,
IO_VALUE
.
HIGH
);
IOMove
(
axis
.
Config
.
BreakOnDO
,
IO_VALUE
.
HIGH
);
return
true
;
return
true
;
}
}
SetWarnMsg
(
Name
+
msg
,
axis
.
Config
.
DisplayStr
+
"_轴报警"
);
SetWarnMsg
(
Name
+
msg
,
axis
.
Config
.
DisplayStr
+
"_轴报警"
);
//WarnMsg = DateTime.Now.ToLongTimeString() + " " + Name + msg;
//WarnMsg = DateTime.Now.ToLongTimeString() + " " + Name + msg;
Alarm
(
LineAlarmType
.
AxisAlarm
);
Alarm
(
LineAlarmType
.
AxisAlarm
);
return
false
;
return
false
;
...
@@ -431,9 +575,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -431,9 +575,9 @@ namespace OnlineStore.DeviceLibrary
}
}
foreach
(
WaitResultInfo
wait
in
list
)
foreach
(
WaitResultInfo
wait
in
list
)
{
{
if
(
wait
==
null
)
if
(
wait
==
null
)
{
{
LogUtil
.
error
(
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] wait == null 跳过此项等待"
);
LogUtil
.
error
(
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] wait == null 跳过此项等待"
);
continue
;
continue
;
}
}
if
(
wait
.
IsEnd
)
if
(
wait
.
IsEnd
)
...
@@ -468,7 +612,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -468,7 +612,7 @@ namespace OnlineStore.DeviceLibrary
{
{
isOk
=
false
;
isOk
=
false
;
string
type
=
moveInfo
.
GetStepDes
()
+
"_轴运动报警"
;
string
type
=
moveInfo
.
GetStepDes
()
+
"_轴运动报警"
;
SetWarnMsg
(
msg
,
type
,
moveInfo
);
SetWarnMsg
(
msg
,
type
,
moveInfo
);
Alarm
(
LineAlarmType
.
AxisMoveError
);
Alarm
(
LineAlarmType
.
AxisMoveError
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
AxisMoveError
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
AxisMoveError
);
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
14
);
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
14
);
...
@@ -493,10 +637,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -493,10 +637,10 @@ namespace OnlineStore.DeviceLibrary
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
alarmType
<=
LineAlarmType
.
IoSingleTimeOut
)
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
alarmType
<=
LineAlarmType
.
IoSingleTimeOut
)
{
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
string
msg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒"
;
string
msg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒"
;
string
type
=
moveInfo
.
GetStepDes
()
+
"_"
+
"超时报警"
;
string
type
=
moveInfo
.
GetStepDes
()
+
"_"
+
"超时报警"
;
SetWarnMsg
(
msg
,
type
,
moveInfo
);
SetWarnMsg
(
msg
,
type
,
moveInfo
);
//WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
//WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
//LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID * 1000 + 13);
//LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID * 1000 + 13);
if
(
NoAlarm
())
if
(
NoAlarm
())
...
@@ -548,7 +692,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -548,7 +692,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W009_BoxCanInstore
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W009_BoxCanInstore
))
{
{
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
,
out
NotOkMsg
);
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
,
out
NotOkMsg
);
}
}
else
else
{
{
...
@@ -588,20 +732,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -588,20 +732,21 @@ namespace OnlineStore.DeviceLibrary
{
{
second
=
30
;
second
=
30
;
}
}
second
=
(
int
)(
span
.
TotalSeconds
/
moveInfo
.
TimeOutSeconds
)
*
10
;
second
=
(
int
)(
span
.
TotalSeconds
/
moveInfo
.
TimeOutSeconds
)
*
10
;
if
(
second
>
120
)
if
(
second
>
120
)
{
{
second
=
120
;
second
=
120
;
}
else
if
(
second
<
10
)
}
else
if
(
second
<
10
)
{
{
second
=
10
;
second
=
10
;
}
}
//WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
//WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 15, second);
//LogUtil.error(WarnMsg, DeviceID * 1000 + 15, second);
string
msg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
string
msg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
string
type
=
moveInfo
.
GetStepDes
()
+
"_"
+
"超时报警"
;
string
type
=
moveInfo
.
GetStepDes
()
+
"_"
+
"超时报警"
;
SetWarnMsg
(
msg
,
type
,
moveInfo
,
second
);
SetWarnMsg
(
msg
,
type
,
moveInfo
,
second
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
IoSingleTimeOut
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
IoSingleTimeOut
);
}
}
...
@@ -721,8 +866,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -721,8 +866,8 @@ namespace OnlineStore.DeviceLibrary
msg
+=
"runS: "
+
runStatus
+
"\n"
;
msg
+=
"runS: "
+
runStatus
+
"\n"
;
msg
+=
"lineS: "
+
lineStatus
+
"\n"
;
msg
+=
"lineS: "
+
lineStatus
+
"\n"
;
msg
+=
"alarm: "
+
alarmType
+
" "
+
LastAlarmTime
.
ToLongTimeString
()
+
"\n"
;
msg
+=
"alarm: "
+
alarmType
+
" "
+
LastAlarmTime
.
ToLongTimeString
()
+
"\n"
;
msg
+=
"MoveT:"
+
MoveInfo
.
MoveType
+
"\n"
;
msg
+=
"MoveT:"
+
MoveInfo
.
MoveType
+
"\n"
;
msg
+=
"MoveS :"
+
MoveInfo
.
SLog
+
"\n"
;
msg
+=
"MoveS :"
+
MoveInfo
.
SLog
+
"\n"
;
msg
+=
"SMoveT:"
+
SecondMoveInfo
.
MoveType
+
"\n"
;
msg
+=
"SMoveT:"
+
SecondMoveInfo
.
MoveType
+
"\n"
;
msg
+=
"SMoveS:"
+
SecondMoveInfo
.
MoveStep
+
""
;
msg
+=
"SMoveS:"
+
SecondMoveInfo
.
MoveStep
+
""
;
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
7bbe83b
...
@@ -205,7 +205,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -205,7 +205,7 @@ namespace OnlineStore.DeviceLibrary
if
(
Config
.
SidesWayNum
<=
0
)
if
(
Config
.
SidesWayNum
<=
0
)
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_Stop2Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_Stop2Down
);
CheckLog
(
"托盘检测:"
+
SecondMoveInfo
.
SLog
+
"阻挡1上升,等待FL_TrayCheck=1
,最多等待30秒"
);
CheckLog
(
"托盘检测:"
+
SecondMoveInfo
.
SLog
+
"阻挡1上升,等待FL_TrayCheck=1
"
);
//,最多等待30秒
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
FL_TrayCheck
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
FL_TrayCheck
,
IO_VALUE
.
HIGH
));
//SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000));
//SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000));
//SecondMoveInfo.OneWaitCanEndStep = true;
//SecondMoveInfo.OneWaitCanEndStep = true;
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
7bbe83b
...
@@ -292,7 +292,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -292,7 +292,7 @@ namespace OnlineStore.DeviceLibrary
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
if
(!
DisableShunt2
)
if
(!
DisableShunt2
)
{
{
IOMove
(
IO_Type
.
Shunt2_StopDown1_Front
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Shunt2_StopDown1_Front
,
IO_VALUE
.
LOW
);
}
}
}
}
if
(
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
if
(
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
...
@@ -464,7 +464,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -464,7 +464,7 @@ namespace OnlineStore.DeviceLibrary
{
{
IoCheckTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
serverConTimer
.
Enabled
=
false
;
serverConTimer
.
Enabled
=
false
;
AgvClient
.
SetCancelState
(
true
);
AgvClient
.
SetCancelState
(
true
);
RFIDManager
.
Close
();
RFIDManager
.
Close
();
//停止运行时,把阻挡气缸上升
//停止运行时,把阻挡气缸上升
...
@@ -538,7 +538,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -538,7 +538,7 @@ namespace OnlineStore.DeviceLibrary
Shunt2Stop
();
Shunt2Stop
();
foreach
(
EquipBase
equip
in
this
.
AllEquipMap
.
Values
)
foreach
(
EquipBase
equip
in
this
.
AllEquipMap
.
Values
)
{
{
if
(
equip
.
runStatus
>
LineRunStatus
.
Wait
)
if
(
equip
.
runStatus
>
LineRunStatus
.
Wait
)
{
{
equip
.
Alarm
(
alarmType
);
equip
.
Alarm
(
alarmType
);
}
}
...
@@ -589,11 +589,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -589,11 +589,11 @@ namespace OnlineStore.DeviceLibrary
{
{
yellowShanShuo
=
true
;
yellowShanShuo
=
true
;
}
}
if
(
isInSuddenDown
||
isNoAirCheck
||
alarmType
>
LineAlarmType
.
AxisAlarm
)
if
(
isInSuddenDown
||
isNoAirCheck
||
alarmType
>
LineAlarmType
.
AxisAlarm
)
{
{
isNeedAlarmLed
=
true
;
isNeedAlarmLed
=
true
;
}
}
else
if
(
alarmType
.
Equals
(
LineAlarmType
.
None
).
Equals
(
false
)||
TrayManager
.
TrayErrorMsg
!=
""
)
else
if
(
alarmType
.
Equals
(
LineAlarmType
.
None
).
Equals
(
false
)
||
TrayManager
.
TrayErrorMsg
!=
""
)
{
{
yellowShanShuo
=
true
;
yellowShanShuo
=
true
;
}
}
...
@@ -723,7 +723,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -723,7 +723,7 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
SetWarnMsg
(
"收到急停信号,报警急停"
,
"急停报警"
);
SetWarnMsg
(
"收到急停信号,报警急停"
,
"急停报警"
);
Alarm
(
LineAlarmType
.
SuddenStop
);
Alarm
(
LineAlarmType
.
SuddenStop
);
}
}
//});
//});
...
@@ -758,8 +758,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -758,8 +758,6 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
protected
override
void
mainTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
protected
override
void
mainTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
{
if
(
Monitor
.
TryEnter
(
lockMainTimer
))
{
try
try
{
{
DateTime
time
=
DateTime
.
Now
;
DateTime
time
=
DateTime
.
Now
;
...
@@ -809,15 +807,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -809,15 +807,11 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
error
(
Name
+
"主定时器出错:"
,
ex
);
LogUtil
.
error
(
Name
+
"主定时器出错:"
,
ex
);
}
}
finally
{
Monitor
.
Exit
(
lockMainTimer
);
}
Thread
.
Sleep
(
1
);
Thread
.
Sleep
(
1
);
}
}
}
private
bool
busyPro
=
false
;
private
bool
busyPro
=
false
;
private
DateTime
busyProTime
=
DateTime
.
Now
;
private
DateTime
busyProTime
=
DateTime
.
Now
;
private
int
maxSeconds
=
3
;
private
int
maxSeconds
=
3
;
private
void
LineTimerPro
()
private
void
LineTimerPro
()
...
@@ -877,10 +871,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -877,10 +871,10 @@ namespace OnlineStore.DeviceLibrary
{
{
if
((
DateTime
.
Now
-
lastAirCloseTime
).
TotalSeconds
>
Config
.
AirCheckSeconds
)
if
((
DateTime
.
Now
-
lastAirCloseTime
).
TotalSeconds
>
Config
.
AirCheckSeconds
)
{
{
SetWarnMsg
(
"持续"
+
Config
.
AirCheckSeconds
+
"秒未检测到气压信号"
,
"未检测到气压信号"
);
SetWarnMsg
(
"持续"
+
Config
.
AirCheckSeconds
+
"秒未检测到气压信号"
,
"未检测到气压信号"
);
//SendAlarmCode(0, LineAlarm.NoAirCheck);
//SendAlarmCode(0, LineAlarm.NoAirCheck);
airValue
=
IO_VALUE
.
LOW
;
airValue
=
IO_VALUE
.
LOW
;
Alarm
(
LineAlarmType
.
NoAirCheck
);
Alarm
(
LineAlarmType
.
NoAirCheck
);
}
}
}
}
else
else
...
@@ -923,15 +917,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -923,15 +917,16 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"IsReviceInPosId【"
+
posId
+
"】出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"IsReviceInPosId【"
+
posId
+
"】出错:"
+
ex
.
ToString
());
}
}
return
isReviceInfo
;
return
isReviceInfo
;
}
}
#
endregion
#
endregion
internal
override
void
StopMove
(
)
internal
override
void
StopMove
()
{
{
foreach
(
EquipBase
equip
in
this
.
AllEquipMap
.
Values
)
foreach
(
EquipBase
equip
in
this
.
AllEquipMap
.
Values
)
...
@@ -1043,7 +1038,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1043,7 +1038,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
span
.
TotalSeconds
>
120
)
else
if
(
span
.
TotalSeconds
>
120
)
{
{
string
wMsg
=
Name
+
"["
+
MoveInfo
.
MoveStep
+
"]["
+
msg
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
string
wMsg
=
Name
+
"["
+
MoveInfo
.
MoveStep
+
"]["
+
msg
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
SetWarnMsg
(
wMsg
,
$
"{msg}超时"
,
MoveInfo
);
SetWarnMsg
(
wMsg
,
$
"{msg}超时"
,
MoveInfo
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
}
}
...
@@ -1059,11 +1054,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1059,11 +1054,11 @@ namespace OnlineStore.DeviceLibrary
msg
+=
" "
+
lineStatus
+
"\n"
;
msg
+=
" "
+
lineStatus
+
"\n"
;
msg
+=
"alarm: "
+
alarmType
+
"\n"
;
msg
+=
"alarm: "
+
alarmType
+
"\n"
;
msg
+=
"Move:"
+
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
SLog
+
"\n"
;
msg
+=
"Move:"
+
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
SLog
+
"\n"
;
msg
+=
"横移41托盘:"
+
Sw41TrayNum
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
SW41_MoveInfo
.
MoveType
+
" "
+
SW41_MoveInfo
.
MoveStep
+
"\n"
;
msg
+=
"横移41托盘:"
+
Sw41TrayNum
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
SW41_MoveInfo
.
MoveType
+
" "
+
SW41_MoveInfo
.
MoveStep
+
"\n"
;
msg
+=
"横移23托盘:"
+
Sw23TrayNum
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
SW23_MoveInfo
.
MoveType
+
" "
+
SW23_MoveInfo
.
MoveStep
+
"\n"
;
msg
+=
"横移23托盘:"
+
Sw23TrayNum
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
SW23_MoveInfo
.
MoveType
+
" "
+
SW23_MoveInfo
.
MoveStep
+
"\n"
;
//msg += "分流1托盘: " + ShuntTrayNum + " (" + ShuntWaitTrayNum + ")\n";
//msg += "分流1托盘: " + ShuntTrayNum + " (" + ShuntWaitTrayNum + ")\n";
msg
+=
"分流1: "
+
Shunt_MoveInfo
.
MoveType
+
" "
+
Shunt_MoveInfo
.
MoveStep
+
" "
+
ShuntTrayNum
+
" ("
+
ShuntWaitTrayNum
+
") "
+
"\n"
;
msg
+=
"分流1: "
+
Shunt_MoveInfo
.
MoveType
+
" "
+
Shunt_MoveInfo
.
MoveStep
+
" "
+
ShuntTrayNum
+
" ("
+
ShuntWaitTrayNum
+
") "
+
"\n"
;
//msg += "分流2托盘: " + Shunt2TrayNum + " (" + Shunt2WaitTrayNum + ")\n";
//msg += "分流2托盘: " + Shunt2TrayNum + " (" + Shunt2WaitTrayNum + ")\n";
msg
+=
"分流2: "
+
Shunt2_MoveInfo
.
MoveType
+
" "
+
Shunt2_MoveInfo
.
MoveStep
+
" "
+
Shunt2TrayNum
+
"\n"
;
msg
+=
"分流2: "
+
Shunt2_MoveInfo
.
MoveType
+
" "
+
Shunt2_MoveInfo
.
MoveStep
+
" "
+
Shunt2TrayNum
+
"\n"
;
...
@@ -1116,7 +1111,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1116,7 +1111,7 @@ namespace OnlineStore.DeviceLibrary
}
}
if
(
String
.
IsNullOrEmpty
(
IOErrorMsg
).
Equals
(
false
))
if
(
String
.
IsNullOrEmpty
(
IOErrorMsg
).
Equals
(
false
))
{
{
alarmList
.
Add
(
new
AlarmMsg
(
Name
,
"line.IO"
,
IOErrorMsg
));
alarmList
.
Add
(
new
AlarmMsg
(
Name
,
"line.IO"
,
IOErrorMsg
));
}
}
//int num = TrayDisableManager.GetDisableList().Count;
//int num = TrayDisableManager.GetDisableList().Count;
...
@@ -1130,7 +1125,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1130,7 +1125,7 @@ namespace OnlineStore.DeviceLibrary
//}
//}
foreach
(
EquipBase
equip
in
AllEquipMap
.
Values
)
foreach
(
EquipBase
equip
in
AllEquipMap
.
Values
)
{
{
if
(
equip
.
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
equip
.
WarnMsg
.
Contains
(
"获取库位号超时"
)||
if
(
equip
.
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
equip
.
WarnMsg
.
Contains
(
"获取库位号超时"
)
||
equip
.
alarmType
.
Equals
(
LineAlarmType
.
IoSingleTimeOut
))
equip
.
alarmType
.
Equals
(
LineAlarmType
.
IoSingleTimeOut
))
{
{
continue
;
continue
;
...
@@ -1160,7 +1155,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1160,7 +1155,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
MoveEquipMap
[
deviceId
];
return
MoveEquipMap
[
deviceId
];
}
}
foreach
(
MoveEquip
m
in
MoveEquipMap
.
Values
)
foreach
(
MoveEquip
m
in
MoveEquipMap
.
Values
)
{
{
if
(
m
.
StoreID
.
Equals
(
deviceId
))
if
(
m
.
StoreID
.
Equals
(
deviceId
))
{
{
...
...
source/DeviceLibrary/assemblyLine/LineBean_Shunt.cs
查看文件 @
7bbe83b
...
@@ -107,10 +107,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,10 +107,12 @@ namespace OnlineStore.DeviceLibrary
{
{
ShuntTrayNum
=
ShuntWaitTrayNum
;
ShuntTrayNum
=
ShuntWaitTrayNum
;
ShuntWaitTrayNum
=
-
1
;
ShuntWaitTrayNum
=
-
1
;
LogUtil
.
debug
(
$
"UpateShuntTrayNum:ShuntTrayNum={ShuntTrayNum},ShuntWaitTrayNum=-1"
);
}
}
public
void
ShuntStop
()
public
void
ShuntStop
()
{
{
ShuntWaitTrayNum
=
-
1
;
ShuntWaitTrayNum
=
-
1
;
LogUtil
.
debug
(
$
"ShuntWaitTrayNum=-1"
);
ShuntCheck1Watch
.
Stop
();
ShuntCheck1Watch
.
Stop
();
shuntCheck4Watch
.
Stop
();
shuntCheck4Watch
.
Stop
();
...
@@ -249,18 +251,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -249,18 +251,22 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
Shunt_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
Shunt04_Stop1Down
);
Shunt_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
Shunt04_Stop1Down
);
LogUtil
.
info
(
Name
+
"["
+
ShuntTrayNum
+
"]"
+
"分流横移: 不需要分流,直接放行,Shunt_StopDown1_Front 下降1200 "
);
LogUtil
.
info
(
Name
+
"["
+
ShuntTrayNum
+
"]"
+
"分流横移: 不需要分流,直接放行,Shunt_StopDown1_Front "
);
IOMove
(
IO_Type
.
Shunt_StopDown1_Front
,
IO_VALUE
.
HIGH
,
1200
);
IOMove
(
IO_Type
.
Shunt_StopDown1_Front
,
IO_VALUE
.
HIGH
);
//1200
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Shunt_StopDown1_Front
,
IO_VALUE
.
HIGH
));
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Shunt_Check1_Front
,
IO_VALUE
.
LOW
));
}
}
}
}
else
if
(
Shunt_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
Shunt04_Stop1Down
))
else
if
(
Shunt_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
Shunt04_Stop1Down
))
{
{
Shunt_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
Shunt05_WaitCheck1Low
);
Shunt_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
Shunt05_WaitCheck1Low
);
ShuntLog
(
"分流横移: 不需要分流,等待检测1信号消失 "
);
ShuntLog
(
"分流横移: 不需要分流,等待检测1信号消失300ms "
);
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Shunt_Check1_Front
,
IO_VALUE
.
LOW
));
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Shunt_Check1_Front
,
IO_VALUE
.
LOW
));
}
}
else
if
(
Shunt_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
Shunt05_WaitCheck1Low
))
else
if
(
Shunt_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
Shunt05_WaitCheck1Low
))
{
{
IOMove
(
IO_Type
.
Shunt_StopDown1_Front
,
IO_VALUE
.
LOW
);
Shunt_MoveInfo
.
EndMove
();
Shunt_MoveInfo
.
EndMove
();
ShuntLog
(
"分流横移: 已离开 "
);
ShuntLog
(
"分流横移: 已离开 "
);
}
}
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
7bbe83b
...
@@ -61,6 +61,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -61,6 +61,11 @@ namespace OnlineStore.DeviceLibrary
ClampNeedCheck
=
config
.
DIList
.
ContainsKey
(
IO_Type
.
ClampCylinder_Check
);
ClampNeedCheck
=
config
.
DIList
.
ContainsKey
(
IO_Type
.
ClampCylinder_Check
);
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
,
Name
);
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
,
Name
);
readBuffRfidTimer
=
new
System
.
Timers
.
Timer
();
readBuffRfidTimer
.
Enabled
=
false
;
readBuffRfidTimer
.
Interval
=
300
;
readBuffRfidTimer
.
Elapsed
+=
ReadRfidBuff
;
readBuffRfidTimer
.
AutoReset
=
true
;
}
}
public
override
bool
StartRun
(
bool
isDebug
=
false
)
public
override
bool
StartRun
(
bool
isDebug
=
false
)
...
@@ -177,6 +182,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -177,6 +182,11 @@ namespace OnlineStore.DeviceLibrary
}
}
private
void
ResetEnd
()
private
void
ResetEnd
()
{
{
//启动rfid监听
//readBuffRfidThread = new Thread(ReadRfidBuff);
//readBuffRfidThread.IsBackground = true;
//readBuffRfidThread.Start();
readBuffRfidTimer
.
Enabled
=
true
;
LogInfo
(
MoveInfo
.
MoveType
+
" 完成!"
);
LogInfo
(
MoveInfo
.
MoveType
+
" 完成!"
);
runStatus
=
LineRunStatus
.
Runing
;
runStatus
=
LineRunStatus
.
Runing
;
MoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
...
@@ -232,6 +242,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -232,6 +242,7 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove
(
IO_Type
.
ClampCylinder_Slack
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
ClampCylinder_Slack
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
ClampCylinder_Tighten
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
ClampCylinder_Tighten
,
IO_VALUE
.
LOW
);
runStatus
=
LineRunStatus
.
Wait
;
runStatus
=
LineRunStatus
.
Wait
;
readBuffRfidTimer
.
Enabled
=
false
;
}
}
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
7bbe83b
...
@@ -84,7 +84,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -84,7 +84,7 @@ namespace OnlineStore.DeviceLibrary
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_52_CylinderDown
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_52_CylinderDown
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 上下气缸下降 "
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 上下气缸下降 "
);
UpdownDownP3Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
UpdownDownP3Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
}
}
else
else
...
@@ -342,10 +342,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -342,10 +342,10 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(!
UseAxis
)
if
(!
UseAxis
)
{
{
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_03_CylinderDown
)
&&
MoveInfo
.
IsTimeOut
(
20
))
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_03_CylinderDown
)
&&
MoveInfo
.
IsTimeOut
(
20
))
{
{
//顶升气缸上升到位,升降气缸下降不到位
//顶升气缸上升到位,升降气缸下降不到位
if
(
CylinderIsOk
(
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
)
&&
if
(
CylinderIsOk
(
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
)
&&
IOValue
(
IO_Type
.
UpDownCylinder_Up
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
UpDownCylinder_Up
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
UpDownCylinder_Down
).
Equals
(
IO_VALUE
.
LOW
))
IOValue
(
IO_Type
.
UpDownCylinder_Down
).
Equals
(
IO_VALUE
.
LOW
))
{
{
...
@@ -384,7 +384,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -384,7 +384,7 @@ namespace OnlineStore.DeviceLibrary
IOValue
(
IO_Type
.
TrayCheck
).
Equals
(
IO_VALUE
.
LOW
))
IOValue
(
IO_Type
.
TrayCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
{
ConfigIO
io
=
Config
.
getWaitIO
(
IO_Type
.
TrayCheck
);
ConfigIO
io
=
Config
.
getWaitIO
(
IO_Type
.
TrayCheck
);
if
(
io
!=
null
)
if
(
io
!=
null
)
{
{
LogInfo
(
"当前托盘上的料盘检测信号["
+
io
.
ConfigStr
+
"]的值:"
+
IOValue
(
IO_Type
.
TrayCheck
));
LogInfo
(
"当前托盘上的料盘检测信号["
+
io
.
ConfigStr
+
"]的值:"
+
IOValue
(
IO_Type
.
TrayCheck
));
}
}
...
@@ -528,7 +528,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -528,7 +528,7 @@ namespace OnlineStore.DeviceLibrary
if
(
sendCount
>=
3
)
if
(
sendCount
>=
3
)
{
{
SetWarnMsg
(
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
" 等待BOX开始入库超时 已发送"
+
sendCount
+
"次"
,
"等待BOX开始入库超时"
);
SetWarnMsg
(
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
" 等待BOX开始入库超时 已发送"
+
sendCount
+
"次"
,
"等待BOX开始入库超时"
);
//LogUtil.error(WarnMsg);
//LogUtil.error(WarnMsg);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
...
@@ -641,7 +641,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -641,7 +641,7 @@ namespace OnlineStore.DeviceLibrary
if
(
isFull
.
Equals
(
false
))
if
(
isFull
.
Equals
(
false
))
{
{
//顶升上升时才判断
//顶升上升时才判断
if
(
CylinderIsOk
(
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
)
&&
if
(
CylinderIsOk
(
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
)
&&
LineManager
.
useTrayCheck
.
Contains
(
DeviceID
)
&&
LineManager
.
useTrayCheck
.
Contains
(
DeviceID
)
&&
IOValue
(
IO_Type
.
TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
IOValue
(
IO_Type
.
TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
...
@@ -724,7 +724,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -724,7 +724,7 @@ namespace OnlineStore.DeviceLibrary
}
}
if
(
reIndex
>=
0
)
if
(
reIndex
>=
0
)
{
{
if
(
CylinderIsOk
(
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
)
&&
if
(
CylinderIsOk
(
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
)
&&
LineManager
.
useTrayCheck
.
Contains
(
DeviceID
)
&&
LineManager
.
useTrayCheck
.
Contains
(
DeviceID
)
&&
IOValue
(
IO_Type
.
TrayCheck
).
Equals
(
IO_VALUE
.
LOW
))
IOValue
(
IO_Type
.
TrayCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
{
...
@@ -756,7 +756,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -756,7 +756,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
Name
+
"托盘号【"
+
currTrayNum
+
"】入库信息【"
+
currCode
.
ToStr
()
+
"】料仓未验证成功,不拦截托盘,更新此托盘为NG,从waitInStoreList中删除,取消入库任务"
);
LogUtil
.
error
(
Name
+
"托盘号【"
+
currTrayNum
+
"】入库信息【"
+
currCode
.
ToStr
()
+
"】料仓未验证成功,不拦截托盘,更新此托盘为NG,从waitInStoreList中删除,取消入库任务"
);
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
,
"Box验证入库失败"
);
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
,
"Box验证入库失败"
);
waitInStoreList
.
RemoveAt
(
reIndex
);
waitInStoreList
.
RemoveAt
(
reIndex
);
SServerManager
.
cancelPutInTask
(
Name
,
currCode
.
WareCode
,
true
);
SServerManager
.
cancelPutInTask
(
Name
,
currCode
.
WareCode
,
true
);
return
false
;
return
false
;
}
}
...
@@ -791,7 +791,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -791,7 +791,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo
(
"*******"
+
logName
+
",清理入库任务:【"
+
param
.
ToStr
()
+
"】"
);
LogInfo
(
"*******"
+
logName
+
",清理入库任务:【"
+
param
.
ToStr
()
+
"】"
);
if
(
IsCancel
)
if
(
IsCancel
)
{
{
SServerManager
.
cancelPutInTask
(
Name
,
param
.
WareCode
,
false
);
SServerManager
.
cancelPutInTask
(
Name
,
param
.
WareCode
,
false
);
}
}
return
true
;
return
true
;
}
}
...
@@ -847,7 +847,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -847,7 +847,7 @@ namespace OnlineStore.DeviceLibrary
{
{
bool
check2IsOk
=
TrayManager
.
checkWatch
(
trayCheck2LowWait
,
TrayManager
.
SwTrayWaitTime
,
false
);
bool
check2IsOk
=
TrayManager
.
checkWatch
(
trayCheck2LowWait
,
TrayManager
.
SwTrayWaitTime
,
false
);
if
(
IOValue
(
IO_Type
.
StopCylinder_Check1
).
Equals
(
IO_VALUE
.
HIGH
)&&
TrayManager
.
HasCheck1
(
DeviceID
))
if
(
IOValue
(
IO_Type
.
StopCylinder_Check1
).
Equals
(
IO_VALUE
.
HIGH
)
&&
TrayManager
.
HasCheck1
(
DeviceID
))
{
{
if
(
TrayManager
.
checkWatch
(
trayCheckWait
,
TrayManager
.
SwTrayWaitTime
,
false
)
&&
check2IsOk
&&
canpro
)
if
(
TrayManager
.
checkWatch
(
trayCheckWait
,
TrayManager
.
SwTrayWaitTime
,
false
)
&&
check2IsOk
&&
canpro
)
{
{
...
@@ -856,12 +856,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -856,12 +856,14 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处
//托盘在第一个阻挡处
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_00_Stop1Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_00_Stop1Down
);
CheckLog
(
" 托盘检测:料盘检测StopCylinder_Check1 "
+
SecondMoveInfo
.
SLog
+
"阻挡气缸1-1下降 , 等待 StopCylinder_Check1=0,清理托盘RFID"
);
ClearTrayRFID
();
ClearTrayRFID
();
ClearAllBuff
();
StartReadRfid
();
CheckLog
(
" 托盘检测:料盘检测StopCylinder_Check1 "
+
SecondMoveInfo
.
SLog
+
"阻挡气缸1-1下降 , 等待 StopCylinder_Check1=0,清理托盘RFID,开始记录rfid缓存"
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
//TrayManager.StopDTime
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
//TrayManager.StopDTime
SecondMoveInfo
.
OneWaitCanEndStep
=
true
;
SecondMoveInfo
.
OneWaitCanEndStep
=
true
;
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Check1
,
IO_VALUE
.
LOW
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Check1
,
IO_VALUE
.
LOW
));
//
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Check2
,
IO_VALUE
.
HIGH
));
//SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000));
//SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000));
}
}
}
}
...
@@ -911,14 +913,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -911,14 +913,14 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopDownWait
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopDownWait
);
//CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 再次等待前阻挡检测消失或托盘到达
");
CheckLog
(
"托盘阻挡"
+
SecondMoveInfo
.
SLog
+
" 再次等待前阻挡检测消失
"
);
CheckLog
(
"托盘阻挡"
+
SecondMoveInfo
.
SLog
+
" 3
00ms后StopCylinder_Check1上升"
);
//CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 1
00ms后StopCylinder_Check1上升");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
);
// SecondMoveInfo.OneWaitCanEndStep = true;
// SecondMoveInfo.OneWaitCanEndStep = true;
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check1, IO_VALUE.LOW));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check1, IO_VALUE.LOW));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3
00
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1
00
));
}
}
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_01_StopDownWait
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_01_StopDownWait
))
...
@@ -953,9 +955,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -953,9 +955,18 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
try
{
StopReadRfid
();
LogUtil
.
info
(
$
"【{Name}】停止记录rfid缓存"
);
}
catch
(
Exception
ex1
)
{
LogUtil
.
error
(
$
"【{Name}】停止记录rfid缓存:"
,
ex1
);
}
//判断是否需要顶升
//判断是否需要顶升
bool
isNeed
=
false
;
bool
isNeed
=
false
;
UpdateTrayNum
();
UpdateTrayNum
FromBuff
();
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
{
...
@@ -1153,18 +1164,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1153,18 +1164,10 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_19_StopCylinder_Back
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_19_StopCylinder_Back
))
{
{
if
(
RFIDManager
.
CheckHasSecond
(
DeviceID
))
{
CheckLog
(
"连续托盘流入处理,仓门口还有一个托盘需要放行"
);
MIO_02_FixtureCheck
();
}
else
{
CheckLog
(
"托盘放行 SecondMove:(托盘放行结束) "
);
CheckLog
(
"托盘放行 SecondMove:(托盘放行结束) "
);
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
}
}
}
#
endregion
#
endregion
}
}
private
void
MIO_02_FixtureCheck
()
private
void
MIO_02_FixtureCheck
()
...
@@ -1204,7 +1207,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1204,7 +1207,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
SecondMoveInfo
.
IsTimeOut
(
120
))
else
if
(
SecondMoveInfo
.
IsTimeOut
(
120
))
{
{
MoveTimeoutAlarm
(
SecondMoveInfo
,
"等待分流横移1空闲
"
);
MoveTimeoutAlarm
(
SecondMoveInfo
,
$
"等待分流横移1空闲【{LineManager.Line.ShuntWaitTrayNum}】
"
);
//WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveType + "][" + SecondMoveInfo.SLog + "]等待分流横移1空闲[" + Math.Round(SecondMoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveType + "][" + SecondMoveInfo.SLog + "]等待分流横移1空闲[" + Math.Round(SecondMoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
//LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
//Alarm(LineAlarmType.IoSingleTimeOut);
//Alarm(LineAlarmType.IoSingleTimeOut);
...
...
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
查看文件 @
7bbe83b
...
@@ -7,6 +7,7 @@ using System.Collections.Concurrent;
...
@@ -7,6 +7,7 @@ using System.Collections.Concurrent;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
...
@@ -14,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -14,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
{
{
public
class
RFIDManager
public
class
RFIDManager
{
{
p
rivate
static
int
DefaultTrayNum
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultTrayNum
);
p
ublic
static
int
DefaultTrayNum
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultTrayNum
);
private
static
ReadAll
readAll
=
new
ReadAll
(
"TheRFID"
);
private
static
ReadAll
readAll
=
new
ReadAll
(
"TheRFID"
);
private
static
bool
IsOpen
=
false
;
private
static
bool
IsOpen
=
false
;
private
static
ConcurrentDictionary
<
string
,
string
>
LastRfidMap
=
new
ConcurrentDictionary
<
string
,
string
>();
private
static
ConcurrentDictionary
<
string
,
string
>
LastRfidMap
=
new
ConcurrentDictionary
<
string
,
string
>();
...
@@ -40,53 +41,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -40,53 +41,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"Open 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"Open 出错:"
+
ex
.
ToString
());
}
}
}
}
public
static
ConcurrentDictionary
<
string
,
ConcurrentQueue
<
RFIDBuff
>>
RfidBuff
=
new
ConcurrentDictionary
<
string
,
ConcurrentQueue
<
RFIDBuff
>>();
static
int
getFirstTrayNum
(
string
ip
,
int
curNum
)
{
RFIDBuff
rFIDBuff
=
new
RFIDBuff
()
{
TrayNum
=
curNum
,
UpdateTime
=
DateTime
.
Now
};
if
(!
RfidBuff
.
ContainsKey
(
ip
))
{
RfidBuff
.
TryAdd
(
ip
,
new
ConcurrentQueue
<
RFIDBuff
>());
RfidBuff
[
ip
].
Enqueue
(
rFIDBuff
);
}
else
{
if
(!
RfidBuff
[
ip
].
Contains
(
rFIDBuff
))
RfidBuff
[
ip
].
Enqueue
(
rFIDBuff
);
}
LogUtil
.
info
(
$
"[{ip}]加入缓存:{JsonHelper.SerializeObject(rFIDBuff)}"
);
if
(
RfidBuff
[
ip
].
TryDequeue
(
out
RFIDBuff
rFID
))
{
LogUtil
.
info
(
$
"[{ip}]取第一个RFID:{JsonHelper.SerializeObject(rFID)}"
);
return
rFID
.
TrayNum
;
}
else
return
0
;
}
static
void
clearTrayNumBuff
(
string
ip
)
{
//if (RfidBuff.ContainsKey(ip))
//{
// if (RfidBuff[ip].Count>0)
// RfidBuff[ip] = new ConcurrentQueue<RFIDBuff>();
//}
//LogUtil.info($"[{ip}]清除RFID缓存");
}
public
static
void
ClearAllBuff
()
{
//RfidBuff = new ConcurrentDictionary<string, ConcurrentQueue<RFIDBuff>>();
//LogUtil.info($"清除所有RFID缓存");
}
public
static
bool
CheckHasSecond
(
int
subType
)
{
//string ip = GetRFIP(subType);
//if (RfidBuff.ContainsKey(ip))
//{
// if (RfidBuff[ip].Count > 0)
// return true;
//}
return
false
;
}
public
static
int
GetTrayNum
(
int
subType
,
bool
isClear
=
false
)
public
static
int
GetTrayNum
(
int
subType
,
bool
isClear
=
false
)
{
{
if
(
DefaultTrayNum
>
0
)
if
(
DefaultTrayNum
>
0
)
...
@@ -109,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -109,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
data
.
RFType
.
Equals
(
'E'
))
if
(
data
.
RFType
.
Equals
(
'E'
))
{
{
return
data
.
Num
;
// return getFirstTrayNum(ip, data.Num);
return
data
.
Num
;
}
}
else
if
(
data
.
RFType
>
0
)
else
if
(
data
.
RFType
>
0
)
{
{
...
@@ -139,7 +93,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -139,7 +93,6 @@ namespace OnlineStore.DeviceLibrary
string
ip
=
GetRFIP
(
subType
);
string
ip
=
GetRFIP
(
subType
);
RFIDData
data
=
ReadRFID
(
ip
,
true
);
RFIDData
data
=
ReadRFID
(
ip
,
true
);
clearTrayNumBuff
(
ip
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -210,16 +163,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -210,16 +163,8 @@ namespace OnlineStore.DeviceLibrary
}
}
public
class
RFIDBuff
public
class
RFIDBuff
{
{
public
int
TrayNum
{
get
;
set
;
}
public
RFIDData
FIDData
{
get
;
set
;
}
public
DateTime
UpdateTime
{
get
;
set
;
}
public
int
TrayNum
{
get
{
return
FIDData
.
Num
;
}
}
public
override
bool
Equals
(
object
obj
)
{
RFIDBuff
buf
=
obj
as
RFIDBuff
;
if
(
buf
==
null
)
return
false
;
return
this
.
TrayNum
.
Equals
(
buf
.
TrayNum
);
}
}
}
public
class
RFIDData
public
class
RFIDData
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论