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
904c607d
Commit
904c607d
authored
May 09, 2020
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
a6e7887f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
156 additions
and
44 deletions
+156
-44
ATS_AIM_customer_data_analysis.js
ats/analysis/ATS_AIM_customer_data_analysis.js
+131
-40
config_ats.js
config_ats.js
+4
-0
scott_test.js
test/scott_test.js
+21
-4
No files found.
ats/analysis/ATS_AIM_customer_data_analysis.js
View file @
904c607d
...
...
@@ -165,23 +165,24 @@ try {
vc_card_size_l
:
{
api
:
"vc_card_size"
,
props
:
"ysize"
},
// card长边尺寸 // ? 保留小数
vc_array_size_w
:
{
api
:
"vc_array_size"
,
props
:
"xsize"
},
// ! array短边尺寸 需要arr_step // ? 保留小数
vc_array_size_l
:
{
api
:
"vc_array_size"
,
props
:
"ysize"
},
// ! array长边尺寸 需要arr_step // ? 保留小数
vc_pcs_count_on_panel
:
true
,
//
todo
array中pcs的数量 ! 需要arr_step
vc_pcs_count_on_panel
:
true
,
// array中pcs的数量 ! 需要arr_step
stack_vias_number
:
true
,
// via孔连续叠加的层数
stack_vias_more
:
{
only_value
:
true
},
// yes|no : 14层板以上时,Stack Vias >=12时,存yes // ! 需要分析完via连续叠加层数
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
,
//
todo
via孔在埋孔上时,存yes
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中铣切长度
vc_src_01005_pad_result
:
{
api
:
"board_has_attr"
,
props
:
"01005_pad"
},
// * yes|no:board 层中检查存在01005属性物件时,存yes 这里先拿.smd代替了
ATS_technology_25dc
:
{
api
:
"layer_exist"
,
props
:
"cavity"
},
// yes|no:存在cavity层别时存yes
ATS_technology_25dr
:
{
api
:
"layer_exist"
,
props
:
"cavity"
},
// yes|no:存在cavity层别时存yes
vc_src_01005_pad_result
:
{
api
:
"board_has_attr"
,
props
:
"01005_pad"
},
vc_src_EDGE_PLATING
:
{
api
:
"layer_exist2"
,
props
:[
"fab_page2"
]},
// fab_page2
ATS_technology_25dc
:
{
api
:
"layer_exist"
,
props
:[
"bend"
,
"top_coverlay"
]},
// yes|no:存在cavity层别时存yes
ATS_technology_25dr
:
{
api
:
"layer_exist"
,
props
:
"nclegend-1-2"
},
// yes|no:存在cavity层别时存yes
vc_src_EDGE_PLATING
:
true
,
// yes|no:检查线路外形是否存在物件,存在则存yes // !料号需要有rout层
edge_plating_length
:
true
,
// todo 检查线路外形处物件的长度
glod_finger
:
true
,
// todo yes|no:暂无逻辑
glod_finger_area
:
true
,
// todo 暂无逻辑
solder_mask_side
:
true
,
// top|bot|both:检查防焊层所在面次 solder_mask
_side
silk_screen_side
:
true
,
// top|bot|both:检查文字层所在面次
ATS_sm_side
:
true
,
// top|bot|both:检查防焊层所在面次 ATS_sm
_side
vc_id_print_side
:
true
,
// top|bot|both:检查文字层所在面次 vc_id_print_side
min_drl_size
:
true
,
// todo 0.5mm 最小圆孔
max_pth_drl_size
:
true
,
// todo 3.5mm 最大pth圆孔
max_npth_drl_size
:
true
,
// todo 6.0mm 最大npth圆孔
...
...
@@ -376,6 +377,42 @@ try {
var
oChecklistName
=
"mychecklist"
var
signalLayers
=
analysis_obj
.
matrixInfo
.
mSignals
.
map
(
function
(
v
){
return
v
.
name
})
var
drillLayers
=
analysis_obj
.
matrixInfo
.
mDrills
.
map
(
function
(
v
){
return
v
.
name
})
console
.
log
(
"=============================> 13 save card_copper_distribution"
)
var
copper_distribution_steplist
=
[
pcs_step
,
array_step
];
copper_distribution_steplist
.
forEach
(
function
(
step
){
if
(
step
){
GEN
.
openStep
({
job
:
job
,
name
:
step
})
// 铜面积 分step
var
copper_percent_tmp
=
signalLayers
.
map
(
function
(
v
){
var
tmp
=
{
layer
:
v
}
tmp
.
copper_percent
=
GEN
.
copperArea
({
layer1
:
v
}).
percent
+
"%"
return
tmp
})
console
.
log
(
"================ ==signalLayers============"
+
_
.
toString
(
signalLayers
));
console
.
log
(
_
.
toString
(
copper_percent_tmp
));
copper_percent_tmp
.
forEach
(
function
(
item
){
var
save_info
=
{
jobid
:
JobId
,
layer
:
item
.
layer
,
}
if
(
/^cad/ig
.
test
(
step
)){
save_info
.
layerinfohash
=
{
card_copper_distribution
:
item
.
copper_percent
}
}
else
if
(
/^stp/ig
.
test
(
step
)){
save_info
.
layerinfohash
=
{
array_copper_distribution
:
item
.
copper_percent
}
}
save_layerinfo
(
save_info
)
})
GEN
.
closeStep
()
}
})
var
info
=
{
min_line_width
:
[
"line"
,
"user_nor_line"
],
min_line_spacing
:
[
"l2l"
],
...
...
@@ -482,25 +519,8 @@ try {
})
})
// 铜面积
console
.
log
(
"=============================> 13 save copper_percent"
)
var
copper_percent_pcs
=
signalLayers
.
map
(
function
(
v
){
var
tmp
=
{
layer
:
v
}
tmp
.
copper_percent
=
GEN
.
copperArea
({
layer1
:
v
}).
percent
+
"%"
return
tmp
})
console
.
log
(
"================ ==signalLayers============"
+
_
.
toString
(
signalLayers
));
console
.
log
(
_
.
toString
(
copper_percent_pcs
));
GEN
.
closeStep
()
copper_percent_pcs
.
forEach
(
function
(
item
){
save_layerinfo
({
jobid
:
JobId
,
layer
:
item
.
layer
,
layerinfohash
:
{
copper_percent
:
item
.
copper_percent
}
})
})
})
// 保存
...
...
@@ -841,6 +861,13 @@ function analysis(props){
return
GEN
.
getProfileLimits
({
job
:
this
.
job
,
step
:
this
.
array_step
,
units
:
"mm"
})[
props
].
toFixed
(
2
)
}
T_m_p
.
prototype
.
analysis_vc_pcs_count_on_panel
=
function
(
props
){
//
if
(
!
this
.
array_step
){
return
"_error"
}
var
has_step
=
has_steps
({
job
:
this
.
job
,
pcs_step
:
this
.
pcs_step
,
array_step
:
this
.
array_step
})
// 有无拼版关系
if
(
has_step
){
// arr 中 pcs数量
var
tmp
=
GEN
.
getRepeat
({
job
:
job
,
step
:
array_step
})
return
tmp
.
length
}
return
"_todo"
}
T_m_p
.
prototype
.
analysis_stack_vias_number
=
function
(
props
){
// via孔连续叠加的层数
...
...
@@ -918,11 +945,67 @@ function analysis(props){
t
.
jobInfo
.
laser_info
=
laser_info
;
return
res
}
T_m_p
.
prototype
.
analysis_layer_exist2
=
function
(
props
){
// 存在某某层? string
var
layers
=
Object
.
keys
(
this
.
matrixInfo
.
matrix
)
if
(
/string/ig
.
test
(
typeof
(
props
))){
return
layers
.
indexOf
(
props
)
>=
0
?
"yes"
:
"unknow"
}
else
{
var
res
=
"unknow"
props
.
forEach
(
function
(
v
){
if
(
layers
.
indexOf
(
v
)
>=
0
){
res
=
"yes"
}
})
return
res
}
}
T_m_p
.
prototype
.
analysis_layer_exist
=
function
(
props
){
// 存在某某层? string
return
this
.
matrixInfo
.
matrix
.
hasOwnProperty
(
props
)
?
"yes"
:
"no"
var
layers
=
Object
.
keys
(
this
.
matrixInfo
.
matrix
)
if
(
/string/ig
.
test
(
typeof
(
props
))){
return
layers
.
indexOf
(
props
)
>=
0
?
"yes"
:
"no"
}
else
{
var
res
=
"no"
props
.
forEach
(
function
(
v
){
if
(
layers
.
indexOf
(
v
)
>=
0
){
res
=
"yes"
}
})
return
res
}
}
T_m_p
.
prototype
.
analysis_laser_via_on_buried_hole
=
function
(){
// todo
return
"_todo"
T_m_p
.
prototype
.
analysis_laser_via_on_buried_hole
=
function
(){
// via孔在埋孔上
var
t
=
this
// 找出 镭射孔 机械孔
var
laser_layers
=
[]
var
buried_hole
=
[]
for
(
var
key
in
t
.
matrix
)
{
var
val
=
t
.
matrix
[
key
]
if
(
val
.
type
==
"laser_drill"
){
laser_layers
.
push
(
val
)
}
else
if
(
val
.
type
==
"blind_drill"
||
val
.
type
==
"bury_drill"
){
buried_hole
.
push
(
val
)
}
}
var
res
=
"no"
if
(
buried_hole
.
length
>
0
&&
laser_layers
.
length
){
// 有机械孔 和镭射
GEN
.
openStep
({
job
:
t
.
job
,
name
:
t
.
pcs_step
})
GEN
.
affectedLayer
({
affected
:
'no'
,
mode
:
'all'
})
try
{
laser_layers
.
forEach
(
function
(
laser
){
GEN
.
workLayer
({
name
:
laser
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
selClearFeature
()
buried_hole
.
forEach
(
function
(
buried
){
GEN
.
selRefFeat
({
layers
:
buried
,
use
:
'filter'
,
mode
:
'touch'
})
if
(
GEN
.
getSelectCount
()
>
0
){
res
=
"yes"
throw
"yes"
}
})
})
}
catch
(
msg
)
{
}
GEN
.
closeStep
()
}
return
res
}
T_m_p
.
prototype
.
analysis_milling_bit_size
=
function
(){
// todo
return
"_todo"
...
...
@@ -977,35 +1060,35 @@ function analysis(props){
T_m_p
.
prototype
.
analysis_glod_finger_area
=
function
(){
// todo
return
"_todo"
}
T_m_p
.
prototype
.
analysis_
solder_mask
_side
=
function
(){
// 检查防焊层所在面次
T_m_p
.
prototype
.
analysis_
ATS_sm
_side
=
function
(){
// 检查防焊层所在面次
var
solder_paste_layers
=
this
.
matrixInfo
.
matrixVal
.
filter
(
function
(
v
){
return
v
.
layer_type
==
"solder_mask"
})
var
solder_paste_info
=
solder_paste_layers
.
map
(
function
(
v
){
return
v
.
side
}).
reduce
(
function
(
a
,
b
){
if
(
a
.
indexOf
(
b
)
<
0
){
a
.
push
(
b
)
}
return
a
},[])
var
res
=
"
none
"
var
res
=
"
NONE
"
if
(
solder_paste_info
.
length
==
0
){
res
=
"
none
"
res
=
"
NONE
"
}
else
if
(
solder_paste_info
.
length
==
1
)
{
res
=
/top/ig
.
test
(
solder_paste_info
[
0
])
?
"
top"
:
"bot
"
res
=
/top/ig
.
test
(
solder_paste_info
[
0
])
?
"
FRONT1"
:
"BACK1
"
}
else
{
res
=
"
both
"
res
=
"
FRONT1_BACK1
"
}
return
res
}
T_m_p
.
prototype
.
analysis_
silk_screen
_side
=
function
(){
// 检查文字层所在面次
T_m_p
.
prototype
.
analysis_
vc_id_print
_side
=
function
(){
// 检查文字层所在面次
var
solder_mask_layers
=
this
.
matrixInfo
.
matrixVal
.
filter
(
function
(
v
){
return
v
.
layer_type
==
"solder_paste"
})
var
solder_mask_info
=
solder_mask_layers
.
map
(
function
(
v
){
return
v
.
side
}).
reduce
(
function
(
a
,
b
){
if
(
a
.
indexOf
(
b
)
<
0
){
a
.
push
(
b
)
}
return
a
},[])
var
res
=
"
none
"
var
res
=
"
NA
"
if
(
solder_mask_info
.
length
==
0
){
res
=
"
none
"
res
=
"
NA
"
}
else
if
(
solder_mask_info
.
length
==
1
)
{
res
=
/top/ig
.
test
(
solder_mask_info
[
0
])
?
"
top"
:
"bot
"
res
=
/top/ig
.
test
(
solder_mask_info
[
0
])
?
"
FRONT"
:
"BACK
"
}
else
{
res
=
"
both
"
res
=
"
FRONT / BACK
"
}
return
res
}
...
...
@@ -1668,4 +1751,12 @@ function createOutline(props){
return
false
}
}
function
has_steps
(
props
){
var
job
=
props
.
job
var
pcs_step
=
props
.
pcs_step
var
array_step
=
props
.
array_step
var
res
=
GEN
.
getSubSteps
({
job
:
job
,
step
:
array_step
})
return
res
.
indexOf
(
pcs_step
)
>=
0
}
\ No newline at end of file
config_ats.js
View file @
904c607d
...
...
@@ -267,6 +267,8 @@
}
],
"tl_name"
:
[
{
"orig_name"
:
[
"top_enig"
],
"tl_name"
:
"top_enig"
},
{
"orig_name"
:
[
"bot_enig"
],
"tl_name"
:
"bot_enig"
},
{
"orig_name"
:
[
"^spt$"
,
"^past_top$"
],
"tl_name"
:
"past_top"
},
{
"orig_name"
:
[
"^spb$"
,
"^past_botm$"
],
"tl_name"
:
"past_botm"
},
{
"orig_name"
:
[
"^sst$"
,
"^silk_top$"
],
"tl_name"
:
"silk_top"
},
...
...
@@ -547,6 +549,7 @@
}
},
"data_format"
:
[
{
"tl_name"
:
"top_enig"
,
"new_name"
:
"top_enig"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"mixed"
}},
{
"tl_name"
:
"past_top"
,
"new_name"
:
"past_top"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"solder_paste"
}},
{
"tl_name"
:
"silk_top"
,
"new_name"
:
"silk_top"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"silk_screen"
}},
{
"tl_name"
:
"sm_top"
,
"new_name"
:
"sm_top"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"solder_mask"
}},
...
...
@@ -556,6 +559,7 @@
{
"tl_name"
:
"sm_botm"
,
"new_name"
:
"sm_botm"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"solder_mask"
}},
{
"tl_name"
:
"silk_bot"
,
"new_name"
:
"silk_bot"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"silk_screen"
}},
{
"tl_name"
:
"past_botm"
,
"new_name"
:
"past_botm"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"solder_paste"
}},
{
"tl_name"
:
"bot_enig"
,
"new_name"
:
"bot_enig"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"mixed"
}},
{
"tl_name"
:
"d_(
\\
d+)-(
\\
d+)"
,
"new_name"
:
"d($1)-($2)"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"drill"
}},
{
"tl_name"
:
"drill"
,
"new_name"
:
"drill"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"drill"
}},
{
"tl_name"
:
"rout"
,
"new_name"
:
"rout"
,
"attr"
:{
"context"
:
"board"
,
"type"
:
"rout"
}},
...
...
test/scott_test.js
View file @
904c607d
...
...
@@ -62,17 +62,34 @@ try {
if
(
!
GEN
.
isJobExists
({
job
:
job
})){
throw
"job "
+
job
+
" is not exist"
}
if
(
!
GEN
.
isJobOpen
({
job
:
job
})){
GEN
.
openJob
({
job
:
job
})}
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
var
signalLayers
=
Object
.
keys
(
matrix
).
filter
(
function
(
v
){
return
matrix
[
v
].
layer_type
==
"signal"
})
var
signalLayers
=
Object
.
keys
(
matrix
).
filter
(
function
(
v
){
var
val
=
matrix
[
v
]
return
val
.
layer_type
==
"signal"
&&
val
.
context
==
"board"
})
var
step
=
"cad"
GEN
.
openStep
({
job
:
job
,
name
:
step
})
var
copper_percent_pcs
=
signalLayers
.
map
(
function
(
v
){
var
tmp
=
{
layer
:
v
}
tmp
.
copper_percent
=
GEN
.
copperArea
({
layer1
:
v
}).
percent
+
"%"
tmp
.
card_copper_distribution
=
GEN
.
copperArea
({
layer1
:
v
}).
percent
+
"%"
return
tmp
})
console
.
log
(
"==================================>card copper_percent_pcs:"
+
_
.
toString
(
copper_percent_pcs
))
var
arr_step
=
"stp"
GEN
.
openStep
({
job
:
job
,
name
:
arr_step
})
var
copper_percent_stp
=
signalLayers
.
map
(
function
(
v
){
var
tmp
=
{
layer
:
v
}
tmp
.
array_copper_distribution
=
GEN
.
copperArea
({
layer1
:
v
}).
percent
+
"%"
return
tmp
})
console
.
log
(
"==================================>copper_percent_pcs:"
+
_
.
toString
(
copper_percent_pcs
))
console
.
log
(
"==================================>card copper_percent_stp:"
+
_
.
toString
(
copper_percent_stp
))
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
...
...
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