Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f7f6a7c2
由
贾鹏旭
编写于
2023-08-10 14:46:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
注释GC回收
1 个父辈
7dfece50
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
10 行删除
AccAOI/FrmAoiSetting.cs
AccAOI/FrmAoiSetting.cs
查看文件 @
f7f6a7c
...
@@ -61,7 +61,7 @@ namespace AccAOI
...
@@ -61,7 +61,7 @@ namespace AccAOI
DefaultPath
=
defaultPath
;
DefaultPath
=
defaultPath
;
}
}
string
CurrentCamera
=
""
;
string
CurrentCamera
=
""
;
private
void
FrmAoiSetting_Load
(
object
sender
,
EventArgs
e
)
private
void
FrmAoiSetting_Load
(
object
sender
,
EventArgs
e
)
{
{
LoadTypes
();
LoadTypes
();
...
@@ -102,7 +102,7 @@ namespace AccAOI
...
@@ -102,7 +102,7 @@ namespace AccAOI
private
void
btnOpenImage_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOpenImage_Click
(
object
sender
,
EventArgs
e
)
{
{
System
.
Windows
.
Forms
.
OpenFileDialog
openDialog
=
new
System
.
Windows
.
Forms
.
OpenFileDialog
();
System
.
Windows
.
Forms
.
OpenFileDialog
openDialog
=
new
System
.
Windows
.
Forms
.
OpenFileDialog
();
openDialog
.
Title
=
AOIResourceCulture
.
GetValue
(
"打开本地图片"
);
openDialog
.
Title
=
AOIResourceCulture
.
GetValue
(
"打开本地图片"
);
openDialog
.
Filter
=
"All Supported Images (*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png)|*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Graphics Interchange Format (*.gif)|*.gif|Joint Photographic Experts (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|All Files (*.*)|*.*"
;
openDialog
.
Filter
=
"All Supported Images (*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png)|*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Graphics Interchange Format (*.gif)|*.gif|Joint Photographic Experts (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|All Files (*.*)|*.*"
;
openDialog
.
DefaultExt
=
"png"
;
openDialog
.
DefaultExt
=
"png"
;
...
@@ -306,7 +306,7 @@ namespace AccAOI
...
@@ -306,7 +306,7 @@ namespace AccAOI
string
defaultName
=
Project
.
methodMap
.
Values
.
Count
.
ToString
().
PadLeft
(
2
,
'0'
)
+
"_"
+
text
;
string
defaultName
=
Project
.
methodMap
.
Values
.
Count
.
ToString
().
PadLeft
(
2
,
'0'
)
+
"_"
+
text
;
FrmMethodName
frmName
=
new
FrmMethodName
(
defaultName
,
new
List
<
string
>(
Project
.
methodMap
.
Keys
));
FrmMethodName
frmName
=
new
FrmMethodName
(
defaultName
,
new
List
<
string
>(
Project
.
methodMap
.
Keys
));
frmName
.
Text
=
AOIResourceCulture
.
GetValue
(
"请输入新【{0}】名称"
,
text
);
frmName
.
Text
=
AOIResourceCulture
.
GetValue
(
"请输入新【{0}】名称"
,
text
);
DialogResult
result
=
frmName
.
ShowDialog
();
DialogResult
result
=
frmName
.
ShowDialog
();
if
(
result
.
Equals
(
DialogResult
.
OK
))
if
(
result
.
Equals
(
DialogResult
.
OK
))
{
{
...
@@ -421,14 +421,14 @@ namespace AccAOI
...
@@ -421,14 +421,14 @@ namespace AccAOI
}
}
}
}
private
void
aoiList_IndexChanged
(
object
sender
)
private
void
aoiList_IndexChanged
(
object
sender
)
{
{
// int index = aoiList.SelectedIndex;
// int index = aoiList.SelectedIndex;
if
(
aoiList
.
SelectedIndex
>=
0
&&
(
Project
!=
null
))
if
(
aoiList
.
SelectedIndex
>=
0
&&
(
Project
!=
null
))
{
{
string
text
=
aoiList
.
Text
;
string
text
=
aoiList
.
Text
;
// List<AoiMethod> methods = new List<AoiMethod>(Project.methodMap.Values);
// List<AoiMethod> methods = new List<AoiMethod>(Project.methodMap.Values);
if
(
Project
.
methodMap
.
ContainsKey
(
text
))
if
(
Project
.
methodMap
.
ContainsKey
(
text
))
{
{
AoiMethod
method
=
Project
.
methodMap
[
text
];
AoiMethod
method
=
Project
.
methodMap
[
text
];
if
(
aoiControl
!=
null
&&
aoiControl
.
TitleName
.
Equals
(
method
.
MethodName
))
if
(
aoiControl
!=
null
&&
aoiControl
.
TitleName
.
Equals
(
method
.
MethodName
))
...
@@ -507,9 +507,9 @@ namespace AccAOI
...
@@ -507,9 +507,9 @@ namespace AccAOI
}
}
else
else
{
{
lblTestResult
.
Text
=
ControlUtil
.
GetResultsStr
(
result
);
lblTestResult
.
Text
=
ControlUtil
.
GetResultsStr
(
result
);
}
}
GC
.
Collect
();
//
GC.Collect();
CanSel
=
true
;
CanSel
=
true
;
}
}
...
@@ -638,7 +638,7 @@ namespace AccAOI
...
@@ -638,7 +638,7 @@ namespace AccAOI
private
void
btnUpdateName_Click
(
object
sender
,
EventArgs
e
)
private
void
btnUpdateName_Click
(
object
sender
,
EventArgs
e
)
{
{
// int index = aoiList.SelectedIndex;
// int index = aoiList.SelectedIndex;
if
(
aoiList
.
SelectedIndex
>=
0
&&
(
Project
!=
null
)
&&(
aoiControl
!=
null
))
if
(
aoiList
.
SelectedIndex
>=
0
&&
(
Project
!=
null
)
&&
(
aoiControl
!=
null
))
{
{
string
oldName
=
aoiList
.
Text
;
string
oldName
=
aoiList
.
Text
;
...
@@ -653,7 +653,7 @@ namespace AccAOI
...
@@ -653,7 +653,7 @@ namespace AccAOI
DialogResult
result
=
frmName
.
ShowDialog
();
DialogResult
result
=
frmName
.
ShowDialog
();
if
(
result
.
Equals
(
DialogResult
.
OK
))
if
(
result
.
Equals
(
DialogResult
.
OK
))
{
{
string
newName
=
frmName
.
MethodName
;
string
newName
=
frmName
.
MethodName
;
if
(
newName
.
Equals
(
oldName
))
if
(
newName
.
Equals
(
oldName
))
{
{
return
;
return
;
...
@@ -714,7 +714,8 @@ namespace AccAOI
...
@@ -714,7 +714,8 @@ namespace AccAOI
needSaveImage
.
Save
(
fileName
,
ImageFormat
.
Bmp
);
needSaveImage
.
Save
(
fileName
,
ImageFormat
.
Bmp
);
MyMessage
.
Show
(
"保存成功"
);
MyMessage
.
Show
(
"保存成功"
);
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
MessageBox
.
Show
(
ex
.
ToString
());
MessageBox
.
Show
(
ex
.
ToString
());
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论