Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 73b57b24
由
LN
编写于
2019-11-20 12:59:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
da1049af
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
116 行增加
和
394 行删除
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblymanager/StoreServerManager.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/deviceLibrary/RFID/RFIDManager.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/model/TrayInfo.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
73b57b2
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
toolStripSeparator8
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
...
@@ -418,7 +419,7 @@
...
@@ -418,7 +419,7 @@
// 扫码测试ToolStripMenuItem
// 扫码测试ToolStripMenuItem
//
//
this
.
扫码测试
ToolStripMenuItem
.
Name
=
"扫码测试ToolStripMenuItem"
;
this
.
扫码测试
ToolStripMenuItem
.
Name
=
"扫码测试ToolStripMenuItem"
;
this
.
扫码测试
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
8
0
,
26
);
this
.
扫码测试
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
6
0
,
26
);
this
.
扫码测试
ToolStripMenuItem
.
Text
=
"扫码测试"
;
this
.
扫码测试
ToolStripMenuItem
.
Text
=
"扫码测试"
;
this
.
扫码测试
ToolStripMenuItem
.
Visible
=
false
;
this
.
扫码测试
ToolStripMenuItem
.
Visible
=
false
;
this
.
扫码测试
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
扫码测试
ToolStripMenuItem_Click
);
this
.
扫码测试
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
扫码测试
ToolStripMenuItem_Click
);
...
@@ -426,25 +427,25 @@
...
@@ -426,25 +427,25 @@
// toolStripSeparator6
// toolStripSeparator6
//
//
this
.
toolStripSeparator6
.
Name
=
"toolStripSeparator6"
;
this
.
toolStripSeparator6
.
Name
=
"toolStripSeparator6"
;
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
1
7
7
,
6
);
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
1
5
7
,
6
);
this
.
toolStripSeparator6
.
Visible
=
false
;
this
.
toolStripSeparator6
.
Visible
=
false
;
//
//
// 二维码学习ToolStripMenuItem
// 二维码学习ToolStripMenuItem
//
//
this
.
二维码学习
ToolStripMenuItem
.
Name
=
"二维码学习ToolStripMenuItem"
;
this
.
二维码学习
ToolStripMenuItem
.
Name
=
"二维码学习ToolStripMenuItem"
;
this
.
二维码学习
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
8
0
,
26
);
this
.
二维码学习
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
6
0
,
26
);
this
.
二维码学习
ToolStripMenuItem
.
Text
=
"二维码学习"
;
this
.
二维码学习
ToolStripMenuItem
.
Text
=
"二维码学习"
;
this
.
二维码学习
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
二维码学习
ToolStripMenuItem_Click
);
this
.
二维码学习
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
二维码学习
ToolStripMenuItem_Click
);
//
//
// toolStripSeparator7
// toolStripSeparator7
//
//
this
.
toolStripSeparator7
.
Name
=
"toolStripSeparator7"
;
this
.
toolStripSeparator7
.
Name
=
"toolStripSeparator7"
;
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
1
7
7
,
6
);
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
1
5
7
,
6
);
//
//
// 托盘初始化ToolStripMenuItem
// 托盘初始化ToolStripMenuItem
//
//
this
.
托盘初始化
ToolStripMenuItem
.
Name
=
"托盘初始化ToolStripMenuItem"
;
this
.
托盘初始化
ToolStripMenuItem
.
Name
=
"托盘初始化ToolStripMenuItem"
;
this
.
托盘初始化
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
8
0
,
26
);
this
.
托盘初始化
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
6
0
,
26
);
this
.
托盘初始化
ToolStripMenuItem
.
Text
=
"托盘编码"
;
this
.
托盘初始化
ToolStripMenuItem
.
Text
=
"托盘编码"
;
this
.
托盘初始化
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
托盘初始化
ToolStripMenuItem_Click
);
this
.
托盘初始化
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
托盘初始化
ToolStripMenuItem_Click
);
//
//
...
@@ -476,21 +477,22 @@
...
@@ -476,21 +477,22 @@
this
.
contextMenuStrip1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
contextMenuStrip1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
contextMenuStrip1
.
Items
.
AddRange
(
new
System
.
Windows
.
Forms
.
ToolStripItem
[]
{
this
.
contextMenuStrip1
.
Items
.
AddRange
(
new
System
.
Windows
.
Forms
.
ToolStripItem
[]
{
this
.
显示
ToolStripMenuItem
,
this
.
显示
ToolStripMenuItem
,
this
.
toolStripSeparator8
,
this
.
toolStripMenuItem1
});
this
.
toolStripMenuItem1
});
this
.
contextMenuStrip1
.
Name
=
"contextMenuStrip1"
;
this
.
contextMenuStrip1
.
Name
=
"contextMenuStrip1"
;
this
.
contextMenuStrip1
.
Size
=
new
System
.
Drawing
.
Size
(
1
13
,
56
);
this
.
contextMenuStrip1
.
Size
=
new
System
.
Drawing
.
Size
(
1
81
,
84
);
//
//
// 显示ToolStripMenuItem
// 显示ToolStripMenuItem
//
//
this
.
显示
ToolStripMenuItem
.
Name
=
"显示ToolStripMenuItem"
;
this
.
显示
ToolStripMenuItem
.
Name
=
"显示ToolStripMenuItem"
;
this
.
显示
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
12
,
26
);
this
.
显示
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
显示
ToolStripMenuItem
.
Text
=
"显示"
;
this
.
显示
ToolStripMenuItem
.
Text
=
"显示"
;
this
.
显示
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
显示
ToolStripMenuItem_Click
);
this
.
显示
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
显示
ToolStripMenuItem_Click
);
//
//
// toolStripMenuItem1
// toolStripMenuItem1
//
//
this
.
toolStripMenuItem1
.
Name
=
"toolStripMenuItem1"
;
this
.
toolStripMenuItem1
.
Name
=
"toolStripMenuItem1"
;
this
.
toolStripMenuItem1
.
Size
=
new
System
.
Drawing
.
Size
(
1
12
,
26
);
this
.
toolStripMenuItem1
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
toolStripMenuItem1
.
Text
=
"退出"
;
this
.
toolStripMenuItem1
.
Text
=
"退出"
;
this
.
toolStripMenuItem1
.
Click
+=
new
System
.
EventHandler
(
this
.
toolStripMenuItem1_Click
);
this
.
toolStripMenuItem1
.
Click
+=
new
System
.
EventHandler
(
this
.
toolStripMenuItem1_Click
);
//
//
...
@@ -516,6 +518,11 @@
...
@@ -516,6 +518,11 @@
this
.
listView1
.
View
=
System
.
Windows
.
Forms
.
View
.
Details
;
this
.
listView1
.
View
=
System
.
Windows
.
Forms
.
View
.
Details
;
this
.
listView1
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
listView1_SelectedIndexChanged
);
this
.
listView1
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
listView1_SelectedIndexChanged
);
//
//
// toolStripSeparator8
//
this
.
toolStripSeparator8
.
Name
=
"toolStripSeparator8"
;
this
.
toolStripSeparator8
.
Size
=
new
System
.
Drawing
.
Size
(
177
,
6
);
//
// FrmLineStore
// FrmLineStore
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
@@ -599,6 +606,7 @@
...
@@ -599,6 +606,7 @@
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator7
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator7
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
托盘初始化
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
托盘初始化
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
Button
btnUpdateStatus
;
private
System
.
Windows
.
Forms
.
Button
btnUpdateStatus
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator8
;
}
}
}
}
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
73b57b2
...
@@ -106,14 +106,17 @@ namespace OnlineStore.AssemblyLine
...
@@ -106,14 +106,17 @@ namespace OnlineStore.AssemblyLine
LogUtil
.
error
(
"加载配置失败,直接退出程序"
);
LogUtil
.
error
(
"加载配置失败,直接退出程序"
);
Application
.
Exit
();
Application
.
Exit
();
}
}
LoadStoreData
();
formLineStatus
(
false
);
formLineStatus
(
false
);
string
title
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
);
string
title
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
);
this
.
Text
=
title
;
this
.
Text
=
title
;
this
.
notifyIcon1
.
Text
=
title
;
this
.
notifyIcon1
.
Text
=
title
;
int
autoValue
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
int
autoValue
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
chbAutoRun
.
Checked
=
autoValue
.
Equals
(
1
);
chbAutoRun
.
Checked
=
autoValue
.
Equals
(
1
);
LoadStoreData
();
LoadListView
();
LoadListView
();
托盘初始化
ToolStripMenuItem
.
Visible
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
OpenRFIDWrite
).
Equals
(
1
);
托盘初始化
ToolStripMenuItem
.
Visible
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
OpenRFIDWrite
).
Equals
(
1
);
LoadOk
=
true
;
LoadOk
=
true
;
HideForm
();
HideForm
();
...
@@ -255,6 +258,8 @@ namespace OnlineStore.AssemblyLine
...
@@ -255,6 +258,8 @@ namespace OnlineStore.AssemblyLine
IOManager
.
instance
.
CloseAllConnection
();
IOManager
.
instance
.
CloseAllConnection
();
//AIManager.CloseConnect();
//AIManager.CloseConnect();
ACServerManager
.
CloseAllPort
();
ACServerManager
.
CloseAllPort
();
CodeManager
.
CloseAllCamera
();
RFIDManager
.
CloseAllConnection
();
//this.Close();
//this.Close();
System
.
Environment
.
Exit
(
System
.
Environment
.
ExitCode
);
System
.
Environment
.
Exit
(
System
.
Environment
.
ExitCode
);
}
}
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
73b57b2
...
@@ -11,7 +11,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -11,7 +11,7 @@ namespace OnlineStore.DeviceLibrary
{
{
public
abstract
class
EquipBase
:
KTK_Store
public
abstract
class
EquipBase
:
KTK_Store
{
{
private
bool
IsIntSlvBlock
=
false
;
public
bool
IsDebug
=
false
;
public
bool
IsDebug
=
false
;
internal
AxisAlarmInfo
AxisAlarm
=
new
AxisAlarmInfo
();
internal
AxisAlarmInfo
AxisAlarm
=
new
AxisAlarmInfo
();
public
bool
UseAxis
=
false
;
public
bool
UseAxis
=
false
;
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
查看文件 @
73b57b2
...
@@ -130,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -130,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
{
{
//此处先对托盘号进行验证
//此处先对托盘号进行验证
preTrayNum
=
currTrayNum
;
preTrayNum
=
currTrayNum
;
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
{
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
...
@@ -138,10 +138,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -138,10 +138,10 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
}
//出料中,需要拦盘
//出料中,需要拦盘
if
(
NeedCurrTray
(
true
))
if
(
NeedCurrTray
(
true
))
{
{
//preTrayNum = currMoveTrayNum;
//preTrayNum = currMoveTrayNum;
// SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
// SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_05_WaitTime
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_05_WaitTime
);
SecondMoveInfo
.
EndStepWait
();
SecondMoveInfo
.
EndStepWait
();
return
;
return
;
...
@@ -183,16 +183,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -183,16 +183,16 @@ namespace OnlineStore.DeviceLibrary
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
))
{
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】 ,需要入料,移栽料盘"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】 ,需要入料,移栽料盘"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
SecondMoveInfo
.
EndStepWait
();
}
}
else
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
else
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】 ,需要出库,开始出库处理,升降伺服到P1点"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】 ,需要出库,开始出库处理,升降伺服到P1点"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_201_UpDownToP1
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_201_UpDownToP1
);
InStoreLog
(
" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点"
);
InStoreLog
(
" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
}
}
...
@@ -217,10 +217,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -217,10 +217,19 @@ namespace OnlineStore.DeviceLibrary
{
{
//更新托盘条码信息
//更新托盘条码信息
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
TrayManager
.
UpdateTrayCode
(
currTrayNum
,
code
);
TrayManager
.
UpdateTrayCode
(
currTrayNum
,
code
);
if
(
code
.
Equals
(
""
))
{
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
);
}
//从服务器获取库位号
//从服务器获取库位号
string
result
=
StoreServerManager
.
CodeReceived
(
Name
,
currTrayNum
,
LastCodeList
,
LastHeight
,
LastWidth
);
string
result
=
StoreServerManager
.
CodeReceived
(
Name
,
currTrayNum
,
LastCodeList
,
LastHeight
,
LastWidth
);
if
(!
result
.
Equals
(
""
))
{
LogUtil
.
error
(
result
);
}
if
(!
result
.
Equals
(
""
))
{
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
);
LogUtil
.
error
(
result
);
}
InStoreLog
(
" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降"
);
InStoreLog
(
" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_13_LoactionCylinder_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_13_LoactionCylinder_Down
);
...
@@ -230,7 +239,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -230,7 +239,8 @@ namespace OnlineStore.DeviceLibrary
{
{
CheckLog
(
"托盘检测 SecondStoreMove:(MO_14_TopCylinder_Down ,托盘号【"
+
currTrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
CheckLog
(
"托盘检测 SecondStoreMove:(MO_14_TopCylinder_Down ,托盘号【"
+
currTrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_14_TopCylinder_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_14_TopCylinder_Down
);
if
(
Config
.
SidesWayNum
>
0
)
//只有2号横移不需要下降
if
(
Config
.
SidesWayNum
.
Equals
(
2
))
{
{
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SW_TopCylinder_Up
,
IO_Type
.
SW_TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SW_TopCylinder_Up
,
IO_Type
.
SW_TopCylinder_Down
);
}
}
...
@@ -288,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -288,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
#
region
紧急出料,先移载料盘
#
region
紧急出料,先移载料盘
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_201_UpDownToP1
)
&&
MoveInfo
.
MoveStep
>=
(
LineMoveStep
.
FO_07_LocationCylinder_Up
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_201_UpDownToP1
)
&&
MoveInfo
.
MoveStep
>=
(
LineMoveStep
.
FO_07_LocationCylinder_Up
))
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_202_MoveCylinder_Give
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_202_MoveCylinder_Give
);
InStoreLog
(
" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端"
);
InStoreLog
(
" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端"
);
...
@@ -304,7 +314,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -304,7 +314,7 @@ namespace OnlineStore.DeviceLibrary
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_204_UpdownAxisToP2
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_204_UpdownAxisToP2
);
int
targetP
=
Config
.
GetUpdownPositionP2
(
SecondMoveInfo
.
MoveParam
.
PlateH
);
int
targetP
=
Config
.
GetUpdownPositionP2
(
SecondMoveInfo
.
MoveParam
.
PlateH
);
InStoreLog
(
" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置"
+
targetP
);
InStoreLog
(
" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置"
+
targetP
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
targetP
,
Config
.
UpdownAxis_P2Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
targetP
,
Config
.
UpdownAxis_P2Speed
);
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_204_UpdownAxisToP2
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_204_UpdownAxisToP2
))
...
@@ -322,7 +332,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -322,7 +332,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_206_UpdownAxisToP1
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_206_UpdownAxisToP1
))
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_207_MoveCylinder_Up
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_207_MoveCylinder_Up
);
InStoreLog
(
" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构上升,更新【"
+
currTrayNum
+
"】为空托盘"
);
InStoreLog
(
" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构上升,更新【"
+
currTrayNum
+
"】为空托盘"
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
//更新此托盘为空托盘
//更新此托盘为空托盘
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
73b57b2
...
@@ -105,137 +105,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -105,137 +105,8 @@ namespace OnlineStore.DeviceLibrary
// isInprocess = false;
// isInprocess = false;
// return;
// return;
//}
//}
//if (IOValue(IO_Type.Fixture_Check_4).Equals(IO_VALUE.LOW))
//TODO 需要处理NG料盘推出
//{
// IsWaitToScan = false;
// IsWaitEmptyGo = false;
// //出料口有空托盘才可以放行,StopCylinder_Check=出料是否有托盘。OutStore_TrayCheck=出料托盘是否有料盘
// if (IOValue(IO_Type.StopCylinder_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.OutStore_TrayCheck).Equals(IO_VALUE.LOW))
// {
// //延迟一秒钟放行
// if (!isWaitOutGo)
// {
// WaitOutGoTime = DateTime.Now.AddMilliseconds(500);
// isWaitOutGo = true;
// }
// else if (DateTime.Now > WaitOutGoTime)
// {
// LogUtil.debug(Name + "检测到出料口有空托盘, 且入料口没有托盘,,等待500后下降阻挡气缸1(出料口阻挡)");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
// isWaitOutGo = false;
// }
// }
// else
// {
// isWaitOutGo = false;
// }
//}
//else
//{
// isWaitOutGo = false;
// //上料工位有盘,阻挡1需要上升
// if (IOValue(IO_Type.StopCylinder_Down1).Equals(IO_VALUE.HIGH))
// {
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// }
// int trayNum = TrayManager.GetNum(0);
// if (trayNum > 0)
// {
// //先判断是空盘还是有料盘
// if ((IOValue(IO_Type.InStore_TrayCheck1).Equals(IO_VALUE.HIGH)) || (IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.HIGH)))
// {
// //有料盘,直接扫码通过 。如果移栽在出库过程中,不能扫码
// IsWaitEmptyGo = false;
// if (!IsScanCode && CanScanCode())
// {
// if (!IsWaitToScan)
// {
// UpdateSleep(false);
// IsWaitToScan = true;
// NextScanTime = DateTime.Now.AddMilliseconds(1500);
// LogUtil.debug(Name + "有料托盘【" + trayNum + "】等待1.5秒后开始扫码");
// }
// else if (DateTime.Now > NextScanTime)
// {
// UpdateSleep(false);
// IsWaitToScan = false;
// //进入忙碌状态,开始扫码枪
// LogUtil.debug(Name + "有料托盘【" + trayNum + "】,已经等待1.5秒,开始扫码");
// //判断盘号是否正确
// if (TrayManager.RightTrayCode(trayNum, preTrayNum, true))
// {
// GetCameraCode();
// }
// else
// {
// string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前有料托盘【" + trayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
// TrayManager.UpdateTrayNumError(0, msg);
// LogUtil.error(msg);
// }
// }
// }
// }
// else
// { //无料盘,若需要空盘,放行通过
// IsWaitToScan = false;
// IsScanCode = false;
// if (!IsWaitEmptyGo)
// {
// IsWaitEmptyGo = true;
// NextEmptyGo = DateTime.Now.AddMilliseconds(500);
// }
// else if (DateTime.Now > NextEmptyGo)
// {
// trayNum = TrayManager.GetNum(0);
// IsWaitEmptyGo = false;
// isNotScanCode = false;
// TrayManager.UpdateFixtureValue(trayNum, false, 0);
// //判断盘号是否正确
// if (TrayManager.RightTrayCode(trayNum, preTrayNum, true))
// {
// bool isNeedGo = false;
// //判断是否需要空盘 或者还有有 料盘 的托盘,一直走
// if (TrayManager.isNeedEmptyTray())
// {
// isNeedGo = true;
// LogUtil.info(Name + " 检测到空托盘【" + trayNum + "】并等待500, 放盘通过");
// }
// else if (TrayManager.IsHasFullOutFixture())
// {
// isNeedGo = true;
// LogUtil.info(Name + " 检测到空托盘【" + trayNum + "】并等待500 ,还有没有出库完成的,放盘通过");
// }
// if (isNeedGo)
// {
// UpdateSleep(false);
// //放行操作
// preTrayNum = trayNum;
// StartOutStoreMove(null);
// }
// }
// else
// {
// string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前空托盘【" + trayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
// TrayManager.UpdateTrayNumError(0, msg);
// LogUtil.error(msg);
// }
// }
// }
// }
// else
// {
// IsWaitToScan = false;
// IsWaitEmptyGo = false;
// LogUtil.debug(Name + "检测到Fixture_Check_4亮,但是托盘号为0,不处理托盘~");
// }
//}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -421,39 +292,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -421,39 +292,7 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
IsInWait
)
if
(
MoveInfo
.
IsInWait
)
{
{
return
;
return
;
}
}
//switch (MoveInfo.MoveStep)
//{
// //if (StoreMove.MoveStep == StoreMoveStep.LO_00_Wait100)
// case LineMoveStep.LO_00_Wait100:
// MoveInfo.NextMoveStep(LineMoveStep.LO_01_StopCylinder2Down);
// InOutLog("出库处理:(LO_01_StopCylinder2Down 流水线出库,阻挡气缸0-1上升,阻挡气缸0-2下降, ) 开始");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
// MoveInfo.EndStepWait();
// break;
// case LineMoveStep.LO_01_StopCylinder2Down:
// MoveInfo.NextMoveStep(LineMoveStep.LO_02_FixtureCheck);
// InOutLog("出库处理:(LO_02_FixtureCheck 检测夹具检测4=0 ) 开始");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.LOW));
// break;
// case LineMoveStep.LO_02_FixtureCheck:
// MoveInfo.NextMoveStep(LineMoveStep.LO_03_StopCylinder2Up);
// InOutLog("出库处理:(LO_03_StopCylinder2Up1Down , 阻挡气缸0-2上升 ) 开始 ");
// // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); break;
// case LineMoveStep.LO_03_StopCylinder2Up:
// IsScanCode = false;
// MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing;
// lineStatus = LineStatus.StoreOnline;
// InOutLog("出库处理:放行完成! ");
// break;
// default:
// break;
//}
}
}
#
endregion
#
endregion
...
@@ -490,61 +329,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -490,61 +329,7 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
IsInWait
)
if
(
MoveInfo
.
IsInWait
)
{
{
return
;
return
;
}
}
//switch (MoveInfo.MoveStep)
//{
// case LineMoveStep.LI_00_Wait100:
// //判断是否可以入库
// string posId = MoveInfo.MoveParam.PosId;
// int id = MoveInfo.MoveParam.GetStoreId();
// bool result = LineServer.RightInPosId(id, posId);
// MoveEquip moveEquip = null;
// MoveEquipMap.TryGetValue(id, out moveEquip);
// if (!result || moveEquip == null)
// {
// LogUtil.error("入库处理:入库验证失败【" + id + "】【" + posId + "】,结束入库");
// IsScanCode = false;
// MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing;
// lineStatus = LineStatus.StoreOnline;
// }
// else
// {
// preTrayNum = MoveInfo.MoveParam.TrayNumber;
// lock (moveEquip.waitInListLock)
// {
// //如果当前正在出入库中,需要记录下来,等待空闲时执行
// LogUtil.info(moveEquip.Name + " 入库命令: " + MoveInfo.MoveParam.ToStr() + "已验证完成 ,写入排队列表中等待!");
// moveEquip.waitInStoreList.Add(MoveInfo.MoveParam);
// }
// MoveInfo.NextMoveStep(LineMoveStep.LI_01_StopCylinder2Down);
// InOutLog("入库处理:(LI_01_StopCylinder2Down ,阻挡气缸0-1上升,阻挡气缸0-2下降 ) 开始");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
// }
// break;
// case LineMoveStep.LI_01_StopCylinder2Down:
// MoveInfo.NextMoveStep(LineMoveStep.LI_02_FixtureCheck);
// InOutLog("入库处理:(LI_02_CheckX3X4 等待夹具检测4=0 ) 开始");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.LOW));
// break;
// case LineMoveStep.LI_02_FixtureCheck:
// MoveInfo.NextMoveStep(LineMoveStep.LI_03_StopCylinder2Up);
// InOutLog("入库处理:(LI_03_StopCylinder2Up1Down 阻挡气缸0-2上升) 开始 ");
// // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
// break;
// case LineMoveStep.LI_03_StopCylinder2Up:
// IsScanCode = false;
// MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing;
// lineStatus = LineStatus.StoreOnline;
// InOutLog(Name + "入库处理:放行完成! ");
// break;
// default: break;
//}
}
}
#
endregion
#
endregion
...
@@ -660,17 +445,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -660,17 +445,12 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
span12
=
DateTime
.
Now
-
SideWay41Ntime
;
TimeSpan
span12
=
DateTime
.
Now
-
SideWay41Ntime
;
if
(
SideWay41IsWait
&&
span12
.
TotalSeconds
>
1
)
if
(
SideWay41IsWait
&&
span12
.
TotalSeconds
>
1
)
{
{
SWLog
(
"横移轨道4检测到托盘,定位气缸下降"
);
// TrayManager.UpdateSWState(4, 2);
SW41_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
// TrayManager.UpdateSWState(1, 2);
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_LocationCylinderDown
);
SW41_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
//IOMove(IO_Type.SW1_StopCylinderDown, IO_VALUE.LOW);
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
SWLog
(
"横移轨道41: 等待横移4托盘检测信号 "
);
//CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW4_TrayCheck
,
IO_VALUE
.
HIGH
));
//CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW1_LocationCylinder_Up
,
IO_Type
.
SW1_LocationCylinder_Down
);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW4_LocationCylinder_Up
,
IO_Type
.
SW4_LocationCylinder_Down
);
}
}
else
if
(!
SideWay41IsWait
)
else
if
(!
SideWay41IsWait
)
{
{
...
@@ -700,17 +480,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -700,17 +480,12 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
span34
=
DateTime
.
Now
-
SideWay23Ntime
;
TimeSpan
span34
=
DateTime
.
Now
-
SideWay23Ntime
;
if
(
SideWay23IsWait
&&
span34
.
TotalSeconds
>
1
)
if
(
SideWay23IsWait
&&
span34
.
TotalSeconds
>
1
)
{
{
SWLog
(
"横移轨道2检测到托盘,定位气缸下降"
);
// TrayManager.UpdateSWState(2, 2);
//TrayManager.UpdateSWState(3, 2);
SW23_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW23_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_LocationCylinderDown
);
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
//IOMove(IO_Type.SW3_StopCylinderDown, IO_VALUE.HIGH);
SWLog
(
"横移轨道23: 等待横移4托盘检测信号 "
);
//SideWay23TopCylinderMove(IO_VALUE.HIGH, IO_VALUE.LOW, SW23_MoveInfo);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW2_TrayCheck
,
IO_VALUE
.
HIGH
));
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
//CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
//CylinderMove(SW23_MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_LocationCylinder_Up
,
IO_Type
.
SW2_LocationCylinder_Down
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW3_LocationCylinder_Up
,
IO_Type
.
SW3_LocationCylinder_Down
);
}
}
else
if
(!
SideWay23IsWait
)
else
if
(!
SideWay23IsWait
)
{
{
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
73b57b2
...
@@ -42,10 +42,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -42,10 +42,8 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
error
(
Name
+
" 启动出库【"
+
posId
+
"】失败,当前状态,storeStatus="
+
runStatus
);
LogUtil
.
error
(
Name
+
" 启动出库【"
+
posId
+
"】失败,当前状态,storeStatus="
+
runStatus
);
return
false
;
return
false
;
}
}
}
}
protected
override
void
OutStoreProcess
()
protected
override
void
OutStoreProcess
()
{
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
...
@@ -346,7 +344,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -346,7 +344,7 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
isFull
.
Equals
(
false
))
if
(
isFull
.
Equals
(
false
))
{
{
LogInfo
(
" 托盘号【"
+
preTrayNum
+
"】,当前托盘号【(isFull="
+
isFull
+
"):"
+
currTrayNum
+
"】
需要出库,不顶升直接让移栽放
盘~"
);
LogInfo
(
" 托盘号【"
+
preTrayNum
+
"】,当前托盘号【(isFull="
+
isFull
+
"):"
+
currTrayNum
+
"】
出库中,拦截 托
盘~"
);
return
true
;
return
true
;
}
}
//去掉直接丢料盘处理
//去掉直接丢料盘处理
...
@@ -491,18 +489,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -491,18 +489,14 @@ namespace OnlineStore.DeviceLibrary
bool
isNeed
=
false
;
bool
isNeed
=
false
;
//此处先对托盘号进行验证
//此处先对托盘号进行验证
preTrayNum
=
currTrayNum
;
preTrayNum
=
currTrayNum
;
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
{
//出库中,需要拦盘
//出库中,需要拦盘
if
(
CheckIsNeedOutStore
())
if
(
CheckIsNeedOutStore
())
{
{
//preTrayNum = currMoveTrayNum;
isNeed
=
true
;
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currTrayNum
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
return
;
}
}
else
if
(
isFull
&&
IsInStoreNeed
())
else
if
(
isFull
&&
IsInStoreNeed
())
{
{
...
@@ -552,7 +546,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -552,7 +546,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
);
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_06_TopCylinderUp
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_06_TopCylinderUp
))
{
{
CheckLog
(
"托盘检测(流水线阻挡)*************** 托盘号【"
+
currTrayNum
+
"】"
);
CheckLog
(
"托盘检测(流水线阻挡)*************** 托盘号【"
+
currTrayNum
+
"】"
);
//托盘号正确
//托盘号正确
...
@@ -567,19 +561,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -567,19 +561,17 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
SecondMoveInfo
.
EndStepWait
();
}
}
else
if
(
CheckIsNeedInStore
())
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】不是空盘,有对应的入库任务,等待移栽"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_08_WaitInStore
);
isNeedMove
=
true
;
}
else
else
{
{
if
(
CheckIsNeedInStore
())
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】不需要出入库, 放盘通过"
);
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】不是空盘,有对应的入库任务,等待移栽"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_08_WaitInStore
);
isNeedMove
=
true
;
}
else
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】不是空盘, 放盘通过"
);
}
}
}
if
(!
isNeedMove
)
if
(!
isNeedMove
)
{
{
//preTrayNum = num;
//preTrayNum = num;
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
73b57b2
...
@@ -171,6 +171,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -171,6 +171,7 @@ namespace OnlineStore.DeviceLibrary
CheckLog
(
"托盘放行 SecondMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
CheckLog
(
"托盘放行 SecondMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_15_WaitCanGo
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_15_WaitCanGo
);
//更新横移托盘已处理完成
//更新横移托盘已处理完成
//TODO 阻挡气缸是否需要处理
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
1
);
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
1
);
}
}
...
...
source/DeviceLibrary/assemblymanager/StoreServerManager.cs
查看文件 @
73b57b2
...
@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
try
try
{
{
string
codeStr
=
""
;
string
codeStr
=
""
;
foreach
(
string
str
in
codeList
)
foreach
(
string
str
in
codeList
)
{
{
if
(
codeStr
.
Equals
(
""
))
if
(
codeStr
.
Equals
(
""
))
{
{
...
@@ -39,14 +39,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -39,14 +39,10 @@ namespace OnlineStore.DeviceLibrary
//http://localhost/myproject/service/store/emptyPosForPutin
//http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid
// 参数:cids: 多个 cid
//code: 条码内容
//code: 条码内容
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
)
+
"?cids="
+
LineServer
.
GetAllCID
()
+
"&code=%3D"
+
codeStr
;
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
)
+
"?cids="
+
LineServer
.
GetAllCID
()
+
"&code=%3D"
+
codeStr
;
LogUtil
.
info
(
deviceName
+
"托盘【"
+
trayNum
+
"】 收到条码<< "
+
codeStr
+
",获取入库PosID:"
+
server
);
LogUtil
.
info
(
deviceName
+
"托盘【"
+
trayNum
+
"】 收到条码<< "
+
codeStr
+
",获取入库PosID:"
+
server
);
//发送扫码内容到服务器进行入库操作
// Operation operation =LineServer.GetInStoreOperation(codeStr);
// LineGetPosOp op = new LineGetPosOp(LineServer.GetAllCID(), codeStr);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LineOperation
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
LineOperation
>(
resultStr
);
LineOperation
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
LineOperation
>(
resultStr
);
if
(
serverResult
==
null
)
if
(
serverResult
==
null
)
...
@@ -68,33 +64,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -68,33 +64,25 @@ namespace OnlineStore.DeviceLibrary
{
{
return
msg
=
deviceName
+
"托盘【"
+
trayNum
+
"】 入库库位格式错误:条码【"
+
codeStr
+
"】库位【"
+
posId
+
"】"
;
return
msg
=
deviceName
+
"托盘【"
+
trayNum
+
"】 入库库位格式错误:条码【"
+
codeStr
+
"】库位【"
+
posId
+
"】"
;
}
}
//判断盘是否过高(7*8的盘需要判断,如果盘过高,不让盘通过,直接显示报警信息)
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
string
wareNum
=
serverResult
.
barcode
;
//根据库位号查找移栽
//根据库位号查找移栽
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
//取盘号
InOutParam
param
=
new
InOutParam
(
trayNum
,
wareNum
,
posId
,
plateH
,
plateW
);
string
wareNum
=
serverResult
.
barcode
;
if
(
LineManager
.
Line
.
IsReviceInPosId
(
moveEquip
,
posId
))
int
trayCode
=
TrayManager
.
GetTrayNum
(
0
);
{
LogUtil
.
info
(
"更新盘空满信息,托盘号【"
+
trayCode
+
"】,是否有料盘【"
+
true
+
"】,出库入库【"
+
1
+
"】"
);
LineManager
.
Line
.
WarnMsg
=
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
;
TrayManager
.
UpdateTrayInfo
(
trayCode
,
true
,
ReelType
.
InStore
,
wareNum
,
posId
,
plateH
,
plateW
);
moveEquip
.
WarnMsg
=
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
;
return
msg
=
(
"收到服务器入库命令 "
+
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
}
LogUtil
.
info
(
"更新盘空满信息,托盘号【"
+
trayNum
+
"】,是否有料盘【"
+
true
+
"】,出库入库【"
+
1
+
"】"
);
TrayManager
.
UpdateTrayInfo
(
trayNum
,
true
,
ReelType
.
InStore
,
wareNum
,
posId
,
plateH
,
plateW
);
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if
(
LineServer
.
BoxCanInStore
(
moveEquip
.
DeviceID
))
if
(
LineServer
.
BoxCanInStore
(
moveEquip
.
DeviceID
))
{
{
InOutParam
param
=
new
InOutParam
(
trayCode
,
wareNum
,
posId
,
plateH
,
plateW
);
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
if
(
LineManager
.
Line
.
IsReviceInPosId
(
moveEquip
,
posId
))
{
LineManager
.
Line
.
WarnMsg
=
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
;
moveEquip
.
WarnMsg
=
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
;
return
msg
=
(
"收到服务器入库命令 "
+
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
}
LineServer
.
CheckInStorePos
(
storeId
,
param
);
LineServer
.
CheckInStorePos
(
storeId
,
param
);
//StartInStoreMove(param);
TrayManager
.
UpdateTrayInfo
(
trayCode
,
true
,
1
,
codeStr
,
posId
,
plateH
,
plateW
);
}
}
}
}
}
}
...
@@ -103,81 +91,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -103,81 +91,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
}
}
return
""
;
return
""
;
}
}
///// <summary>
///// 是否已经扫码
///// </summary>
//private bool IsScanCode = false;
//private string CodeMsg = "";
//private static string ACCode = "";
//public void GetCameraCode()
//{
// if (IsInScan())
// {
// LogUtil.info("上次扫码还未执行完毕,请稍后!");
// return;
// }
// Task.Factory.StartNew(delegate
// {
// IsScanCode = true;
// LastScanTime = DateTime.Now;
// DateTime date = DateTime.Now;
// // IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
// List<string> codeList = CodeManager.CameraScan();
// if (codeList.Count <= 0)
// {
// codeList = CodeManager.CameraScan();
// }
// List<string> list = new List<string>();
// string outMsg = "";
// string message = "";
// int height = GetHeight();
// int width = GetWidth();
// //= 1 + 123.4x100.5 - 7x12 = CODE
// foreach (string str in codeList)
// {
// if (list.Contains(str.Trim()))
// {
// continue;
// }
// list.Add(str.Trim());
// //string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
// string code = width + "x" + height + "%3D" + str.Trim();
// message = message + code + spiltStr;
// }
// if (!outMsg.Equals(""))
// {
// CodeMsg = "盘尺寸错误,清理二维码【" + message + "】";
// LogUtil.error("盘尺寸错误,清理二维码【" + message + "】");
// message = "";
// }
// // KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
// onCodeReceived(message, height, width);
// IsScanCode = false;
// });
//}
//
//private DateTime LastScanTime = DateTime.Now;
//private bool IsInScan()
//{
// if (!IsScanCode)
// {
// return false;
// }
// TimeSpan span = DateTime.Now - LastScanTime;
// if (span.TotalSeconds > 60)
// {
// //大于60秒表示超时了,可以重新开始扫码
// return false;
// }
// return true;
//}
}
}
}
}
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
73b57b2
...
@@ -105,7 +105,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -105,7 +105,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
internal
static
void
UpdateTrayCode
(
int
trayNum
,
string
wareCode
=
""
)
internal
static
void
UpdateTrayCode
(
int
trayNum
,
string
wareCode
=
""
)
{
{
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】的条码为【"
+
wareCode
+
"】"
);
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】的条码为【"
+
wareCode
+
"】"
);
lock
(
fixtureMapLock
)
lock
(
fixtureMapLock
)
...
@@ -113,6 +113,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -113,6 +113,19 @@ namespace OnlineStore.DeviceLibrary
if
(
fixtureCodeFullMap
.
ContainsKey
(
trayNum
))
if
(
fixtureCodeFullMap
.
ContainsKey
(
trayNum
))
{
{
fixtureCodeFullMap
[
trayNum
].
WareCode
=
wareCode
;
fixtureCodeFullMap
[
trayNum
].
WareCode
=
wareCode
;
}
}
}
internal
static
void
UpdateInStoreNG
(
int
trayNum
,
bool
isNg
=
false
)
{
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】InStoreNG=【"
+
isNg
+
"】"
);
lock
(
fixtureMapLock
)
{
if
(
fixtureCodeFullMap
.
ContainsKey
(
trayNum
))
{
fixtureCodeFullMap
[
trayNum
].
InStoreNG
=
isNg
;
}
}
}
}
}
}
...
@@ -245,7 +258,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -245,7 +258,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
true
;
return
true
;
}
}
else
if
(
swNum
.
Equals
(
1
)
||
swNum
.
Equals
(
2
))
else
if
(
swNum
.
Equals
(
1
)
||
swNum
.
Equals
(
3
))
{
{
if
(
SidesWayStateMap
[
swNum
].
Equals
(
0
))
if
(
SidesWayStateMap
[
swNum
].
Equals
(
0
))
{
{
...
@@ -259,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -259,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
/// 更新横移托盘的处理状态
/// 更新横移托盘的处理状态
/// </summary>
/// </summary>
/// <param name="swNum">横移编号</param>
/// <param name="swNum">横移编号</param>
/// <param name="value">0=未处理等待中,1=托盘处理完成,可处理横移,2=托盘
正在
处理中</param>
/// <param name="value">0=未处理等待中,1=托盘处理完成,可处理横移,2=托盘
检测
处理中</param>
internal
static
void
UpdateSWState
(
int
swNum
,
int
value
)
internal
static
void
UpdateSWState
(
int
swNum
,
int
value
)
{
{
if
(
swNum
<=
0
)
if
(
swNum
<=
0
)
...
...
source/DeviceLibrary/deviceLibrary/RFID/RFIDManager.cs
查看文件 @
73b57b2
...
@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
private
static
List
<
string
>
RfIPList
=
new
List
<
string
>();
private
static
List
<
string
>
RfIPList
=
new
List
<
string
>();
private
static
System
.
Timers
.
Timer
conTimer
=
null
;
private
static
System
.
Timers
.
Timer
conTimer
=
null
;
internal
static
void
ConnectRFIOList
(
List
<
string
>
rfioNameList
)
public
static
void
ConnectRFIOList
(
List
<
string
>
rfioNameList
)
{
{
try
{
try
{
if
(
conTimer
==
null
)
if
(
conTimer
==
null
)
...
@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"连接RFIP模块 "
+
logName
+
" 出错:"
+
error
.
ToString
());
LogUtil
.
error
(
"连接RFIP模块 "
+
logName
+
" 出错:"
+
error
.
ToString
());
}
}
}
}
internal
static
void
CloseAllConnection
()
public
static
void
CloseAllConnection
()
{
{
foreach
(
Reader
reader
in
RFReaderMap
.
Values
)
foreach
(
Reader
reader
in
RFReaderMap
.
Values
)
{
{
...
...
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
73b57b2
...
@@ -193,11 +193,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -193,11 +193,12 @@ namespace OnlineStore.DeviceLibrary
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
foreach
(
string
codeType
in
codeTypeList
)
foreach
(
string
codeType
in
codeTypeList
)
{
{
Task
<
List
<
CodeInfo
>>
typeDeCode
=
Task
.
Factory
.
StartNew
(
delegate
()
Task
<
List
<
CodeInfo
>>
typeDeCode
=
new
Task
<
List
<
CodeInfo
>>
(
delegate
()
{
{
return
DeCode
(
ho_Image
,
codeType
);
return
DeCode
(
ho_Image
,
codeType
);
});
});
taskList
.
Add
(
typeDeCode
);
taskList
.
Add
(
typeDeCode
);
typeDeCode
.
Start
();
}
}
}
}
});
});
...
@@ -205,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -205,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
Task
.
WaitAll
(
taskList
.
ToArray
());
Task
.
WaitAll
(
taskList
.
ToArray
());
foreach
(
Task
<
List
<
CodeInfo
>>
t
in
taskList
)
foreach
(
Task
<
List
<
CodeInfo
>>
t
in
taskList
)
{
{
List
<
CodeInfo
>
cc
=
t
.
Result
;
List
<
CodeInfo
>
cc
=
t
.
Result
;
if
(
cc
.
Count
>
0
)
if
(
cc
.
Count
>
0
)
{
{
...
...
source/DeviceLibrary/model/TrayInfo.cs
查看文件 @
73b57b2
...
@@ -57,6 +57,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -57,6 +57,10 @@ namespace OnlineStore.DeviceLibrary
/// 料盘宽度
/// 料盘宽度
/// </summary>
/// </summary>
public
int
PlateW
{
get
;
set
;
}
public
int
PlateW
{
get
;
set
;
}
/// <summary>
/// 入库失败料盘,未扫到码或获取库位号失败
/// </summary>
public
bool
InStoreNG
=
false
;
public
bool
EmergencyOut
=
false
;
public
bool
EmergencyOut
=
false
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论