Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7177613c
由
LN
编写于
2021-06-23 09:36:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库重复任务过滤。条码数量改为可配置。
1 个父辈
4fcb71c2
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
66 行增加
和
7 行删除
source/ACSingleStore/App.config
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/ACSingleStore/App.config
查看文件 @
7177613
...
@@ -60,6 +60,7 @@
...
@@ -60,6 +60,7 @@
<
add
key
=
"Tool_P6_Offset"
value
=
"6000"
/>
<
add
key
=
"Tool_P6_Offset"
value
=
"6000"
/>
<
add
key
=
"Tool_TargetSpeed"
value
=
"20"
/>
<
add
key
=
"Tool_TargetSpeed"
value
=
"20"
/>
<
add
key
=
"Tool_TargetPosition"
value
=
"6000"
/>
<
add
key
=
"Tool_TargetPosition"
value
=
"6000"
/>
<
add
key
=
"CodeCount"
value
=
"1"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/Common/Setting_Init.cs
查看文件 @
7177613
...
@@ -114,6 +114,7 @@ namespace OnlineStore.Common
...
@@ -114,6 +114,7 @@ namespace OnlineStore.Common
public
static
string
Tool_TargetSpeed
=
"Tool_TargetSpeed"
;
public
static
string
Tool_TargetSpeed
=
"Tool_TargetSpeed"
;
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
public
static
string
CodeCount
=
"CodeCount"
;
}
}
}
}
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
7177613
...
@@ -134,7 +134,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -134,7 +134,11 @@ namespace OnlineStore.DeviceLibrary
[
HandleProcessCorruptedStateExceptions
]
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
(
)
public
static
List
<
string
>
CameraScan
(
)
{
{
int
codeCount
=
1
;
int
codeCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeCount
);
if
(
codeCount
<=
0
)
{
codeCount
=
1
;
}
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
string
>
codeList
=
new
List
<
string
>();
if
(
cameraNameList
==
null
||
cameraNameList
.
Count
<=
0
)
if
(
cameraNameList
==
null
||
cameraNameList
.
Count
<=
0
)
{
{
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
7177613
...
@@ -2019,6 +2019,24 @@ namespace OnlineStore.DeviceLibrary
...
@@ -2019,6 +2019,24 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
,!
isSingleOut
);
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
,!
isSingleOut
);
//如果当前正在出库中,且库位号相同,暂不处理
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
))
{
if
(
StoreMove
.
MoveParam
.
PositionNum
.
Equals
(
posId
))
{
LogUtil
.
error
(
LOGGER
,
$
"收到服务器出库命令:出库任务重复:当前正在【{posId}】出库执行中"
);
continue
;
}
}
FixtureCodeInfo
waitInfo
=
GetOutInfo
(
posId
);
if
(
waitInfo
!=
null
)
{
LogUtil
.
error
(
LOGGER
,
$
"收到服务器出库命令:出库任务重复:已存在库位号为【{posId}】的任务:【{waitInfo.ToStr()}】"
);
continue
;
}
if
(
CanStarInOut
())
if
(
CanStarInOut
())
{
{
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
plateH
,
plateW
),
!
isSingleOut
);
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
plateH
,
plateW
),
!
isSingleOut
);
...
@@ -2046,6 +2064,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -2046,6 +2064,19 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
FixtureCodeInfo
GetOutInfo
(
string
posId
)
{
List
<
FixtureCodeInfo
>
waitoutlist
=
new
List
<
FixtureCodeInfo
>(
waitOutStoreList
);
foreach
(
FixtureCodeInfo
codeInfo
in
waitoutlist
)
{
if
(
codeInfo
.
PosId
.
Equals
(
posId
))
{
return
codeInfo
;
}
}
return
null
;
}
#
endregion
#
endregion
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
7177613
...
@@ -318,7 +318,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -318,7 +318,12 @@ namespace OnlineStore.DeviceLibrary
}
}
LogUtil
.
info
(
LOGGER
,
StoreName
+
logMsg
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logMsg
);
storeRunStatus
=
StoreRunStatus
.
Busy
;
storeRunStatus
=
StoreRunStatus
.
Busy
;
if
(
StoreMove
.
IsNeedInStore
)
{
storeStatus
=
StoreStatus
.
InStoreExecute
;
storeStatus
=
StoreStatus
.
InStoreExecute
;
}
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
,
param
);
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
,
param
);
//lastMoveType = StoreMoveType.InStore;
//lastMoveType = StoreMoveType.InStore;
StoreMove
.
IsBatchInOutStore
=
IsBatchWork
;
StoreMove
.
IsBatchInOutStore
=
IsBatchWork
;
...
@@ -705,16 +710,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -705,16 +710,18 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SIS_37_InoutToP2
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SIS_37_InoutToP2
))
{
{
InStoreLog
(
"入库:SIS_38 ,清理扫码信息,开始扫码,最多等待
6
000 "
);
InStoreLog
(
"入库:SIS_38 ,清理扫码信息,开始扫码,最多等待
9
000 "
);
AutomaticBaiting
.
ClearInStoreInfo
();
AutomaticBaiting
.
ClearInStoreInfo
();
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SIS_38_ScanCode
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SIS_38_ScanCode
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
9
000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5
000
));
StoreMove
.
OneWaitCanEndStep
=
true
;
StoreMove
.
OneWaitCanEndStep
=
true
;
AutomaticBaiting
.
GetCameraCode
();
AutomaticBaiting
.
GetCameraCode
();
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SIS_38_ScanCode
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SIS_38_ScanCode
))
{
{
if
(
AutomaticBaiting
.
ScanTask
==
null
||
AutomaticBaiting
.
ScanTask
.
IsCompleted
)
{
if
(
AutomaticBaiting
.
LastCode
.
Equals
(
""
))
if
(
AutomaticBaiting
.
LastCode
.
Equals
(
""
))
{
{
SingleSendOut
(
"未扫到二维码"
);
SingleSendOut
(
"未扫到二维码"
);
...
@@ -751,6 +758,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -751,6 +758,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SIS_39_GetPosId
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SIS_39_GetPosId
))
{
{
SingleSendOut
(
"启动入库超时 "
);
SingleSendOut
(
"启动入库超时 "
);
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
7177613
...
@@ -5,6 +5,7 @@ using System.Collections.Generic;
...
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
...
@@ -329,6 +330,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -329,6 +330,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
static
int
SuckingDisc_WorkCount
=
0
;
private
static
int
SuckingDisc_WorkCount
=
0
;
private
static
Task
GetPosTask
=
null
;
private
static
void
InStoreProcess
()
private
static
void
InStoreProcess
()
{
{
...
@@ -359,10 +361,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -359,10 +361,13 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I03_ScanCode
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I03_ScanCode
))
{
{
if
(
ScanTask
==
null
||
ScanTask
.
IsCompleted
)
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I04_SuckingDisc_Down
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I04_SuckingDisc_Down
);
InStoreLog
(
" 扫码结束,二维码【"
+
LastCode
+
"】 吸盘开始下降"
);
InStoreLog
(
" 扫码结束,二维码【"
+
LastCode
+
"】 吸盘开始下降"
);
CylinderMove
(
IO_Type
.
ClampingDisc_Down
,
IO_Type
.
ClampingDisc_Up
,
true
);
CylinderMove
(
IO_Type
.
ClampingDisc_Down
,
IO_Type
.
ClampingDisc_Up
,
true
);
}
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I04_SuckingDisc_Down
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I04_SuckingDisc_Down
))
{
{
SuckingDiscWork
();
SuckingDiscWork
();
...
@@ -476,11 +481,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -476,11 +481,13 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I08_GetPosId
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I08_GetPosId
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
LogUtil
.
debug
(
Name
+
StoreMove
.
MoveStep
+
"入料: 从服务器获取入库PosId,尺寸:【"
+
LastWidth
+
"*"
+
LastHeight
+
"】二维码【"
+
LastCode
+
"】"
);
LogUtil
.
debug
(
Name
+
StoreMove
.
MoveStep
+
"入料: 从服务器获取入库PosId,尺寸:【"
+
LastWidth
+
"*"
+
LastHeight
+
"】二维码【"
+
LastCode
+
"】"
);
GetPosTask
=
null
;
GetPosTask
=
Task
.
Factory
.
StartNew
(
delegate
()
{
GetInStorePosId
(
ProcessMsg
());
GetInStorePosId
(
ProcessMsg
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
)
);
}
);
}
}
}
}
else
if
(
span
.
TotalSeconds
>
60
)
else
if
(
span
.
TotalSeconds
>
60
)
...
@@ -503,6 +510,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -503,6 +510,8 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I08_GetPosId
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I08_GetPosId
))
{
{
if
(
GetPosTask
==
null
||
GetPosTask
.
IsCompleted
)
{
//判断是否开始入库
//判断是否开始入库
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
(!
LastPosId
.
Equals
(
""
)))
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
(!
LastPosId
.
Equals
(
""
)))
{
{
...
@@ -519,6 +528,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -519,6 +528,7 @@ namespace OnlineStore.DeviceLibrary
SendTrayOut
();
SendTrayOut
();
}
}
}
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I09_WaitTrayLeave
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I09_WaitTrayLeave
))
{
{
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
||
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
||
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
7177613
...
@@ -350,10 +350,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -350,10 +350,14 @@ namespace OnlineStore.DeviceLibrary
#
region
Halcon
扫码枪代码
#
region
Halcon
扫码枪代码
public
bool
IsTestCamera
=
false
;
public
bool
IsTestCamera
=
false
;
private
static
string
spiltStr
=
"##"
;
private
static
string
spiltStr
=
"##"
;
public
static
Task
ScanTask
=
null
;
public
static
void
GetCameraCode
()
public
static
void
GetCameraCode
()
{
{
Task
.
Factory
.
StartNew
(
delegate
()
ScanTask
=
Task
.
Factory
.
StartNew
(
delegate
()
{
{
LastCode
=
""
;
LastCodeList
=
new
List
<
string
>();
DateTime
startTime
=
DateTime
.
Now
;
DateTime
startTime
=
DateTime
.
Now
;
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
string
message
=
""
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论