Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
SO1131-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9debbf56
由
张东亮
编写于
2023-03-09 17:02:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
调试模式下入库上报正常、扫码异常
1 个父辈
a8e81f8e
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
52 行增加
和
68 行删除
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/storeBean/EquipBase.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
source/DeviceLibrary/storeBean/inputBean/BatchMoveBean_Partial.cs
source/DeviceLibrary/storeBean/inputBean/InputEquip_InStore.cs
source/XLRStoreClient/FrmXLRStore.cs
source/XLRStoreClient/Program.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
9debbf5
...
...
@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
DateTime
startTime
=
DateTime
.
Now
;
if
(
deviceName
!=
""
)
{
LogUtil
.
debug
(
deviceName
+
" 【"
+
cameraName
+
"】开始取图片"
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】开始取图片"
);
}
Bitmap
bmp
=
null
;
HalconDotNet
.
HObject
ho_Image
=
null
;
...
...
@@ -147,75 +147,53 @@ namespace OnlineStore.DeviceLibrary
continue
;
}
LogUtil
.
debug
(
deviceName
+
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
string
r
=
""
;
bool
eyemNoCode
=
false
;
if
(!
isPreScan
)
{
if
(!
findRightCode
)
try
{
try
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
RemoteDecodeHelper
.
RemoteDecodeParam
remoteDecodeParam
=
new
RemoteDecodeHelper
.
RemoteDecodeParam
{
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
// eyemNoCode = true;
RemoteDecodeHelper
.
RemoteDecodeParam
remoteDecodeParam
=
new
RemoteDecodeHelper
.
RemoteDecodeParam
{
codeTypeList
=
codeTypeList
.
ToArray
(),
codeCount
=
codeCount
,
timeout
=
codeTimeout
};
cc
=
RemoteDecodeHelper
.
DecodeRequest
(
ho_Image
,
remoteDecodeParam
);
if
(
cc
!=
null
)
codeTypeList
=
codeTypeList
.
ToArray
(),
codeCount
=
codeCount
,
timeout
=
codeTimeout
};
cc
=
RemoteDecodeHelper
.
DecodeRequest
(
ho_Image
,
remoteDecodeParam
);
if
(
cc
!=
null
)
{
foreach
(
CodeInfo
c
in
cc
)
{
foreach
(
CodeInfo
c
in
cc
)
string
str
=
CodeManager
.
ReplaceCode
(
c
.
CodeStr
);
if
(!
codeList
.
Contains
(
str
))
{
string
str
=
CodeManager
.
ReplaceCode
(
c
.
CodeStr
);
if
(!
codeList
.
Contains
(
str
))
codeList
.
Add
(
str
);
r
=
r
+
"##remote|"
+
c
.
CodeType
+
"|"
+
str
;
if
(!
findRightCode
)
{
codeList
.
Add
(
str
);
r
=
r
+
"##remote|"
+
c
.
CodeType
+
"|"
+
str
;
if
(!
findRightCode
)
{
findRightCode
=
HasRightCode
(
str
);
}
findRightCode
=
HasRightCode
(
str
);
}
}
}
}
catch
(
Exception
ex
)
if
(!
findRightCode
)
{
LogUtil
.
error
(
deviceName
+
" RemoteDecodeHelper扫码出错:"
+
ex
.
ToString
()
);
SaveNGImageToFile
(
deviceName
,
cameraName
,
bmp
);
}
}
//if (!findRightCode && SaveErrorImageToFile.Equals(1))
if
((!
findRightCode
)
||
eyemNoCode
)
{
//如果halcon没扫出的,
string
nameStr
=
""
;
if
(
findRightCode
&&
eyemNoCode
)
else
{
nameStr
=
"eyem"
;
SaveOKImageToFile
(
deviceName
,
cameraName
,
bmp
)
;
}
//if (!taskResult)
//{
// nameStr = "eyemTimeOut";
//}
SaveNGImageToFile
(
deviceName
,
cameraName
+
nameStr
,
bmp
);
}
else
catch
(
Exception
ex
)
{
SaveOKImageToFile
(
deviceName
,
cameraName
,
bmp
);
LogUtil
.
error
(
deviceName
+
" RemoteDecodeHelper扫码出错:"
+
ex
.
ToString
()
);
}
}
if
(
deviceName
!=
""
||
r
!=
""
)
{
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】["
+
findRightCode
+
"]"
+
ScanCount
+
" :"
+
r
);
}
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】["
+
findRightCode
+
"]"
+
ScanCount
+
" :"
+
r
);
}
catch
(
AccessViolationException
e
)
{
...
...
@@ -410,7 +388,7 @@ namespace OnlineStore.DeviceLibrary
}
return
(
codeList
,
bitmapfilename
);
}
static
int
CntImgs
=
ConfigAppSettings
.
GetIntValue
(
"SaveImgCnt"
,
100
);
static
int
CntImgs
=
ConfigAppSettings
.
GetIntValue
(
"SaveImgCnt"
,
100
);
private
static
string
SaveNGImageToFile
(
string
deviceName
,
string
cameraName
,
Bitmap
bitmap
)
{
string
date
=
DateTime
.
Now
.
ToString
(
"HH-mm-ss-"
)
+
DateTime
.
Now
.
Millisecond
;
...
...
@@ -446,11 +424,11 @@ namespace OnlineStore.DeviceLibrary
{
Directory
.
CreateDirectory
(
dire
);
}
using
(
Bitmap
bit
=
(
Bitmap
)
bitmap
.
Clone
())
using
(
Bitmap
bit
=
(
Bitmap
)
bitmap
.
Clone
())
{
deleteFiles
(
dire
);
bit
.
Save
(
dire
+
iamgeName
,
ImageFormat
.
Bmp
);
// bit.Dispose();
// bit.Dispose();
}
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】保存OK图片到【"
+
dire
+
iamgeName
+
"】成功"
);
...
...
source/DeviceLibrary/storeBean/EquipBase.cs
查看文件 @
9debbf5
...
...
@@ -387,7 +387,7 @@ namespace OnlineStore.DeviceLibrary
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒"
;
if
(
moveInfo
.
IsStep
(
StepEnum
.
Line_02_WaitReduceSig
))
if
(
moveInfo
.
IsStep
(
StepEnum
.
Line_02_WaitReduceSig
)
||
moveInfo
.
IsStep
(
StepEnum
.
Line_03_ReelArriveStop
)
)
{
SServerManager
.
DisablePos
(
"仓内长皮带线"
,
moveInfo
.
MoveParam
.
PosInfo
.
barcode
,
moveInfo
.
MoveParam
.
PosInfo
.
PosId
,
$
"在长皮带线{timeOutSeconds}S内未检测到料盘"
);
wait
.
IsEnd
=
true
;
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
查看文件 @
9debbf5
...
...
@@ -107,7 +107,8 @@ namespace OnlineStore.DeviceLibrary
{
boxStatus
.
status
=
(
int
)
DeviceStatus
.
Debugging
;
}
else
if
(
runStatus
.
Equals
(
DeviceStatus
.
OutStoreBoxEnd
)
||
runStatus
.
Equals
(
DeviceStatus
.
InStoreEnd
))
if
(
runStatus
.
Equals
(
DeviceStatus
.
OutStoreBoxEnd
)
||
runStatus
.
Equals
(
DeviceStatus
.
InStoreEnd
))
{
boxStatus
.
data
.
Add
(
ParamDefine
.
posId
,
lastPosId
);
boxStatus
.
data
.
Add
(
ParamDefine
.
barcode
,
lastBarcode
);
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
查看文件 @
9debbf5
...
...
@@ -51,7 +51,8 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns>
private
bool
PreInStoreCheck
(
InOutParam
param
)
{
if
(
IsDebug
)
return
true
;
//调试模式开启
//if (IsDebug) return true;
if
(!
AutoInout
.
autoNext
&&
!
InDoorCheck
(
param
))
{
if
(
param
==
null
||
param
.
PosInfo
==
null
)
...
...
@@ -107,8 +108,8 @@ namespace OnlineStore.DeviceLibrary
{
if
(
posinfo
==
null
)
return
false
;
LogUtil
.
error
(
Name
+
$
" 启动入库出错,入口料盘
无入库信息[barcode={posinfo.barcode},PosSide={posinfo.GetPosSide()}], 任务取消
"
);
SServerManager
.
cancelPutInTask
(
Name
,
posinfo
.
barcode
);
LogUtil
.
error
(
Name
+
$
" 启动入库出错,入口料盘
入库信息和检测信号不符合条件[barcode={posinfo.barcode},PosSide={posinfo.GetPosSide()}]
"
);
//
SServerManager.cancelPutInTask(Name, posinfo.barcode);
return
false
;
}
...
...
source/DeviceLibrary/storeBean/inputBean/BatchMoveBean_Partial.cs
查看文件 @
9debbf5
...
...
@@ -373,11 +373,15 @@ namespace OnlineStore.DeviceLibrary
{
Robot
.
IOMove
(
IO_Type
.
CameraLed
,
IO_VALUE
.
HIGH
);
L
astCodeList
=
CodeManager
.
CameraScan
(
Config
.
CameraName
,
Name
);
if
(
LastCodeList
.
Count
<=
0
)
L
ist
<
string
>
codes
=
CodeManager
.
CameraScan
(
Config
.
CameraName
,
Name
);
if
(
codes
.
Count
<=
0
)
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
CameraName
,
Name
);
}
else
{
LastCodeList
=
new
List
<
string
>(
codes
);
}
//TODO 需要判断是否和上次的条码重复,重复的条码不可用
bool
isCanUse
=
true
;
//判断是否可用
...
...
source/DeviceLibrary/storeBean/inputBean/InputEquip_InStore.cs
查看文件 @
9debbf5
...
...
@@ -165,10 +165,10 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
II06_WaitHeight
))
{
BatchMoveBean
moveBean
=
BatchMove
;
//
if (moveBean.LastHeight > 0)
if
(
moveBean
.
LastHeight
>
0
)
{
ClearTimeoutAlarm
(
"获取料盘高度完成超时"
);
int
Height
=
8
;
//
moveBean.LastHeight;
int
Height
=
moveBean
.
LastHeight
;
int
width
=
7
;
//if (IOValue(IO_Type.Feeding_Reel_13_Check).Equals(IO_VALUE.HIGH))
//{
...
...
@@ -180,10 +180,10 @@ namespace OnlineStore.DeviceLibrary
MoveLog
(
$
"入库取料{shelf}{MoveInfo.SLog}: 料盘尺寸{width}X{Height}"
);
II13_GetPosId
();
}
//
else if (MoveInfo.IsTimeOut(60))
//
{
//
MoveTimeOut(MoveInfo, "" + moveBean.Name + "获取料盘高度完成");
//
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
MoveTimeOut
(
MoveInfo
,
""
+
moveBean
.
Name
+
"获取料盘高度完成"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
II08_GetPosId
))
{
...
...
source/XLRStoreClient/FrmXLRStore.cs
查看文件 @
9debbf5
...
...
@@ -590,7 +590,7 @@ namespace OnlineStore.XLRStore
{
if
(
Camera
.
_cam
!=
null
)
{
Camera
.
_cam
.
CloseAll
();
Camera
.
_cam
?
.
CloseAll
();
}
CodeLibrary
.
FrmCodeDecode
frm
=
new
CodeLibrary
.
FrmCodeDecode
(
false
);
frm
.
ShowDialog
();
...
...
source/XLRStoreClient/Program.cs
查看文件 @
9debbf5
...
...
@@ -254,8 +254,8 @@ namespace OnlineStore.XLRStore
return
Write
(
fileName
,
DumpType
.
MiniDumpWithFullMemory
);
}
public
static
bool
Write
(
string
fileName
,
DumpType
dumpType
)
{
using
(
var
fs
=
new
System
.
IO
.
FileStream
(
fileName
,
System
.
IO
.
FileMode
.
Create
,
System
.
IO
.
FileAccess
.
Write
,
System
.
IO
.
FileShare
.
None
))
{
using
(
var
fs
=
new
System
.
IO
.
FileStream
(
fileName
,
System
.
IO
.
FileMode
.
OpenOr
Create
,
System
.
IO
.
FileAccess
.
Write
,
System
.
IO
.
FileShare
.
None
))
{
MiniDumpExceptionInformation
exp
;
exp
.
ThreadId
=
GetCurrentThreadId
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论