Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8d9482bc
由
LN
编写于
2020-03-14 13:15:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
794fac15
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
47 行增加
和
15 行删除
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
8d9482b
...
@@ -284,9 +284,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -284,9 +284,12 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
Line3TurnIsStop
()
&&
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
StationInfo_NG
.
TrayValue
.
Equals
(
IO_VALUE
.
HIGH
))
if
(
Line3TurnIsStop
()
&&
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
StationInfo_NG
.
TrayValue
.
Equals
(
IO_VALUE
.
HIGH
))
{
{
if
(
ScanIsEnd
()
||
DeviceID
.
Equals
(
302
))
{
StartNOutStoreMove
(
new
InOutParam
());
StartNOutStoreMove
(
new
InOutParam
());
}
}
}
}
}
else
else
{
{
//皮带线3出口有料,分盘定位装置无料
//皮带线3出口有料,分盘定位装置无料
...
@@ -577,14 +580,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -577,14 +580,14 @@ namespace OnlineStore.DeviceLibrary
msg
+=
"LIsRun:"
+
TrayLine1
.
IsInTurn
()
+
" "
+
TrayLine2
.
IsInTurn
()
+
" "
+
Line3Turn
.
InTurn
+
" "
+
"\n"
;
msg
+=
"LIsRun:"
+
TrayLine1
.
IsInTurn
()
+
" "
+
TrayLine2
.
IsInTurn
()
+
" "
+
Line3Turn
.
InTurn
+
" "
+
"\n"
;
msg
+=
"L3CanRun:"
+
TrayLine1
.
Line3CanRun
+
" "
+
TrayLine2
.
Line3CanRun
+
" "
+
"\n"
;
msg
+=
"L3CanRun:"
+
TrayLine1
.
Line3CanRun
+
" "
+
TrayLine2
.
Line3CanRun
+
" "
+
"\n"
;
//msg += "LastWidth:" + LastWidth+"\n";
//msg += "LastWidth:" + LastWidth+"\n";
if
(
IsNewType
)
//if (IsNewType)
{
//{
msg
+=
"Move:"
+
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
MoveStep
+
" "
+
LastWidth
+
"="
+
StationInfo_Move
.
CodeStr
+
"\n"
;
}
else
{
msg
+=
"Move:"
+
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
MoveStep
+
" "
+
LastWidth
+
"="
+
StationInfo_Move
.
CodeStr
+
"\n"
;
msg
+=
"Move:"
+
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
MoveStep
+
" "
+
LastWidth
+
"="
+
StationInfo_Move
.
CodeStr
+
"\n"
;
}
//}
//else
//{
// msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.MoveStep + " " + LastWidth + "=" + StationInfo_Move.CodeStr + "\n";
//}
//msg += "NG 工位:" + StationInfo_NG.ToStr + "\n";
//msg += "NG 工位:" + StationInfo_NG.ToStr + "\n";
//msg += "扫码工位:" + StationInfo_Scan.ToStr + "\n";
//msg += "扫码工位:" + StationInfo_Scan.ToStr + "\n";
//msg += "IsInScanCode:" + IsInScanCode;
//msg += "IsInScanCode:" + IsInScanCode;
...
...
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
查看文件 @
8d9482b
...
@@ -280,6 +280,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -280,6 +280,10 @@ namespace OnlineStore.DeviceLibrary
int
robotIndex
=
GetRobotIndex
();
int
robotIndex
=
GetRobotIndex
();
string
result
=
SServerManager
.
GetTraySize
(
Name
,
robotIndex
,
StationInfo_Move
.
CodeStr
,
out
LastWidth
);
string
result
=
SServerManager
.
GetTraySize
(
Name
,
robotIndex
,
StationInfo_Move
.
CodeStr
,
out
LastWidth
);
LogUtil
.
info
(
hengyiName
+
MoveInfo
.
SLog
+
"送料: ["
+
StationInfo_Move
.
CodeStr
+
"] 获取尺寸【"
+
LastWidth
+
"】【"
+
result
+
"】"
);
LogUtil
.
info
(
hengyiName
+
MoveInfo
.
SLog
+
"送料: ["
+
StationInfo_Move
.
CodeStr
+
"] 获取尺寸【"
+
LastWidth
+
"】【"
+
result
+
"】"
);
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DON_03_GetTraySize
))
{
MoveInfo
.
EndStepWait
();
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DON_03_GetTraySize
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DON_03_GetTraySize
))
{
{
...
...
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
8d9482b
...
@@ -137,19 +137,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -137,19 +137,20 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】开始取图片"
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】开始取图片"
);
using
(
Bitmap
bitmap
=
GetCamerImage
(
cameraName
))
using
(
Bitmap
bitmap
=
GetCamerImage
(
cameraName
))
{
{
HalconDotNet
.
HObject
ho_Image
=
null
;
Bitmap
bit
=
null
;
try
{
if
(
bitmap
==
null
)
if
(
bitmap
==
null
)
{
{
LogUtil
.
error
(
deviceName
+
" 【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"],关闭相机"
);
LogUtil
.
error
(
deviceName
+
" 【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"],关闭相机"
);
CloseCamera
(
cameraName
);
CloseCamera
(
cameraName
);
continue
;
continue
;
}
}
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】取图片完成,开始转换并扫码"
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】取图片完成,开始转换并扫码"
);
// System.Threading.Thread.Sleep(1);
bit
=
new
Bitmap
(
bitmap
);
//转换托盘大概100-150ms,不打印日志
Bitmap
bit
=
new
Bitmap
(
bitmap
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】new Bitmap(bitmap);完成"
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】new Bitmap(bitmap);完成"
);
HalconDotNet
.
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bit
);
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bit
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
string
r
=
""
;
string
r
=
""
;
...
@@ -180,16 +181,40 @@ namespace OnlineStore.DeviceLibrary
...
@@ -180,16 +181,40 @@ namespace OnlineStore.DeviceLibrary
// SaveImageToFile(deviceName, cameraName, bit);
// SaveImageToFile(deviceName, cameraName, bit);
}
}
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】:"
+
r
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】:"
+
r
);
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
deviceName
+
" 扫码出现AccessViolationException异常,关闭相机【"
+
cameraName
+
"】:"
+
e
.
ToString
());
Camera
.
_cam
.
Close
(
cameraName
);
// GC.Collect();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" 扫码出错:"
+
ex
.
ToString
());
}
finally
{
if
(
bitmap
!=
null
)
{
bitmap
.
Dispose
();
}
if
(
bit
!=
null
)
{
bit
.
Dispose
();
bit
.
Dispose
();
}
if
(
ho_Image
!=
null
)
{
ho_Image
.
Dispose
();
ho_Image
.
Dispose
();
bitmap
.
Dispose
();
}
}
}
}
}
}
}
}
catch
(
AccessViolationException
e
)
catch
(
AccessViolationException
e
)
{
{
LogUtil
.
error
(
deviceName
+
" 扫码出现AccessViolationException异常:"
+
e
.
ToString
());
LogUtil
.
error
(
deviceName
+
" 扫码出现AccessViolationException异常,关闭所有相机:"
+
e
.
ToString
());
// GC.Collect();
Camera
.
_cam
.
CloseAll
();
//GC.Collect();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论