Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit eb1109d2
由
LN
编写于
2022-11-16 09:33:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
料盘验证时若未扫到条码,增加料盘识别
1 个父辈
58d1a0b3
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
272 行增加
和
81 行删除
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/darknet/detect-tiny-label.cfg
source/DeviceLibrary/darknet/detect-tiny-label.weights
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/deviceLibrary/halcon/EyemManager.cs
source/DeviceLibrary/model/InOutParam.cs
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
eb1109d
...
...
@@ -89,6 +89,7 @@
<Compile Include="assemblymanager\TrayManager.cs" />
<Compile Include="baan\AxisBean.cs" />
<Compile Include="baan\WaitUtil.cs" />
<Compile Include="deviceLibrary\halcon\EyemManager.cs" />
<Compile Include="deviceLibrary\reelCheck\MyCamera.cs" />
<Compile Include="deviceLibrary\reelCheck\ReelCheckUtil.cs" />
<Compile Include="deviceLibrary\halcon\CodeManager.cs" />
...
...
@@ -249,6 +250,12 @@
<Content Include="Config\Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="darknet\detect-tiny-label.cfg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="darknet\detect-tiny-label.weights">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LineConfig\Config_FeedingEquip_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
eb1109d
...
...
@@ -169,26 +169,16 @@ namespace OnlineStore.DeviceLibrary
{
//扫码
(
bool
result
,
string
barcode
)
=
CodeManager
.
ReelCheckCameraScan
(
new
List
<
string
>
{
Config
.
CameraName_1
},
Name
);
//没扫到条码,检测到没料 ,保存图片, 清空
if
(
tray
.
IsFull
)
//初次检测有料盘
{
if
(
result
)
//有料盘
{
(
int
resCode
,
taskInfo
task
)
=
SServerManager
.
getTaskInfo
(
barcode
);
if
(
resCode
==
-
1
)
{
TrayDisableManager
.
AddDisableTray
(
trayNum
);
LogUtil
.
info
(
$
"【屏蔽料盘二次判断】【-1】【需要禁用该托盘】【{tray.ToStr()}】"
);
}
else
if
(
resCode
==
100
)
{
tray
.
InoutPar
.
InStoreNg
=
true
;
tray
.
InoutPar
.
PlateH
=
task
.
plateH
;
tray
.
InoutPar
.
PlateW
=
task
.
plateW
;
TrayManager
.
UpdateTrayInfo
(
trayNum
,
true
,
tray
.
InOrOutStore
,
tray
.
InoutPar
);
tray
.
InoutPar
.
Corrected
=
true
;
LogUtil
.
info
(
$
"【屏蔽料盘二次判断】【100】【有尺寸信息,认为NG】【{tray.ToStr()}】"
);
}
else
if
(
resCode
==
0
)
if
(
resCode
==
0
)
{
//if (task != null)
{
...
...
@@ -213,6 +203,21 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
$
"【屏蔽料盘二次判断】【初次有料,第二次有料,认为有料】【{tray.ToStr()}】"
);
}
}
else
if
(
task
.
plateH
>
0
)
{
tray
.
InoutPar
.
InStoreNg
=
true
;
tray
.
InoutPar
.
PlateH
=
task
.
plateH
;
tray
.
InoutPar
.
PlateW
=
task
.
plateW
;
TrayManager
.
UpdateTrayInfo
(
trayNum
,
true
,
tray
.
InOrOutStore
,
tray
.
InoutPar
);
tray
.
InoutPar
.
Corrected
=
true
;
LogUtil
.
info
(
$
"【屏蔽料盘二次判断】【100】【有尺寸信息,认为NG】【{tray.ToStr()}】"
);
}
else
{
TrayDisableManager
.
AddDisableTray
(
trayNum
);
LogUtil
.
info
(
$
"【屏蔽料盘二次判断】【-1】【需要禁用该托盘】【{tray.ToStr()}】"
);
}
}
else
//二次检测无料盘
...
...
source/DeviceLibrary/darknet/detect-tiny-label.cfg
0 → 100644
查看文件 @
eb1109d
[net]
# Testing
batch=1
subdivisions=1
# Training
# batch=64
# subdivisions=64
width=960
height=960
channels=3
momentum=0.9
decay=0.0005
angle=180
saturation = 1.5
exposure = 1.5
hue=.1
learning_rate=0.001
burn_in=1000
max_batches = 4000
policy=steps
steps=3200,3600
scales=.1,.1
[convolutional]
batch_normalize=1
filters=16
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=1
[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky
###########
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky
[convolutional]
size=1
stride=1
pad=1
filters=18
activation=linear
[yolo]
mask = 3,4,5
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=1
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
[route]
layers = -4
[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
[upsample]
stride=2
[route]
layers = -1, 8
[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky
[convolutional]
size=1
stride=1
pad=1
filters=18
activation=linear
[yolo]
mask = 0,1,2
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=1
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
source/DeviceLibrary/darknet/detect-tiny-label.weights
0 → 100644
查看文件 @
eb1109d
此文件太大,无法显示。
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
eb1109d
...
...
@@ -46,6 +46,8 @@ namespace OnlineStore.DeviceLibrary
LoadCamera
(
false
);
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
""
,
codeStr
);
CodeLibrary
.
EyemDecode
.
InitModel
();
EyemManager
.
Init
();
}
catch
(
Exception
ex
)
{
...
...
@@ -259,11 +261,11 @@ namespace OnlineStore.DeviceLibrary
}
[
HandleProcessCorruptedStateExceptions
]
public
static
(
bool
,
string
)
ReelCheckCameraScan
(
List
<
string
>
cameraList
,
string
deviceName
)
public
static
(
bool
,
string
)
ReelCheckCameraScan
(
List
<
string
>
cameraList
,
string
deviceName
)
{
bool
isPreScan
=
deviceName
.
EndsWith
(
"预扫码"
);
List
<
string
>
codeList
=
new
List
<
string
>();
bool
findCode
=
true
;
string
code
=
""
;
if
(
cameraList
==
null
||
cameraList
.
Count
<=
0
)
{
return
(
findCode
,
ProcessCode
(
codeList
));
...
...
@@ -298,8 +300,9 @@ namespace OnlineStore.DeviceLibrary
string
r
=
""
;
// bool eyemNoCode = false;
Task
eyemtask
=
Task
.
Factory
.
StartNew
(
delegate
{
// bool eyemNoCode = false;
Task
eyemtask
=
Task
.
Factory
.
StartNew
(
delegate
{
List
<
CodeInfo
>
tlci
=
EyemDecode
.
ModelDecoder
(
ref
bmp
);
foreach
(
CodeInfo
co
in
tlci
)
{
...
...
@@ -309,14 +312,10 @@ namespace OnlineStore.DeviceLibrary
{
codeList
.
Add
(
str
);
r
=
r
+
"##eyem|"
+
co
.
CodeType
+
"|"
+
str
;
//if (!findCode)
//{
// findCode = HasRightCode(str);
//}
}
}
});
//最多等待60秒
bool
taskResult
=
eyemtask
.
Wait
(
60000
);
if
(!
taskResult
)
...
...
@@ -325,59 +324,59 @@ namespace OnlineStore.DeviceLibrary
//eyemNoCode = true;
}
//if (!isPreScan)
//{
// if (!findCode)
// {
// try
// {
// List<CodeInfo> cc = new List<CodeInfo>();
// eyemNoCode = true
;
//
RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam
//
{
//
codeTypeList = allCodeTypeList.ToArray(),
//
codeCount = 3,
//
timeout = 3000
//
};
//
cc = RemoteDecodeHelper.DecodeRequest(ho_Image, remoteDecodeParam);
//
if (cc != null && cc.Count > 0) findCode = true;
// //
if (cc != null)
// //
{
// //
foreach (CodeInfo c in cc)
// //
{
// //
string str = CodeManager.ReplaceCode(c.CodeStr);
// //
if (!codeList.Contains(str))
// //
{
// //
codeList.Add(str);
// //
r = r + "##halcon|" + c.CodeType + "|" + str;
// // if (!findCode)
// // {
// // findCode = HasRightCode(str);
// //
}
// // }
// // }
// //}
// }
// catch (Exception ex)
// {
// LogUtil.error(deviceName + " RemoteDecodeHelper扫码出错:" + ex.ToString());
// }
// }
// //if (!findRightCode && SaveErrorImageToFile.Equals(1))
// if (SaveImage || (((!findCode) || eyemNoCode) && (!isPreScan)))
// {
// //如果halcon没扫出的,
// string nameStr = "";
// if (findCode && eyemNo
Code)
//
{
// nameStr = "eyem
";
// }
// SaveImageToFile(deviceName, cameraName + nameStr, bmp);
// }
//}
code
=
ProcessCode
(
codeList
);
findCode
=
string
.
IsNullOrEmpty
(
code
)
?
false
:
true
;
if
(!
findCode
)
{
try
{
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>()
;
RemoteDecodeHelper
.
RemoteDecodeParam
remoteDecodeParam
=
new
RemoteDecodeHelper
.
RemoteDecodeParam
{
codeTypeList
=
allCodeTypeList
.
ToArray
(),
codeCount
=
3
,
timeout
=
3000
};
cc
=
RemoteDecodeHelper
.
DecodeRequest
(
ho_Image
,
remoteDecodeParam
);
if
(
cc
!=
null
&&
cc
.
Count
>
0
)
findCode
=
true
;
if
(
cc
!=
null
)
{
foreach
(
CodeInfo
c
in
cc
)
{
string
str
=
CodeManager
.
ReplaceCode
(
c
.
CodeStr
);
if
(!
codeList
.
Contains
(
str
))
{
codeList
.
Add
(
str
);
r
=
r
+
"##halcon|"
+
c
.
CodeType
+
"|"
+
str
;
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" RemoteDecodeHelper扫码出错:"
+
ex
.
ToString
());
}
code
=
ProcessCode
(
codeList
);
findCode
=
string
.
IsNullOrEmpty
(
code
)
?
false
:
true
;
}
if
(!
findCode
)
{
//验证是否有料盘
findCode
=
EyemManager
.
ReelCheck
(
bmp
);
}
if
(!
find
Code
)
{
string
nameStr
=
"nofindCode
"
;
SaveImageToFile
(
deviceName
,
cameraName
+
nameStr
,
bmp
);
}
if
(
deviceName
!=
""
||
r
!=
""
)
{
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】["
+
findCode
+
"]"
+
ScanCount
+
" :"
+
r
);
...
...
@@ -416,9 +415,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
deviceName
+
" 扫码出错:"
+
ex
.
ToString
());
}
string
code
=
ProcessCode
(
codeList
);
findCode
=
string
.
IsNullOrEmpty
(
code
)
?
false
:
true
;
return
(
findCode
,
code
);
return
(
findCode
,
code
);
}
private
static
int
SaveErrorImageToFile
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
SaveErrorImageToFile
);
...
...
source/DeviceLibrary/deviceLibrary/halcon/EyemManager.cs
0 → 100644
查看文件 @
eb1109d
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/model/InOutParam.cs
查看文件 @
eb1109d
...
...
@@ -61,7 +61,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
bool
InStoreNg
=
false
;
/// <summary>
/// 手动判断NG
/// 手动判断NG
不处理
/// </summary>
public
bool
ManualJudgeNG
=
false
;
/// <summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论