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
f35174ce
Commit
f35174ce
authored
5 years ago
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
7c261950
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
12 deletions
+45
-12
analysis_test.js
ats/scott_test/analysis_test.js
+2
-1
format_test.js
ats/scott_test/format_test.js
+43
-10
input_test.js
ats/scott_test/input_test.js
+0
-1
No files found.
ats/scott_test/analysis_test.js
View file @
f35174ce
...
...
@@ -2319,5 +2319,6 @@ function saveMeans(props){
var
meas
=
GEN
.
getCheckMeas
({
job
:
job
,
step
:
step
,
chklist
:
chklist
,
nact
:
nact
,
layer
:
layer
})
var
basepath
=
props
.
jobpath
+
"/user/opcam/steps"
var
respath
=
mkPath
(
basepath
,[
step
,
"chk"
,
chklist
+
"_"
+
nact
,
layer
])
fs
.
writeFile
(
respath
+
"/meas"
,
meas
.
join
(
"
\n
"
))
fs
.
writeFile
(
respath
+
"/meas"
,
meas
.
join
(
"
\n
"
))
fs
.
chmod
(
respath
+
"/meas"
,
777
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ats/scott_test/format_test.js
View file @
f35174ce
...
...
@@ -103,6 +103,20 @@ try {
if
(
custCfg
.
hasOwnProperty
(
"mergerule"
)){
var
mergeRule
=
custCfg
.
mergerule
if
(
mergeRule
.
drill
){
if
(
mergeRule
.
drill_second
){
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
var
layers
=
Object
.
keys
(
matrix
)
var
is_second
=
false
layers
.
forEach
(
function
(
layer
){
mergeRule
.
drill
.
forEach
(
function
(
item
){
var
reg
=
new
RegExp
(
item
.
orig_rule
,
"ig"
)
if
(
reg
.
test
(
layer
)){
is_second
=
true
}
})
})
if
(
!
is_second
){
mergeRule
.
drill
=
mergeRule
.
drill_second
}
}
if
(
/string/ig
.
test
(
typeof
(
mergeRule
.
drill
[
0
]))){
// drill层 计算
var
drill_layers
=
[]
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
...
...
@@ -134,12 +148,7 @@ try {
GEN
.
COM
(
"matrix_rename_layer"
,{
job
:
job
,
matrix
:
"matrix"
,
layer
:
drill_layer
,
new_name
:
"drill"
})
}
}
else
if
(
/object/ig
.
test
(
typeof
(
mergeRule
.
drill
[
0
]))){
// drill: [
// {orig_rule:["contournonplated"],drill_type:"non_plated",shape:"slot"},
// {orig_rule:["contourplated"],drill_type:"plated",shape:"slot"},
// {orig_rule:["thruholenonplated"],drill_type:"non_plated",shape:"hole"},
// {orig_rule:["thruholeplated"],drill_type:"plated",shape:"hole"},
// ],
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
// 计算最大值
var
layers
=
Object
.
keys
(
matrix
)
...
...
@@ -153,16 +162,34 @@ try {
if
(
tmp
.
length
){
tmp
=
tmp
[
0
]
GEN
.
workLayer
({
name
:
layer
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
COM
(
"cur_atr_set,attribute=.drill,option="
+
tmp
.
drill_type
)
GEN
.
COM
(
"sel_change_atr,mode=add"
)
if
(
tmp
.
drill_type
){
GEN
.
COM
(
"cur_atr_set,attribute=.drill,option="
+
tmp
.
drill_type
)
GEN
.
COM
(
"sel_change_atr,mode=add"
)
}
GEN
.
selCopyOther
({
dest
:
'layer_name'
,
target_layer
:
'drill'
,
invert
:
'no'
,
dx
:
0
,
dy
:
0
,
size
:
0
})
GEN
.
workLayer
({
name
:
"drill"
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
COM
(
"chklist_single,action=valor_dfm_nfpr,show=yes"
)
GEN
.
COM
(
"chklist_cupd,chklist=valor_dfm_nfpr,nact=1,params=((pp_layer=.affected)(pp_delete=Duplicate)(pp_work=Features)(pp_drill=PTH
\
;NPTH
\
;Via
\
;PTH - Pressfit
\
;Via - Laser
\
;Via - Photo)(pp_non_drilled=Yes)(pp_in_selected=All)(pp_remove_mark=Remove)),mode=regular"
)
GEN
.
COM
(
"chklist_run,chklist=valor_dfm_nfpr,nact=1,area=global"
)
GEN
.
deleteLayer
({
job
:
job
,
layer
:[
"drill+++"
]})
}
})
GEN
.
closeStep
()
}
}
if
(
mergeRule
.
laser
){
mergeLaser
({
job
:
job
,
mergeRule
:
mergeRule
.
laser
})
var
newdrills
=
mergeLaser
({
job
:
job
,
mergeRule
:
mergeRule
.
laser
})
var
tmp_step
=
GEN
.
getStepList
({
job
:
job
})
GEN
.
openStep
({
job
:
job
,
name
:
tmp_step
[
0
]})
newdrills
.
forEach
(
function
(
v
){
GEN
.
workLayer
({
name
:
v
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
COM
(
"chklist_single,action=valor_dfm_nfpr,show=yes"
)
GEN
.
COM
(
"chklist_cupd,chklist=valor_dfm_nfpr,nact=1,params=((pp_layer=.affected)(pp_delete=Duplicate)(pp_work=Features)(pp_drill=PTH
\
;NPTH
\
;Via
\
;PTH - Pressfit
\
;Via - Laser
\
;Via - Photo)(pp_non_drilled=Yes)(pp_in_selected=All)(pp_remove_mark=Remove)),mode=regular"
)
GEN
.
COM
(
"chklist_run,chklist=valor_dfm_nfpr,nact=1,area=global"
)
GEN
.
deleteLayer
({
job
:
job
,
layer
:[
"drill+++"
]})
})
GEN
.
deleteLayer
({
job
:
job
,
layer
:
newdrills
.
map
(
function
(
v
){
return
v
+
"+++"
})})
GEN
.
closeStep
()
}
if
(
mergeRule
.
profile
){
profileRule
=
mergeRule
.
profile
...
...
@@ -228,6 +255,7 @@ 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失败"
...
...
@@ -556,11 +584,14 @@ function mergeLaser(props){ // 合并钻孔
}
GEN.affectedLayer({affected:"
no
",mode:"
all
"});
GEN.clearLayers();
GEN.closeStep();
GEN.closeStep();
return newdrills
}
function createOutline(props){
var profileRule = props.profileRule
console.log("
----
profileRule
------->
:
" + _.toString(profileRule));
var job = props.job
var step = props.step
var matrix = props.matrix
...
...
@@ -574,6 +605,8 @@ function createOutline(props){
})
return flag
})
console.log("
----
outlines
------->
:
" + _.toString(outlines));
var drill_layer = Object.keys(matrix).filter(function(v){return matrix[v].layer_type=="
drill
" && matrix[v].context == "
board
"})
var tmp_outline
if(outlines.length){
...
...
This diff is collapsed.
Click to expand it.
ats/scott_test/input_test.js
View file @
f35174ce
...
...
@@ -242,7 +242,6 @@ try {
GEN
.
COM
(
"input_manual_reset"
)
gerberInfo
.
forEach
(
function
(
v
){
import_info
.
push
({
name
:
v
.
layer
,
type
:
"gerber274x"
,
date
:
now
(),
user
:
$
.
user_name
})
GEN
.
COM
(
"input_manual_set"
,
v
)
})
GEN
.
COM
(
"input_manual"
)
...
...
This diff is collapsed.
Click to expand it.
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