Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c56c58e0
由
LN
编写于
2019-08-29 12:59:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加复制功能
1 个父辈
169fa747
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
90 行增加
和
3 行删除
AOI/AoiMethod.cs
AccAOI/ControlUtil.cs
AccAOI/FrmAoiSetting.Designer.cs
AccAOI/FrmAoiSetting.cs
AccAOI/Properties/en-US.resource
AccAOI/Properties/zh-CN.resource
ImageBox/ImageBox.cs
AOI/AoiMethod.cs
查看文件 @
c56c58e
...
@@ -105,5 +105,10 @@ namespace AOI
...
@@ -105,5 +105,10 @@ namespace AOI
{
{
return
GetRoiImage
(
image
,
RoiPath
,
needCut
);
return
GetRoiImage
(
image
,
RoiPath
,
needCut
);
}
}
public
AoiMethod
GetClone
()
{
return
(
AoiMethod
)
this
.
MemberwiseClone
();
}
}
}
}
}
AccAOI/ControlUtil.cs
查看文件 @
c56c58e
...
@@ -10,7 +10,27 @@ namespace AccAOI
...
@@ -10,7 +10,27 @@ namespace AccAOI
{
{
public
class
ControlUtil
public
class
ControlUtil
{
{
public
static
string
GetMethodType
(
AoiMethod
method
)
{
if
(
method
is
AoiBlobMethod
)
{
return
ControlType
.
AOIBlob
;
}
else
if
(
method
is
AoiMarkMethod
)
{
return
ControlType
.
Mark
;
}
else
if
(
method
is
AoiMethodRgb
)
{
return
ControlType
.
AOIRGB
;
}
else
if
(
method
is
AoiTemplateMethod
)
{
return
ControlType
.
Match
;
}
return
""
;
}
public
static
AoiMethod
GetMethod
(
string
type
)
public
static
AoiMethod
GetMethod
(
string
type
)
{
{
AoiMethod
methodInfo
=
null
;
AoiMethod
methodInfo
=
null
;
...
...
AccAOI/FrmAoiSetting.Designer.cs
查看文件 @
c56c58e
...
@@ -56,6 +56,7 @@ namespace AccAOI
...
@@ -56,6 +56,7 @@ namespace AccAOI
this
.
lblTestResult
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblTestResult
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
testImageBox1
=
new
Acc
.
ImageBox
.
AccImageBox
();
this
.
testImageBox1
=
new
Acc
.
ImageBox
.
AccImageBox
();
this
.
imageBox1
=
new
Acc
.
ImageBox
.
AccImageBox
();
this
.
imageBox1
=
new
Acc
.
ImageBox
.
AccImageBox
();
this
.
btnCopy
=
new
Asa
.
Theme
.
FlatButton
();
this
.
panTest
.
SuspendLayout
();
this
.
panTest
.
SuspendLayout
();
this
.
panel1
.
SuspendLayout
();
this
.
panel1
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
...
@@ -195,7 +196,7 @@ namespace AccAOI
...
@@ -195,7 +196,7 @@ namespace AccAOI
this
.
btnDel
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnDel
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnDel
.
ImageSize
=
new
System
.
Drawing
.
Size
(
0
,
0
);
this
.
btnDel
.
ImageSize
=
new
System
.
Drawing
.
Size
(
0
,
0
);
this
.
btnDel
.
Inside
=
false
;
this
.
btnDel
.
Inside
=
false
;
this
.
btnDel
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
141
);
this
.
btnDel
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
104
);
this
.
btnDel
.
Name
=
"btnDel"
;
this
.
btnDel
.
Name
=
"btnDel"
;
this
.
btnDel
.
Size
=
new
System
.
Drawing
.
Size
(
135
,
30
);
this
.
btnDel
.
Size
=
new
System
.
Drawing
.
Size
(
135
,
30
);
this
.
btnDel
.
StateColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
this
.
btnDel
.
StateColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
...
@@ -356,10 +357,25 @@ namespace AccAOI
...
@@ -356,10 +357,25 @@ namespace AccAOI
this
.
imageBox1
.
TabIndex
=
4
;
this
.
imageBox1
.
TabIndex
=
4
;
this
.
imageBox1
.
SelectionRegionChanged
+=
new
System
.
EventHandler
(
this
.
imageBox1_SelectionRegionChanged
);
this
.
imageBox1
.
SelectionRegionChanged
+=
new
System
.
EventHandler
(
this
.
imageBox1_SelectionRegionChanged
);
//
//
// btnCopy
//
this
.
btnCopy
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
this
.
btnCopy
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnCopy
.
ImageSize
=
new
System
.
Drawing
.
Size
(
0
,
0
);
this
.
btnCopy
.
Inside
=
false
;
this
.
btnCopy
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
140
);
this
.
btnCopy
.
Name
=
"btnCopy"
;
this
.
btnCopy
.
Size
=
new
System
.
Drawing
.
Size
(
135
,
30
);
this
.
btnCopy
.
StateColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
this
.
btnCopy
.
TabIndex
=
26
;
this
.
btnCopy
.
Text
=
"复制"
;
this
.
btnCopy
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCopy_Click
);
//
// FrmAoiSetting
// FrmAoiSetting
//
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1270
,
641
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1270
,
641
);
this
.
Controls
.
Add
(
this
.
btnCopy
);
this
.
Controls
.
Add
(
this
.
panTest
);
this
.
Controls
.
Add
(
this
.
panTest
);
this
.
Controls
.
Add
(
this
.
btnLan
);
this
.
Controls
.
Add
(
this
.
btnLan
);
this
.
Controls
.
Add
(
this
.
btnUpdateName
);
this
.
Controls
.
Add
(
this
.
btnUpdateName
);
...
@@ -418,5 +434,6 @@ namespace AccAOI
...
@@ -418,5 +434,6 @@ namespace AccAOI
private
System
.
Windows
.
Forms
.
Panel
panTest
;
private
System
.
Windows
.
Forms
.
Panel
panTest
;
private
System
.
Windows
.
Forms
.
Label
lblTestResult
;
private
System
.
Windows
.
Forms
.
Label
lblTestResult
;
private
System
.
Windows
.
Forms
.
Panel
panel1
;
private
System
.
Windows
.
Forms
.
Panel
panel1
;
private
Asa
.
Theme
.
FlatButton
btnCopy
;
}
}
}
}
\ No newline at end of file
\ No newline at end of file
AccAOI/FrmAoiSetting.cs
查看文件 @
c56c58e
...
@@ -792,5 +792,43 @@ namespace AccAOI
...
@@ -792,5 +792,43 @@ namespace AccAOI
}
}
LoadTypes
();
LoadTypes
();
}
}
private
void
btnCopy_Click
(
object
sender
,
EventArgs
e
)
{
if
(
aoiControl
!=
null
&&
aoiControl
.
Visible
)
{
//保存原来的
AoiMethod
OldMethod
=
aoiControl
.
GetAoiInfo
();
AoiMethod
methodInfo
=
OldMethod
.
GetClone
();
string
text
=
ControlUtil
.
GetMethodType
(
methodInfo
);
string
defaultName
=
Project
.
methodMap
.
Values
.
Count
.
ToString
().
PadLeft
(
2
,
'0'
)
+
"_"
+
text
;
FrmMethodName
frmName
=
new
FrmMethodName
(
defaultName
,
new
List
<
string
>(
Project
.
methodMap
.
Keys
));
frmName
.
Text
=
AOIResourceCulture
.
GetValue
(
"请输入新【{0}】名称"
,
text
);
DialogResult
result
=
frmName
.
ShowDialog
();
if
(
result
.
Equals
(
DialogResult
.
OK
))
{
methodInfo
.
MethodName
=
frmName
.
MethodName
;
}
else
{
return
;
}
CloseCurrAoi
();
Project
.
methodMap
.
Add
(
methodInfo
.
MethodName
,
methodInfo
);
ShowAoi
(
methodInfo
);
aoiList
.
ItemAdd
(
methodInfo
.
MethodName
);
aoiList
.
SelectedIndex
=
Project
.
methodMap
.
Count
-
1
;
if
(
imageBox1
.
Visible
.
Equals
(
false
))
{
btnImageChange_Click
(
null
,
null
);
}
}
}
}
}
}
}
AccAOI/Properties/en-US.resource
查看文件 @
c56c58e
...
@@ -5,6 +5,7 @@ FrmAoiSetting_flatButton1_Text=Get test image
...
@@ -5,6 +5,7 @@ FrmAoiSetting_flatButton1_Text=Get test image
FrmAoiSetting_flatButton2_Text=Select test image
FrmAoiSetting_flatButton2_Text=Select test image
FrmAoiSetting_btnImageChange_Text=Switch to test Image
FrmAoiSetting_btnImageChange_Text=Switch to test Image
FrmAoiSetting_btnDel_Text=Delete
FrmAoiSetting_btnDel_Text=Delete
FrmAoiSetting_btnCopy_Text=Copy
FrmAoiSetting_btnExcute_Text=Execute
FrmAoiSetting_btnExcute_Text=Execute
FrmAoiSetting_btnGetCameraImg_Text=Get standard Image
FrmAoiSetting_btnGetCameraImg_Text=Get standard Image
FrmAoiSetting_flatLabel1_Text=Cameras:
FrmAoiSetting_flatLabel1_Text=Cameras:
...
...
AccAOI/Properties/zh-CN.resource
查看文件 @
c56c58e
...
@@ -5,6 +5,7 @@ FrmAoiSetting_flatButton1_Text=获取测试图片
...
@@ -5,6 +5,7 @@ FrmAoiSetting_flatButton1_Text=获取测试图片
FrmAoiSetting_flatButton2_Text=选择测试图片
FrmAoiSetting_flatButton2_Text=选择测试图片
FrmAoiSetting_btnImageChange_Text=切换为测试图片
FrmAoiSetting_btnImageChange_Text=切换为测试图片
FrmAoiSetting_btnDel_Text=删除
FrmAoiSetting_btnDel_Text=删除
FrmAoiSetting_btnCopy_Text=复制
FrmAoiSetting_btnExcute_Text=执行
FrmAoiSetting_btnExcute_Text=执行
FrmAoiSetting_btnGetCameraImg_Text=获取基准图片
FrmAoiSetting_btnGetCameraImg_Text=获取基准图片
FrmAoiSetting_flatLabel1_Text=相机:
FrmAoiSetting_flatLabel1_Text=相机:
...
...
ImageBox/ImageBox.cs
查看文件 @
c56c58e
...
@@ -1223,7 +1223,12 @@ namespace Acc.ImageBox
...
@@ -1223,7 +1223,12 @@ namespace Acc.ImageBox
}
}
}
}
}
}
public
virtual
void
SetImage
(
Image
img
)
{
this
.
SizeMode
=
ImageBoxSizeMode
.
Fit
;
Image
=
img
;
this
.
SizeMode
=
ImageBoxSizeMode
.
Normal
;
}
/// <summary>
/// <summary>
/// Gets or sets the image.
/// Gets or sets the image.
/// </summary>
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论