Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
Scott
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scott Sun
Scott
Commits
a81035d3
Commit
a81035d3
authored
Apr 10, 2020
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
topcam
parent
9e829f7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
26 deletions
+65
-26
ATS_AIM_customer_data_analysis.js
test/ATS_AIM_customer_data_analysis.js
+5
-13
ATS_AIM_input_data.js
test/ATS_AIM_input_data.js
+16
-6
导入配置.json
导入配置.json
+44
-7
No files found.
test/ATS_AIM_customer_data_analysis.js
View file @
a81035d3
...
@@ -86,10 +86,8 @@ try {
...
@@ -86,10 +86,8 @@ try {
cavity
:
"cavity"
cavity
:
"cavity"
}
}
// 料号验证
// 料号验证
err
=
beforeStart
({
job
:
job
})
job
=
"1"
if
(
err
){
err
=
beforeStart
({
job
:
job
});
if
(
err
){
throw
err
};
throw
err
}
// matrix分析
// matrix分析
var
matrixInfo
=
getMatrixInfo
({
job
:
job
})
var
matrixInfo
=
getMatrixInfo
({
job
:
job
})
var
matrix_analysis
=
UPLOAD_LAYER_MATRIX
({
job
:
job
,
matrixInfo
:
matrixInfo
})
// 分析matrix
var
matrix_analysis
=
UPLOAD_LAYER_MATRIX
({
job
:
job
,
matrixInfo
:
matrixInfo
})
// 分析matrix
...
@@ -111,13 +109,6 @@ try {
...
@@ -111,13 +109,6 @@ try {
...
@@ -276,6 +267,7 @@ function UPLOAD_LAYER_MATRIX(props){
...
@@ -276,6 +267,7 @@ function UPLOAD_LAYER_MATRIX(props){
matrix
:
matrix
,
matrix
:
matrix
,
layers
:
Object
.
keys
(
matrix
).
sort
(
function
(
a
,
b
){
return
matrix
[
a
][
"row"
]
-
matrix
[
b
][
"row"
]}),
layers
:
Object
.
keys
(
matrix
).
sort
(
function
(
a
,
b
){
return
matrix
[
a
][
"row"
]
-
matrix
[
b
][
"row"
]}),
jobcategory
:
props
.
jobcategory
},
1
);
jobcategory
:
props
.
jobcategory
},
1
);
IKM
.
msg
(
ret
)
if
(
ret
.
errText
)
{
if
(
ret
.
errText
)
{
return
{
return
{
jobcategory
:
props
.
jobcategory
,
jobcategory
:
props
.
jobcategory
,
...
@@ -314,8 +306,8 @@ function ANALYSIS_STACKUP(props){
...
@@ -314,8 +306,8 @@ function ANALYSIS_STACKUP(props){
layer
.
drl_to_num
=
layer_count
;
layer
.
drl_to_num
=
layer_count
;
layer
.
type
=
'main_drill'
;
layer
.
type
=
'main_drill'
;
}
}
else
if
(
/^
txt
(\d
+
)\-(\d
+
)
$/
.
test
(
layer
.
odb_name
)){
else
if
(
/^
d
(\d
+
)\-(\d
+
)
$/
.
test
(
layer
.
odb_name
)){
var
tmp
=
/^
txt
(\d
+
)\-(\d
+
)
$/
.
exec
(
layer
.
odb_name
)
var
tmp
=
/^
d
(\d
+
)\-(\d
+
)
$/
.
exec
(
layer
.
odb_name
)
var
drl_star
=
tmp
[
1
];
var
drl_star
=
tmp
[
1
];
var
drl_end
=
tmp
[
2
];
var
drl_end
=
tmp
[
2
];
layer
.
name
=
'drill'
+
drl_star
+
'-'
+
drl_end
;
layer
.
name
=
'drill'
+
drl_star
+
'-'
+
drl_end
;
...
...
test/ATS_AIM_input_data.js
View file @
a81035d3
...
@@ -50,7 +50,16 @@ var Job = $.job;
...
@@ -50,7 +50,16 @@ var Job = $.job;
try
{
try
{
// 获取脚本参数
// 获取脚本参数
var
par
=
$
.
par
;
var
par
=
$
.
par
;
// !!! tmp
par
=
{
customer
:
"ats"
,
job_name
:
"1"
,
path
:
"C:/Users/Administrator/Desktop/Customer_1"
}
var
parParams
=
[
"customer"
,
"job_name"
,
"path"
];
// par应该有的属性
var
parParams
=
[
"customer"
,
"job_name"
,
"path"
];
// par应该有的属性
var
isParExist
=
parParams
.
reduce
(
function
(
a
,
b
)
{
var
isParExist
=
parParams
.
reduce
(
function
(
a
,
b
)
{
if
(
!
par
.
hasOwnProperty
(
b
))
{
if
(
!
par
.
hasOwnProperty
(
b
))
{
...
@@ -68,10 +77,10 @@ try {
...
@@ -68,10 +77,10 @@ try {
if
(
!
isParExist
){
throw
"par error"
}
// 如果par没有parParams里的属性 就退出
if
(
!
isParExist
){
throw
"par error"
}
// 如果par没有parParams里的属性 就退出
var
cfg
=
JSON
.
parse
(
IKM
.
select_value
({
table
:
'pub_conf'
,
field
:
'json_data'
,
where
:{
path
:
'cam/input_data'
}}));
// 读取配置文件
var
cfg
=
JSON
.
parse
(
IKM
.
select_value
({
table
:
'pub_conf'
,
field
:
'json_data'
,
where
:{
path
:
'cam/input_data'
}}));
// 读取配置文件
var
useCfg
=
cfg
[
par
.
customer
.
toLowerCase
()];
var
useCfg
=
cfg
[
par
.
customer
.
toLowerCase
()];
addDefaultCfg
(
cfg
.
def
,
useCfg
)
// 添加默认配置
addDefaultCfg
(
cfg
.
def
,
useCfg
)
// 添加默认配置
var
job
=
par
.
job_name
,
path
=
par
.
path
,
step
=
useCfg
.
step
,
err
var
job
=
par
.
job_name
,
path
=
par
.
path
||
useCfg
.
path
,
step
=
useCfg
.
step
,
err
err
=
delSameJob
({
job
:
job
,
delSame
:
useCfg
.
delSameJob
});
if
(
err
){
throw
err
}
err
=
delSameJob
({
job
:
job
,
delSame
:
useCfg
.
delSameJob
});
if
(
err
){
throw
err
}
// 判断导入方式 处理path
// 判断导入方式 处理path
var
jobPath
=
path
+
"/"
+
job
var
jobPath
=
path
+
"/"
+
job
...
@@ -151,6 +160,7 @@ try {
...
@@ -151,6 +160,7 @@ try {
return
'Done'
;
return
'Done'
;
}
}
catch
(
error
)
{
catch
(
error
)
{
IKM
.
msg
(
error
)
return
'Error'
;
return
'Error'
;
}
}
...
@@ -204,11 +214,11 @@ function getPathInfo(props){
...
@@ -204,11 +214,11 @@ function getPathInfo(props){
},[])
},[])
if
(
cfg
.
Gerber
){
if
(
cfg
.
Gerber
){
res
.
type
=
cfg
.
Gerber
.
files
.
reduce
(
function
(
a
,
b
){
res
.
type
=
cfg
.
Gerber
.
files
.
reduce
(
function
(
a
,
b
){
if
(
res
.
fileSuffix
.
indexOf
(
b
)
<
0
){
if
(
res
.
fileSuffix
.
indexOf
(
b
)
>=
0
){
a
=
fals
e
a
=
tru
e
}
}
return
a
return
a
},
tru
e
)?
"Gerber"
:
undefined
},
fals
e
)?
"Gerber"
:
undefined
}
}
if
(
cfg
.
ODB
){
if
(
cfg
.
ODB
){
res
.
type
=
cfg
.
ODB
.
files
.
reduce
(
function
(
a
,
b
){
res
.
type
=
cfg
.
ODB
.
files
.
reduce
(
function
(
a
,
b
){
...
...
导入配置.json
View file @
a81035d3
...
@@ -97,12 +97,50 @@
...
@@ -97,12 +97,50 @@
"files"
:
[
"drl"
,
"art"
],
"files"
:
[
"drl"
,
"art"
],
"format"
:
{
"format"
:
{
"art"
:
"Gerber274x"
,
"art"
:
"Gerber274x"
,
"drd"
:
"Excellon1"
,
"drl"
:
"Excellon2"
"drl"
:
"Excellon2"
,
},
"ipc"
:
"IPC356"
,
"gerberConfig"
:
{
"phd"
:
"Gerber274x"
,
"drl"
:
{
"phl"
:
"Ascii"
"nf1"
:
2
,
"nf2"
:
3
,
"units"
:
"inch"
,
"zeroes"
:
"leading"
,
"decimal"
:
"no"
,
"nf_comp"
:
0
,
"break_sr"
:
"yes"
,
"data_type"
:
"ascii"
,
"separator"
:
"nl"
,
"threshold"
:
200
,
"drill_only"
:
"no"
,
"multiplier"
:
1
,
"resolution"
:
3
,
"tool_units"
:
"inch"
,
"coordinates"
:
"absolute"
,
"merge_by_rule"
:
"no"
,
"signed_coords"
:
"no"
,
"text_line_width"
:
0.0024
},
"art"
:
{
"nf1"
:
3
,
"nf2"
:
5
,
"units"
:
"inch"
,
"zeroes"
:
"leading"
,
"decimal"
:
"no"
,
"nf_comp"
:
0
,
"break_sr"
:
"yes"
,
"data_type"
:
"ascii"
,
"separator"
:
"*"
,
"threshold"
:
200
,
"drill_only"
:
"no"
,
"multiplier"
:
1
,
"resolution"
:
3
,
"tool_units"
:
"inch"
,
"coordinates"
:
"absolute"
,
"merge_by_rule"
:
"no"
,
"signed_coords"
:
"no"
,
"text_line_width"
:
0.0024
}
}
}
}
}
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment