Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2974d919
由
LN
编写于
2020-11-27 17:32:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加出料线禁用框
1 个父辈
5b55cc5a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
145 行增加
和
58 行删除
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/Common/Setting_Init.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/ALineManager.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
2974d91
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
2974d91
...
...
@@ -75,7 +75,14 @@ namespace OnlineStore.AssemblyLine
{
启用蜂鸣器
ToolStripMenuItem
.
Text
=
"启用蜂鸣器"
;
}
if
(
TrayManager
.
DisTraySave
)
{
自动保存托盘信息
ToolStripMenuItem
.
Text
=
"自动保存托盘信息"
;
}
else
{
自动保存托盘信息
ToolStripMenuItem
.
Text
=
gouStr
+
"自动保存托盘信息"
;
}
LogUtil
.
logBox
=
this
.
logBox
;
lastLogTime
=
DateTime
.
Now
.
AddMinutes
(-
10
);
this
.
Opacity
=
100
;
...
...
@@ -1014,9 +1021,8 @@ namespace OnlineStore.AssemblyLine
}
}
}
#
endregion
#
endregion
#
region
ListView
显示
...
...
@@ -1243,5 +1249,58 @@ namespace OnlineStore.AssemblyLine
//}
#
endregion
private
void
自动保存托盘信息
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
if
(!
LoadOk
)
{
return
;
}
bool
result
=
自动保存托盘信息
ToolStripMenuItem
.
Text
.
Contains
(
gouStr
);
if
(
result
.
Equals
(
TrayManager
.
DisTraySave
))
{
return
;
}
TrayManager
.
DisTraySave
=
result
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DisTraySave
,
(
TrayManager
.
DisTraySave
?
1
:
0
));
if
(
TrayManager
.
DisTraySave
)
{
自动保存托盘信息
ToolStripMenuItem
.
Text
=
"自动保存托盘信息"
;
}
else
{
自动保存托盘信息
ToolStripMenuItem
.
Text
=
gouStr
+
" 自动保存托盘信息"
;
}
LogUtil
.
info
(
Name
+
" 点击:"
+
自动保存托盘信息
ToolStripMenuItem
.
Text
);
}
private
void
chbLeftDis_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
if
(!
LoadOk
)
{
return
;
}
if
(
LineManager
.
DisLeftOutLine
.
Equals
(
chbLeftDis
.
Checked
))
{
return
;
}
LineManager
.
DisLeftOutLine
=
chbLeftDis
.
Checked
;
LogUtil
.
error
(
"用户点击勾选:"
+
chbLeftDis
.
Text
+
"="
+
LineManager
.
DisLeftOutLine
);
}
private
void
chbRightDis_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
if
(!
LoadOk
)
{
return
;
}
if
(
LineManager
.
DisRightOutLine
.
Equals
(
chbRightDis
.
Checked
))
{
return
;
}
LineManager
.
DisRightOutLine
=
chbRightDis
.
Checked
;
LogUtil
.
error
(
"用户点击勾选:"
+
chbRightDis
.
Text
+
"="
+
LineManager
.
DisRightOutLine
);
}
}
}
source/Common/Setting_Init.cs
查看文件 @
2974d91
...
...
@@ -101,5 +101,7 @@ namespace OnlineStore.Common
public
static
string
UseHCBoard
=
"UseHCBoard"
;
public
static
string
ConfigPath_TrayList
=
"ConfigPath_TrayList"
;
public
static
string
DisTraySave
=
"DisTraySave"
;
}
}
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
2974d91
...
...
@@ -309,11 +309,11 @@ namespace OnlineStore.DeviceLibrary
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
+
"],托盘号不连续"
);
}
//
else if (!TrayManager.CheckIsRightNum(currTrayNum, preTrayNum))
//
{
//
TrayManager.TrayErrorMsg = DateTime.Now.ToLongTimeString() + " " + Name + "托盘号出现错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续";
//
LogUtil.error(Name + "托盘号错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续");
//
}
return
true
;
}
internal
void
ClearTrayRFID
()
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
查看文件 @
2974d91
...
...
@@ -757,6 +757,16 @@ namespace OnlineStore.DeviceLibrary
{
try
{
//判断是否禁用
if
(
LineManager
.
DisLeftOutLine
&&(
DeviceID
.
Equals
(
204
)
||
DeviceID
.
Equals
(
209
)))
{
return
false
;
}
if
(
LineManager
.
DisRightOutLine
&&
(
DeviceID
.
Equals
(
213
)
||
DeviceID
.
Equals
(
216
)))
{
return
false
;
}
if
(
Config
.
IsOutLineIn
&&
trayNum
>
0
)
{
//测线满时不需要横移
...
...
source/DeviceLibrary/assemblyLine/HY/HY_Coveryor.cs
查看文件 @
2974d91
...
...
@@ -142,6 +142,7 @@ namespace OnlineStore.DeviceLibrary
private
int
GetRobotIndex
()
{
//机器人索引号
int
robotIndex
=
1
;
if
(
DeviceID
.
Equals
(
212
))
{
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
2974d91
...
...
@@ -746,24 +746,15 @@ namespace OnlineStore.DeviceLibrary
bool
isNeed
=
false
;
UpdateTrayNum
();
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
//出库中,需要拦盘
if
(
CheckIsNeedOutStore
())
{
//出库中,需要拦盘
if
(
CheckIsNeedOutStore
())
{
isNeed
=
true
;
}
else
if
(
isFull
&&
IsInStoreNeed
())
{
isNeed
=
true
;
}
isNeed
=
true
;
}
else
else
if
(
isFull
&&
IsInStoreNeed
())
{
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
LogUtil
.
error
(
msg
);
return
;
isNeed
=
true
;
}
if
(
isNeed
)
{
...
...
@@ -780,9 +771,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_15_WaitCanGo
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
//CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,等待 NextStopCheck=0");
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.NextStopCheck, IO_VALUE.LOW));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
}
}
...
...
source/DeviceLibrary/assemblymanager/ALineManager.cs
查看文件 @
2974d91
...
...
@@ -14,6 +14,10 @@ namespace OnlineStore.DeviceLibrary
{
public
class
LineManager
{
public
static
bool
DisLeftOutLine
=
false
;
public
static
bool
DisRightOutLine
=
false
;
public
static
bool
UseBuzzer
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseBuzzer
).
Equals
(
1
);
private
static
bool
isInit
=
false
;
public
static
bool
IsConnectServer
=
!
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
).
Equals
(
""
);
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
2974d91
...
...
@@ -15,15 +15,16 @@ namespace OnlineStore.DeviceLibrary
{
public
class
TrayManager
{
public
static
bool
DisTraySave
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DisTraySave
).
Equals
(
1
);
/// <summary>
/// 托盘集合,key=托盘编号,value=托盘详细信息
/// </summary>
private
static
ConcurrentDictionary
<
int
,
TrayInfo
>
TrayInfoMap
=
new
ConcurrentDictionary
<
int
,
TrayInfo
>();
/// <summary>
/// 最大托盘号,必须按照顺序从1到6走过
/// </summary>
internal
static
int
MaxTrayNum
=
0
;
///
//
<summary>
///
//
最大托盘号,必须按照顺序从1到6走过
///
//
</summary>
//
internal static int MaxTrayNum = 0;
/// <summary>
/// 托盘错误消息
/// </summary>
...
...
@@ -123,33 +124,33 @@ namespace OnlineStore.DeviceLibrary
}
public
static
bool
NeedCheckTray
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
NeedCheckTray
).
Equals
(
1
);
internal
static
bool
CheckIsRightNum
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
=
true
)
{
if
(!
NeedCheckTray
)
{
return
true
;
}
int
defNext
=
preTrayNum
+
1
;
if
(
preTrayNum
.
Equals
(
0
)
||
MaxTrayNum
.
Equals
(
0
)
||
trayNum
.
Equals
(
defNext
))
{
if
(
isCanUpdateMax
&&
trayNum
>
MaxTrayNum
)
{
MaxTrayNum
=
trayNum
;
LogUtil
.
info
(
"更新MaxTrayNum="
+
preTrayNum
);
}
return
true
;
}
else
if
(
trayNum
.
Equals
(
1
)
&&
preTrayNum
>=
MaxTrayNum
)
{
return
true
;
}
return
false
;
}
internal
static
bool
RightTrayCode
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
=
true
)
{
return
true
;
return
CheckIsRightNum
(
trayNum
,
preTrayNum
,
isCanUpdateMax
);
}
//
internal static bool CheckIsRightNum(int trayNum, int preTrayNum, bool isCanUpdateMax = true)
//
{
//
if (!NeedCheckTray)
//
{
//
return true;
//
}
//
int defNext = preTrayNum + 1;
//
if (preTrayNum.Equals(0) || MaxTrayNum.Equals(0) || trayNum.Equals(defNext))
//
{
//
if (isCanUpdateMax && trayNum > MaxTrayNum)
//
{
//
MaxTrayNum = trayNum;
//
LogUtil.info("更新MaxTrayNum=" + preTrayNum);
//
}
//
return true;
//
}
//
else if (trayNum.Equals(1) && preTrayNum >= MaxTrayNum)
//
{
//
return true;
//
}
//
return false;
//
}
//
internal static bool RightTrayCode(int trayNum, int preTrayNum, bool isCanUpdateMax = true)
//
{
//
return true;
// //
return CheckIsRightNum(trayNum, preTrayNum, isCanUpdateMax);
//
}
internal
static
void
UpdateTrayNumError
(
int
errorStoreID
,
string
errorMsg
)
{
...
...
@@ -174,6 +175,11 @@ namespace OnlineStore.DeviceLibrary
public
static
void
InitFileData
()
{
TrayInfoMap
=
new
ConcurrentDictionary
<
int
,
TrayInfo
>();
if
(
DisTraySave
)
{
LogUtil
.
error
(
"禁用了托盘保存功能,不需要从文件夹加载托盘"
);
return
;
}
FilePath
=
Application
.
StartupPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ConfigPath_TrayList
);
if
(
File
.
Exists
(
FilePath
))
{
...
...
@@ -186,6 +192,22 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
info
(
"加载到缓存托盘:"
+
tray
.
ToStr
());
TrayInfoMap
.
TryAdd
(
tray
.
TrayNum
,
tray
);
if
(
tray
.
InOrOutStore
.
Equals
(
1
)&&
tray
.
InoutPar
.
InStoreNg
.
Equals
(
false
)
&&
(!
tray
.
InoutPar
.
PosId
.
Equals
(
""
))
&&
(!
tray
.
InoutPar
.
WareCode
.
Equals
(
""
)))
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
if
(
storeId
>
0
&&
LineManager
.
Line
.
MoveEquipMap
.
ContainsKey
(
storeId
))
{
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
lock
(
moveEquip
.
waitInListLock
)
{
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
moveEquip
.
Name
+
" 将托盘入库任务["
+
tray
.
TrayNum
+
"]: "
+
tray
.
InoutPar
.
ToStr
()
+
"加入等待列表中!"
);
moveEquip
.
waitInStoreList
.
Add
(
tray
.
InoutPar
);
}
}
}
}
}
LogUtil
.
info
(
"托盘加载完成"
);
...
...
@@ -195,7 +217,7 @@ namespace OnlineStore.DeviceLibrary
public
static
void
SaveMapToFile
()
{
try
{
{
List
<
TrayInfo
>
trayList
=
new
List
<
TrayInfo
>();
List
<
string
>
lineList
=
new
List
<
string
>();
foreach
(
TrayInfo
tray
in
trayList
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论