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
431f8581
Commit
431f8581
authored
Jun 19, 2020
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
f35174ce
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
185 additions
and
277 deletions
+185
-277
analysis_test.js
ats/scott_test/analysis_test.js
+69
-6
format_test.js
ats/scott_test/format_test.js
+3
-2
config_ats.js
config_ats.js
+1
-0
ATS_AIM_input_data.js
test/ATS_AIM_input_data.js
+112
-261
mytest.js
test/mytest.js
+0
-8
No files found.
ats/scott_test/analysis_test.js
View file @
431f8581
...
...
@@ -429,8 +429,9 @@ try {
depth_drilling
:
{
api
:
"layer_exist"
,
props
:
"depth_drill"
},
// yes|no :存在 depth_drill 层时 ,存yes
depth_routing
:
{
api
:
"layer_exist"
,
props
:
"depth_routing"
},
// tmp yes|no :存在 depth_routing 层时,,存yes
laser_via_on_buried_hole
:
true
,
// via孔在埋孔上时,存yes
milling_bit_size
:
true
,
// todo 检查array中pcs的最小间距值
milling_length
:
true
,
// todo 检查array中铣切长度
milling_bit_size
:
false
,
// todo 检查array中pcs的最小间距值
milling_length_card
:
true
,
milling_length_array
:
true
,
vc_src_01005_pad_result
:
{
api
:
"board_has_attr"
,
props
:
vc_src_01005_pad_result
},
// 本地使用 .pth_pad ats 01005_pad
ATS_technology_25dc
:
{
api
:
"layer_exist"
,
props
:[
"bot_coverlay"
,
"top_coverlay"
]},
// yes|no:存在cavity层别时存yes
ATS_technology_25dr
:
{
api
:
"layer_exist"
,
props
:[
"bot_coverlay"
,
"top_coverlay"
]},
// yes|no:存在cavity层别时存yes
...
...
@@ -468,6 +469,7 @@ try {
jobInfo
[
key
]
=
analysis_obj
[
"analysis_"
+
key
](
props
)
}
}
catch
(
e
)
{
console
.
log
(
"========================================error:"
);
console
.
log
(
e
);
jobInfo
[
key
]
=
"_error"
}
...
...
@@ -490,7 +492,7 @@ try {
jobinfohash
:
jobInfo
})
console
.
log
(
"===================================> 5 save drill info"
)
// * 获取pcs_step 和 array_step的钻孔信息
var
drill_tool_info
=
{};
var
drillLayers
=
analysis_obj
.
matrixInfo
.
mDrills
;
...
...
@@ -1464,8 +1466,60 @@ function analysis(props){
T_m_p
.
prototype
.
analysis_milling_bit_size
=
function
(){
// todo
return
"_todo"
}
T_m_p
.
prototype
.
analysis_milling_length
=
function
(){
// todo
return
"_todo"
T_m_p
.
prototype
.
analysis_milling_length_card
=
function
(){
// todo
var
allStep
=
[
this
.
pcs_step
,
this
.
array_step
]
var
res
=
0
var
that
=
this
;
console
.
log
(
"============analysis_milling_length_card============="
);
console
.
log
(
"========step========:"
+
_
.
toString
(
allStep
));
var
steps
=
GEN
.
getStepList
({
job
:
this
.
job
})
allStep
.
forEach
(
function
(
step
){
if
(
steps
.
indexOf
(
step
)
>=
0
){
GEN
.
openStep
({
job
:
that
.
job
,
name
:
step
})
var
tmp
=
"length_tmp"
if
(
GEN
.
isLayerExists
({
job
:
that
.
job
,
layer
:
tmp
})){
GEN
.
deleteLayer
({
job
:
that
.
job
,
layer
:[
tmp
]})}
GEN
.
createLayer
({
job
:
that
.
job
,
layer
:
tmp
,
conext
:
'misc'
,
type
:
'document'
})
GEN
.
COM
(
"profile_to_rout,layer="
+
tmp
+
",width=1"
)
var
feautres
=
GEN
.
getFeatures
({
job
:
that
.
job
,
step
:
step
,
layer
:
tmp
,
units
:
"mm"
})
fs
.
writeFile
(
"/home/samba/tmp/tmp.js"
,
_
.
toString
(
feautres
))
// 根据feautres 算出周长
var
milling
=
Object
.
keys
(
feautres
).
reduce
(
function
(
a
,
b
){
var
value
=
feautres
[
b
]
if
(
value
.
type
==
"line"
){
length
=
Math
.
sqrt
((
Number
(
value
.
xe
)
-
Number
(
value
.
xs
))
*
(
Number
(
value
.
xe
)
-
Number
(
value
.
xs
))
+
(
Number
(
value
.
ye
)
-
Number
(
value
.
ys
))
*
(
Number
(
value
.
ye
)
-
Number
(
value
.
ys
)))
a
+=
length
}
else
if
(
value
.
type
==
"arc"
)
{
a
+=
arcLength
(
Number
(
value
.
xs
),
Number
(
value
.
ys
),
Number
(
value
.
xe
),
Number
(
value
.
ye
),
Number
(
value
.
xc
),
Number
(
value
.
yc
))
}
return
a
},
0
)
console
.
log
(
"========milling:"
+
milling
);
res
+=
milling
console
.
log
(
"========res:"
+
res
);
GEN
.
deleteLayer
({
job
:
that
.
job
,
layer
:[
tmp
]})
}
})
return
res
.
toFixed
(
3
)
}
T_m_p
.
prototype
.
analysis_milling_length_array
=
function
(){
// todo
if
(
!
this
.
array_step
){
return
"_error"
}
GEN
.
openStep
({
job
:
this
.
job
,
name
:
this
.
array_step
})
var
tmp
=
"length_tmp"
GEN
.
COM
(
"profile_to_rout,layer="
+
tmp
+
",width=1"
)
var
feautres
=
GEN
.
getFeatures
({
job
:
this
.
job
,
step
:
this
.
array_step
,
layer
:
tmp
,
units
:
"mm"
})
// 根据feautres 算出周长
var
milling
=
Object
.
keys
(
feautres
).
reduce
(
function
(
a
,
b
){
var
value
=
feautres
[
b
]
if
(
value
.
type
==
"line"
){
length
=
Math
.
sqrt
((
value
.
xe
-
value
.
xs
)
*
(
value
.
xe
-
value
.
xs
)
+
(
value
.
ye
-
value
.
ys
)
*
(
value
.
ye
-
value
.
ys
))
a
+=
length
}
else
if
(
value
.
type
==
"arc"
)
{
a
+=
arcLength
(
Number
(
value
.
xs
),
Number
(
value
.
ys
),
Number
(
value
.
xe
),
Number
(
value
.
ye
),
Number
(
value
.
xc
),
Number
(
value
.
yc
))
}
return
a
},
0
)
GEN
.
closeStep
()
return
milling
}
T_m_p
.
prototype
.
analysis_board_has_attr
=
function
(
props
){
// board层中检查存在01005属性物件时
GEN
.
openStep
({
job
:
this
.
job
,
name
:
this
.
pcs_step
})
...
...
@@ -1544,7 +1598,7 @@ function analysis(props){
}
else
if
(
solder_paste_info
.
length
==
1
)
{
res
=
/top/ig
.
test
(
solder_paste_info
[
0
])
?
"FRONT1"
:
"BACK1"
}
else
{
res
=
"FRONT1
_
BACK1"
res
=
"FRONT1
;
BACK1"
}
return
res
}
...
...
@@ -2321,4 +2375,13 @@ function saveMeans(props){
var
respath
=
mkPath
(
basepath
,[
step
,
"chk"
,
chklist
+
"_"
+
nact
,
layer
])
fs
.
writeFile
(
respath
+
"/meas"
,
meas
.
join
(
"
\n
"
))
fs
.
chmod
(
respath
+
"/meas"
,
777
)
}
// 算弧长
function
arcLength
(
x1
,
y1
,
x2
,
y2
,
x3
,
y3
){
var
cos0
=
+
((
x3
-
x1
)
*
(
x2
-
x3
)
+
(
y3
-
y1
)
*
(
y2
-
y3
))
/
(
Math
.
pow
((
Math
.
pow
(
x2
-
x3
,
2
)
+
Math
.
pow
(
y2
-
y3
,
2
)),
0.5
)
*
Math
.
pow
((
Math
.
pow
(
x3
-
x1
,
2
)
+
Math
.
pow
(
y3
-
y1
,
2
)),
0.5
))
var
tmp
=
Math
.
acos
(
cos0
)
var
sin0
=
Math
.
sin
(
tmp
)
var
length
=
+
Math
.
sqrt
(
Math
.
pow
(
x2
-
x1
,
2
)
+
Math
.
pow
(
y2
-
y1
,
2
))
/
sin0
*
tmp
return
length
}
\ No newline at end of file
ats/scott_test/format_test.js
View file @
431f8581
...
...
@@ -255,7 +255,6 @@ try {
var
now_profile
=
GEN
.
getProfile
({
job
:
job
,
step
:
tmp_step
})
if
(
now_profile
.
match
(
/
\n
/ig
).
length
==
1
){
// 如果没有profile
createOutline
({
job
:
job
,
step
:
tmp_step
,
matrix
:
tmp_matrix
,
profileRule
:
profileRule
})
throw
"tmp"
var
hasProfile
=
GEN
.
getProfile
({
job
:
job
,
step
:
tmp_step
})
if
(
hasProfile
.
match
(
/
\n
/ig
).
length
==
1
){
throw
"创建profile失败"
...
...
@@ -636,6 +635,7 @@ function createOutline(props){
if(GEN.getSelectCount()>0){GEN.selDelete()}
GEN.selClearFeature()
GEN.COM("
sel_cut_data
,
det_tol
=
1
,
con_tol
=
1
,
rad_tol
=
0.1
,
filter_overlaps
=
no
,
delete_doubles
=
no
,
use_order
=
yes
,
ignore_width
=
yes
,
ignore_holes
=
none
,
start_positive
=
yes
,
polarity_of_touching
=
same
")
GEN.selContourize()
GEN.selectByFilter({feat_types:"
surface
"})
GEN.selReverse()
if(GEN.getSelectCount()>0){GEN.selDelete()}
...
...
@@ -647,7 +647,8 @@ function createOutline(props){
GEN.workLayer({name:l,display_number:2,clear_before:"
yes
"})
GEN.selAllFeat()
GEN.selDelete()
GEN.workLayer({name:tmp_outline2,display_number:2,clear_before:"
yes
"})
GEN.workLayer({name:tmp_outline2,display_number:2,clear_before:"
yes
"})
GEN.COM("
sel_clean_holes
,
max_size
=
200
,
clean_mode
=
x_and_y
")
GEN.COM("
sel_surf2outline
,
width
=
1
")
GEN.selAllFeat()
selCopyLayer({job:job,layer:l})
...
...
config_ats.js
View file @
431f8581
...
...
@@ -1008,6 +1008,7 @@
],
"mergerule"
:
{
drill
:[
"(
\\
d+)-(
\\
d+)
\\
.drl$"
],
profile
:[
"sm_top"
],
laser
:
{
tl_name
:
"drill($1)-($2)"
,
regs
:
[
"(
\\
d+)-(
\\
d+)
\\
.drl$"
]
...
...
test/ATS_AIM_input_data.js
View file @
431f8581
This diff is collapsed.
Click to expand it.
test/mytest.js
View file @
431f8581
...
...
@@ -10,15 +10,7 @@ var Job = $.job;
var
JobId
=
$
.
job_id
;
try
{
return
"Done"
}
catch
(
e
)
{
return
"Error"
...
...
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