Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4d231871
由
LN
编写于
2022-11-29 16:41:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
关机功能
1 个父辈
988c40bb
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
360 行增加
和
69 行删除
source/AssemblyLineClient/FrmLineStore.cs
source/AssemblyLineClient/记录.txt
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1_SLStation.cs
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor.cs
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor_Partial.cs
source/DeviceLibrary/assemblyLine/HY/HY_OutLine.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
4d23187
...
@@ -423,6 +423,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -423,6 +423,7 @@ namespace OnlineStore.AssemblyLine
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
{
LogM
();
LogM
();
StopRunProcess
();
UpdateControl
();
UpdateControl
();
string
canScanCode
=
""
;
string
canScanCode
=
""
;
...
@@ -489,6 +490,57 @@ namespace OnlineStore.AssemblyLine
...
@@ -489,6 +490,57 @@ namespace OnlineStore.AssemblyLine
SetMenuS
(
停止
TToolStripMenuItem
,
false
);
SetMenuS
(
停止
TToolStripMenuItem
,
false
);
}
}
}
}
bool
stopRun
=
false
;
bool
stopRequest
=
false
;
DateTime
stopTime
=
new
DateTime
();
private
void
StopRunProcess
()
{
if
(
lineBean
.
runStatus
<=
LineRunStatus
.
Wait
)
{
return
;
}
try
{
if
(
SServerManager
.
stopRun
(
Name
))
{
if
(!
stopRequest
)
{
stopTime
=
DateTime
.
Now
;
stopRequest
=
true
;
//lineBean.WriteDrivetMotorRun(IO_VALUE.LOW);
}
if
(!
stopRun
&&
stopRequest
&&
(
DateTime
.
Now
-
stopTime
).
TotalSeconds
>
40
)
{
stopRun
=
true
;
lineBean
.
LineStopRun
=
true
;
//停止所有料仓TToolStripMenuItem_Click(null, null);
if
(
lineBean
.
LineCanStop
())
{
LogUtil
.
info
(
"收到服务端停机要求,直接停止环形线"
);
lineBean
.
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
}
else
{
LogUtil
.
info
(
"收到服务端停机要求,托盘还有料,等托盘无料30S后再停止环形线"
);
}
}
}
else
{
if
(
stopRun
)
{
lineBean
.
LineStopRun
=
false
;
lineBean
.
WriteDrivetMotorRun
(
IO_VALUE
.
HIGH
);
//启动所有料仓AToolStripMenuItem_Click(null, null);
stopRun
=
false
;
LogUtil
.
info
(
"收到服务端开机要求,启动环形线"
);
}
stopRequest
=
false
;
}
}
catch
{
lineBean
.
WriteDrivetMotorRun
(
IO_VALUE
.
HIGH
);
}
}
private
void
SetMenuS
(
ToolStripMenuItem
toolMenu
,
bool
isEn
)
private
void
SetMenuS
(
ToolStripMenuItem
toolMenu
,
bool
isEn
)
{
{
if
(!
toolMenu
.
Enabled
.
Equals
(
isEn
))
if
(!
toolMenu
.
Enabled
.
Equals
(
isEn
))
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
4d23187
20210511
20221125 :
增加关机功能。
20210511
1.扫码算法更新。
1.扫码算法更新。
2.HY12顶升之后增加延迟。
2.HY12顶升之后增加延迟。
3.取消入库任务增加参数。
3.取消入库任务增加参数。
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
4d23187
...
@@ -361,6 +361,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -361,6 +361,8 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" "
+
Name
+
"托盘号错乱:当前托盘 ["
+
currTrayNum
+
"] 上个托盘["
+
preTrayNum
+
"] ,连续两个托盘号一样"
;
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" "
+
Name
+
"托盘号错乱:当前托盘 ["
+
currTrayNum
+
"] 上个托盘["
+
preTrayNum
+
"] ,连续两个托盘号一样"
;
LogUtil
.
error
(
Name
+
"托盘号错乱:当前托盘 ["
+
currTrayNum
+
"] 上个托盘["
+
preTrayNum
+
"] ,连续两个托盘号一样"
);
LogUtil
.
error
(
Name
+
"托盘号错乱:当前托盘 ["
+
currTrayNum
+
"] 上个托盘["
+
preTrayNum
+
"] ,连续两个托盘号一样"
);
//托盘号一样,返回false
return
false
;
}
}
}
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
4d23187
...
@@ -948,68 +948,75 @@ namespace OnlineStore.DeviceLibrary
...
@@ -948,68 +948,75 @@ namespace OnlineStore.DeviceLibrary
private
Task
ScanCodeTask
=
null
;
private
Task
ScanCodeTask
=
null
;
private
void
FI_18_ScanCode
()
private
void
FI_18_ScanCode
()
{
{
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Giv
e
))
if
(
SServerManager
.
putInEnable
(
Nam
e
))
{
{
if
(
YuScanTask
==
null
||
YuScanTask
.
IsCompleted
)
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
)
)
{
{
ClearTimeoutAlarm
(
"预扫码结束超时"
);
if
(
YuScanTask
==
null
||
YuScanTask
.
IsCompleted
)
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_18_ScanCode
);
{
bool
isScan
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
NeedScanCode
).
Equals
(
1
);
ClearTimeoutAlarm
(
"预扫码结束超时"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_18_ScanCode
);
bool
isScan
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
NeedScanCode
).
Equals
(
1
);
LastCodeList
=
new
List
<
string
>();
LastCodeList
=
new
List
<
string
>();
ScanCodeTask
=
null
;
ScanCodeTask
=
null
;
if
(
NextCodeList
.
Count
>
0
)
if
(
NextCodeList
.
Count
>
0
)
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
LastCodeList
=
new
List
<
string
>(
NextCodeList
);
NextCodeList
=
new
List
<
string
>();
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_21_CylinderTake
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移取料端"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
}
else
if
(
isScan
)
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码"
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitFeedScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
7000
));
try
{
{
ScanCodeTask
=
Task
.
Factory
.
StartNew
(
delegate
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
LastCodeList
=
new
List
<
string
>(
NextCodeList
);
NextCodeList
=
new
List
<
string
>();
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_21_CylinderTake
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移取料端"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
}
else
if
(
isScan
)
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码"
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitFeedScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
7000
));
try
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
ScanCodeTask
=
Task
.
Factory
.
StartNew
(
delegate
bool
hasRightCode
=
CodeManager
.
HasRightCode
(
LastCodeList
.
ToArray
());
if
(!
hasRightCode
)
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
}
bool
hasRightCode
=
CodeManager
.
HasRightCode
(
LastCodeList
.
ToArray
());
return
LastCodeList
;
if
(!
hasRightCode
)
});
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
}
return
LastCodeList
;
});
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
""
+
MoveInfo
.
SLog
+
":扫码出错:"
,
ex
);
}
//finally
//{
// MoveInfo.EndStepWait();
//}
}
}
catch
(
Exception
ex
)
else
{
{
LogUtil
.
error
(
""
+
MoveInfo
.
SLog
+
":扫码出错:"
,
ex
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":不需要扫码"
);
}
}
//finally
//{
// MoveInfo.EndStepWait();
//}
}
}
else
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":不需要扫码
"
);
MoveTimeoutAlarm
(
MoveInfo
,
"预扫码结束超时
"
);
}
}
}
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
else
{
{
MoveTimeoutAlarm
(
MoveInfo
,
"预扫码结束超时"
);
FI_17_CylinderGive
(
);
}
}
}
}
else
else
{
{
FI_17_CylinderGive
(
);
MoveTimeoutAlarm
(
MoveInfo
,
"即将关机,暂停抓取料盘"
);
}
}
}
}
private
void
CheckHasTray
()
private
void
CheckHasTray
()
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
查看文件 @
4d23187
...
@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
stopWatchCheck
();
stopWatchCheck
();
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
{
if
(
LineManager
.
Line
.
CanProcessLine
())
if
(
LineManager
.
Line
.
CanProcessLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
{
CheckFixture
();
CheckFixture
();
}
}
...
@@ -411,11 +411,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -411,11 +411,11 @@ namespace OnlineStore.DeviceLibrary
if
(
IOValue
(
IO_Type
.
HY_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
HY_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
//判断是否需要横移托盘,或者取放料
//判断是否需要横移托盘,或者取放料
UpdateTrayNum
();
UpdateTrayNum
();
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
HY05_TrayCheck
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
HY05_TrayCheck
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
//先判断是否需要到出料线,在判断是否需要横移
//先判断是否需要到出料线,在判断是否需要横移
if
(
TrayNeedToOutLine
(
currTrayNum
))
if
(
TrayNeedToOutLine
(
currTrayNum
))
{
{
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1_SLStation.cs
查看文件 @
4d23187
...
@@ -149,7 +149,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -149,7 +149,7 @@ namespace OnlineStore.DeviceLibrary
//判断流水线打开了才可以运行
//判断流水线打开了才可以运行
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
{
if
(
LineManager
.
Line
.
CanProcessLine
())
if
(
LineManager
.
Line
.
CanProcessLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
{
CheckFixture
();
CheckFixture
();
}
}
...
@@ -185,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -185,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
{
try
try
{
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
{
LogUtil
.
error
(
Name
+
" CheckFixture "
+
" 不在空闲中,直接返回 "
);
LogUtil
.
error
(
Name
+
" CheckFixture "
+
" 不在空闲中,直接返回 "
);
...
@@ -318,7 +318,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -318,7 +318,7 @@ namespace OnlineStore.DeviceLibrary
if
(
IOValue
(
IO_Type
.
HY_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
HY_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
//更新托盘号
//更新托盘号
UpdateTrayNum
();
UpdateTrayNum
();
//判断托盘是否需要横移,或进出料线
//判断托盘是否需要横移,或进出料线
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
HY05_TrayCheck
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
HY05_TrayCheck
);
...
...
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor.cs
查看文件 @
4d23187
...
@@ -179,7 +179,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -179,7 +179,7 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess
();
BusyMoveProcess
();
if
(
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
(!
MoveStop
))
if
(
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
(!
MoveStop
))
{
{
if
(
LineManager
.
Line
.
OutHyCanProLine
())
if
(
LineManager
.
Line
.
OutHyCanProLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
{
CheckFixture
();
CheckFixture
();
}
}
...
...
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor_Partial.cs
查看文件 @
4d23187
...
@@ -208,7 +208,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -208,7 +208,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
SecondMoveInfo
.
IsStep
(
LineMoveStep
.
JHY_07_TopUp
))
else
if
(
SecondMoveInfo
.
IsStep
(
LineMoveStep
.
JHY_07_TopUp
))
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
JHY_08_LocationUp
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
JHY_08_LocationUp
);
CheckLog
(
" 接驳台托盘"
+
SecondMoveInfo
.
SLog
+
":料盘需要横移,定位上升"
);
CheckLog
(
" 接驳台托盘"
+
SecondMoveInfo
.
SLog
+
":料盘需要横移,定位上升"
);
LocationCylinderUp
(
SecondMoveInfo
);
LocationCylinderUp
(
SecondMoveInfo
);
...
...
source/DeviceLibrary/assemblyLine/HY/HY_OutLine.cs
查看文件 @
4d23187
...
@@ -117,7 +117,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -117,7 +117,7 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
{
if
(
LineManager
.
Line
.
OutHyCanProLine
())
if
(
LineManager
.
Line
.
OutHyCanProLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
{
CheckFixture
();
CheckFixture
();
}
}
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
4d23187
...
@@ -446,7 +446,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -446,7 +446,10 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
}
}
/// <summary>
/// 关机
/// </summary>
public
bool
LineStopRun
=
false
;
public
void
WriteDrivetMotorRun
(
IO_VALUE
value
)
public
void
WriteDrivetMotorRun
(
IO_VALUE
value
)
{
{
IOMove
(
IO_Type
.
MotorRun_C1_123
,
value
);
IOMove
(
IO_Type
.
MotorRun_C1_123
,
value
);
...
@@ -454,8 +457,30 @@ namespace OnlineStore.DeviceLibrary
...
@@ -454,8 +457,30 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
MotorRun_23458
,
value
);
IOMove
(
IO_Type
.
MotorRun_23458
,
value
);
IOMove
(
IO_Type
.
MotorRun_679
,
value
);
IOMove
(
IO_Type
.
MotorRun_679
,
value
);
}
}
public
bool
MotorHasRun
()
{
if
(
IOValue
(
IO_Type
.
MotorRun_C1_123
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
MotorRun_C1_4
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
MotorRun_23458
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
MotorRun_679
).
Equals
(
IO_VALUE
.
HIGH
)
)
{
return
true
;
}
return
false
;
}
/// <summary>
/// 横移是否可以处理新托盘
/// </summary>
/// <returns></returns>
public
bool
HYProcessNewTray
()
{
if
((!
LineStopRun
)
||
hasReel
())
{
return
true
;
}
return
false
;
}
#
region
灯光处理
#
region
灯光处理
...
@@ -471,7 +496,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -471,7 +496,7 @@ namespace OnlineStore.DeviceLibrary
try
try
{
{
DateTime
time
=
DateTime
.
Now
;
DateTime
time
=
DateTime
.
Now
;
if
(
runStatus
<=
LineRunStatus
.
Wait
)
if
(
runStatus
<=
LineRunStatus
.
Wait
||
LineStopRun
)
{
{
CloseLed
();
CloseLed
();
return
;
return
;
...
@@ -728,7 +753,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -728,7 +753,18 @@ namespace OnlineStore.DeviceLibrary
default
:
break
;
default
:
break
;
}
}
T3C1_TimerProcess
();
T3C1_TimerProcess
();
if
(
LineStopRun
)
{
//需要关机
if
(
MotorHasRun
()
&&
LineCanStop
())
{
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
LogInfo
(
"收到服务端停机要求,线体还未关闭,停止环形线线体转动"
);
}
}
else
{
noReel
=
false
;
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -983,5 +1019,64 @@ namespace OnlineStore.DeviceLibrary
...
@@ -983,5 +1019,64 @@ namespace OnlineStore.DeviceLibrary
conIsPro
=
false
;
conIsPro
=
false
;
}
}
}
}
/// <summary>
/// 所有托盘都要是空托盘或者禁用托盘
/// </summary>
/// <returns></returns>
public
bool
hasReel
()
{
List
<
TrayInfo
>
trayList
=
TrayManager
.
getTrayList
();
foreach
(
TrayInfo
tray
in
trayList
)
{
if
(
tray
.
IsFull
)
{
//if (TrayDisableManager.DisableTray(tray.TrayCode))
//{
// continue;
//}
return
true
;
}
}
return
false
;
}
/// <summary>
/// 关机功能:判断是否可以关闭线体,验证横移上是否有料盘
/// </summary>
/// <returns></returns>
public
bool
LineCanStop
()
{
if
(
hasReel
())
{
noReel
=
false
;
trayNoReelTime
=
DateTime
.
Now
;
}
else
{
if
(
noReel
)
{
}
else
{
noReel
=
true
;
trayNoReelTime
=
DateTime
.
Now
;
}
}
if
(
noReel
)
{
//判断是否已经无料盘30秒
TimeSpan
span
=
DateTime
.
Now
-
trayNoReelTime
;
if
(
span
.
TotalSeconds
>
30
)
{
return
true
;
}
}
return
false
;
}
public
bool
noReel
=
false
;
private
DateTime
trayNoReelTime
=
DateTime
.
Now
;
}
}
}
}
\ No newline at end of file
\ No newline at end of file
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
4d23187
...
@@ -919,17 +919,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -919,17 +919,19 @@ namespace OnlineStore.DeviceLibrary
{
{
//判断是否需要顶升
//判断是否需要顶升
bool
isNeed
=
false
;
bool
isNeed
=
false
;
UpdateTrayNum
();
bool
result
=
UpdateTrayNum
();
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
result
)
//出库中,需要拦盘
{
if
(
CheckIsNeedOutStore
())
//出库中,需要拦盘
{
if
(
CheckIsNeedOutStore
())
isNeed
=
true
;
{
}
isNeed
=
true
;
else
if
(
isFull
&&
IsInStoreNeed
())
}
{
else
if
(
isFull
&&
IsInStoreNeed
())
isNeed
=
true
;
{
isNeed
=
true
;
}
}
}
if
(
isNeed
)
if
(
isNeed
)
{
{
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
4d23187
...
@@ -699,6 +699,93 @@ namespace OnlineStore.DeviceLibrary
...
@@ -699,6 +699,93 @@ namespace OnlineStore.DeviceLibrary
}
}
return
defaultPut
;
return
defaultPut
;
}
}
public
static
bool
IgnoreServerStop
=
false
;
private
static
string
Addr_stopRun
=
"/rest/api/qisda/device/stopRun"
;
/// <summary>
/// 流水线停止运行
/// </summary>
/// <param name="deviceName"></param>
/// <returns>true:停止运行</returns>
public
static
bool
stopRun
(
string
deviceName
)
{
if
(
IgnoreServerStop
)
return
false
;
try
{
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
//paramMap.Add("barcode", barcode);
string
server
=
GetAddr
(
Addr_stopRun
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
debug
(
$
"{deviceName}stopRun {FormUtil.GetSpanStr(DateTime.Now - startTime)} 【{server}】【{resultStr}】"
);
ReturnData2
data
=
JsonHelper
.
DeserializeJsonToObject
<
ReturnData2
>(
resultStr
);
if
(
data
!=
null
)
{
bool
result
=
data
.
data
.
stopOut
;
if
(
data
.
code
.
Equals
(
0
))
{
return
result
&&
data
.
data
.
unfinishedTask
<
1
;
}
else
if
(!
data
.
code
.
Equals
(
0
))
{
LogUtil
.
error
(
$
"{deviceName} stopRun 返回错误 :{data.msg}={data.msg}"
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
}
return
false
;
}
private
static
string
Addr_putInEnable
=
"/rest/api/qisda/device/putInEnable"
;
/// <summary>
/// 流水线抓取料盘前获取是否可以继续抓取料盘
/// </summary>
/// <param name="deviceName"></param>
/// <returns></returns>
public
static
bool
putInEnable
(
string
deviceName
)
{
if
(
IgnoreServerStop
)
return
true
;
// 返回: // { "code":0,"msg":"ok","data":{"putInEnable":true}}
// code: 0为正常,其他为异常
// msg:消息,
//putInEnable: false 时不允许抓取下一盘,true时允许抓取
try
{
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
//paramMap.Add("barcode", barcode);
string
server
=
GetAddr
(
Addr_putInEnable
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
debug
(
$
"{deviceName}putInEnable {FormUtil.GetSpanStr(DateTime.Now - startTime)} 【{server}】【{resultStr}】"
);
ReturnData1
data
=
JsonHelper
.
DeserializeJsonToObject
<
ReturnData1
>(
resultStr
);
if
(
data
!=
null
)
{
bool
result
=
data
.
data
.
putInEnable
;
if
(
data
.
code
.
Equals
(
0
))
{
return
result
;
}
else
if
(!
data
.
code
.
Equals
(
0
))
{
LogUtil
.
error
(
$
"{deviceName} putInEnable 返回错误 :{data.msg}={data.msg}"
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
}
return
false
;
}
}
}
public
class
ReturnData
public
class
ReturnData
{
{
...
@@ -823,6 +910,33 @@ namespace OnlineStore.DeviceLibrary
...
@@ -823,6 +910,33 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
public
class
ReturnData2
{
// { "code":0,"msg":"ok","data":true}
public
int
code
{
get
;
set
;
}
public
string
msg
{
get
;
set
;
}
public
StopRun
data
{
get
;
set
;
}
}
public
class
StopRun
{
public
int
unfinishedTask
{
get
;
set
;
}
public
bool
stopOut
{
get
;
set
;
}
}
public
class
ReturnData1
{
// { "code":0,"msg":"ok","data":true}
public
int
code
{
get
;
set
;
}
public
string
msg
{
get
;
set
;
}
public
PutInEnable
data
{
get
;
set
;
}
}
public
class
PutInEnable
{
public
bool
putInEnable
{
get
;
set
;
}
}
}
}
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
4d23187
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
8
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</PropertyGroup>
</PropertyGroup>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论