Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b933db27
由
LN
编写于
2019-09-16 10:35:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
5744dc8a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
257 行增加
和
146 行删除
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/LineConfig/Config_FeedingEquip_1.csv
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/TrayManager.cs
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/model/StoreMoveInfo.cs
source/DeviceLibrary/server/BoxInfo.cs
source/DeviceLibrary/server/LineServer.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
b933db2
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
b933db2
...
...
@@ -44,29 +44,27 @@ namespace OnlineStore.AssemblyLine
FrmIOStatus
ioStatus
=
new
FrmIOStatus
();
AddForm
(
" 流水线IO状态 "
,
ioStatus
);
List
<
MoveEquip
>
moveEquipList
=
new
List
<
MoveEquip
>(
lineBean
.
MoveEquipMap
.
Values
);
for
(
int
i
=
0
;
i
<
moveEquipList
.
Count
;
i
++)
{
MoveEquip
store
=
moveEquipList
[
i
];
FrmMoveEquip
test
=
new
FrmMoveEquip
(
store
);
AddForm
(
" "
+
store
.
Name
,
test
);
}
List
<
FeedingEquip
>
feeds
=
new
List
<
FeedingEquip
>(
lineBean
.
FeedingEquipMap
.
Values
);
for
(
int
i
=
0
;
i
<
feeds
.
Count
;
i
++)
{
FeedingEquip
feed
=
feeds
[
i
];
FrmFeedingEquip
test
=
new
FrmFeedingEquip
(
feed
);
AddForm
(
" "
+
feed
.
Name
,
test
);
AddForm
(
" "
+
feed
.
Name
+
" "
,
test
);
}
List
<
ProvidingEquip
>
provids
=
new
List
<
ProvidingEquip
>(
lineBean
.
ProvidingEquipMap
.
Values
);
for
(
int
i
=
0
;
i
<
provids
.
Count
;
i
++)
{
ProvidingEquip
provid
=
provids
[
i
];
FrmProvidingEquip
test
=
new
FrmProvidingEquip
(
provid
);
AddForm
(
" "
+
provid
.
Name
,
test
);
}
List
<
MoveEquip
>
moveEquipList
=
new
List
<
MoveEquip
>(
lineBean
.
MoveEquipMap
.
Values
);
for
(
int
i
=
0
;
i
<
moveEquipList
.
Count
;
i
++)
{
MoveEquip
store
=
moveEquipList
[
i
];
FrmMoveEquip
test
=
new
FrmMoveEquip
(
store
);
AddForm
(
" "
+
store
.
Name
,
test
);
AddForm
(
" "
+
provid
.
Name
+
" "
,
test
);
}
lblCID
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Line_CID
);
chbLineDebug
.
Checked
=
TrayManager
.
LineRunTest
;
...
...
@@ -109,14 +107,14 @@ namespace OnlineStore.AssemblyLine
private
void
LoadListView
()
{
this
.
listView1
.
Columns
.
Clear
();
AddHealder
(
"设备名称"
,
1
4
0
);
AddHealder
(
"
移栽报警"
,
8
0
);
AddHealder
(
"设备名称"
,
1
0
0
);
AddHealder
(
"
报警"
,
10
0
);
// AddHealder("设备状态", 100);
AddHealder
(
"
移栽状态"
,
15
0
);
AddHealder
(
"
状态"
,
10
0
);
AddHealder
(
"BOX_CID"
,
80
);
AddHealder
(
"BOX报警"
,
100
);
AddHealder
(
"更新时间"
,
80
);
AddHealder
(
"BOX状态"
,
listView1
.
Size
.
Width
-
100
-
80
-
80
-
1
50
-
80
-
14
0
-
8
);
AddHealder
(
"BOX状态"
,
listView1
.
Size
.
Width
-
100
-
80
-
80
-
1
00
-
100
-
10
0
-
8
);
foreach
(
MoveEquip
move
in
lineBean
.
MoveEquipMap
.
Values
)
{
ListViewItem
lvi
=
new
ListViewItem
();
...
...
@@ -141,7 +139,28 @@ namespace OnlineStore.AssemblyLine
}
this
.
listView1
.
Items
.
Add
(
lvi
);
}
ListViewItem
emptyView
=
new
ListViewItem
();
this
.
listView1
.
Items
.
Add
(
emptyView
);
foreach
(
FeedingEquip
equip
in
lineBean
.
FeedingEquipMap
.
Values
)
{
ListViewItem
lvi
=
new
ListViewItem
();
lvi
.
Text
=
equip
.
Name
;
lvi
.
SubItems
.
Add
(
equip
.
alarmType
.
ToString
());
// lvi.SubItems.Add(move.lineStatus.ToString());
lvi
.
SubItems
.
Add
(
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
this
.
listView1
.
Items
.
Add
(
lvi
);
}
this
.
listView1
.
Items
.
Add
((
ListViewItem
)
emptyView
.
Clone
());
foreach
(
ProvidingEquip
equip
in
lineBean
.
ProvidingEquipMap
.
Values
)
{
ListViewItem
lvi
=
new
ListViewItem
();
lvi
.
Text
=
equip
.
Name
;
lvi
.
SubItems
.
Add
(
equip
.
alarmType
.
ToString
());
// lvi.SubItems.Add(move.lineStatus.ToString());
lvi
.
SubItems
.
Add
(
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
this
.
listView1
.
Items
.
Add
(
lvi
);
}
cmbBoxIndex
.
Items
.
Clear
();
foreach
(
int
key
in
lineBean
.
MoveEquipMap
.
Keys
)
{
...
...
@@ -380,9 +399,7 @@ namespace OnlineStore.AssemblyLine
{
ListViewItem
lvi
=
new
ListViewItem
();
lvi
.
Text
=
move
.
Name
;
SetItemText
(
i
,
1
,
move
.
alarmType
.
ToString
());
// this.listView1.Items[i].SubItems[2].Text = move.lineStatus.ToString();
SetItemText
(
i
,
1
,
move
.
alarmType
.
ToString
());
SetItemText
(
i
,
2
,
KTK_Store
.
GetRunStr
(
move
.
lineStatus
,
move
.
runStatus
));
BoxInfo
box
=
LineServer
.
GetBoxInfo
(
move
.
DeviceID
);
if
(
box
!=
null
)
...
...
@@ -390,29 +407,27 @@ namespace OnlineStore.AssemblyLine
SetItemText
(
i
,
3
,
box
.
CId
.
ToString
());
SetItemText
(
i
,
4
,
box
.
SAlarmType
.
ToString
());
SetItemText
(
i
,
5
,
box
.
LastMsgTime
.
ToLongTimeString
());
SetItemText
(
i
,
6
,
box
.
ToShowStr
());
}
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
{
SetItemColor
(
i
,
Color
.
White
);
//listView1.Items[i].BackColor = Color.White;
}
else
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
HomeMoving
)
||
move
.
runStatus
.
Equals
(
LineRunStatus
.
Reset
))
{
SetItemColor
(
i
,
Color
.
Orange
);
}
else
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Busy
))
{
SetItemColor
(
i
,
Color
.
Green
);
}
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Runing
))
{
SetItemColor
(
i
,
Color
.
LightBlue
);
SetItemText
(
i
,
6
,
box
.
ToShowStr
());
}
SetItemColor
(
i
,
move
.
runStatus
);
i
++;
}
i
++;
foreach
(
FeedingEquip
equip
in
lineBean
.
FeedingEquipMap
.
Values
)
{
SetItemText
(
i
,
1
,
equip
.
alarmType
.
ToString
());
SetItemText
(
i
,
2
,
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
SetItemColor
(
i
,
equip
.
runStatus
);
i
++;
}
i
++;
foreach
(
ProvidingEquip
equip
in
lineBean
.
ProvidingEquipMap
.
Values
)
{
SetItemText
(
i
,
1
,
equip
.
alarmType
.
ToString
());
SetItemText
(
i
,
2
,
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
SetItemColor
(
i
,
equip
.
runStatus
);
i
++;
}
if
(
lineBean
.
runStatus
>
LineRunStatus
.
Wait
)
{
if
(
启动
AToolStripMenuItem
.
Enabled
.
Equals
(
true
))
...
...
@@ -436,6 +451,28 @@ namespace OnlineStore.AssemblyLine
SetMenuS
(
停止
TToolStripMenuItem
,
false
);
}
}
private
void
SetItemColor
(
int
i
,
LineRunStatus
runStatus
)
{
if
(
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
{
SetItemColor
(
i
,
Color
.
White
);
//listView1.Items[i].BackColor = Color.White;
}
else
if
(
runStatus
.
Equals
(
LineRunStatus
.
HomeMoving
)
||
runStatus
.
Equals
(
LineRunStatus
.
Reset
))
{
SetItemColor
(
i
,
Color
.
Orange
);
}
else
if
(
runStatus
.
Equals
(
LineRunStatus
.
Busy
))
{
SetItemColor
(
i
,
Color
.
Green
);
}
if
(
runStatus
.
Equals
(
LineRunStatus
.
Runing
))
{
SetItemColor
(
i
,
Color
.
LightBlue
);
}
}
private
void
SetMenuS
(
ToolStripMenuItem
toolMenu
,
bool
isEn
)
{
if
(!
toolMenu
.
Enabled
.
Equals
(
isEn
))
...
...
source/DeviceLibrary/LineConfig/Config_FeedingEquip_1.csv
查看文件 @
b933db2
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,阻挡气缸控制信号(1-4分别对应夹具检测1-4),StopCylinderIOType,1
,,,,,
,,,,
,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,0,,,,,
PRO,0,移栽上下移动料盘高度对应的上升位置,UpDownPositions,12=1000;16=1300;20=2000;24=2000;36=3000;,,,,,
,
PRO,0,移栽上下移动料盘高度对应的上升位置,UpDownPositions,12=1000;16=1300;20=2000;24=2000;36=3000;,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,2,COM1,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
...
...
@@ -11,3 +11,5 @@ PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
PRO,0,移栽上下轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,
PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
,,,,,,,,,
PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
b933db2
...
...
@@ -20,11 +20,7 @@ namespace OnlineStore.DeviceLibrary
public
bool
UpdownUseAxis
=
false
;
public
AxisAlarmInfo
AxisAlarm
=
new
AxisAlarmInfo
();
public
FeedingEquip_Config
Config
;
/// <summary>
///入料装置后面分为两条移动线
/// </summary>
public
LineMoveInfo
SecondMoveInfo
=
null
;
// public List<InOutParam> waitOutStoreList = new List<InOutParam>();
public
List
<
InOutParam
>
waitInStoreList
=
new
List
<
InOutParam
>();
...
...
@@ -46,8 +42,7 @@ namespace OnlineStore.DeviceLibrary
}
//this.Box = box;
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"入料-"
+
DeviceID
+
"-MoveInfo"
);
SecondMoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"入料-"
+
DeviceID
+
"-SecondMoveInfo"
);
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"入料-"
+
DeviceID
+
"-MoveInfo"
);
IsDebug
=
config
.
IsDebug
.
Equals
(
1
);
UpdownUseAxis
=
config
.
UpDownUseAxis
.
Equals
(
1
);
if
(
UpdownUseAxis
)
...
...
@@ -70,8 +65,7 @@ namespace OnlineStore.DeviceLibrary
public
override
bool
StartRun
(
)
{
mainTimer
.
Enabled
=
false
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
lineStatus
=
LineStatus
.
StoreOnline
;
//TODO 调试时暂时注释
runStatus
=
LineRunStatus
.
HomeMoving
;
...
...
@@ -81,8 +75,7 @@ namespace OnlineStore.DeviceLibrary
public
bool
StartDebugRun
()
{
mainTimer
.
Enabled
=
false
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
lineStatus
=
LineStatus
.
StoreOnline
;
//TODO 调试时暂时注释
runStatus
=
LineRunStatus
.
HomeMoving
;
...
...
@@ -141,11 +134,11 @@ namespace OnlineStore.DeviceLibrary
// break;
default
:
break
;
}
if
(
MoveInfo
.
MoveType
==
LineMoveType
.
InStore
||
this
.
SecondMoveInfo
.
MoveType
==
LineMoveType
.
InStore
)
if
(
MoveInfo
.
MoveType
==
LineMoveType
.
InStore
)
{
InStoreProcess
();
}
else
if
(
MoveInfo
.
MoveType
==
LineMoveType
.
OutStore
||
SecondMoveInfo
.
MoveType
==
LineMoveType
.
OutStore
)
else
if
(
MoveInfo
.
MoveType
==
LineMoveType
.
OutStore
)
{
OutStoreProcess
();
}
...
...
@@ -160,12 +153,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveType
==
LineMoveType
.
StopMove
)
{
StopMoveProcess
();
}
if
(
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
CheckFixture
))
{
//CheckFixtureProcess();
}
}
}
...
...
@@ -191,7 +179,7 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess
();
//判断流水线打开了才可以运行
if
(
Second
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
LineBean
lineBean
=
LineManager
.
Line
;
if
(
lineBean
.
isCanProcessLine
()
&&
IOManager
.
IOValue
(
IO_Type
.
DriveMotor_Run
,
0
).
Equals
(
IO_VALUE
.
HIGH
)
&&
lineBean
.
runStatus
>=
LineRunStatus
.
Runing
&&
lineBean
.
IsSleep
.
Equals
(
false
))
...
...
@@ -226,7 +214,7 @@ namespace OnlineStore.DeviceLibrary
}
//若BOX和入料都没有在等待Io的过程中则此Io超时异常可能已经处理过
if
(
MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
SecondMoveInfo
.
IsInWait
.
Equals
(
false
)
)
if
(
MoveInfo
.
IsInWait
.
Equals
(
false
))
{
LogUtil
.
info
(
Name
+
"清理信号超时报警【"
+
WarnMsg
+
"】 "
);
alarmType
=
LineAlarmType
.
None
;
...
...
@@ -294,8 +282,7 @@ namespace OnlineStore.DeviceLibrary
// preTrayNum = 0;
// currMoveTrayNum = 0;
LogInfo
(
"开始重置:清零上一个托盘号,(上下气缸回原点,阻挡气缸输入=0 )开始;"
);
runStatus
=
LineRunStatus
.
Reset
;
SecondMoveInfo
.
EndMove
();
runStatus
=
LineRunStatus
.
Reset
;
MoveInfo
.
NewMove
(
LineMoveType
.
Reset
);
UpdownHomeMove
();
...
...
@@ -323,11 +310,8 @@ namespace OnlineStore.DeviceLibrary
{
CheckWait
(
MoveInfo
);
}
else
if
(
SecondMoveInfo
.
IsInWait
)
{
CheckWait
(
SecondMoveInfo
);
}
if
(!
MoveInfo
.
IsInWait
&&
!
SecondMoveInfo
.
IsInWait
)
if
(!
MoveInfo
.
IsInWait
)
{
//流水线各装置复原位,夹料气缸状态不变
//阻挡气缸全部=0
...
...
@@ -350,12 +334,10 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Slack
,
IO_Type
.
ClampCylinder_Tighten
);
break
;
case
LineMoveStep
.
MH_OtherCylinder_Back
:
case
LineMoveStep
.
MH_OtherCylinder_Back
:
LogInfo
(
"重置完成!"
);
runStatus
=
LineRunStatus
.
Runing
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
break
;
//TODO 需要继续之前的的出入库处理
//ContinueInOutStore();
...
...
@@ -372,12 +354,8 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
IsInWait
)
{
CheckWait
(
MoveInfo
);
}
if
(
SecondMoveInfo
.
IsInWait
)
{
CheckWait
(
SecondMoveInfo
);
}
if
(!
MoveInfo
.
IsInWait
&&
!
SecondMoveInfo
.
IsInWait
)
}
if
(!
MoveInfo
.
IsInWait
)
{
switch
(
MoveInfo
.
MoveStep
)
{
...
...
@@ -397,8 +375,7 @@ namespace OnlineStore.DeviceLibrary
break
;
case
LineMoveStep
.
MH_OtherCylinder_Back
:
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
LogInfo
(
"原点返回完成!"
);
runStatus
=
LineRunStatus
.
Runing
;
//如果是调试模式,入料装置两个阻挡气缸落下,并且不再移动
...
...
@@ -423,11 +400,8 @@ namespace OnlineStore.DeviceLibrary
{
CheckWait
(
MoveInfo
);
}
if
(
SecondMoveInfo
.
IsInWait
)
{
CheckWait
(
SecondMoveInfo
);
}
if
(!
MoveInfo
.
IsInWait
&&
!
SecondMoveInfo
.
IsInWait
)
if
(!
MoveInfo
.
IsInWait
)
{
switch
(
MoveInfo
.
MoveStep
)
{
...
...
@@ -473,8 +447,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
DelNeedEmptyTrayNum
();
MoveInfo
.
EndMove
();
}
runStatus
=
LineRunStatus
.
Busy
;
SecondMoveInfo
.
EndMove
();
runStatus
=
LineRunStatus
.
Busy
;
LogInfo
(
"停止运动:(上下气缸上升端,阻挡气缸输入=0 )开始 "
);
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
b933db2
...
...
@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
string
msg
=
Name
+
"
出现托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号【"
+
trayNum
+
"(有料盘)
】"
;
string
msg
=
Name
+
"
托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前有料托盘【"
+
trayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"
】"
;
TrayManager
.
UpdateTrayNumError
(
0
,
msg
);
LogUtil
.
error
(
msg
);
}
...
...
@@ -169,7 +169,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
string
msg
=
Name
+
"
出现托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号【"
+
trayNum
+
"(空盘)
】"
;
string
msg
=
Name
+
"
托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前空托盘【"
+
trayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"
】"
;
TrayManager
.
UpdateTrayNumError
(
0
,
msg
);
LogUtil
.
error
(
msg
);
}
...
...
@@ -181,7 +181,7 @@ namespace OnlineStore.DeviceLibrary
{
IsWaitToScan
=
false
;
IsWaitEmptyGo
=
false
;
LogUtil
.
error
(
Name
+
Config
.
StopCylinderIOType
+
"检测到Fixture_Check_4亮,但是托盘号为0,不处理托盘~"
);
LogUtil
.
debug
(
Name
+
Config
.
StopCylinderIOType
+
"检测到Fixture_Check_4亮,但是托盘号为0,不处理托盘~"
);
}
}
...
...
@@ -305,6 +305,16 @@ namespace OnlineStore.DeviceLibrary
else
if
(
wait
.
WaitType
==
3
)
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
else
if
(
wait
.
WaitType
==
8
)
{
string
posId
=
checkWaitInfo
.
MoveParam
.
PosId
;
int
id
=
checkWaitInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
RightInPosId
(
id
,
posId
);
}
else
if
(
wait
.
WaitType
.
Equals
(
9
))
{
int
storeId
=
checkWaitInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
}
if
(
wait
.
IsEnd
&&
checkWaitInfo
.
OneWaitCanEndStep
)
{
...
...
@@ -404,9 +414,14 @@ namespace OnlineStore.DeviceLibrary
InOutLog
(
"开始入库忙碌中[BUSY]"
);
MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
LI_00_Wait100
);
MoveInfo
.
MoveParam
=
param
;
preTrayNum
=
param
.
TrayNumber
;
//InOutLog("入库处理:(LI_00_Wait100 ,等待300毫秒后再放行 ) 开始");
//StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
//等待料仓验证成功,最多等待10秒,若验证不成功,直接失败
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCanInstore
());
MoveInfo
.
OneWaitCanEndStep
=
true
;
}
protected
override
void
InStoreProcess
()
{
...
...
@@ -425,10 +440,33 @@ namespace OnlineStore.DeviceLibrary
switch
(
MoveInfo
.
MoveStep
)
{
case
LineMoveStep
.
LI_00_Wait100
:
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
);
//判断是否可以入库
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
{
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
);
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
b933db2
...
...
@@ -33,7 +33,6 @@ namespace OnlineStore.DeviceLibrary
public
MoveEquip
(
string
cid
,
MoveEquip_Config
config
)
{
baseConfig
=
config
;
this
.
DeviceID
=
config
.
Id
;
this
.
Config
=
config
;
Name
=
(
" "
+
"_移栽_"
+
DeviceID
+
" "
).
ToUpper
();
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
b933db2
...
...
@@ -131,6 +131,17 @@ namespace OnlineStore.DeviceLibrary
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
else
if
(
wait
.
WaitType
==
8
)
{
string
posId
=
moveInfo
.
MoveParam
.
PosId
;
int
id
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
RightInPosId
(
id
,
posId
);
}
else
if
(
wait
.
WaitType
.
Equals
(
9
))
{
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
}
if
(
wait
.
IsEnd
&&
moveInfo
.
OneWaitCanEndStep
)
{
isOk
=
true
;
...
...
@@ -408,11 +419,12 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_09_UpDownCylinderUp
))
{
InStoreLog
(
"入库:(MI_10_BeforeAfterCylinderBefore,前后气缸1前进)"
);
int
num
=
MoveInfo
.
MoveParam
.
TrayNumber
;
InStoreLog
(
"入库:(MI_10_BeforeAfterCylinderBefore,前后气缸1前进),更新盘号【"
+
num
+
"】为空盘"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_10_BeforeAfterCylinderBefore
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_After
,
IO_Type
.
BeforeAfterCylinder_Before
);
int
num
=
TrayManager
.
GetNum
(
DeviceID
);
LogInfo
(
"入库【"
+
posId
+
"】处理: 物品已移走,重新读取并更新盘号【"
+
num
+
"】为空盘"
);
//
int num = TrayManager.GetNum(DeviceID);
//
LogInfo("入库【" + posId + "】处理: 物品已移走,重新读取并更新盘号【" + num + "】为空盘");
TrayManager
.
UpdateFixtureValue
(
num
,
false
,
0
);
//阻挡气缸移动
...
...
@@ -423,9 +435,9 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_10_BeforeAfterCylinderBefore
))
{
LogInfo
(
"入库【"
+
posId
+
"】处理(等待移栽):(判断box门口没有盘
之后,才能把料盘放下
"
);
LogInfo
(
"入库【"
+
posId
+
"】处理(等待移栽):(判断box门口没有盘
, 且可以入库,才能把料盘放下)
"
);
//此处需要等待box门口没有盘
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
Wait
IO
(
IO_Type
.
TrayCheck
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
Wait
BoxCanReviceTray
(
));
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_10_WaitBox
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_10_WaitBox
))
...
...
@@ -669,7 +681,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
string
msg
=
Name
+
"
出现托盘顺序错乱,上一个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currMoveTrayNum
+
"】"
;
string
msg
=
Name
+
"
托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currMoveTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
LogUtil
.
error
(
msg
);
return
;
...
...
@@ -682,7 +694,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上
一个托盘号【"
+
preTrayNum
+
"】,当前托盘号【(isFull="
+
isFull
+
"):"
+
currMoveTrayNum
+
"】没有匹配的
出入库任务,放盘通过~"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上
个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
currMoveTrayNum
+
"】没有
出入库任务,放盘通过~"
);
// preTrayNum = currMoveTrayNum;
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
{
...
...
@@ -817,6 +829,28 @@ namespace OnlineStore.DeviceLibrary
}
public
void
CylinderMove
(
LineMoveInfo
moveInfo
,
string
IoLowType
,
string
IoHighType
)
{
IOMove
(
IoLowType
,
IO_VALUE
.
LOW
);
IOMove
(
IoHighType
,
IO_VALUE
.
HIGH
);
if
(
moveInfo
!=
null
)
{
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IoLowType
,
IO_VALUE
.
LOW
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IoHighType
,
IO_VALUE
.
HIGH
));
}
}
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
)
{
IOManager
.
IOMove
(
IoType
,
value
,
Config
.
Id
);
}
public
IO_VALUE
IOValue
(
string
IoType
)
{
return
IOManager
.
IOValue
(
IoType
,
Config
.
Id
);
}
public
void
LogInfo
(
string
logInfo
)
{
LogUtil
.
info
(
Name
+
logInfo
);
}
}
}
source/DeviceLibrary/assemblyLine/TrayManager.cs
查看文件 @
b933db2
...
...
@@ -159,34 +159,22 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
/// <summary>
/// 验证托盘号是否正确
/// </summary>
public
static
bool
RightTrayCode
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
)
{
if
(
preTrayNum
==
0
)
{
return
true
;
}
else
if
(
trayNum
==
preTrayNum
+
1
)
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
(
MaxTrayNum
>
0
&&
trayNum
==
1
&&
preTrayNum
==
MaxTrayNum
)
{
return
true
;
}
if
(
trayNum
==
1
&&
MaxTrayNum
==
0
&&
isCanUpdateMax
)
{
MaxTrayNum
=
preTrayNum
;
LogUtil
.
info
(
"更新MaxTrayNum="
+
preTrayNum
);
return
true
;
}
else
if
(
isCanUpdateMax
==
false
&&
MaxTrayNum
==
0
)
else
if
(
trayNum
.
Equals
(
1
)
&&
preTrayNum
>=
MaxTrayNum
)
{
return
true
;
}
}
return
false
;
}
...
...
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
b933db2
...
...
@@ -520,10 +520,10 @@ namespace OnlineStore.DeviceLibrary
return
value
;
}
private
Box_Addr
GetAddr
(
ushort
StartAddress
)
{
return
(
Box_Addr
)(
StartAddress
);
}
//
private Box_Addr GetAddr(ushort StartAddress)
//
{
//
return (Box_Addr)(StartAddress);
//
}
private
Box_Sta
GetBox_Sta
(
IO_VALUE
onOff
)
{
if
(
onOff
.
Equals
(
IO_VALUE
.
HIGH
))
...
...
source/DeviceLibrary/model/StoreMoveInfo.cs
查看文件 @
b933db2
...
...
@@ -244,6 +244,18 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
false
;
return
wait
;
}
public
static
WaitResultInfo
WaitCanInstore
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
8
;
return
wait
;
}
public
static
WaitResultInfo
WaitBoxCanReviceTray
(
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
9
;
return
wait
;
}
public
string
ToStr
()
{
if
(
WaitType
==
1
)
...
...
@@ -279,6 +291,13 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
WaitType
==
7
)
{
return
"料盘高度【"
+
HeightValue
+
"】 "
;
}
else
if
(
WaitType
==
8
)
{
return
"入库库位验证完成"
;
}
else
if
(
WaitType
==
9
)
{
return
"入库BOX可以开始入库"
;
}
else
{
...
...
@@ -334,6 +353,8 @@ namespace OnlineStore.DeviceLibrary
/// 高度
/// </summary>
public
int
HeightValue
{
get
;
set
;
}
}
public
enum
LineMoveType
{
...
...
source/DeviceLibrary/server/BoxInfo.cs
查看文件 @
b933db2
using
System
;
using
System.Collections.Generic
;
namespace
OnlineStore.DeviceLibrary
{
...
...
@@ -13,10 +14,10 @@ namespace OnlineStore.DeviceLibrary
SRunStatus
=
(
int
)
LineRunStatus
.
Wait
;
SAlarmType
=
LineAlarmType
.
None
;
HasTray
=
0
;
WaitInStoreList
=
new
List
<
string
>();
}
public
BoxInfo
(
int
id
,
string
cid
,
int
seq
,
int
ss
,
int
runs
,
int
hasTray
,
int
alarmType
)
public
BoxInfo
(
int
id
,
string
cid
,
int
seq
,
int
ss
,
int
runs
,
int
hasTray
,
int
alarmType
,
List
<
string
>
inList
)
{
this
.
ID
=
id
;
CId
=
cid
;
...
...
@@ -26,6 +27,7 @@ namespace OnlineStore.DeviceLibrary
SAlarmType
=
(
LineAlarmType
)
alarmType
;
LastMsgTime
=
DateTime
.
Now
;
this
.
HasTray
=
hasTray
;
this
.
WaitInStoreList
=
inList
;
}
public
string
ToShowStr
()
...
...
@@ -69,5 +71,6 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
int
HasTray
{
get
;
set
;
}
public
List
<
string
>
WaitInStoreList
=
new
List
<
string
>();
}
}
source/DeviceLibrary/server/LineServer.cs
查看文件 @
b933db2
...
...
@@ -71,7 +71,25 @@ namespace OnlineStore.DeviceLibrary
}
return
false
;
}
/// <summary>
/// 判断库位是否验证成功
/// </summary>
public
static
bool
RightInPosId
(
int
id
,
string
posId
)
{
BoxInfo
box
=
GetBoxInfo
(
id
);
if
(
box
!=
null
)
{
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
if
(
span
.
TotalSeconds
<
ClientKeepSecond
)
{
if
(
box
.
WaitInStoreList
!=
null
&&
box
.
WaitInStoreList
.
Contains
(
posId
))
{
return
true
;
}
}
}
return
false
;
}
/// <summary>
/// 移栽装置送盘到料仓门口时,需要判断是否可以将盘送入
/// </summary>
...
...
@@ -83,22 +101,14 @@ namespace OnlineStore.DeviceLibrary
if
(
box
!=
null
)
{
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
if
(
span
.
TotalSeconds
<
ClientKeepSecond
&&
box
.
HasTray
.
Equals
(
0
)&&
box
.
SAlarmType
.
Equals
(
LineAlarmType
.
None
))
if
(
span
.
TotalSeconds
<
ClientKeepSecond
&&
box
.
HasTray
.
Equals
(
0
)&&
box
.
SAlarmType
.
Equals
(
LineAlarmType
.
None
)
)
{
LineRunStatus
runs
=
(
LineRunStatus
)
box
.
SRunStatus
;
if
(
runs
.
Equals
(
LineRunStatus
.
Runing
))
{
return
true
;
}
else
if
(
runs
.
Equals
(
LineRunStatus
.
Busy
))
{
LineStatus
status
=
(
LineStatus
)
box
.
SStatus
;
if
(
status
.
Equals
(
LineStatus
.
StoreOnline
)
||
status
.
Equals
(
LineStatus
.
InStoreEnd
)
||
status
.
Equals
(
LineStatus
.
InStoreExecute
))
{
return
true
;
}
}
}
}
}
return
false
;
...
...
@@ -240,6 +250,10 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
"CheckInStorePos【"
+
id
+
"】【"
+
msg
+
"】失败"
);
}
else
{
// LogUtil.info("CheckInStorePos【" + id + "】【" + msg + "】发送成功");
}
}
}
catch
(
Exception
ex
)
{
...
...
@@ -321,7 +335,7 @@ namespace OnlineStore.DeviceLibrary
else
{
int
id
=
storeSMsg
.
StoreId
;
BoxInfo
box
=
new
BoxInfo
(
storeSMsg
.
StoreId
,
storeSMsg
.
Cid
,
storeSMsg
.
Seq
,
storeSMsg
.
SStatus
,
storeSMsg
.
SRunStatus
,
storeSMsg
.
DoorHasTray
,
storeSMsg
.
AlarmType
);
BoxInfo
box
=
new
BoxInfo
(
storeSMsg
.
StoreId
,
storeSMsg
.
Cid
,
storeSMsg
.
Seq
,
storeSMsg
.
SStatus
,
storeSMsg
.
SRunStatus
,
storeSMsg
.
DoorHasTray
,
storeSMsg
.
AlarmType
,
storeSMsg
.
WaitInStoreList
);
SaveBoxClient
(
id
,
box
,
client
);
string
cmd
=
storeSMsg
.
Cmd
;
...
...
@@ -405,6 +419,8 @@ namespace OnlineStore.DeviceLibrary
public
string
PosId
=
""
;
public
string
PlateH
=
"0"
;
public
string
PlateW
=
"0"
;
public
List
<
string
>
WaitInStoreList
=
new
List
<
string
>();
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论