Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 67ccc046
由
LN
编写于
2019-12-06 16:08:56 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
0bcf605c
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
195 行增加
和
105 行删除
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
source/AssemblyLineClient/FrmFeedingEquip.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/Common/bean/Bean.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/MoveEquip.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/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/model/KTK_Store.cs
source/DeviceLibrary/model/TrayInfo.cs
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
查看文件 @
67ccc04
...
...
@@ -94,6 +94,7 @@
this
.
chbMoveStop
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
lblName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnScan
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblwidth
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
...
...
@@ -581,7 +582,7 @@
this
.
lblThisSta
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblThisSta
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblThisSta
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblThisSta
.
Location
=
new
System
.
Drawing
.
Point
(
406
,
65
);
this
.
lblThisSta
.
Location
=
new
System
.
Drawing
.
Point
(
406
,
110
);
this
.
lblThisSta
.
Name
=
"lblThisSta"
;
this
.
lblThisSta
.
Size
=
new
System
.
Drawing
.
Size
(
720
,
109
);
this
.
lblThisSta
.
TabIndex
=
246
;
...
...
@@ -696,6 +697,7 @@
this
.
groupBox6
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupBox6
.
Controls
.
Add
(
this
.
lblwidth
);
this
.
groupBox6
.
Controls
.
Add
(
this
.
lblMoveInfo
);
this
.
groupBox6
.
Controls
.
Add
(
this
.
lblAgvInfo
);
this
.
groupBox6
.
Controls
.
Add
(
this
.
lblInstoreList
);
...
...
@@ -736,7 +738,7 @@
this
.
lblInstoreList
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblInstoreList
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
lblInstoreList
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblInstoreList
.
Location
=
new
System
.
Drawing
.
Point
(
406
,
175
);
this
.
lblInstoreList
.
Location
=
new
System
.
Drawing
.
Point
(
406
,
220
);
this
.
lblInstoreList
.
Name
=
"lblInstoreList"
;
this
.
lblInstoreList
.
Size
=
new
System
.
Drawing
.
Size
(
720
,
109
);
this
.
lblInstoreList
.
TabIndex
=
277
;
...
...
@@ -1150,6 +1152,17 @@
this
.
btnScan
.
UseVisualStyleBackColor
=
false
;
this
.
btnScan
.
Click
+=
new
System
.
EventHandler
(
this
.
btnScan_Click
);
//
// lblwidth
//
this
.
lblwidth
.
AutoSize
=
true
;
this
.
lblwidth
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblwidth
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblwidth
.
Location
=
new
System
.
Drawing
.
Point
(
248
,
78
);
this
.
lblwidth
.
Name
=
"lblwidth"
;
this
.
lblwidth
.
Size
=
new
System
.
Drawing
.
Size
(
92
,
17
);
this
.
lblwidth
.
TabIndex
=
279
;
this
.
lblwidth
.
Text
=
"当前料盘宽度:"
;
//
// FrmFeedingEquip
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
...
@@ -1267,6 +1280,7 @@
private
System
.
Windows
.
Forms
.
CheckBox
chbMoveStop
;
private
System
.
Windows
.
Forms
.
Button
btnOLine
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage3
;
private
System
.
Windows
.
Forms
.
Label
lblwidth
;
}
}
source/AssemblyLineClient/FrmFeedingEquip.cs
查看文件 @
67ccc04
...
...
@@ -133,6 +133,7 @@ namespace OnlineStore.AssemblyLine
lblInstoreList
.
Text
=
text
;
}
lblMoveInfo
.
Text
=
equipBean
.
GetMoveStr
();
lblwidth
.
Text
=
" "
;
}
catch
(
Exception
ex
)
{
...
...
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
67ccc04
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
67ccc04
...
...
@@ -718,5 +718,16 @@ namespace OnlineStore.AssemblyLine
FrmIOMsg
frm
=
new
FrmIOMsg
();
frm
.
ShowDialog
();
}
private
void
btnTrayInfo_Click
(
object
sender
,
EventArgs
e
)
{
List
<
TrayInfo
>
tray
=
TrayManager
.
getTrayList
();
LogUtil
.
info
(
"-------------------开始打印托盘信息:"
);
foreach
(
TrayInfo
t
in
tray
)
{
LogUtil
.
info
(
t
.
ToStr
());
}
LogUtil
.
info
(
"-------------------结束打印托盘信息"
);
}
}
}
source/Common/bean/Bean.cs
查看文件 @
67ccc04
...
...
@@ -17,8 +17,10 @@ namespace OnlineStore.Common
public
string
cids
=
""
;
public
string
code
=
""
;
}
public
class
LineOperation
{
// //{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
/// <summary>
/// 0=成功
/// </summary>
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
67ccc04
...
...
@@ -482,7 +482,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
debug
(
Name
+
msg
);
}
protected
void
In
Store
Log
(
string
msg
)
protected
void
InLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
if
(
String
.
IsNullOrEmpty
(
posId
))
...
...
@@ -494,7 +494,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
Name
+
" "
+
"["
+
posId
+
"]"
+
msg
);
}
}
protected
void
Out
Store
Log
(
string
msg
)
protected
void
OutLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
if
(
String
.
IsNullOrEmpty
(
posId
))
...
...
@@ -506,7 +506,30 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
Name
+
" "
+
"["
+
posId
+
"] "
+
msg
);
}
}
protected
void
SInLog
(
string
msg
)
{
string
posId
=
SecondMoveInfo
.
MoveParam
!=
null
?
SecondMoveInfo
.
MoveParam
.
PosId
:
""
;
if
(
String
.
IsNullOrEmpty
(
posId
))
{
LogUtil
.
info
(
Name
+
" "
+
msg
);
}
else
{
LogUtil
.
info
(
Name
+
" "
+
"["
+
posId
+
"]"
+
msg
);
}
}
protected
void
SOutLog
(
string
msg
)
{
string
posId
=
SecondMoveInfo
.
MoveParam
!=
null
?
SecondMoveInfo
.
MoveParam
.
PosId
:
""
;
if
(
String
.
IsNullOrEmpty
(
posId
))
{
LogUtil
.
info
(
Name
+
" "
+
msg
);
}
else
{
LogUtil
.
info
(
Name
+
" "
+
"["
+
posId
+
"] "
+
msg
);
}
}
public
string
GetMoveStr
()
{
string
msg
=
""
;
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
67ccc04
...
...
@@ -410,6 +410,7 @@ namespace OnlineStore.DeviceLibrary
private
IO_VALUE
TargetIoValue
=
IO_VALUE
.
HIGH
;
private
bool
BatchAxisStartCheck
(
string
targetIo
=
""
,
IO_VALUE
value
=
IO_VALUE
.
HIGH
)
{
isOk
=
false
;
if
(
String
.
IsNullOrEmpty
(
targetIo
))
{
targetIo
=
IO_Type
.
SL_AxisLocationCheck
;
...
...
@@ -430,6 +431,7 @@ namespace OnlineStore.DeviceLibrary
private
bool
BatchAxisStopCheck
()
{
isOk
=
false
;
if
(!(
axisCheckTimer
==
null
))
{
axisCheckTimer
.
Stop
();
...
...
@@ -437,15 +439,34 @@ namespace OnlineStore.DeviceLibrary
return
true
;
}
private
bool
IsInProcess
=
false
;
private
bool
isOk
=
false
;
private
DateTime
lastOkTime
=
DateTime
.
Now
;
private
void
CheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
IsInProcess
)
{
return
;
}
IsInProcess
=
true
;
if
(
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
{
LogUtil
.
info
(
Name
+
"上料轴,检测到 "
+
TargetIoType
+
"="
+
TargetIoValue
+
",可以停止运动"
);
BatchAxis
.
SuddenStop
();
BatchAxisStopCheck
();
if
(!
isOk
)
{
isOk
=
true
;
lastOkTime
=
DateTime
.
Now
;
}
else
{
TimeSpan
span
=
DateTime
.
Now
-
lastOkTime
;
if
(
span
.
TotalMilliseconds
>
200
)
{
LogUtil
.
info
(
Name
+
"上料轴,检测到 "
+
TargetIoType
+
"="
+
TargetIoValue
+
",可以停止运动"
);
BatchAxis
.
SuddenStop
();
BatchAxisStopCheck
();
}
}
}
else
{
isOk
=
false
;
}
IsInProcess
=
false
;
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
67ccc04
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
查看文件 @
67ccc04
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
67ccc04
...
...
@@ -74,16 +74,9 @@ namespace OnlineStore.DeviceLibrary
ProvidingEquipMap
=
new
Dictionary
<
int
,
ProvidingEquip
>();
DisLineMap
=
new
Dictionary
<
int
,
DischargeLine
>();
List
<
string
>
ioList
=
new
List
<
string
>();
ioList
=
new
List
<
string
>(
DeviceConfig
.
ProIOIpMap
.
Values
);
AddDeviceName
(
ioList
,
Config
.
IOIPList
);
foreach
(
MoveEquip_Config
config
in
configList
.
Values
)
{
MoveEquip
equip
=
new
MoveEquip
(
lineConfig
.
CID
,
config
);
AddDeviceName
(
ioList
,
config
.
IOIPList
);
MoveEquipMap
.
Add
(
config
.
Id
,
equip
);
AllEquipMap
.
Add
(
config
.
Id
,
equip
);
}
foreach
(
FeedingEquip_Config
config
in
feedMap
.
Values
)
{
FeedingEquip
equip
=
new
FeedingEquip
(
lineConfig
.
CID
,
config
);
...
...
@@ -95,6 +88,14 @@ namespace OnlineStore.DeviceLibrary
FeedingEquipMap
.
Add
(
config
.
Id
,
equip
);
AllEquipMap
.
Add
(
config
.
Id
,
equip
);
}
foreach
(
MoveEquip_Config
config
in
configList
.
Values
)
{
MoveEquip
equip
=
new
MoveEquip
(
lineConfig
.
CID
,
config
);
AddDeviceName
(
ioList
,
config
.
IOIPList
);
MoveEquipMap
.
Add
(
config
.
Id
,
equip
);
AllEquipMap
.
Add
(
config
.
Id
,
equip
);
}
foreach
(
ProvidingEquip_Config
config
in
providMap
.
Values
)
{
ProvidingEquip
equip
=
new
ProvidingEquip
(
lineConfig
.
CID
,
config
);
...
...
@@ -127,7 +128,7 @@ namespace OnlineStore.DeviceLibrary
string
[]
testDeviceIdList
=
ids
.
Split
(
','
);
foreach
(
string
str
in
testDeviceIdList
)
{
{
int
id
=
Convert
.
ToInt32
(
str
);
if
(
FeedingEquipMap
.
ContainsKey
(
id
))
{
...
...
@@ -922,7 +923,7 @@ namespace OnlineStore.DeviceLibrary
public
string
GetMoveStr
()
{
string
msg
=
""
;
int
tLength
=
20
;
//
int tLength = 20;
//msg += "preTrayNum:".PadRight(tLength, ' ') + preTrayNum + "\n";
//msg += "currTrayNum:".PadRight(tLength, ' ') + currTrayNum + "\n";
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
67ccc04
...
...
@@ -62,7 +62,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
runStatus
=
LineRunStatus
.
HomeMoving
;
LogInfo
(
"开始原点返回:
(上下气缸回原点,阻挡1气缸上升 )开始
"
);
LogInfo
(
"开始原点返回:
上下气缸回原点,阻挡1气缸上升
"
);
MoveInfo
.
NewMove
(
LineMoveType
.
ReturnHome
);
StartReset
();
if
(
isDebug
)
...
...
@@ -80,7 +80,7 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
LogInfo
(
"开始重置:
清空托盘号,(上下气缸回原点,阻挡1气缸上升 )开始;
"
);
LogInfo
(
"开始重置:
上下气缸回原点,阻挡1气缸上升
"
);
runStatus
=
LineRunStatus
.
Reset
;
SecondMoveInfo
.
EndMove
();
...
...
@@ -130,13 +130,13 @@ namespace OnlineStore.DeviceLibrary
{
case
LineMoveStep
.
MH_UpDownHomeMove
:
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
Lo
gInfo
(
MoveInfo
.
MoveType
+
" : (上下轴原点返回完成,上下轴走到待机点 )开始"
);
Debu
gInfo
(
MoveInfo
.
MoveType
+
" : (上下轴原点返回完成,上下轴走到待机点 )开始"
);
UpdownUpMove
();
break
;
case
LineMoveStep
.
MH_UpDownCylinder_Up
:
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_OtherCylinder_Back
);
Lo
gInfo
(
MoveInfo
.
MoveType
+
" : (上升到位,顶升气缸下降,前后气缸回退 )开始"
);
Debu
gInfo
(
MoveInfo
.
MoveType
+
" : (上升到位,顶升气缸下降,前后气缸回退 )开始"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Slack
,
IO_Type
.
ClampCylinder_Tighten
);
...
...
@@ -144,7 +144,7 @@ namespace OnlineStore.DeviceLibrary
case
LineMoveStep
.
MH_OtherCylinder_Back
:
LogInfo
(
MoveInfo
.
MoveType
+
"
:
完成!"
);
LogInfo
(
MoveInfo
.
MoveType
+
" 完成!"
);
runStatus
=
LineRunStatus
.
Runing
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
...
...
@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
//如果正在出库中,需要减去托盘号
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
Lo
gInfo
(
"停止运动时出库执行中,减去托盘数;"
);
Debu
gInfo
(
"停止运动时出库执行中,减去托盘数;"
);
//减去需要的盘数
TrayManager
.
DelNeedEmptyTrayNum
();
MoveInfo
.
EndMove
();
...
...
@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
runStatus
=
LineRunStatus
.
Busy
;
SecondMoveInfo
.
EndMove
();
LogInfo
(
"停止运动:
(上下气缸上升端,阻挡气缸输入=0 )
开始 "
);
LogInfo
(
"停止运动:
上下气缸上升端,阻挡气缸上升 ,
开始 "
);
UpdownUpMove
();
CylinderMove
(
MoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
...
...
@@ -238,12 +238,12 @@ namespace OnlineStore.DeviceLibrary
if
(
ok
)
{
LogUtil
.
info
(
Name
+
"
开始
执行排队中的出库【"
+
waitOutParma
.
ToStr
()
+
"】"
);
LogUtil
.
info
(
Name
+
"执行排队中的出库【"
+
waitOutParma
.
ToStr
()
+
"】"
);
//出库
bool
result
=
StartOutStoreMove
(
waitOutParma
);
if
(!
result
)
{
LogUtil
.
info
(
Name
+
" 执行
排队中的
出库【"
+
waitOutParma
.
ToStr
()
+
"】失败,重新加入等待队列"
);
LogUtil
.
info
(
Name
+
" 执行出库【"
+
waitOutParma
.
ToStr
()
+
"】失败,重新加入等待队列"
);
AddWaitOutInfo
(
waitOutParma
);
}
}
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
67ccc04
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
67ccc04
...
...
@@ -256,20 +256,20 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_01_UpDownCylinderDown
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_02_UpDownCylinderDownWait
);
Out
Store
Log
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸1下降后等待0.3秒再夹紧"
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸1下降后等待0.3秒再夹紧"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
}
//只有当BOX可以进行出出料时,移栽物品,防止卡住
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_02_UpDownCylinderDownWait
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_03_ClampCylinderSlack
);
Out
Store
Log
(
"出库 "
+
MoveInfo
.
SLog
+
" : 夹料气缸夹紧)"
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
" : 夹料气缸夹紧)"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Tighten
,
IO_Type
.
ClampCylinder_Slack
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_03_ClampCylinderSlack
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_04_UpDownCylinderUp
);
Out
Store
Log
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸上升)"
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸上升)"
);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
UpdownUpMove
();
}
...
...
@@ -283,7 +283,7 @@ namespace OnlineStore.DeviceLibrary
//阻挡气缸移动
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
InStoreLog
(
"放托盘(放开阻挡)"
+
Second
MoveInfo
.
SLog
+
" 物品已移走,顶升气缸1下降)"
);
OutLog
(
"放托盘(放开阻挡)"
+
MoveInfo
.
SLog
+
" 物品已移走,顶升气缸1下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_14_TopCylinder_Down
);
if
(
Config
.
SidesWayNum
<=
0
)
{
...
...
@@ -293,33 +293,33 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_05_WaitBox
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_06_BeforeAfterCylinderBefore
);
Out
StoreLog
(
"出库:PO_06_BeforeAfterCylinderBefore
,前后气缸前进)"
);
Out
Log
(
"出库:"
+
MoveInfo
.
SLog
+
"
,前后气缸前进)"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_After
,
IO_Type
.
BeforeAfterCylinder_Before
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_06_BeforeAfterCylinderBefore
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_07_UpDownCylinderDown
);
Out
StoreLog
(
"出库:"
+
Second
MoveInfo
.
SLog
+
" ,上下气缸下降)"
);
Out
Log
(
"出库:"
+
MoveInfo
.
SLog
+
" ,上下气缸下降)"
);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
UpdownDownP3Move
(
MoveInfo
.
MoveParam
.
PlateH
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_07_UpDownCylinderDown
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_08_ClampCylinderTighten
);
InStoreLog
(
"出料:"
+
Second
MoveInfo
.
SLog
+
",夹料气缸放松)"
);
OutLog
(
"出料:"
+
MoveInfo
.
SLog
+
",夹料气缸放松)"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Slack
,
IO_Type
.
ClampCylinder_Tighten
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_08_ClampCylinderTighten
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_09_UpdownCylinderUp
);
Out
StoreLog
(
"出库:"
+
Second
MoveInfo
.
SLog
+
",上下气缸上升)"
);
Out
Log
(
"出库:"
+
MoveInfo
.
SLog
+
",上下气缸上升)"
);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
UpdownUpMove
();
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_09_UpdownCylinderUp
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_10_BeforeAfterCylinderAfter
);
Out
StoreLog
(
"出库:"
+
Second
MoveInfo
.
SLog
+
",前后气缸后退,等待4000 )"
);
Out
Log
(
"出库:"
+
MoveInfo
.
SLog
+
",前后气缸后退,等待4000 )"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
4000
));
...
...
source/DeviceLibrary/assemblymanager/StoreServerManager.cs
查看文件 @
67ccc04
...
...
@@ -30,7 +30,7 @@ namespace OnlineStore.DeviceLibrary
}
if
(
String
.
IsNullOrEmpty
(
codeStr
))
{
return
msg
=
deviceName
+
"
托盘【"
+
trayNum
+
"】 没有扫码
到条码"
;
return
msg
=
deviceName
+
"
未扫
到条码"
;
}
//if (LineManager.Line.runStatus.Equals(LineRunStatus.Wait))
...
...
@@ -43,17 +43,19 @@ namespace OnlineStore.DeviceLibrary
//code: 条码内容
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
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
"HttpHelper.Post结果:"
+
resultStr
);
//{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
LineOperation
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
LineOperation
>(
resultStr
);
if
(
serverResult
==
null
)
{
return
msg
=
deviceName
+
"
托盘【"
+
trayNum
+
"】
条码【"
+
codeStr
+
"】没有收到服务器反馈"
;
return
msg
=
deviceName
+
" 条码【"
+
codeStr
+
"】没有收到服务器反馈"
;
}
else
if
((!
string
.
IsNullOrEmpty
(
serverResult
.
msg
))
||
serverResult
.
result
.
Equals
(
0
).
Equals
(
false
))
{
return
msg
=
deviceName
+
"
托盘【"
+
trayNum
+
"】
条码【"
+
codeStr
+
"】 :"
+
serverResult
.
msg
;
return
msg
=
deviceName
+
" 条码【"
+
codeStr
+
"】 :"
+
serverResult
.
msg
;
}
if
(!
serverResult
.
pos
.
Equals
(
""
))
...
...
@@ -64,7 +66,7 @@ namespace OnlineStore.DeviceLibrary
string
[]
posArray
=
posId
.
Split
(
'#'
);
if
(!(
posArray
.
Length
==
2
))
{
return
msg
=
deviceName
+
"
托盘【"
+
trayNum
+
"】
入库库位格式错误:条码【"
+
codeStr
+
"】库位【"
+
posId
+
"】"
;
return
msg
=
deviceName
+
" 入库库位格式错误:条码【"
+
codeStr
+
"】库位【"
+
posId
+
"】"
;
}
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
string
wareNum
=
serverResult
.
barcode
;
...
...
@@ -78,7 +80,7 @@ namespace OnlineStore.DeviceLibrary
moveEquip
.
SetWarnMsg
(
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
return
msg
=
(
"收到服务器入库命令 "
+
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
}
LogUtil
.
info
(
"
更新盘空满信息,托盘号【"
+
trayNum
+
"】,是否有料盘【"
+
true
+
"】,出库入库【"
+
1
+
"】
"
);
LogUtil
.
info
(
"
收到入库命令: "
+
param
.
ToStr
()
+
" ,更新盘空满信息,托盘号【"
+
trayNum
+
"】,有料,"
+
ReelType
.
InStore
+
"
"
);
TrayManager
.
UpdateTrayInfo
(
trayNum
,
true
,
ReelType
.
InStore
,
wareNum
,
posId
,
plateH
,
plateW
);
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
...
...
@@ -86,6 +88,12 @@ namespace OnlineStore.DeviceLibrary
{
LineServer
.
CheckInStorePos
(
storeId
,
param
);
}
lock
(
moveEquip
.
waitInListLock
)
{
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
moveEquip
.
Name
+
" 入库命令: "
+
" + param.ToStr() + "
+
"加入等待列表中!"
);
moveEquip
.
waitInStoreList
.
Add
(
param
);
}
}
}
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
67ccc04
...
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 放在公共地方,方便存取,夹料编码盘列表,key=编码(1-6),value=是否有物品,true=有物品
/// </summary>
private
static
ConcurrentDictionary
<
int
,
TrayInfo
>
fixtureCodeFull
Map
=
new
ConcurrentDictionary
<
int
,
TrayInfo
>();
private
static
ConcurrentDictionary
<
int
,
TrayInfo
>
TrayInfo
Map
=
new
ConcurrentDictionary
<
int
,
TrayInfo
>();
/// <summary>
/// 流水线需要的空盘数量
...
...
@@ -42,6 +42,10 @@ namespace OnlineStore.DeviceLibrary
{
LineRunTest
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
LineRunTest
).
Equals
(
1
);
}
public
static
List
<
TrayInfo
>
getTrayList
()
{
return
new
List
<
TrayInfo
>(
TrayInfoMap
.
Values
);
}
internal
static
void
AddNeedEmptyTrayNum
()
{
Interlocked
.
Increment
(
ref
LineNeedEmptyTrayNum
);
...
...
@@ -58,18 +62,18 @@ namespace OnlineStore.DeviceLibrary
/// <returns>盘上是否有料盘</returns>
internal
static
bool
TrayIsFull
(
int
trayNum
)
{
if
(
fixtureCodeFull
Map
.
ContainsKey
(
trayNum
))
if
(
TrayInfo
Map
.
ContainsKey
(
trayNum
))
{
return
fixtureCodeFull
Map
[
trayNum
].
IsFull
;
return
TrayInfo
Map
[
trayNum
].
IsFull
;
}
return
false
;
}
internal
static
TrayInfo
GetTrayInfo
(
int
trayNum
)
{
if
(
fixtureCodeFull
Map
.
ContainsKey
(
trayNum
))
if
(
TrayInfo
Map
.
ContainsKey
(
trayNum
))
{
return
fixtureCodeFull
Map
[
trayNum
];
return
TrayInfo
Map
[
trayNum
];
}
TrayInfo
tray
=
new
TrayInfo
(
trayNum
,
false
,
0
);
...
...
@@ -79,56 +83,42 @@ namespace OnlineStore.DeviceLibrary
internal
static
void
UpdateTrayInfo
(
int
trayNum
,
bool
isFull
=
false
,
int
inOrOut
=
0
,
string
wareCode
=
""
,
string
posId
=
""
,
int
plateH
=
0
,
int
plateW
=
0
)
{
if
(
fixtureCodeFull
Map
.
ContainsKey
(
trayNum
))
if
(
TrayInfo
Map
.
ContainsKey
(
trayNum
))
{
fixtureCodeFull
Map
[
trayNum
].
IsFull
=
isFull
;
fixtureCodeFull
Map
[
trayNum
].
InOrOutStore
=
inOrOut
;
TrayInfo
Map
[
trayNum
].
IsFull
=
isFull
;
TrayInfo
Map
[
trayNum
].
InOrOutStore
=
inOrOut
;
fixtureCodeFull
Map
[
trayNum
].
WareCode
=
wareCode
;
fixtureCodeFull
Map
[
trayNum
].
PosId
=
posId
;
fixtureCodeFull
Map
[
trayNum
].
PlateH
=
plateH
;
fixtureCodeFull
Map
[
trayNum
].
PlateW
=
plateW
;
TrayInfo
Map
[
trayNum
].
WareCode
=
wareCode
;
TrayInfo
Map
[
trayNum
].
PosId
=
posId
;
TrayInfo
Map
[
trayNum
].
PlateH
=
plateH
;
TrayInfo
Map
[
trayNum
].
PlateW
=
plateW
;
}
else
{
TrayInfo
fixture
=
new
TrayInfo
(
trayNum
,
isFull
,
inOrOut
,
wareCode
,
posId
,
plateH
,
plateW
);
fixtureCodeFullMap
.
TryAdd
(
trayNum
,
fixture
);
}
}
internal
static
void
UpdateTrayCode
(
int
trayNum
,
string
wareCode
=
""
)
{
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】的条码为【"
+
wareCode
+
"】"
);
if
(
fixtureCodeFullMap
.
ContainsKey
(
trayNum
))
{
fixtureCodeFullMap
[
trayNum
].
WareCode
=
wareCode
;
TrayInfoMap
.
TryAdd
(
trayNum
,
fixture
);
}
}
internal
static
void
UpdateInStoreNG
(
int
trayNum
,
bool
isNg
=
false
)
internal
static
void
UpdateInStoreNG
(
int
trayNum
,
bool
isNg
,
string
msg
)
{
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】InStoreNG=【"
+
isNg
+
"】"
);
if
(
fixtureCodeFull
Map
.
ContainsKey
(
trayNum
))
LogUtil
.
info
(
"更新托盘【"
+
trayNum
+
"】InStoreNG=【"
+
isNg
+
"】
NgMsg=【"
+
msg
+
"】
"
);
if
(
TrayInfo
Map
.
ContainsKey
(
trayNum
))
{
fixtureCodeFullMap
[
trayNum
].
InStoreNG
=
isNg
;
TrayInfoMap
[
trayNum
].
InStoreNG
=
isNg
;
TrayInfoMap
[
trayNum
].
NgMsg
=
msg
;
}
}
internal
static
void
UpdateTrayPosId
(
int
trayNum
,
string
PosId
=
""
)
{
if
(
fixtureCodeFullMap
.
ContainsKey
(
trayNum
))
{
fixtureCodeFullMap
[
trayNum
].
PosId
=
PosId
;
}
}
/// <summary>
/// 是否还有有料仓的盘
/// </summary>
internal
static
bool
IsHasFullTray
()
{
foreach
(
int
key
in
fixtureCodeFull
Map
.
Keys
)
foreach
(
int
key
in
TrayInfo
Map
.
Keys
)
{
if
(
fixtureCodeFull
Map
[
key
].
IsFull
)
if
(
TrayInfo
Map
[
key
].
IsFull
)
{
return
true
;
}
...
...
@@ -140,9 +130,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
internal
static
bool
IsHasFullOutFixture
()
{
foreach
(
int
key
in
fixtureCodeFull
Map
.
Keys
)
foreach
(
int
key
in
TrayInfo
Map
.
Keys
)
{
if
(
fixtureCodeFullMap
[
key
].
IsFull
&&
fixtureCodeFull
Map
[
key
].
InOrOutStore
.
Equals
(
2
))
if
(
TrayInfoMap
[
key
].
IsFull
&&
TrayInfo
Map
[
key
].
InOrOutStore
.
Equals
(
2
))
{
return
true
;
}
...
...
@@ -258,7 +248,7 @@ namespace OnlineStore.DeviceLibrary
if
(
equip
.
IsDebug
||
equip
.
runStatus
<=
LineRunStatus
.
Wait
)
{
return
true
;
}
}
}
}
foreach
(
ProvidingEquip
equip
in
LineManager
.
Line
.
ProvidingEquipMap
.
Values
)
...
...
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
67ccc04
...
...
@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
{
// Create new modbus master and add event functions
aioBox
=
new
AIOBOX
();
aioBox
.
LogPath
(
Application
.
StartupPath
+
@"\logs\aio\"
);
//
aioBox.LogPath( Application.StartupPath+@"\logs\aio\");
aioBox
.
IP
=
ioIp
;
// bool rtn = aioBox.AutoIP(ioIp);
...
...
source/DeviceLibrary/model/KTK_Store.cs
查看文件 @
67ccc04
...
...
@@ -357,7 +357,10 @@ namespace OnlineStore.DeviceLibrary
{
return
IOManager
.
IOValue
(
IoType
,
baseConfig
.
Id
);
}
public
void
DebugInfo
(
string
logInfo
)
{
LogUtil
.
debug
(
Name
+
logInfo
);
}
public
void
LogInfo
(
string
logInfo
)
{
LogUtil
.
info
(
Name
+
logInfo
);
...
...
source/DeviceLibrary/model/TrayInfo.cs
查看文件 @
67ccc04
...
...
@@ -9,16 +9,16 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 托盘信息
/// </summary>
public
class
TrayInfo
{
public
class
TrayInfo
{
public
TrayInfo
(
int
trayNum
,
bool
isFull
=
false
,
int
inOrOut
=
0
)
{
this
.
TrayCode
=
trayNum
;
this
.
IsFull
=
isFull
;
this
.
InOrOutStore
=
inOrOut
;
}
public
TrayInfo
(
int
trayNum
,
bool
isFull
,
int
inOrOut
,
string
wareCode
,
string
posId
,
int
plateH
,
int
plateW
)
public
TrayInfo
(
int
trayNum
,
bool
isFull
=
false
,
int
inOrOut
=
0
)
{
this
.
TrayCode
=
trayNum
;
this
.
IsFull
=
isFull
;
this
.
InOrOutStore
=
inOrOut
;
}
public
TrayInfo
(
int
trayNum
,
bool
isFull
,
int
inOrOut
,
string
wareCode
,
string
posId
,
int
plateH
,
int
plateW
)
{
this
.
TrayCode
=
trayNum
;
this
.
IsFull
=
isFull
;
...
...
@@ -27,19 +27,34 @@ namespace OnlineStore.DeviceLibrary
this
.
PosId
=
posId
;
this
.
PlateH
=
plateH
;
this
.
PlateW
=
plateW
;
InStoreNG
=
false
;
NgMsg
=
""
;
}
public
string
ToStr
()
{
string
type
=
"无操作"
;
if
(
InOrOutStore
.
Equals
(
1
))
{
type
=
"入库"
;
}
else
{
type
=
"出库"
;
}
return
"托盘【"
+
TrayCode
+
"】"
+
(
IsFull
?
"有料,"
:
"空,"
)
+
type
+
","
+
WareCode
+
","
+
PosId
+
","
+
PlateH
+
","
+
PlateW
+
","
+
InStoreNG
+
","
+
NgMsg
;
}
/// <summary>
/// 夹具编码值(1-32?)
/// </summary>
public
int
TrayCode
{
get
;
set
;
}
/// <summary>
/// 是否有料盘,true=有料盘
/// </summary>
public
bool
IsFull
{
get
;
set
;
}
/// <summary>
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary>
public
int
InOrOutStore
{
get
;
set
;
}
/// <summary>
/// 夹具编码值(1-32?)
/// </summary>
public
int
TrayCode
{
get
;
set
;
}
/// <summary>
/// 是否有料盘,true=有料盘
/// </summary>
public
bool
IsFull
{
get
;
set
;
}
/// <summary>
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary>
public
int
InOrOutStore
{
get
;
set
;
}
/// <summary>
/// 物品二维码信息
...
...
@@ -48,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 位置名(对应配置表的位置)
/// </summary>
public
string
PosId
{
get
;
set
;
}
public
string
PosId
{
get
;
set
;
}
/// <summary>
/// 料盘高度
/// </summary>
...
...
@@ -61,6 +76,7 @@ namespace OnlineStore.DeviceLibrary
/// 入库失败料盘,未扫到码或获取库位号失败
/// </summary>
public
bool
InStoreNG
=
false
;
public
string
NgMsg
=
""
;
public
bool
EmergencyOut
=
false
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论