Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f1c775ee
由
LN
编写于
2022-11-25 10:28:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.清空入库任务时清空托盘。2.入料夹爪抓料后如果伺服检测信号亮,从服务器获取库位成功继续入库,未取到尺寸直接NG. 3.皮带线视觉识别图片保存功能。
1 个父辈
a6fb11bc
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
286 行增加
和
76 行删除
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
...
@@ -709,6 +709,14 @@ namespace OnlineStore.AssemblyLine
}
}
else
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
,
"手动清除入库任务"
);
equipBean
.
RemoveInStore
(
param
,
"手动清除入库任务"
);
txtPosId
.
Clear
();
txtPosId
.
Clear
();
}
}
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
f1c775e
...
@@ -612,4 +612,24 @@ PRO,0,是否存放的大料盘,IsBigTray,1,,,,,
...
@@ -612,4 +612,24 @@ PRO,0,是否存放的大料盘,IsBigTray,1,,,,,
20221121修改:
20221121修改:
信号超时报警也需要响蜂鸣器。短皮带线二增加相机检测功能。
信号超时报警也需要响蜂鸣器。短皮带线二增加相机检测功能。
Config_DischargeLine_1.csv 需要增加一行配置(r_camera_2需要改为为真实相机名称):
Config_DischargeLine_1.csv 需要增加一行配置(r_camera_2需要改为为真实相机名称):
PRO,0,短皮带线2监控相机,CameraName_2,r_camera_2,,,,,
\ No newline at end of file
\ No newline at end of file
PRO,0,短皮带线2监控相机,CameraName_2,r_camera_2,,,,,
抓料报警。
没有高度,使用
没有宽度尺寸 ,托盘标记为NG, 到检测点 NG
没有从服务器获取到尺寸NG 。
料串自动下降到信号灭。
流水线清理入库任务,同时清空托盘,给服务器发取消任务。
20221124修改:
1.清空入库任务时清空托盘。
2.入料夹爪抓料后如果伺服检测信号亮,从服务器获取库位成功继续入库,未取到尺寸直接NG.
3.皮带线视觉识别图片保存功能。
\ No newline at end of file
\ No newline at end of file
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
f1c775e
...
@@ -832,7 +832,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -832,7 +832,7 @@ namespace OnlineStore.DeviceLibrary
// 信号不到位,后退,再次循环
// 信号不到位,后退,再次循环
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_08_TrayLocation_Back
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_08_TrayLocation_Back
);
InLog
(
"料架入库"
+
MoveInfo
.
SLog
+
":升降盘定位气缸第"
+
TrayLCylinderMoveCount
+
"次后退,等待再次前进"
);
InLog
(
"料架入库"
+
MoveInfo
.
SLog
+
":升降盘定位气缸第"
+
TrayLCylinderMoveCount
+
"次后退,等待再次前进"
);
TrayLCylinderAfter
(
MoveInfo
);
TrayLCylinderAfter
(
MoveInfo
);
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_08_TrayLocation_Back
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_08_TrayLocation_Back
))
...
@@ -841,7 +841,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -841,7 +841,7 @@ namespace OnlineStore.DeviceLibrary
if
(
TrayLCylinderMoveCount
<
10
)
if
(
TrayLCylinderMoveCount
<
10
)
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_07_TrayLocation_Before
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_07_TrayLocation_Before
);
InLog
(
"料架入库"
+
MoveInfo
.
SLog
+
":升降盘定位气缸第"
+
TrayLCylinderMoveCount
+
"次前进 2秒"
);
InLog
(
"料架入库"
+
MoveInfo
.
SLog
+
":升降盘定位气缸第"
+
TrayLCylinderMoveCount
+
"次前进 2秒"
);
TrayLCylinderBefore
(
null
);
TrayLCylinderBefore
(
null
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
}
}
...
@@ -852,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -852,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
LastCodeList
=
new
List
<
string
>();
LastCodeList
=
new
List
<
string
>();
NextCodeList
=
new
List
<
string
>();
NextCodeList
=
new
List
<
string
>();
TrayLCylinderBefore
(
MoveInfo
);
TrayLCylinderBefore
(
MoveInfo
);
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_09_TrayLocation_Before
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_09_TrayLocation_Before
))
{
{
...
@@ -917,24 +917,70 @@ namespace OnlineStore.DeviceLibrary
...
@@ -917,24 +917,70 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_17_UpdownAxisToP1
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_17_UpdownAxisToP1
))
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_18_WaitNoLocationCheck
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_18_WaitNoLocationCheck
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":等待 SL_AxisLocationCheck=LOW"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":等待 SL_AxisLocationCheck=LOW,最多等待 5000,清空 LastHeight,LastWidth "
);
LastHeight
=
0
;
LastWidth
=
0
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_AxisLocationCheck
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_AxisLocationCheck
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_18_WaitNoLocationCheck
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_18_WaitNoLocationCheck
))
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_19_BatchAxisToP3
);
//判断是否检测到
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
if
(
IOValue
(
IO_Type
.
SL_AxisLocationCheck
).
Equals
(
IO_VALUE
.
HIGH
))
LastWidth
=
GetWidth
();
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":提升伺服运动到P3,盘宽【"
+
LastWidth
+
"】,横移气缸上升 "
);
if
(!
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
))
{
{
CylinderMove
(
null
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_18_GetReelSize
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":SL_AxisLocationCheck=HIGH, 从服务器获取尺寸 "
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
//从服务器获取尺寸信息
string
result
=
SServerManager
.
GetReelSize
(
Name
,
code
,
out
int
width
,
out
int
height
);
if
(
string
.
IsNullOrEmpty
(
result
)
&&
width
>
0
&&
height
>
0
)
{
LastWidth
=
width
;
LastHeight
=
height
;
LogUtil
.
error
(
Name
+
"料盘移栽"
+
MoveInfo
.
SLog
+
":SL_AxisLocationCheck =HIGH,从服务器获取到尺寸【"
+
LastWidth
+
"X"
+
LastHeight
+
"】 不需要计算高度直接继续,横移气缸上升 "
);
}
else
{
//判断是否有宽度
LastWidth
=
GetNoHeightWidth
();
LastHeight
=
0
;
LogUtil
.
error
(
Name
+
"料盘移栽"
+
MoveInfo
.
SLog
+
":SL_AxisLocationCheck =HIGH,从服务器获取到尺寸结果【"
+
result
+
"】,【"
+
LastWidth
+
"X"
+
LastHeight
+
"】 不需要计算高度直接继续,横移气缸上升 "
);
}
FI_19_GetHFromServer
();
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_19_BatchAxisToP3
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
LastWidth
=
GetWidth
();
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":提升伺服运动到P3,盘宽【"
+
LastWidth
+
"】,横移气缸上升 "
);
if
(!
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
))
{
CylinderMove
(
null
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
}
else
{
CylinderMove
(
null
,
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
);
}
BatchAxisToP3
(
false
);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_19_GetHFromServer
))
{
if
(
MoveCylineIsUp
())
{
FI_21_CylinderGive
();
}
}
else
else
{
{
CylinderMove
(
null
,
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_20_SaveSize
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移气缸放料SOL前先上升横移气缸"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
}
}
BatchAxisToP3
(
false
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录 高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】,预扫码"
);
YuScanCode
();
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_19_BatchAxisToP3
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_19_BatchAxisToP3
))
{
{
...
@@ -959,9 +1005,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -959,9 +1005,6 @@ namespace OnlineStore.DeviceLibrary
}
}
if
(
MoveCylineIsUp
())
if
(
MoveCylineIsUp
())
{
{
//MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive);
//InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
//CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
FI_21_CylinderGive
();
FI_21_CylinderGive
();
}
}
else
else
...
@@ -970,24 +1013,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -970,24 +1013,7 @@ namespace OnlineStore.DeviceLibrary
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移气缸放料SOL前先上升横移气缸"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移气缸放料SOL前先上升横移气缸"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
}
}
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
//LastHeight = GetHeight();
//if (LastWidth.Equals(7))
//{
// if (LastHeight > 16)
// {
// LogUtil.error(Name + "计算后高度" + LastWidth + "X" + LastHeight + ",七寸盘默认盘高最高=16,修改高度为16");
// LastHeight = 16;
// }
//}
//else
//{
// if (LastHeight < 12)
// {
// LogUtil.error(Name + "计算后高度" + LastWidth + "X" + LastHeight + ",非七寸盘默认盘高最低=12,修改高度为12");
// LastHeight = 12;
// }
//}
//判断是否还有料盘
//判断是否还有料盘
if
(
IOValue
(
IO_Type
.
SL_AxisLocationCheck
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
SL_AxisLocationCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
{
...
@@ -1018,9 +1044,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1018,9 +1044,6 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
MoveCylineIsUp
())
if
(
MoveCylineIsUp
())
{
{
//MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive);
//InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
//CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
FI_21_CylinderGive
();
FI_21_CylinderGive
();
}
}
else
else
...
@@ -1048,34 +1071,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1048,34 +1071,7 @@ namespace OnlineStore.DeviceLibrary
FI_25_WaitTray
();
FI_25_WaitTray
();
//FI_24_GetPosID();
//FI_24_GetPosID();
}
}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_WaitReelCheck))
//{
// FI_24_GetPosID();
//}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_GetPosID))
//{
// FI_25_WaitTray();
//if (getPosTask.IsCompleted && LastPosParam != null)
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_25_WaitTray);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
// if ((!LastPosParam.PlateH.Equals(LastHeight)) || (!LastPosParam.PlateW.Equals(LastWidth)))
// {
// InLog(" " + MoveInfo.SLog + " 原有料盘尺寸:【" + LastWidth + "X" + LastHeight + "】更改为服务器返回尺寸【" + LastPosParam.PlateW + "X" + LastPosParam.PlateH + "】 ");
// LastWidth = LastPosParam.PlateW;
// LastHeight = LastPosParam.PlateH;
// }
// InLog(" " + MoveInfo.SLog + " 开始拦截空托盘 " + LastPosParam.ToStr() + "");
// getPosIdMsg = "";
// ClearTimeoutAlarm("获取库位号超时");
//}
//else if (MoveInfo.IsTimeOut(120))
//{
// WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 获取库位号超时 "+ getPosIdMsg + " [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
// LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
// Alarm(LineAlarmType.IoSingleTimeOut);
//}
//}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_25_WaitTray
))
//TODO
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_25_WaitTray
))
//TODO
{
{
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_11_CodeRember
))
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_11_CodeRember
))
...
@@ -1272,9 +1268,26 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1272,9 +1268,26 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
}
}
private
void
FI_19_GetHFromServer
()
{
//尺寸正常,当做正常抓到的料 提升轴下降到信号灭
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_19_GetHFromServer
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":SL_AxisLocationCheck =HIGH,从服务器获取到高度【"
+
LastHeight
+
"】,盘宽【"
+
LastWidth
+
"】不需要计算高度直接继续,横移气缸上升 "
);
if
(!
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
))
{
CylinderMove
(
null
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
}
else
{
CylinderMove
(
null
,
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
);
}
}
private
void
FI_25_WaitTray
()
private
void
FI_25_WaitTray
()
{
{
if
(
getPosTask
.
IsCompleted
&&
LastPosParam
!=
null
)
if
(
(
getPosTask
==
null
||
getPosTask
.
IsCompleted
)
&&
LastPosParam
!=
null
)
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_25_WaitTray
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_25_WaitTray
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
...
@@ -1311,10 +1324,49 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1311,10 +1324,49 @@ namespace OnlineStore.DeviceLibrary
{
{
//MoveInfo.NextMoveStep(LineMoveStep.FI_24_GetPosID);
//MoveInfo.NextMoveStep(LineMoveStep.FI_24_GetPosID);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
InLog
(
"清空LastPosResult,从服务器获取入库库位"
);
LastPosParam
=
null
;
LastPosParam
=
null
;
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
lastcode
=
code
;
lastcode
=
code
;
//如果尺寸或者高度为0,不需要获取库位号
if
(
LastWidth
<=
0
||
LastHeight
<=
0
)
{
InLog
(
$
"【"
+
code
+
"】清空LastPosResult,料盘尺寸 {LastWidth}X{LastHeight} 尺寸不完整,直接NG不需要获取库位号"
);
getPosTask
=
null
;
LastPosParam
=
new
InOutParam
(
0
,
lastcode
,
""
,
LastHeight
,
LastWidth
,
true
)
;
LastPosParam
.
NgMsg
=
$
"入库:{LastWidth}X{LastHeight} 尺寸不完整"
;
LastPosParam
.
InStoreNg
=
true
;
LastPosParam
.
rfid
=
CurrShelfId
;
LastPosParam
.
WareCode
=
lastcode
;
LastPosParam
.
ManualJudgeNG
=
true
;
//如果没有宽度,默认最宽料盘
if
(
LastWidth
<=
0
)
{
LastWidth
=
15
;
LastHeight
=
56
;
LastPosParam
.
PlateH
=
LastHeight
;
LastPosParam
.
PlateW
=
LastWidth
;
InLog
(
$
"【{ code }】宽度为0,默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true"
);
}
else
{
if
(
LastWidth
.
Equals
(
7
))
{
LastHeight
=
16
;
}
else
{
LastHeight
=
56
;
}
LastPosParam
.
PlateH
=
LastHeight
;
InLog
(
$
"【{ code }】宽度为{LastWidth},默认最大料盘尺寸 {LastPosParam.PlateW}X{LastPosParam.PlateH} ,标记 ManualJudgeNG=true"
);
}
return
;
}
InLog
(
"清空LastPosResult,从服务器获取入库库位"
);
getPosTask
=
Task
.
Factory
.
StartNew
(
delegate
getPosTask
=
Task
.
Factory
.
StartNew
(
delegate
{
{
//更新托盘条码信息
//更新托盘条码信息
...
@@ -1743,6 +1795,33 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1743,6 +1795,33 @@ namespace OnlineStore.DeviceLibrary
}
}
return
width
;
return
width
;
}
}
public
int
GetNoHeightWidth
()
{
int
width
=
15
;
if
(
IOValue
(
IO_Type
.
SL_TrayCheck4
).
Equals
(
IO_VALUE
.
HIGH
))
{
width
=
15
;
}
else
if
(
IOValue
(
IO_Type
.
SL_TrayCheck3
).
Equals
(
IO_VALUE
.
HIGH
))
{
width
=
13
;
}
else
if
(
IOValue
(
IO_Type
.
SL_TrayCheck2
).
Equals
(
IO_VALUE
.
HIGH
))
{
width
=
11
;
}
else
if
(
IOValue
(
IO_Type
.
SL_TrayCheck1
).
Equals
(
IO_VALUE
.
HIGH
))
{
width
=
7
;
}
else
{
LogUtil
.
error
(
Name
+
"GetWidth :1234都未检测到,默认为7寸盘"
);
width
=
0
;
}
return
width
;
}
#
endregion
#
endregion
#
region
判断托盘是否需要
#
region
判断托盘是否需要
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
f1c775e
...
@@ -599,7 +599,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -599,7 +599,7 @@ namespace OnlineStore.DeviceLibrary
//如果当前正在出入库中,需要记录下来,等待空闲时执行
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
deviceName
+
"["
+
moveEquip
.
Name
+
" ]入库命令: "
+
param
.
ToStr
()
+
"加入等待列表中!"
);
LogUtil
.
info
(
deviceName
+
"["
+
moveEquip
.
Name
+
" ]入库命令: "
+
param
.
ToStr
()
+
"加入等待列表中!"
);
InOutParam
inOutParam
=
moveEquip
.
waitInStoreList
.
Find
(
s
=>
param
.
PosId
.
Equals
(
s
.
PosId
));
InOutParam
inOutParam
=
moveEquip
.
waitInStoreList
.
Find
(
s
=>
param
.
PosId
.
Equals
(
s
.
PosId
));
if
(
inOutParam
!=
null
)
if
(
inOutParam
!=
null
)
{
{
moveEquip
.
waitInStoreList
.
Remove
(
inOutParam
);
moveEquip
.
waitInStoreList
.
Remove
(
inOutParam
);
}
}
...
@@ -823,9 +823,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -823,9 +823,9 @@ namespace OnlineStore.DeviceLibrary
{
{
return
(-
1
,
data
.
data
);
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
);
return
(
100
,
data
.
data
);
}
}
...
@@ -844,7 +844,67 @@ namespace OnlineStore.DeviceLibrary
...
@@ -844,7 +844,67 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
error
(
"getTaskInfo "
+
ex
.
ToString
());
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
...
@@ -893,6 +953,32 @@ namespace OnlineStore.DeviceLibrary
public
taskInfo
data
{
get
;
set
;
}
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
public
class
taskInfo
{
{
/// <summary>
/// <summary>
...
...
source/DeviceLibrary/deviceLibrary/halcon/EyemManager.cs
查看文件 @
f1c775e
...
@@ -38,10 +38,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -38,10 +38,10 @@ namespace OnlineStore.DeviceLibrary
}
}
public
static
bool
record
=
false
;
//是否保存结果图片
public
static
bool
record
=
false
;
//是否保存结果图片
public
static
bool
ReelCheck
(
Bitmap
a
)
public
static
bool
ReelCheck
(
Bitmap
a
)
{
{
try
try
{
{
Bitmap
b
=
GetReducedImage
(
a
,
1024
,
0
);
Bitmap
b
=
GetReducedImage
(
a
,
a
.
Width
,
a
.
Height
);
a
.
Dispose
();
a
.
Dispose
();
EyemImage
image
=
new
EyemImage
();
EyemImage
image
=
new
EyemImage
();
...
...
source/DeviceLibrary/deviceLibrary/reelCheck/ReelCheckUtil.cs
查看文件 @
f1c775e
...
@@ -165,22 +165,26 @@ dMinorStep 步进,默认1.0。
...
@@ -165,22 +165,26 @@ dMinorStep 步进,默认1.0。
eyemTrackFeature
(
image
,
mask
,
tpRoi
,
hGlobal
,
ipResults
.
Length
,
tpHsvModel
,
ipResults
,
out
EyemImage
tpDstImg
);
eyemTrackFeature
(
image
,
mask
,
tpRoi
,
hGlobal
,
ipResults
.
Length
,
tpHsvModel
,
ipResults
,
out
EyemImage
tpDstImg
);
string
resultStr
=
""
;
string
resultStr
=
""
;
int
hasReelCount
=
0
;
for
(
int
i
=
0
;
i
<
ipResults
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
ipResults
.
Length
;
i
++)
{
{
if
(
ipResults
[
i
]
==
1
)
if
(
ipResults
[
i
]
==
1
)
{
{
Console
.
WriteLine
(
"检测到{0}位置有料盘"
,
i
);
Console
.
WriteLine
(
"检测到{0}位置有料盘"
,
i
);
hasReelCount
++;
}
}
resultStr
+=
ipResults
[
i
];
resultStr
+=
ipResults
[
i
];
}
}
Bitmap
dstBitmap
=
eyemCvtToBitmap
(
tpDstImg
);
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
date
=
cameraName
.
Trim
().
Replace
(
'_'
,
'-'
)
+
"-"
+
DateTime
.
Now
.
ToString
(
"yyyyMMdd-HHmmss"
)
+
DateTime
.
Now
.
Millisecond
;
string
imageName
=
date
+
"-"
+
resultStr
+
".bmp"
;
string
imageName
=
date
+
"-"
+
resultStr
+
".bmp"
;
imgName
=
imageName
;
imgName
=
imageName
;
string
path
=
"D:\\image\\"
+
cameraName
+
"\\ResOut\\"
;
string
path
=
"D:\\image\\"
+
cameraName
+
"\\ResOut\\"
+
dataFolder
+
"\\"
+
hourFolder
+
"\\"
;
if
(
canSavePic
(
path
))
if
(
canSavePic
(
path
))
{
{
dstBitmap
.
Save
(
path
+
imageName
,
ImageFormat
.
Jpeg
);
dstBitmap
.
Save
(
path
+
imageName
,
ImageFormat
.
Jpeg
);
...
@@ -212,7 +216,7 @@ dMinorStep 步进,默认1.0。
...
@@ -212,7 +216,7 @@ dMinorStep 步进,默认1.0。
int
zhao
=(
int
)(
freespace
/
1024
);
int
zhao
=(
int
)(
freespace
/
1024
);
if
(
zhao
<
5
)
if
(
zhao
<
5
)
{
{
LogUtil
.
error
(
volume
+
"盘剩余空间:"
+
freespace
+
"
M
, 不再保存料盘图片"
);
LogUtil
.
error
(
volume
+
"盘剩余空间:"
+
freespace
+
"
G
, 不再保存料盘图片"
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
f1c775e
...
@@ -798,12 +798,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -798,12 +798,25 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
[
Description
(
"入料_取料完成_等待伺服检测信号消失"
)]
[
Description
(
"入料_取料完成_等待伺服检测信号消失"
)]
FI_18_WaitNoLocationCheck
,
FI_18_WaitNoLocationCheck
,
/// <summary>
/// 料盘移栽:等待没有伺服料盘检测信号,从服务器获取库位号
/// </summary>
[
Description
(
"入料_取料完成_等待没有伺服料盘检测信号,从服务器获取库位号"
)]
FI_18_GetReelSize
,
/// <summary>
/// <summary>
/// 料盘移栽:提升伺服运动到P3,横移气缸上升
/// 料盘移栽:提升伺服运动到P3,横移气缸上升
/// </summary>
/// </summary>
[
Description
(
"入料_取料完成_提升伺服运动到P3,横移气缸上升"
)]
[
Description
(
"入料_取料完成_提升伺服运动到P3,横移气缸上升"
)]
FI_19_BatchAxisToP3
,
FI_19_BatchAxisToP3
,
/// <summary>
/// <summary>
/// 料盘移栽:提升伺服运动到P3,横移气缸上升
/// </summary>
[
Description
(
"入料_取料完成_伺服检测信号一直亮,从服务器获取尺寸,横移气缸上升"
)]
FI_19_GetHFromServer
,
/// <summary>
/// 料盘移栽:记录高度尺寸
/// 料盘移栽:记录高度尺寸
/// </summary>
/// </summary>
[
Description
(
"入料_取料完成_记录高度尺寸"
)]
[
Description
(
"入料_取料完成_记录高度尺寸"
)]
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论