Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO1196_X800
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c4a95896
由
刘韬
编写于
2023-01-13 10:27:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
291c42bb
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
134 行增加
和
58 行删除
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/theMachine/BitmapCache.cs
DeviceLibrary/theMachine/Common.cs
DeviceLibrary/theMachine/MainMachine_Counting.cs
DeviceLibrary/theMachine/MainMachine_LabelProcess.cs
DeviceLibrary/theMachine/MainMachine_OutMove.cs
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/SettingControl.Designer.cs
TheMachine/SettingControl.cs
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
c4a9589
...
@@ -102,6 +102,7 @@
...
@@ -102,6 +102,7 @@
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="DeviceLibrary\SQLiteHelper.cs" />
<Compile Include="DeviceLibrary\SQLiteHelper.cs" />
<Compile Include="theMachine\BitmapCache.cs" />
<Compile Include="theMachine\Common.cs" />
<Compile Include="theMachine\Common.cs" />
<Compile Include="theMachine\JobList.cs" />
<Compile Include="theMachine\JobList.cs" />
<Compile Include="theMachine\LabelParam.cs" />
<Compile Include="theMachine\LabelParam.cs" />
...
...
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
c4a9589
...
@@ -258,10 +258,12 @@ namespace DeviceLibrary
...
@@ -258,10 +258,12 @@ namespace DeviceLibrary
codeList
.
Clear
();
codeList
.
Clear
();
}
}
}
}
//if (!hasRightCode)
LogUtil
.
info
(
"Camera 02"
);
if
(!
hasRightCode
)
{
{
bitmapfilename
=
SaveImageToFile
(
"mimo"
,
cameraName
,
bmp
);
bitmapfilename
=
SaveImageToFile
(
"mimo"
,
cameraName
,
bmp
);
}
}
BitmapCache
.
AddBmp
(
bitmapfilename
,
bmp
);
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
}
}
catch
(
AccessViolationException
e
)
catch
(
AccessViolationException
e
)
...
@@ -280,8 +282,8 @@ namespace DeviceLibrary
...
@@ -280,8 +282,8 @@ namespace DeviceLibrary
{
{
ho_Image
.
Dispose
();
ho_Image
.
Dispose
();
}
}
if
(
bmp
!=
null
)
//
if (bmp != null)
bmp
.
Dispose
();
//
bmp.Dispose();
}
}
}
}
catch
(
AccessViolationException
e
)
catch
(
AccessViolationException
e
)
...
...
DeviceLibrary/theMachine/BitmapCache.cs
0 → 100644
查看文件 @
c4a9589
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
DeviceLibrary
{
public
class
BitmapCache
{
static
Dictionary
<
string
,
Bitmap
>
Store
=
new
Dictionary
<
string
,
Bitmap
>();
public
static
void
AddBmp
(
string
name
,
Bitmap
bitmap
)
{
Store
[
name
]
=
bitmap
;
}
public
static
Bitmap
GetBmp
(
string
name
)
{
if
(!
Store
.
ContainsKey
(
name
))
return
null
;
return
Store
[
name
];
}
public
static
bool
HasBmp
(
string
name
)
{
return
Store
.
ContainsKey
(
name
);
}
public
static
void
RemoveBmp
(
string
name
)
{
if
(!
Store
.
ContainsKey
(
name
))
return
;
try
{
Store
[
name
].
Dispose
();
}
catch
{
}
Store
.
Remove
(
name
);
}
}
}
DeviceLibrary/theMachine/Common.cs
查看文件 @
c4a9589
...
@@ -113,9 +113,9 @@ namespace DeviceLibrary
...
@@ -113,9 +113,9 @@ namespace DeviceLibrary
Pen
Greenpen
=
new
Pen
(
Color
.
Green
,
10
);
Pen
Greenpen
=
new
Pen
(
Color
.
Green
,
10
);
Bitmap
srcbitmap
;
Bitmap
srcbitmap
;
if
(
File
.
Exists
(
labelParam
.
bitmapfilename
))
if
(
BitmapCache
.
HasBmp
(
labelParam
.
bitmapfilename
))
{
{
srcbitmap
=
new
Bitma
p
(
labelParam
.
bitmapfilename
);
srcbitmap
=
BitmapCache
.
GetBm
p
(
labelParam
.
bitmapfilename
);
}
}
else
else
{
{
...
@@ -137,10 +137,10 @@ namespace DeviceLibrary
...
@@ -137,10 +137,10 @@ namespace DeviceLibrary
int
widthOffset
=
0
;
int
widthOffset
=
0
;
g
.
FillEllipse
(
blue
,
new
Rectangle
(
org
,
pointsize
));
g
.
FillEllipse
(
blue
,
new
Rectangle
(
org
,
pointsize
));
List
<
int
>
angles
=
new
List
<
int
>();
List
<
int
>
angles
=
new
List
<
int
>();
CodeInfo
rightcode
=
null
;
CodeInfo
rightcode
=
null
;
int
rightangle
=
0
;
int
rightangle
=
0
;
labelParam
.
codeInfos
.
ForEach
((
c
)
=>
{
labelParam
.
codeInfos
.
ForEach
((
c
)
=>
{
if
(
c
.
CodeType
==
"2/5 Interleaved"
||
c
.
CodeType
==
"2/5 Industrial"
)
if
(
c
.
CodeType
==
"2/5 Interleaved"
||
c
.
CodeType
==
"2/5 Industrial"
)
return
;
return
;
if
(
c
.
CodeType
!=
"Code 128"
&&
c
.
CodeType
!=
"Code 39"
&&
c
.
CodeType
!=
"Data Matrix ECC 200"
)
if
(
c
.
CodeType
!=
"Code 128"
&&
c
.
CodeType
!=
"Code 39"
&&
c
.
CodeType
!=
"Data Matrix ECC 200"
)
return
;
return
;
...
@@ -149,12 +149,15 @@ namespace DeviceLibrary
...
@@ -149,12 +149,15 @@ namespace DeviceLibrary
a
=
a
<
0
?
360
+
a
:
a
;
a
=
a
<
0
?
360
+
a
:
a
;
LogUtil
.
info
(
$
"{c.CodeType},{c.CodeStr},angles:{a}"
);
LogUtil
.
info
(
$
"{c.CodeType},{c.CodeStr},angles:{a}"
);
angles
.
Add
(
a
);
angles
.
Add
(
a
);
if
(
c
.
CodeStr
.
Contains
(
labelParam
.
ReeID
)
&&
c
.
CodeType
==
"Data Matrix ECC 200"
)
if
(
c
.
CodeStr
.
Contains
(
labelParam
.
ReeID
)
&&
c
.
CodeType
==
"Data Matrix ECC 200"
)
{
{
rightcode
=
c
;
rightcode
=
c
;
}
}
});
});
if
(
rightcode
==
null
){
rightcode
=
labelParam
.
codeInfos
[
0
];
LogUtil
.
info
(
$
"没有发现准确的码, 随机贴标"
);
}
if
(
rightcode
!=
null
)
if
(
rightcode
!=
null
)
{
{
...
@@ -259,7 +262,7 @@ namespace DeviceLibrary
...
@@ -259,7 +262,7 @@ namespace DeviceLibrary
string
dir
=
"/image/labeldebug/"
;
string
dir
=
"/image/labeldebug/"
;
Directory
.
CreateDirectory
(
dir
);
Directory
.
CreateDirectory
(
dir
);
bitmap
.
Save
(
dir
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd-HH-mm-ss"
)
+
".jpg"
,
ImageFormat
.
Jpeg
);
//
bitmap.Save(dir + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + ".jpg", ImageFormat.Jpeg);
bitmap
.
Dispose
();
bitmap
.
Dispose
();
return
p3
;
return
p3
;
...
...
DeviceLibrary/theMachine/MainMachine_Counting.cs
查看文件 @
c4a9589
...
@@ -136,6 +136,8 @@ namespace DeviceLibrary
...
@@ -136,6 +136,8 @@ namespace DeviceLibrary
LastCode
=
String
.
Join
(
"##"
,
cc
);
LastCode
=
String
.
Join
(
"##"
,
cc
);
CountMoveInfo
.
log
(
"已完成扫码 Code:"
+
LastCode
);
CountMoveInfo
.
log
(
"已完成扫码 Code:"
+
LastCode
);
//Common.codeProcess(CountMoveInfo.MoveParam, out string mmm);
//Common.codeProcess(CountMoveInfo.MoveParam, out string mmm);
CountMoveInfo
.
MoveParam
.
WareCode
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
c
.
CodeStr
.
StartsWith
(
"S20"
)
&&
c
.
CodeType
==
"Data Matrix ECC 200"
).
FirstOrDefault
()?.
CodeStr
;
if
(
string
.
IsNullOrWhiteSpace
(
CountMoveInfo
.
MoveParam
.
WareCode
))
CountMoveInfo
.
MoveParam
.
WareCode
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
c
.
CodeStr
.
StartsWith
(
"S20"
)).
FirstOrDefault
().
CodeStr
;
CountMoveInfo
.
MoveParam
.
WareCode
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
c
.
CodeStr
.
StartsWith
(
"S20"
)).
FirstOrDefault
().
CodeStr
;
CountMoveInfo
.
MoveParam
.
ReeID
=
CountMoveInfo
.
MoveParam
.
WareCode
;
CountMoveInfo
.
MoveParam
.
ReeID
=
CountMoveInfo
.
MoveParam
.
WareCode
;
CountMoveInfo
.
MoveParam
.
PN
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
c
.
CodeStr
.
StartsWith
(
"AT"
)).
FirstOrDefault
()?.
CodeStr
;
CountMoveInfo
.
MoveParam
.
PN
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
c
.
CodeStr
.
StartsWith
(
"AT"
)).
FirstOrDefault
()?.
CodeStr
;
...
@@ -315,7 +317,7 @@ namespace DeviceLibrary
...
@@ -315,7 +317,7 @@ namespace DeviceLibrary
int
xplate_open_retry_times
=
3
;
int
xplate_open_retry_times
=
3
;
for
(
int
ii
=
1
;
ii
<=
xplate_getimage_retry_times
;
ii
++)
for
(
int
ii
=
1
;
ii
<=
xplate_getimage_retry_times
;
ii
++)
{
{
bool
rtn
=
RobotManage
.
xrayImage
.
GetImage
(
1
);
bool
rtn
=
RobotManage
.
xrayImage
.
GetImage
(
2
);
if
(!
rtn
)
if
(!
rtn
)
{
{
if
(
ii
==
xplate_getimage_retry_times
)
if
(
ii
==
xplate_getimage_retry_times
)
...
@@ -413,7 +415,7 @@ namespace DeviceLibrary
...
@@ -413,7 +415,7 @@ namespace DeviceLibrary
if
(
type
==
"auto"
)
if
(
type
==
"auto"
)
{
{
result
=
XrayImage
.
GetLocalCount
(
xrayImagePath
,
ShrinkOffset
,
out
countStr
,
out
dst
);
result
=
XrayImage
.
GetLocalCount
(
xrayImagePath
,
ShrinkOffset
,
out
countStr
,
out
dst
);
CountMoveInfo
.
log
(
"GetCountResult "
+
type
+
"
调用 GetLocalCount 【"
+
xrayImagePath
+
"】,返回【"
+
result
+
"】,结果【"
+
string
.
Join
(
","
,
countStr
)
+
"】"
);
CountMoveInfo
.
log
(
"GetCountResult "
+
type
+
"
, ShrinkOffset="
+
ShrinkOffset
+
", 调用 GetLocalCount 【"
+
xrayImagePath
+
"】,返回【"
+
result
+
"】,结果【"
+
(
countStr
!=
null
?
string
.
Join
(
","
,
countStr
)
:
"null"
)
+
"】"
);
}
}
else
if
(
type
.
StartsWith
(
"IP_Template_PARTS"
))
else
if
(
type
.
StartsWith
(
"IP_Template_PARTS"
))
{
{
...
@@ -423,13 +425,13 @@ namespace DeviceLibrary
...
@@ -423,13 +425,13 @@ namespace DeviceLibrary
template
=
type
.
Substring
(
17
+
1
);
template
=
type
.
Substring
(
17
+
1
);
}
}
result
=
XrayImage
.
GetLocalCountTemplate
(
xrayImagePath
,
ShrinkOffset
,
template
,
out
countStr
,
out
dst
);
result
=
XrayImage
.
GetLocalCountTemplate
(
xrayImagePath
,
ShrinkOffset
,
template
,
out
countStr
,
out
dst
);
CountMoveInfo
.
log
(
"GetCountResult "
+
template
+
"
调用 GetLocalCountTemplate 【"
+
xrayImagePath
+
"】,返回【"
+
result
+
"】,结果【"
+
string
.
Join
(
","
,
countStr
)
+
"】"
);
CountMoveInfo
.
log
(
"GetCountResult "
+
template
+
"
, ShrinkOffset="
+
ShrinkOffset
+
", 调用 GetLocalCountTemplate 【"
+
xrayImagePath
+
"】,返回【"
+
result
+
"】,结果【"
+
(
countStr
!=
null
?
string
.
Join
(
","
,
countStr
)
:
"null"
)
+
"】"
);
}
}
else
else
{
{
result
=
XrayImage
.
GetLocalCountIrregular
(
xrayImagePath
,
ShrinkOffset
,
type
.
ToString
(),
out
countStr
,
out
dst
);
result
=
XrayImage
.
GetLocalCountIrregular
(
xrayImagePath
,
ShrinkOffset
,
type
.
ToString
(),
out
countStr
,
out
dst
);
CountMoveInfo
.
log
(
"GetCountResult "
+
type
+
"
调用 GetLocalCountIrregular 【"
+
xrayImagePath
+
"】,返回【"
+
result
+
"】,结果【"
+
string
.
Join
(
","
,
countStr
)
+
"】"
);
CountMoveInfo
.
log
(
"GetCountResult "
+
type
+
"
, ShrinkOffset="
+
ShrinkOffset
+
" 调用 GetLocalCountIrregular 【"
+
xrayImagePath
+
"】,返回【"
+
result
+
"】,结果【"
+
(
countStr
!=
null
?
string
.
Join
(
","
,
countStr
)
:
"null"
)
+
"】"
);
}
}
if
(
dst
!=
null
)
if
(
dst
!=
null
)
{
{
...
...
DeviceLibrary/theMachine/MainMachine_LabelProcess.cs
查看文件 @
c4a9589
...
@@ -102,6 +102,9 @@ namespace DeviceLibrary
...
@@ -102,6 +102,9 @@ namespace DeviceLibrary
LabelMoveInfo
.
log
(
$
"源坐标:{p}"
);
LabelMoveInfo
.
log
(
$
"源坐标:{p}"
);
var
x
=
p
.
X
;
var
x
=
p
.
X
;
var
y
=
p
.
Y
;
var
y
=
p
.
Y
;
if
(
x
==
0
&&
y
==
0
)
{
}
p
.
Y
=
5472
-
x
;
p
.
Y
=
5472
-
x
;
p
.
X
=
y
;
p
.
X
=
y
;
...
...
DeviceLibrary/theMachine/MainMachine_OutMove.cs
查看文件 @
c4a9589
...
@@ -85,9 +85,12 @@ namespace DeviceLibrary
...
@@ -85,9 +85,12 @@ namespace DeviceLibrary
else
else
{
{
takeretry
++;
takeretry
++;
OutMoveInfo
.
MoveParam
.
PlateH
=
OutMoveInfo
.
MoveParam
.
PlateH
-
2
;
if
(
OutMoveInfo
.
MoveParam
.
PlateH
>
32
)
OutMoveInfo
.
MoveParam
.
PlateH
-=
3
;
else
OutMoveInfo
.
MoveParam
.
PlateH
-=
2
;
OutMoveInfo
.
log
(
$
"未取到料盘"
);
OutMoveInfo
.
log
(
$
"未取到料盘"
);
if
(
takeretry
<
3
&&
OutMoveInfo
.
MoveParam
.
PlateH
>=
8
)
if
(
takeretry
<
9
&&
OutMoveInfo
.
MoveParam
.
PlateH
>=
8
)
{
{
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_05
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_05
);
OutMoveInfo
.
log
(
$
"重试取盘:"
+
OutMoveInfo
.
MoveParam
.
PlateH
);
OutMoveInfo
.
log
(
$
"重试取盘:"
+
OutMoveInfo
.
MoveParam
.
PlateH
);
...
@@ -135,7 +138,7 @@ namespace DeviceLibrary
...
@@ -135,7 +138,7 @@ namespace DeviceLibrary
}
}
}
}
else
if
(
OutMoveInfo
.
IsTimeOut
(
1
0
))
{
else
if
(
OutMoveInfo
.
IsTimeOut
(
2
0
))
{
OutMoveInfo
.
log
(
$
"等待点料结果超时, NG处理"
);
OutMoveInfo
.
log
(
$
"等待点料结果超时, NG处理"
);
OutMoveInfo
.
MoveParam
.
IsNg
=
true
;
OutMoveInfo
.
MoveParam
.
IsNg
=
true
;
OutMoveInfo
.
MoveParam
.
NgMsg
=
"点料超时"
;
OutMoveInfo
.
MoveParam
.
NgMsg
=
"点料超时"
;
...
...
TheMachine/Form1.Designer.cs
查看文件 @
c4a9589
...
@@ -35,10 +35,11 @@ namespace TheMachine
...
@@ -35,10 +35,11 @@ namespace TheMachine
this
.
toolStripSeparator4
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripSeparator4
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
二维码识别调试
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
二维码识别调试
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator1
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripSeparator1
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
点料算法匹配
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator2
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
退出
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
退出
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
语言
toolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
语言
toolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
简体中文
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
简体中文
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
日本语
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
englishToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
englishToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
关于
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
关于
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
tabc
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabc
=
new
System
.
Windows
.
Forms
.
TabControl
();
...
@@ -59,8 +60,6 @@ namespace TheMachine
...
@@ -59,8 +60,6 @@ namespace TheMachine
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
btn_stop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_stop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_run
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_run
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
点料算法匹配
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator2
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
tabc
.
SuspendLayout
();
this
.
tabc
.
SuspendLayout
();
this
.
tabP1
.
SuspendLayout
();
this
.
tabP1
.
SuspendLayout
();
...
@@ -125,6 +124,18 @@ namespace TheMachine
...
@@ -125,6 +124,18 @@ namespace TheMachine
this
.
toolStripSeparator1
.
Name
=
"toolStripSeparator1"
;
this
.
toolStripSeparator1
.
Name
=
"toolStripSeparator1"
;
this
.
toolStripSeparator1
.
Size
=
new
System
.
Drawing
.
Size
(
189
,
6
);
this
.
toolStripSeparator1
.
Size
=
new
System
.
Drawing
.
Size
(
189
,
6
);
//
//
// 点料算法匹配ToolStripMenuItem
//
this
.
点料算法匹配
ToolStripMenuItem
.
Name
=
"点料算法匹配ToolStripMenuItem"
;
this
.
点料算法匹配
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
192
,
26
);
this
.
点料算法匹配
ToolStripMenuItem
.
Text
=
"点料算法匹配"
;
this
.
点料算法匹配
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
点料算法匹配
ToolStripMenuItem_Click
);
//
// toolStripSeparator2
//
this
.
toolStripSeparator2
.
Name
=
"toolStripSeparator2"
;
this
.
toolStripSeparator2
.
Size
=
new
System
.
Drawing
.
Size
(
189
,
6
);
//
// 退出ToolStripMenuItem
// 退出ToolStripMenuItem
//
//
this
.
退出
ToolStripMenuItem
.
Name
=
"退出ToolStripMenuItem"
;
this
.
退出
ToolStripMenuItem
.
Name
=
"退出ToolStripMenuItem"
;
...
@@ -136,7 +147,6 @@ namespace TheMachine
...
@@ -136,7 +147,6 @@ namespace TheMachine
//
//
this
.
语言
toolStripMenuItem
.
DropDownItems
.
AddRange
(
new
System
.
Windows
.
Forms
.
ToolStripItem
[]
{
this
.
语言
toolStripMenuItem
.
DropDownItems
.
AddRange
(
new
System
.
Windows
.
Forms
.
ToolStripItem
[]
{
this
.
简体中文
ToolStripMenuItem
,
this
.
简体中文
ToolStripMenuItem
,
this
.
日本语
ToolStripMenuItem
,
this
.
englishToolStripMenuItem
});
this
.
englishToolStripMenuItem
});
this
.
语言
toolStripMenuItem
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
);
this
.
语言
toolStripMenuItem
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
);
this
.
语言
toolStripMenuItem
.
Name
=
"语言toolStripMenuItem"
;
this
.
语言
toolStripMenuItem
.
Name
=
"语言toolStripMenuItem"
;
...
@@ -151,14 +161,6 @@ namespace TheMachine
...
@@ -151,14 +161,6 @@ namespace TheMachine
this
.
简体中文
ToolStripMenuItem
.
Text
=
"简体中文"
;
this
.
简体中文
ToolStripMenuItem
.
Text
=
"简体中文"
;
this
.
简体中文
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
简体中文
ToolStripMenuItem_Click
);
this
.
简体中文
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
简体中文
ToolStripMenuItem_Click
);
//
//
// 日本语ToolStripMenuItem
//
this
.
日本语
ToolStripMenuItem
.
Name
=
"日本语ToolStripMenuItem"
;
this
.
日本语
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
26
);
this
.
日本语
ToolStripMenuItem
.
Tag
=
"not"
;
this
.
日本语
ToolStripMenuItem
.
Text
=
"日本語"
;
this
.
日本语
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
日本语
ToolStripMenuItem_Click
);
//
// englishToolStripMenuItem
// englishToolStripMenuItem
//
//
this
.
englishToolStripMenuItem
.
Name
=
"englishToolStripMenuItem"
;
this
.
englishToolStripMenuItem
.
Name
=
"englishToolStripMenuItem"
;
...
@@ -387,18 +389,6 @@ namespace TheMachine
...
@@ -387,18 +389,6 @@ namespace TheMachine
this
.
btn_run
.
UseVisualStyleBackColor
=
true
;
this
.
btn_run
.
UseVisualStyleBackColor
=
true
;
this
.
btn_run
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_run_Click
);
this
.
btn_run
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_run_Click
);
//
//
// 点料算法匹配ToolStripMenuItem
//
this
.
点料算法匹配
ToolStripMenuItem
.
Name
=
"点料算法匹配ToolStripMenuItem"
;
this
.
点料算法匹配
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
192
,
26
);
this
.
点料算法匹配
ToolStripMenuItem
.
Text
=
"点料算法匹配"
;
this
.
点料算法匹配
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
点料算法匹配
ToolStripMenuItem_Click
);
//
// toolStripSeparator2
//
this
.
toolStripSeparator2
.
Name
=
"toolStripSeparator2"
;
this
.
toolStripSeparator2
.
Size
=
new
System
.
Drawing
.
Size
(
189
,
6
);
//
// Form1
// Form1
//
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
@@ -455,7 +445,6 @@ namespace TheMachine
...
@@ -455,7 +445,6 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
Panel
pnl
;
private
System
.
Windows
.
Forms
.
Panel
pnl
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
语言
toolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
语言
toolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
简体中文
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
简体中文
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
日本语
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
englishToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
englishToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox2
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox2
;
private
System
.
Windows
.
Forms
.
ListView
listView_reelnfo
;
private
System
.
Windows
.
Forms
.
ListView
listView_reelnfo
;
...
...
TheMachine/Form1.cs
查看文件 @
c4a9589
...
@@ -675,6 +675,7 @@ namespace TheMachine
...
@@ -675,6 +675,7 @@ namespace TheMachine
p
.
Start
();
p
.
Start
();
p
.
WaitForExit
();
p
.
WaitForExit
();
Pn_Algo_Match
.
LoadFile
();
Pn_Algo_Match
.
LoadFile
();
Asa
.
XrayImage
.
ReloadTpl
();
});
});
}
}
}
}
...
...
TheMachine/SettingControl.Designer.cs
查看文件 @
c4a9589
...
@@ -33,6 +33,7 @@ namespace TheMachine
...
@@ -33,6 +33,7 @@ namespace TheMachine
this
.
cb_EnableBuzzer
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
cb_EnableBuzzer
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btn_printertest
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_labeledit
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_labeledit
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
cb_labelselect
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
cb_labelselect
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
btn_Calibration
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Calibration
=
new
System
.
Windows
.
Forms
.
Button
();
...
@@ -41,7 +42,7 @@ namespace TheMachine
...
@@ -41,7 +42,7 @@ namespace TheMachine
this
.
btn_takephoto
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_takephoto
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_openxray
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_openxray
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
uC_SetUserPassword1
=
new
TheMachine
.
UC_SetUserPassword
();
this
.
uC_SetUserPassword1
=
new
TheMachine
.
UC_SetUserPassword
();
this
.
b
tn_printertest
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
b
uttonmunial
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
X
光调试
.
SuspendLayout
();
this
.
X
光调试
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
...
@@ -75,7 +76,7 @@ namespace TheMachine
...
@@ -75,7 +76,7 @@ namespace TheMachine
this
.
groupBox1
.
Controls
.
Add
(
this
.
cb_labelselect
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
cb_labelselect
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
128
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
128
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
3
40
,
126
);
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
3
54
,
126
);
this
.
groupBox1
.
TabIndex
=
11
;
this
.
groupBox1
.
TabIndex
=
11
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"打印设置"
;
this
.
groupBox1
.
Text
=
"打印设置"
;
...
@@ -89,6 +90,16 @@ namespace TheMachine
...
@@ -89,6 +90,16 @@ namespace TheMachine
this
.
label2
.
Text
=
"标签名"
;
this
.
label2
.
Text
=
"标签名"
;
this
.
label2
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label2
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
//
// btn_printertest
//
this
.
btn_printertest
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
77
);
this
.
btn_printertest
.
Name
=
"btn_printertest"
;
this
.
btn_printertest
.
Size
=
new
System
.
Drawing
.
Size
(
107
,
31
);
this
.
btn_printertest
.
TabIndex
=
1
;
this
.
btn_printertest
.
Text
=
"打印测试"
;
this
.
btn_printertest
.
UseVisualStyleBackColor
=
true
;
this
.
btn_printertest
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_printertest_Click
);
//
// btn_labeledit
// btn_labeledit
//
//
this
.
btn_labeledit
.
Location
=
new
System
.
Drawing
.
Point
(
208
,
77
);
this
.
btn_labeledit
.
Location
=
new
System
.
Drawing
.
Point
(
208
,
77
);
...
@@ -109,7 +120,7 @@ namespace TheMachine
...
@@ -109,7 +120,7 @@ namespace TheMachine
//
//
// btn_Calibration
// btn_Calibration
//
//
this
.
btn_Calibration
.
Location
=
new
System
.
Drawing
.
Point
(
1
82
,
115
);
this
.
btn_Calibration
.
Location
=
new
System
.
Drawing
.
Point
(
1
78
,
76
);
this
.
btn_Calibration
.
Name
=
"btn_Calibration"
;
this
.
btn_Calibration
.
Name
=
"btn_Calibration"
;
this
.
btn_Calibration
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_Calibration
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_Calibration
.
TabIndex
=
12
;
this
.
btn_Calibration
.
TabIndex
=
12
;
...
@@ -119,20 +130,21 @@ namespace TheMachine
...
@@ -119,20 +130,21 @@ namespace TheMachine
//
//
// X光调试
// X光调试
//
//
this
.
X
光调试
.
Controls
.
Add
(
this
.
buttonmunial
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_closexray
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_closexray
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_takephoto
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_takephoto
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_openxray
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_openxray
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_Calibration
);
this
.
X
光调试
.
Controls
.
Add
(
this
.
btn_Calibration
);
this
.
X
光调试
.
Location
=
new
System
.
Drawing
.
Point
(
3
17
,
31
3
);
this
.
X
光调试
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
27
3
);
this
.
X
光调试
.
Name
=
"X光调试"
;
this
.
X
光调试
.
Name
=
"X光调试"
;
this
.
X
光调试
.
Size
=
new
System
.
Drawing
.
Size
(
354
,
2
06
);
this
.
X
光调试
.
Size
=
new
System
.
Drawing
.
Size
(
354
,
2
20
);
this
.
X
光调试
.
TabIndex
=
13
;
this
.
X
光调试
.
TabIndex
=
13
;
this
.
X
光调试
.
TabStop
=
false
;
this
.
X
光调试
.
TabStop
=
false
;
this
.
X
光调试
.
Text
=
"groupBox2"
;
this
.
X
光调试
.
Text
=
"groupBox2"
;
//
//
// btn_closexray
// btn_closexray
//
//
this
.
btn_closexray
.
Location
=
new
System
.
Drawing
.
Point
(
1
82
,
39
);
this
.
btn_closexray
.
Location
=
new
System
.
Drawing
.
Point
(
1
78
,
27
);
this
.
btn_closexray
.
Name
=
"btn_closexray"
;
this
.
btn_closexray
.
Name
=
"btn_closexray"
;
this
.
btn_closexray
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_closexray
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_closexray
.
TabIndex
=
12
;
this
.
btn_closexray
.
TabIndex
=
12
;
...
@@ -142,7 +154,7 @@ namespace TheMachine
...
@@ -142,7 +154,7 @@ namespace TheMachine
//
//
// btn_takephoto
// btn_takephoto
//
//
this
.
btn_takephoto
.
Location
=
new
System
.
Drawing
.
Point
(
30
,
115
);
this
.
btn_takephoto
.
Location
=
new
System
.
Drawing
.
Point
(
26
,
76
);
this
.
btn_takephoto
.
Name
=
"btn_takephoto"
;
this
.
btn_takephoto
.
Name
=
"btn_takephoto"
;
this
.
btn_takephoto
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_takephoto
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_takephoto
.
TabIndex
=
12
;
this
.
btn_takephoto
.
TabIndex
=
12
;
...
@@ -152,7 +164,7 @@ namespace TheMachine
...
@@ -152,7 +164,7 @@ namespace TheMachine
//
//
// btn_openxray
// btn_openxray
//
//
this
.
btn_openxray
.
Location
=
new
System
.
Drawing
.
Point
(
30
,
39
);
this
.
btn_openxray
.
Location
=
new
System
.
Drawing
.
Point
(
26
,
27
);
this
.
btn_openxray
.
Name
=
"btn_openxray"
;
this
.
btn_openxray
.
Name
=
"btn_openxray"
;
this
.
btn_openxray
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_openxray
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
btn_openxray
.
TabIndex
=
12
;
this
.
btn_openxray
.
TabIndex
=
12
;
...
@@ -169,15 +181,15 @@ namespace TheMachine
...
@@ -169,15 +181,15 @@ namespace TheMachine
this
.
uC_SetUserPassword1
.
Size
=
new
System
.
Drawing
.
Size
(
405
,
272
);
this
.
uC_SetUserPassword1
.
Size
=
new
System
.
Drawing
.
Size
(
405
,
272
);
this
.
uC_SetUserPassword1
.
TabIndex
=
10
;
this
.
uC_SetUserPassword1
.
TabIndex
=
10
;
//
//
// b
tn_printertest
// b
uttonmunial
//
//
this
.
b
tn_printertest
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
77
);
this
.
b
uttonmunial
.
Location
=
new
System
.
Drawing
.
Point
(
26
,
125
);
this
.
b
tn_printertest
.
Name
=
"btn_printertest
"
;
this
.
b
uttonmunial
.
Name
=
"buttonmunial
"
;
this
.
b
tn_printertest
.
Size
=
new
System
.
Drawing
.
Size
(
107
,
31
);
this
.
b
uttonmunial
.
Size
=
new
System
.
Drawing
.
Size
(
146
,
43
);
this
.
b
tn_printertest
.
TabIndex
=
1
;
this
.
b
uttonmunial
.
TabIndex
=
13
;
this
.
b
tn_printertest
.
Text
=
"打印测试
"
;
this
.
b
uttonmunial
.
Text
=
"手动点料
"
;
this
.
b
tn_printertest
.
UseVisualStyleBackColor
=
true
;
this
.
b
uttonmunial
.
UseVisualStyleBackColor
=
true
;
this
.
b
tn_printertest
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_printertest
_Click
);
this
.
b
uttonmunial
.
Click
+=
new
System
.
EventHandler
(
this
.
buttonmunial
_Click
);
//
//
// SettingControl
// SettingControl
//
//
...
@@ -211,5 +223,6 @@ namespace TheMachine
...
@@ -211,5 +223,6 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
Button
btn_takephoto
;
private
System
.
Windows
.
Forms
.
Button
btn_takephoto
;
private
System
.
Windows
.
Forms
.
Button
btn_openxray
;
private
System
.
Windows
.
Forms
.
Button
btn_openxray
;
private
System
.
Windows
.
Forms
.
Button
btn_printertest
;
private
System
.
Windows
.
Forms
.
Button
btn_printertest
;
private
System
.
Windows
.
Forms
.
Button
buttonmunial
;
}
}
}
}
TheMachine/SettingControl.cs
查看文件 @
c4a9589
...
@@ -207,5 +207,26 @@ namespace TheMachine
...
@@ -207,5 +207,26 @@ namespace TheMachine
}
else
}
else
MessageBox
.
Show
(
"打印成功"
);
MessageBox
.
Show
(
"打印成功"
);
}
}
private
void
buttonmunial_Click
(
object
sender
,
EventArgs
e
)
{
OpenFileDialog
openFileDialog
=
new
OpenFileDialog
();
openFileDialog
.
Filter
=
"PNG files (*.png)|"
;
openFileDialog
.
InitialDirectory
=
"/image/Xray/back/"
;
openFileDialog
.
Multiselect
=
false
;
if
(
openFileDialog
.
ShowDialog
()
==
DialogResult
.
OK
)
{
var
file
=
openFileDialog
.
FileName
;
var
filename
=
Path
.
GetFileNameWithoutExtension
(
file
);
var
f
=
filename
.
Split
(
'-'
);
if
(
f
.
Length
>
0
)
{
RobotManage
.
mainMachine
.
CountMoveInfo
.
MoveParam
.
PN
=
f
[
0
];
}
RobotManage
.
mainMachine
.
xrayImagePath
=
file
;
var
count
=
RobotManage
.
mainMachine
.
GetCountResult
();
MessageBox
.
Show
(
this
,
count
.
ToString
(),
"点料结果"
);
}
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论