Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9e076ac3
由
LN
编写于
2019-08-13 14:50:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
BUG修改。增加图片保存功能
1 个父辈
7e5eeabf
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
58 行增加
和
14 行删除
AOIProject/AOIProject.csproj
AOIProject/aoi.ico
AccAOI/FrmAoiSetting.Designer.cs
AccAOI/FrmAoiSetting.cs
AOIProject/AOIProject.csproj
查看文件 @
9e076ac
...
...
@@ -32,6 +32,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>aoi.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.Theme">
<HintPath>..\dll\Asa.Theme.dll</HintPath>
...
...
@@ -95,5 +98,8 @@
<Name>AccAOI</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="aoi.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
AOIProject/aoi.ico
0 → 100644
查看文件 @
9e076ac
此文件类型无法预览
AccAOI/FrmAoiSetting.Designer.cs
查看文件 @
9e076ac
...
...
@@ -260,6 +260,7 @@ namespace AccAOI
this
.
lblCurrImage
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
22
);
this
.
lblCurrImage
.
TabIndex
=
22
;
this
.
lblCurrImage
.
Text
=
"基准图:"
;
this
.
lblCurrImage
.
Click
+=
new
System
.
EventHandler
(
this
.
lblCurrImage_Click
);
//
// testImageBox1
//
...
...
AccAOI/FrmAoiSetting.cs
查看文件 @
9e076ac
...
...
@@ -414,13 +414,14 @@ namespace AccAOI
private
void
aoiList_IndexChanged
(
object
sender
)
{
int
index
=
aoiList
.
SelectedIndex
;
if
(
i
ndex
>=
0
&&
(
Project
!=
null
))
//
int index = aoiList.SelectedIndex;
if
(
aoiList
.
SelectedI
ndex
>=
0
&&
(
Project
!=
null
))
{
List
<
AoiMethod
>
methods
=
new
List
<
AoiMethod
>(
Project
.
methodMap
.
Values
);
if
(
index
<
methods
.
Count
)
string
text
=
aoiList
.
Text
;
// List<AoiMethod> methods = new List<AoiMethod>(Project.methodMap.Values);
if
(
Project
.
methodMap
.
ContainsKey
(
text
))
{
AoiMethod
method
=
methods
[
index
];
AoiMethod
method
=
Project
.
methodMap
[
text
];
if
(
aoiControl
!=
null
&&
aoiControl
.
TitleName
.
Equals
(
method
.
MethodName
))
{
return
;
...
...
@@ -616,14 +617,15 @@ namespace AccAOI
private
void
btnUpdateName_Click
(
object
sender
,
EventArgs
e
)
{
int
index
=
aoiList
.
SelectedIndex
;
if
(
index
>=
0
&&
(
Project
!=
null
)&&(
aoiControl
!=
null
))
{
List
<
AoiMethod
>
methods
=
new
List
<
AoiMethod
>(
Project
.
methodMap
.
Values
);
if
(
index
<
methods
.
Count
)
// int index = aoiList.SelectedIndex;
if
(
aoiList
.
SelectedIndex
>=
0
&&
(
Project
!=
null
)&&(
aoiControl
!=
null
))
{
string
oldName
=
aoiList
.
Text
;
if
(
Project
.
methodMap
.
ContainsKey
(
oldName
))
{
// AoiMethod method = methods[index];
string
oldName
=
methods
[
index
].
MethodName
;
//
string oldName = methods[index].MethodName;
List
<
string
>
allName
=
new
List
<
string
>(
Project
.
methodMap
.
Keys
);
allName
.
Remove
(
oldName
);
FrmMethodName
frmName
=
new
FrmMethodName
(
oldName
,
allName
);
...
...
@@ -636,12 +638,13 @@ namespace AccAOI
{
return
;
}
methods
[
index
].
MethodName
=
newName
;
Project
.
methodMap
[
oldName
].
MethodName
=
newName
;
List
<
AoiMethod
>
methods
=
new
List
<
AoiMethod
>(
Project
.
methodMap
.
Values
);
//Project.methodMap.Remove(oldName);
//Project.methodMap.Add(newName, method);
Project
.
methodMap
.
Clear
();
aoiList
.
ItemClear
();
foreach
(
AoiMethod
m
in
methods
)
foreach
(
AoiMethod
m
in
methods
)
{
Project
.
methodMap
.
Add
(
m
.
MethodName
,
m
);
aoiList
.
ItemAdd
(
m
.
MethodName
);
...
...
@@ -661,6 +664,40 @@ namespace AccAOI
}
}
private
void
lblCurrImage_Click
(
object
sender
,
EventArgs
e
)
{
try
{
Image
needSaveImage
=
null
;
if
(
testImageBox1
.
Visible
)
{
needSaveImage
=
testImageBox1
.
Image
;
}
else
{
needSaveImage
=
imageBox1
.
Image
;
}
if
(
needSaveImage
!=
null
)
{
System
.
Windows
.
Forms
.
SaveFileDialog
saveFileDialog
=
new
System
.
Windows
.
Forms
.
SaveFileDialog
();
saveFileDialog
.
Title
=
AOIResourceCulture
.
GetValue
(
"保存项目"
);
saveFileDialog
.
Filter
=
"(*.bmp)|*.bmp"
;
System
.
Windows
.
Forms
.
DialogResult
result
=
saveFileDialog
.
ShowDialog
();
if
(
result
==
System
.
Windows
.
Forms
.
DialogResult
.
Cancel
)
{
return
;
}
string
fileName
=
saveFileDialog
.
FileName
;
needSaveImage
.
Save
(
fileName
,
ImageFormat
.
Bmp
);
MyMessage
.
Show
(
"保存成功"
);
}
}
catch
(
Exception
ex
)
{
MessageBox
.
Show
(
ex
.
ToString
());
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论