Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f1c775ee
由
LN
编写于
2022-11-25 10:28:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.清空入库任务时清空托盘。2.入料夹爪抓料后如果伺服检测信号亮,从服务器获取库位成功继续入库,未取到尺寸直接NG. 3.皮带线视觉识别图片保存功能。
1 个父辈
a6fb11bc
全部展开
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
139 行增加
和
8 行删除
source/AssemblyLineClient/FrmMoveEquip.cs
source/AssemblyLineClient/记录.txt
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/deviceLibrary/halcon/EyemManager.cs
source/DeviceLibrary/deviceLibrary/reelCheck/ReelCheckUtil.cs
source/DeviceLibrary/model/StoreStep.cs
source/AssemblyLineClient/FrmMoveEquip.cs
查看文件 @
f1c775e
...
...
@@ -709,6 +709,14 @@ namespace OnlineStore.AssemblyLine
}
else
{
//查找对应的托盘
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
param
.
TrayNumber
);
if
(
tray
!=
null
&&
tray
.
IsFull
&&
tray
.
InoutPar
.
PosId
.
Equals
(
param
.
PosId
)
&&
tray
.
InoutPar
.
WareCode
.
Equals
(
param
.
WareCode
))
{
LogUtil
.
info
(
"手动清除入库任务前清空托盘:"
+
tray
.
ToStr
());
TrayManager
.
UpdateTrayInfo
(
tray
.
TrayCode
);
}
equipBean
.
RemoveInStore
(
param
,
"手动清除入库任务"
);
txtPosId
.
Clear
();
}
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
f1c775e
...
...
@@ -613,3 +613,23 @@ PRO,0,是否存放的大料盘,IsBigTray,1,,,,,
信号超时报警也需要响蜂鸣器。短皮带线二增加相机检测功能。
Config_DischargeLine_1.csv 需要增加一行配置(r_camera_2需要改为为真实相机名称):
PRO,0,短皮带线2监控相机,CameraName_2,r_camera_2,,,,,
抓料报警。
没有高度,使用
没有宽度尺寸 ,托盘标记为NG, 到检测点 NG
没有从服务器获取到尺寸NG 。
料串自动下降到信号灭。
流水线清理入库任务,同时清空托盘,给服务器发取消任务。
20221124修改:
1.清空入库任务时清空托盘。
2.入料夹爪抓料后如果伺服检测信号亮,从服务器获取库位成功继续入库,未取到尺寸直接NG.
3.皮带线视觉识别图片保存功能。
\ No newline at end of file
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
f1c775e
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
f1c775e
...
...
@@ -599,7 +599,7 @@ namespace OnlineStore.DeviceLibrary
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
deviceName
+
"["
+
moveEquip
.
Name
+
" ]入库命令: "
+
param
.
ToStr
()
+
"加入等待列表中!"
);
InOutParam
inOutParam
=
moveEquip
.
waitInStoreList
.
Find
(
s
=>
param
.
PosId
.
Equals
(
s
.
PosId
));
if
(
inOutParam
!=
null
)
if
(
inOutParam
!=
null
)
{
moveEquip
.
waitInStoreList
.
Remove
(
inOutParam
);
}
...
...
@@ -823,9 +823,9 @@ namespace OnlineStore.DeviceLibrary
{
return
(-
1
,
data
.
data
);
}
else
if
(
data
.
code
.
Equals
(
100
))
else
if
(
data
.
code
.
Equals
(
100
))
{
if
(
data
.
data
.
plateH
>
0
&&
data
.
data
.
plateW
>
0
)
if
(
data
.
data
.
plateH
>
0
&&
data
.
data
.
plateW
>
0
)
{
return
(
100
,
data
.
data
);
}
...
...
@@ -844,7 +844,67 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
"getTaskInfo "
+
ex
.
ToString
());
}
return
(
result
,
task
);
return
(
result
,
task
);
}
/// <summary>
///上料机构获取料盘高度
/// </summary>
private
static
string
Addr_getReelHeight
=
"/rest/api/qisda/device/getReelSize"
;
public
static
string
GetReelSize
(
string
deviceName
,
string
barcode
,
out
int
outWidth
,
out
int
outHeight
)
{
outWidth
=
0
;
outHeight
=
0
;
string
msg
=
""
;
try
{
if
(
String
.
IsNullOrEmpty
(
barcode
))
{
return
msg
=
deviceName
+
"未扫到条码"
;
}
///rest/api/qisda/device/getReelSize
//传入参数: barcode
//返回: {code:0, msg:"",data:{"barcode":"ABC","plateW": 7,"plateH":8}}
//code= 0 表示正常,其他为异常
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"barcode"
,
barcode
);
// barcode = 扫到的条码
string
server
=
GetAddr
(
Addr_getReelHeight
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
"GetReelSize "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
//返回: { "code": 0, "msg":"ok", data: 7}
ReturnData4
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
ReturnData4
>(
resultStr
);
if
(
serverResult
==
null
)
{
return
msg
=
deviceName
+
" GetReelSize 条码【 "
+
barcode
+
"】没有收到服务器反馈"
;
}
else
if
(
serverResult
.
code
.
Equals
(
0
).
Equals
(
false
))
{
return
msg
=
deviceName
+
" GetReelSize 条码【 "
+
barcode
+
"】返回:"
+
"["
+
serverResult
.
code
+
"]"
+
serverResult
.
msg
;
}
if
(
serverResult
.
data
==
null
)
{
return
msg
=
deviceName
+
" GetReelSize 条码【 "
+
barcode
+
"】未解析到尺寸信息"
;
}
else
{
// data:料盘直径,= 7时升起气缸
outWidth
=
serverResult
.
data
.
plateW
;
outHeight
=
serverResult
.
data
.
plateH
;
LogUtil
.
info
(
deviceName
+
"GetReelSize 条码【 "
+
barcode
+
"】,获得尺寸:"
+
outWidth
+
"X"
+
outHeight
);
return
""
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" "
,
ex
);
return
"GetReelSize 条码【 "
+
barcode
+
"】出错:"
+
ex
.
ToString
();
}
}
}
...
...
@@ -893,6 +953,32 @@ namespace OnlineStore.DeviceLibrary
public
taskInfo
data
{
get
;
set
;
}
}
//返回: {code:0, msg:"",data:{"barcode":"ABC","plateW": 7,"plateH":8}}
public
class
ReturnData4
{
// { "code":0,"msg":"ok","data":true}
public
int
code
{
get
;
set
;
}
public
string
msg
{
get
;
set
;
}
public
reelInfo
data
{
get
;
set
;
}
}
public
class
reelInfo
{
/// <summary>
/// 解析后的条码
/// </summary>
public
string
barcode
{
get
;
set
;
}
/// <summary>
/// 料盘尺寸
/// </summary>
public
int
plateW
{
get
;
set
;
}
/// <summary>
/// 料盘厚度
/// </summary>
public
int
plateH
{
get
;
set
;
}
}
public
class
taskInfo
{
/// <summary>
...
...
source/DeviceLibrary/deviceLibrary/halcon/EyemManager.cs
查看文件 @
f1c775e
...
...
@@ -41,7 +41,7 @@ namespace OnlineStore.DeviceLibrary
{
try
{
Bitmap
b
=
GetReducedImage
(
a
,
1024
,
0
);
Bitmap
b
=
GetReducedImage
(
a
,
a
.
Width
,
a
.
Height
);
a
.
Dispose
();
EyemImage
image
=
new
EyemImage
();
...
...
source/DeviceLibrary/deviceLibrary/reelCheck/ReelCheckUtil.cs
查看文件 @
f1c775e
...
...
@@ -165,22 +165,26 @@ dMinorStep 步进,默认1.0。
eyemTrackFeature
(
image
,
mask
,
tpRoi
,
hGlobal
,
ipResults
.
Length
,
tpHsvModel
,
ipResults
,
out
EyemImage
tpDstImg
);
string
resultStr
=
""
;
int
hasReelCount
=
0
;
for
(
int
i
=
0
;
i
<
ipResults
.
Length
;
i
++)
{
if
(
ipResults
[
i
]
==
1
)
{
Console
.
WriteLine
(
"检测到{0}位置有料盘"
,
i
);
hasReelCount
++;
}
resultStr
+=
ipResults
[
i
];
}
Bitmap
dstBitmap
=
eyemCvtToBitmap
(
tpDstImg
);
if
(
dstBitmap
!=
null
&&
SaveImage
)
if
(
dstBitmap
!=
null
&&
(
hasReelCount
<
2
)
&&
SaveImage
)
{
string
dataFolder
=
DateTime
.
Now
.
ToString
(
"yyyyMMdd"
);
string
hourFolder
=
DateTime
.
Now
.
ToString
(
"HH"
);
string
date
=
cameraName
.
Trim
().
Replace
(
'_'
,
'-'
)
+
"-"
+
DateTime
.
Now
.
ToString
(
"yyyyMMdd-HHmmss"
)
+
DateTime
.
Now
.
Millisecond
;
string
imageName
=
date
+
"-"
+
resultStr
+
".bmp"
;
imgName
=
imageName
;
string
path
=
"D:\\image\\"
+
cameraName
+
"\\ResOut\\"
;
string
path
=
"D:\\image\\"
+
cameraName
+
"\\ResOut\\"
+
dataFolder
+
"\\"
+
hourFolder
+
"\\"
;
if
(
canSavePic
(
path
))
{
dstBitmap
.
Save
(
path
+
imageName
,
ImageFormat
.
Jpeg
);
...
...
@@ -212,7 +216,7 @@ dMinorStep 步进,默认1.0。
int
zhao
=(
int
)(
freespace
/
1024
);
if
(
zhao
<
5
)
{
LogUtil
.
error
(
volume
+
"盘剩余空间:"
+
freespace
+
"
M
, 不再保存料盘图片"
);
LogUtil
.
error
(
volume
+
"盘剩余空间:"
+
freespace
+
"
G
, 不再保存料盘图片"
);
return
false
;
}
return
true
;
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
f1c775e
...
...
@@ -798,12 +798,25 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
[
Description
(
"入料_取料完成_等待伺服检测信号消失"
)]
FI_18_WaitNoLocationCheck
,
/// <summary>
/// 料盘移栽:等待没有伺服料盘检测信号,从服务器获取库位号
/// </summary>
[
Description
(
"入料_取料完成_等待没有伺服料盘检测信号,从服务器获取库位号"
)]
FI_18_GetReelSize
,
/// <summary>
/// 料盘移栽:提升伺服运动到P3,横移气缸上升
/// </summary>
[
Description
(
"入料_取料完成_提升伺服运动到P3,横移气缸上升"
)]
FI_19_BatchAxisToP3
,
/// <summary>
/// 料盘移栽:提升伺服运动到P3,横移气缸上升
/// </summary>
[
Description
(
"入料_取料完成_伺服检测信号一直亮,从服务器获取尺寸,横移气缸上升"
)]
FI_19_GetHFromServer
,
/// <summary>
/// 料盘移栽:记录高度尺寸
/// </summary>
[
Description
(
"入料_取料完成_记录高度尺寸"
)]
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论