Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-HCSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c56f264f
由
LN
编写于
2021-06-22 11:28:00 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库前需要视觉检测无料
1 个父辈
1ae87798
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
60 行增加
和
22 行删除
dll/camera/Camera.json
source/DeviceLibrary/acSingleStore/BoxBean.cs
source/DeviceLibrary/acSingleStore/BoxBean_Partial.cs
source/DeviceLibrary/bean/model/StoreMoveInfo.cs
dll/camera/Camera.json
查看文件 @
c56f264
{
"CodeOrder"
:
"HalconOnly"
,
"Halcon"
:{
"CodeType"
:
"All"
,
"Zoom1DCode"
:
1.5
,
"Zoom2DCode"
:
1.5
},
"EyemLib"
:{
"CodeType"
:
"All"
,
"BlockSize"
:
11
,
"RangeC"
:
5
,
"SymbolMin"
:
128
,
"SymbolMax"
:
215
},
"Region"
:[{
"CameraName"
:
"monitor"
,
"RegionName"
:
"LeftTop"
,
"X"
:
76
,
"Y"
:
172
,
"Width"
:
416
,
"Height"
:
479
,
"Ratio"
:
0.5
},{
"CameraName"
:
"monitor"
,
"RegionName"
:
"RightTop"
,
"X"
:
555
,
"Y"
:
170
,
"Width"
:
286
,
"Height"
:
202
,
"Ratio"
:
0.4
},{
"CameraName"
:
"monitor"
,
"RegionName"
:
"name1"
,
"X"
:
526
,
"Y"
:
424
,
"Width"
:
640
,
"Height"
:
375
,
"Ratio"
:
0.7
}],
"HIKIPCamera"
:[{
"Name"
:
"monitor"
,
"IP"
:
"192.168.1.64"
,
"Port"
:
"8000"
,
"User"
:
"admin"
,
"Pwd"
:
"qwert2asdfg"
},{
"Name"
:
"photoCamera"
,
"IP"
:
"192.168.1.121"
,
"Port"
:
"8000"
,
"User"
:
"admin"
,
"Pwd"
:
"admin123"
}]}
\ No newline at end of file
{
"CodeOrder"
:
"HalconOnly"
,
"Halcon"
:{
"CodeType"
:
"All"
,
"Zoom1DCode"
:
1.5
,
"Zoom2DCode"
:
1.5
},
"EyemLib"
:{
"CodeType"
:
"All"
,
"BlockSize"
:
11
,
"RangeC"
:
5
,
"SymbolMin"
:
128
,
"SymbolMax"
:
215
},
"Region"
:[{
"CameraName"
:
"monitor"
,
"RegionName"
:
"LeftTop"
,
"X"
:
952
,
"Y"
:
268
,
"Width"
:
416
,
"Height"
:
479
,
"Ratio"
:
0.7
},{
"CameraName"
:
"monitor"
,
"RegionName"
:
"RightTop"
,
"X"
:
967
,
"Y"
:
288
,
"Width"
:
396
,
"Height"
:
456
,
"Ratio"
:
0.7
},{
"CameraName"
:
"monitor"
,
"RegionName"
:
"name1"
,
"X"
:
526
,
"Y"
:
424
,
"Width"
:
640
,
"Height"
:
375
,
"Ratio"
:
0.7
}],
"HIKIPCamera"
:[{
"Name"
:
"monitor"
,
"IP"
:
"192.168.102.210"
,
"Port"
:
"8000"
,
"User"
:
"admin"
,
"Pwd"
:
"acc123456"
}]}
\ No newline at end of file
source/DeviceLibrary/acSingleStore/BoxBean.cs
查看文件 @
c56f264
...
...
@@ -94,6 +94,7 @@ namespace OnlineStore.DeviceLibrary
[
HandleProcessCorruptedStateExceptions
]
public
bool
VisionComp
(
out
Dictionary
<
string
,
bool
>
exist
)
{
LastCheckTime
=
DateTime
.
Now
;
bool
returnResult
=
false
;
exist
=
new
Dictionary
<
string
,
bool
>();
if
(
String
.
IsNullOrEmpty
(
Config
.
Camera_Name
))
...
...
@@ -118,13 +119,13 @@ namespace OnlineStore.DeviceLibrary
{
returnResult
=
true
;
}
string
str
=
re
sult
?
"有料\r\n"
:
"无料\r\n
"
;
string
str
=
re
turnResult
?
"有料:"
:
"无料:
"
;
if
(
exist
!=
null
)
{
List
<
string
>
keys
=
new
List
<
string
>(
exist
.
Keys
);
foreach
(
string
key
in
keys
)
{
str
+=
key
+
"="
+
exist
[
key
]
+
";
\r\n
"
;
str
+=
key
+
"="
+
exist
[
key
]
+
";"
;
}
}
LogUtil
.
info
(
Name
+
"VisionComp "
+
vcount
+
" ["
+
Config
.
Camera_Name
+
"] 结果:"
+
str
);
...
...
source/DeviceLibrary/acSingleStore/BoxBean_Partial.cs
查看文件 @
c56f264
...
...
@@ -134,6 +134,7 @@ namespace OnlineStore.DeviceLibrary
//MoveInfo.WaitList.Add(WaitResultInfo.WaitAxisOrg(Config.InOut_Axis,IO_VALUE.HIGH));
}
private
DateTime
preRWTime
=
DateTime
.
Now
;
private
DateTime
LastCheckTime
=
DateTime
.
Now
;
private
void
CheckWait
()
{
List
<
WaitResultInfo
>
list
=
MoveInfo
.
WaitList
;
...
...
@@ -169,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
//如果原点没完成,且原点亮超过5秒,需要报警
int
org
=
AxisManager
.
instance
.
GetHomeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
if
(
org
.
Equals
(
1
)
&&
wait
.
AxisOrgValue
.
Equals
(
1
))
{
{
TimeSpan
orgSpan
=
DateTime
.
Now
-
wait
.
LastHasOrgTime
;
if
(
orgSpan
.
TotalSeconds
>
5
)
{
...
...
@@ -181,7 +182,7 @@ namespace OnlineStore.DeviceLibrary
{
wait
.
AxisOrgValue
=
org
;
wait
.
LastHasOrgTime
=
DateTime
.
Now
;
}
}
}
}
else
...
...
@@ -200,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
{
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
Config
.
IOSingle_TimerOut
;
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_29_WaitTake
))
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_29_WaitTake
))
{
timeOutMs
=
650000
;
}
...
...
@@ -223,7 +224,7 @@ namespace OnlineStore.DeviceLibrary
}
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
LogUtil
.
error
(
Name
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
14
);
LogUtil
.
error
(
Name
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
14
);
isOk
=
false
;
break
;
}
...
...
@@ -267,9 +268,22 @@ namespace OnlineStore.DeviceLibrary
//{
// LogUtil.debug("等待height=" + wait.HeightValue + "完成");
//}
}
else
if
(
wait
.
WaitType
==
8
)
}
else
if
(
wait
.
WaitType
==
8
)
{
wait
.
IsEnd
=
VisionComp
(
out
Dictionary
<
string
,
bool
>
exist
);
TimeSpan
checkSpan
=
DateTime
.
Now
-
LastCheckTime
;
if
(
checkSpan
.
TotalSeconds
>
1
)
{
bool
result
=
VisionComp
(
out
Dictionary
<
string
,
bool
>
exist
);
if
(
result
&&
wait
.
IoValue
.
Equals
(
IO_VALUE
.
HIGH
))
{
wait
.
IsEnd
=
true
;
}
else
if
((!
result
)
&&
wait
.
IoValue
.
Equals
(
IO_VALUE
.
LOW
))
{
wait
.
IsEnd
=
true
;
}
}
}
if
(
wait
.
IsEnd
)
{
...
...
@@ -603,7 +617,12 @@ namespace OnlineStore.DeviceLibrary
return
""
;
}
string
date
=
Name
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd-HH-mm-ss"
)
+
"-Comp"
;
StoreManager
.
Store
.
vision
.
SaveImage
(
Config
.
Camera_Name
,
Application
.
StartupPath
+
@"\image\"
,
date
,
ImageFormat
.
Png
);
string
dir
=
@"D:\image\"
;
if
(!
Directory
.
Exists
(
dir
))
{
Directory
.
CreateDirectory
(
dir
);
}
StoreManager
.
Store
.
vision
.
SaveImage
(
Config
.
Camera_Name
,
dir
,
date
,
ImageFormat
.
Png
);
return
date
;
}
catch
(
Exception
ex
)
...
...
@@ -839,10 +858,15 @@ namespace OnlineStore.DeviceLibrary
if
(
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
)
&&
VisionComp
(
out
Dictionary
<
string
,
bool
>
exist
))
{
string
fileName
=
SaveComName
(
);
LogUtil
.
error
(
Name
+
"_"
+
MoveInfo
.
MoveStep
+
"_"
+
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
+
"出库:门口检测信号无料,但视觉识别有料盘:"
+
fileName
);
}
LogUtil
.
error
(
Name
+
"_"
+
MoveInfo
.
MoveStep
+
"_"
+
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
+
"出库:门口检测信号无料,但视觉识别有料盘:"
+
fileName
+
",重新等待仓门口无料"
);
SO_53_InoutToP2
();
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SO_22_WaitNoTray
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitVisionComp
(
IO_VALUE
.
LOW
));
}
else
{
SO_53_InoutToP2
();
}
}
else
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_23_InoutToP2
)
{
...
...
source/DeviceLibrary/bean/model/StoreMoveInfo.cs
查看文件 @
c56f264
...
...
@@ -215,14 +215,20 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
false
;
return
wait
;
}
//public static WaitResultInfo WaitVisionComp()
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount = 0;
// wait.WaitType = 8;
// wait.IsEnd = false;
// return wait;
//}
/// <summary>
/// 等待有料
/// </summary>
/// <returns></returns>
public
static
WaitResultInfo
WaitVisionComp
(
IO_VALUE
value
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
CanWhileMoveCount
=
0
;
wait
.
WaitType
=
8
;
wait
.
IoValue
=
value
;
wait
.
IsEnd
=
false
;
return
wait
;
}
//public static WaitResultInfo WaitHeight(int height)
//{
// WaitResultInfo wait = new WaitResultInfo();
...
...
@@ -268,7 +274,14 @@ namespace OnlineStore.DeviceLibrary
return
"料盘高度【"
+
HeightValue
+
"】 "
;
}
else
if
(
WaitType
==
8
)
{
return
"视觉识别门口有料"
;
if
(
IoValue
.
Equals
(
IO_VALUE
.
LOW
))
{
return
"视觉识别门口无料"
;
}
else
{
return
"视觉识别门口有料"
;
}
}
else
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论