Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4d231871
由
LN
编写于
2022-11-29 16:41:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
关机功能
1 个父辈
988c40bb
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
303 行增加
和
12 行删除
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
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
LogM
();
StopRunProcess
();
UpdateControl
();
string
canScanCode
=
""
;
...
...
@@ -489,6 +490,57 @@ namespace OnlineStore.AssemblyLine
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
)
{
if
(!
toolMenu
.
Enabled
.
Equals
(
isEn
))
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
4d23187
20210511
20221125 :
增加关机功能。
20210511
1.扫码算法更新。
2.HY12顶升之后增加延迟。
3.取消入库任务增加参数。
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
4d23187
...
...
@@ -361,6 +361,8 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" "
+
Name
+
"托盘号错乱:当前托盘 ["
+
currTrayNum
+
"] 上个托盘["
+
preTrayNum
+
"] ,连续两个托盘号一样"
;
LogUtil
.
error
(
Name
+
"托盘号错乱:当前托盘 ["
+
currTrayNum
+
"] 上个托盘["
+
preTrayNum
+
"] ,连续两个托盘号一样"
);
//托盘号一样,返回false
return
false
;
}
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
4d23187
...
...
@@ -948,6 +948,8 @@ namespace OnlineStore.DeviceLibrary
private
Task
ScanCodeTask
=
null
;
private
void
FI_18_ScanCode
()
{
if
(
SServerManager
.
putInEnable
(
Name
))
{
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
))
{
if
(
YuScanTask
==
null
||
YuScanTask
.
IsCompleted
)
...
...
@@ -1012,6 +1014,11 @@ namespace OnlineStore.DeviceLibrary
FI_17_CylinderGive
();
}
}
else
{
MoveTimeoutAlarm
(
MoveInfo
,
"即将关机,暂停抓取料盘"
);
}
}
private
void
CheckHasTray
()
{
//若BOX和出料都没有在等待Io的过程中则此Io超时异常可能已经处理过
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
查看文件 @
4d23187
...
...
@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
stopWatchCheck
();
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
if
(
LineManager
.
Line
.
CanProcessLine
())
if
(
LineManager
.
Line
.
CanProcessLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
CheckFixture
();
}
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1_SLStation.cs
查看文件 @
4d23187
...
...
@@ -149,7 +149,7 @@ namespace OnlineStore.DeviceLibrary
//判断流水线打开了才可以运行
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
if
(
LineManager
.
Line
.
CanProcessLine
())
if
(
LineManager
.
Line
.
CanProcessLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
CheckFixture
();
}
...
...
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor.cs
查看文件 @
4d23187
...
...
@@ -179,7 +179,7 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess
();
if
(
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
(!
MoveStop
))
{
if
(
LineManager
.
Line
.
OutHyCanProLine
())
if
(
LineManager
.
Line
.
OutHyCanProLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
CheckFixture
();
}
...
...
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor_Partial.cs
查看文件 @
4d23187
source/DeviceLibrary/assemblyLine/HY/HY_OutLine.cs
查看文件 @
4d23187
...
...
@@ -117,7 +117,7 @@ namespace OnlineStore.DeviceLibrary
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
if
(
LineManager
.
Line
.
OutHyCanProLine
())
if
(
LineManager
.
Line
.
OutHyCanProLine
()
&&
LineManager
.
Line
.
HYProcessNewTray
()
)
{
CheckFixture
();
}
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
4d23187
...
...
@@ -446,7 +446,10 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
}
/// <summary>
/// 关机
/// </summary>
public
bool
LineStopRun
=
false
;
public
void
WriteDrivetMotorRun
(
IO_VALUE
value
)
{
IOMove
(
IO_Type
.
MotorRun_C1_123
,
value
);
...
...
@@ -454,8 +457,30 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
MotorRun_23458
,
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
灯光处理
...
...
@@ -471,7 +496,7 @@ namespace OnlineStore.DeviceLibrary
try
{
DateTime
time
=
DateTime
.
Now
;
if
(
runStatus
<=
LineRunStatus
.
Wait
)
if
(
runStatus
<=
LineRunStatus
.
Wait
||
LineStopRun
)
{
CloseLed
();
return
;
...
...
@@ -729,6 +754,17 @@ namespace OnlineStore.DeviceLibrary
}
T3C1_TimerProcess
();
if
(
LineStopRun
)
{
//需要关机
if
(
MotorHasRun
()
&&
LineCanStop
())
{
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
LogInfo
(
"收到服务端停机要求,线体还未关闭,停止环形线线体转动"
);
}
}
else
{
noReel
=
false
;
}
}
catch
(
Exception
ex
)
{
...
...
@@ -983,5 +1019,64 @@ namespace OnlineStore.DeviceLibrary
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
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
4d23187
...
...
@@ -919,9 +919,10 @@ namespace OnlineStore.DeviceLibrary
{
//判断是否需要顶升
bool
isNeed
=
false
;
UpdateTrayNum
();
bool
result
=
UpdateTrayNum
();
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
result
)
{
//出库中,需要拦盘
if
(
CheckIsNeedOutStore
())
{
...
...
@@ -931,6 +932,7 @@ namespace OnlineStore.DeviceLibrary
{
isNeed
=
true
;
}
}
if
(
isNeed
)
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_05_WaitTime
);
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
4d23187
...
...
@@ -699,6 +699,93 @@ namespace OnlineStore.DeviceLibrary
}
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
{
...
...
@@ -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 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
8
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论