Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 560f3eda
由
LN
编写于
2019-08-06 10:40:55 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
0b7e7fc4
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
51 行增加
和
2 行删除
AOI/AoiProject.cs
AccAOI/FrmAoiSetting.cs
AccAOI/camera/CameraManager.cs
AOI/AoiProject.cs
查看文件 @
560f3ed
...
...
@@ -8,6 +8,7 @@ using System.IO;
using
System.Linq
;
using
System.Runtime.Serialization.Formatters.Binary
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
AOI
...
...
@@ -107,10 +108,13 @@ namespace AOI
/// <param name="filePath"></param>
public
static
AoiProject
Load
(
string
filePath
,
out
string
msg
)
{
Thread
.
Sleep
(
1
);
GC
.
Collect
();
msg
=
""
;
Thread
.
Sleep
(
1
);
AoiProject
aoiProject
=
new
AoiProject
();
try
{
AoiProject
aoiProject
=
new
AoiProject
();
Dictionary
<
string
,
string
>
projectMap
=
JsonUtil
.
DeserializeJsonToObjectFromFile
<
Dictionary
<
string
,
string
>>(
filePath
);
string
base64Img
=
projectMap
[
"base64Img"
];
aoiProject
.
standardImage
=
Base64Util
.
ToImage
(
base64Img
);
...
...
@@ -129,12 +133,18 @@ namespace AOI
PathData
pathData
=
JsonUtil
.
DeserializeJsonToObject
<
PathData
>(
PathDataStr
);
aoiMethod
.
RoiPath
=
new
GraphicsPath
(
pathData
.
Points
,
pathData
.
Types
);
aoiProject
.
methodMap
.
Add
(
item
.
Key
,
aoiMethod
);
Thread
.
Sleep
(
1
);
}
return
aoiProject
;
}
catch
(
Exception
ex
)
{
if
(
aoiProject
.
standardImage
!=
null
)
{
aoiProject
.
standardImage
.
Dispose
();
}
aoiProject
=
null
;
msg
=
ex
.
ToString
();
return
null
;
}
...
...
AccAOI/FrmAoiSetting.cs
查看文件 @
560f3ed
...
...
@@ -138,6 +138,42 @@ namespace AccAOI
private
void
btnOpenPro_Click
(
object
sender
,
EventArgs
e
)
{
if
(
Project
!=
null
)
{
DialogResult
dialResult
=
MessageBox
.
Show
(
"是否打开新项目?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
if
(
dialResult
.
Equals
(
DialogResult
.
Yes
))
{
CloseCurrAoi
();
aoiList
.
ItemClear
();
Project
=
null
;
if
(
TestImage
!=
null
)
{
TestImage
.
Dispose
();
TestImage
=
null
;
}
if
(
BaseImg
!=
null
)
{
BaseImg
.
Dispose
();
BaseImg
=
null
;
}
if
(
testImageBox1
.
Image
!=
null
)
{
testImageBox1
.
Image
.
Dispose
();
testImageBox1
.
Image
=
null
;
}
if
(
this
.
imageBox1
.
Image
!=
null
)
{
this
.
imageBox1
.
Image
.
Dispose
();
this
.
imageBox1
.
Image
=
null
;
}
GC
.
Collect
();
}
else
{
return
;
}
}
System
.
Windows
.
Forms
.
OpenFileDialog
openDialog
=
new
System
.
Windows
.
Forms
.
OpenFileDialog
();
openDialog
.
Title
=
"打开项目"
;
openDialog
.
Filter
=
"(*.data)|*.data|(*.*)|*.*"
;
...
...
@@ -151,6 +187,7 @@ namespace AccAOI
{
return
;
}
string
fileName
=
openDialog
.
FileName
;
// Project = new AoiProject(BaseImg);
string
msg
=
""
;
...
...
@@ -163,6 +200,7 @@ namespace AccAOI
{
currProjectFileName
=
fileName
;
}
ShowPorject
();
}
...
...
AccAOI/camera/CameraManager.cs
查看文件 @
560f3ed
...
...
@@ -16,8 +16,9 @@ namespace AccAOI.camera
public
static
string
ErrorMsg
=
""
;
public
static
void
LoadCamera
(
bool
isReLoad
=
false
)
{
if
(
isReLoad
)
if
(
isReLoad
||
hikNameList
.
Count
<=
0
)
{
hikNameList
=
new
List
<
string
>();
HIKCamera
.
Instance
.
Load
();
}
string
[]
names
=
HIKCamera
.
Instance
.
CameraName
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论