Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
CarerayImage
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 79c08d62
由
刘韬
编写于
2025-12-08 13:32:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
Neox接口添加错误信息输出
1 个父辈
25aba30b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
34 行增加
和
37 行删除
CarerayImage/NeoX.cs
CarerayImage/XrayImage.cs
CarerayImage/haobo_v2.cs
CarerayImage/NeoX.cs
查看文件 @
79c08d6
...
@@ -68,9 +68,9 @@ public static class NeoX
...
@@ -68,9 +68,9 @@ public static class NeoX
}
}
[
HandleProcessCorruptedStateExceptions
]
[
HandleProcessCorruptedStateExceptions
]
public
static
bool
AlgoC
(
string
filename
,
string
templateFile
,
int
shrinkOffset
,
int
Corner
,
string
type
,
out
int
count
,
out
Bitmap
bitmap
)
public
static
bool
AlgoC
(
string
filename
,
string
templateFile
,
int
shrinkOffset
,
int
Corner
,
string
type
,
out
int
count
,
out
Bitmap
bitmap
,
out
string
errormsg
)
{
{
errormsg
=
""
;
var
d
=
new
NeoXData
();
var
d
=
new
NeoXData
();
d
.
imgPath
=
filename
;
d
.
imgPath
=
filename
;
d
.
outPath
=
Corner
+
"-Mark.png"
;
d
.
outPath
=
Corner
+
"-Mark.png"
;
...
@@ -99,6 +99,10 @@ public static class NeoX
...
@@ -99,6 +99,10 @@ public static class NeoX
}
}
else
else
{
{
errormsg
+=
"input:"
+
s
+
"\r\n"
;
errormsg
+=
"output:"
+
ss
+
"\r\n"
;
errormsg
+=
"err:"
+
r
?.
error
+
"\r\n"
;
Console
.
WriteLine
(
ss
);
Console
.
WriteLine
(
ss
);
Debug
.
WriteLine
(
ss
);
Debug
.
WriteLine
(
ss
);
return
false
;
return
false
;
...
@@ -107,6 +111,7 @@ public static class NeoX
...
@@ -107,6 +111,7 @@ public static class NeoX
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Debug
.
WriteLine
(
ex
);
Debug
.
WriteLine
(
ex
);
errormsg
=
ex
.
ToString
();
return
false
;
return
false
;
}
}
}
}
...
...
CarerayImage/XrayImage.cs
查看文件 @
79c08d6
...
@@ -249,15 +249,16 @@ namespace Asa
...
@@ -249,15 +249,16 @@ namespace Asa
/// <param name="tpDstImg"></param>
/// <param name="tpDstImg"></param>
/// <returns></returns>
/// <returns></returns>
[
HandleProcessCorruptedStateExceptions
]
[
HandleProcessCorruptedStateExceptions
]
public
static
int
GetLocalCountIrregular
(
string
path
,
int
ShrinkOffset
,
string
type
,
out
int
[]
count
,
out
Bitmap
BmpDstImg
)
public
static
int
GetLocalCountIrregular
(
string
path
,
int
ShrinkOffset
,
string
type
,
out
int
[]
count
,
out
Bitmap
BmpDstImg
,
out
string
errmsg
)
{
{
type
=
NeoX
.
ConverterType
(
type
,
true
);
type
=
NeoX
.
ConverterType
(
type
,
true
);
errmsg
=
""
;
if
(
NeoX
.
HasNeox
()
&&
type
.
StartsWith
(
"ID"
))
if
(
NeoX
.
HasNeox
()
&&
type
.
StartsWith
(
"ID"
))
{
{
var
tf
=
GetTemplateFile
(
path
);
var
tf
=
GetTemplateFile
(
path
);
if
(!
string
.
IsNullOrEmpty
(
tf
))
if
(!
string
.
IsNullOrEmpty
(
tf
))
type
=
"ID_TYPE_T"
;
type
=
"ID_TYPE_T"
;
var
result
=
NeoX
.
AlgoC
(
path
,
tf
,
ShrinkOffset
,
0
,
type
,
out
int
c
,
out
Bitmap
bitmap
);
var
result
=
NeoX
.
AlgoC
(
path
,
tf
,
ShrinkOffset
,
0
,
type
,
out
int
c
,
out
Bitmap
bitmap
,
out
errmsg
);
count
=
new
int
[
4
]
{
c
,
0
,
0
,
0
};
count
=
new
int
[
4
]
{
c
,
0
,
0
,
0
};
BmpDstImg
=
bitmap
;
BmpDstImg
=
bitmap
;
return
result
?
0
:-
1
;
return
result
?
0
:-
1
;
...
@@ -381,7 +382,7 @@ namespace Asa
...
@@ -381,7 +382,7 @@ namespace Asa
var
tf
=
GetTemplateFile
(
path
);
var
tf
=
GetTemplateFile
(
path
);
if
(!
string
.
IsNullOrEmpty
(
tf
))
if
(!
string
.
IsNullOrEmpty
(
tf
))
type1
=
"ID_TYPE_T"
;
type1
=
"ID_TYPE_T"
;
NeoX
.
AlgoC
(
path
,
tf
,
ShrinkOffset
,
Corner
+
1
,
type1
,
out
int
c
,
out
Bitmap
bitmap
);
NeoX
.
AlgoC
(
path
,
tf
,
ShrinkOffset
,
Corner
+
1
,
type1
,
out
int
c
,
out
Bitmap
bitmap
,
out
_
);
lock
(
ccresult
)
lock
(
ccresult
)
{
{
ccresult
.
Add
(
Corner
,
(
c
,
bitmap
));
ccresult
.
Add
(
Corner
,
(
c
,
bitmap
));
...
...
CarerayImage/haobo_v2.cs
查看文件 @
79c08d6
...
@@ -562,9 +562,11 @@ namespace Asa
...
@@ -562,9 +562,11 @@ namespace Asa
// 当前反馈固件参数,转化为结构体 add by mhyang 20220402
// 当前反馈固件参数,转化为结构体 add by mhyang 20220402
imagedata
=
(
ImageData
)
Marshal
.
PtrToStructure
(
ptrParam1
,
typeof
(
ImageData
));
imagedata
=
(
ImageData
)
Marshal
.
PtrToStructure
(
ptrParam1
,
typeof
(
ImageData
));
#if !savebmp8 // 正常按照16bit图像显示,add by mhyang 20220615
#if !savebmp8 // 正常按照16bit图像显示,add by mhyang 20220615
SaveImage
();
// 保存
if
(
SaveImage
()
==
0
)
// 保存
buffgetted
=
true
;
{
WaitstopToken
.
Cancel
(
false
);
buffgetted
=
true
;
WaitstopToken
.
Cancel
(
false
);
}
#else // 按照8bit图像显示,add by mhyang 20221104
#else // 按照8bit图像显示,add by mhyang 20221104
//int length = imagedata.datalen;
//int length = imagedata.datalen;
if
(
0
==
HBI_FPD_DLL
.
HBI_AutoWindowWidthWindowLevel
(
HBI_FPD_DLL
.
_handel
,
imagedata
.
databuff
,
ref
imagedata
.
datalen
,
imagedata
.
uwidth
,
imagedata
.
uheight
))
if
(
0
==
HBI_FPD_DLL
.
HBI_AutoWindowWidthWindowLevel
(
HBI_FPD_DLL
.
_handel
,
imagedata
.
databuff
,
ref
imagedata
.
datalen
,
imagedata
.
uwidth
,
imagedata
.
uheight
))
...
@@ -992,36 +994,25 @@ namespace Asa
...
@@ -992,36 +994,25 @@ namespace Asa
{
{
return
0
;
return
0
;
}
}
var
nframeId
=
imagedata
.
uframeid
;
try
int
imgagesize
=
0
;
{
buffer
=
new
byte
[
bufflen
];
var
nframeId
=
imagedata
.
uframeid
;
// 存储数据
int
imgagesize
=
0
;
//if (imgbuff.imageushorttemp == null)
buffer
=
new
byte
[
bufflen
];
//{
// imgbuff.imagebytetemp = new byte[bufflen];
// imgagesize = bufflen;
//}
//else
//{
// if (imgagesize != bufflen)
// {
// imgbuff.imagebytetemp = new byte[bufflen];
// imgagesize = bufflen;
// }
//}
//// 拷贝到指定数组中保存
//if (imagedata.datalen != imgagesize)
//{
// return 0;
//}
Marshal
.
Copy
(
imagedata
.
databuff
,
buffer
,
0
,
bufflen
);
string
fileName
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"current.raw"
);
Marshal
.
Copy
(
imagedata
.
databuff
,
buffer
,
0
,
bufflen
);
File
.
WriteAllBytes
(
fileName
,
buffer
);
// 图片信息
string
fileName
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"current.raw"
);
WriteLog
(
string
.
Format
(
"SaveImage success:0x{0:X000}\n"
,
nframeId
));
File
.
WriteAllBytes
(
fileName
,
buffer
);
//
// 图片信息
return
1
;
WriteLog
(
string
.
Format
(
"SaveImage success:0x{0:X000}\n"
,
nframeId
));
//
return
1
;
}
catch
(
Exception
ex
)
{
WriteLog
(
$
"SaveImage fail:{ex}\n"
);
}
return
0
;
}
}
/// <summary>
/// <summary>
/// 加载本地RAW图片,64字节头
/// 加载本地RAW图片,64字节头
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论