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
1eaa49b3
Commit
1eaa49b3
authored
Sep 11, 2020
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scott
parent
5458dacb
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
432 additions
and
25 deletions
+432
-25
ATS_AIM_customer_data_analysis.js
ats/topcam/ATS_AIM_customer_data_analysis.js
+38
-7
ATS_AIM_data_format.js
ats/topcam/ATS_AIM_data_format.js
+20
-1
ATS_AIM_data_input.js
ats/topcam/ATS_AIM_data_input.js
+41
-16
config_ats.js
config_ats.js
+1
-1
scotttest.js
public_script/scotttest.js
+332
-0
No files found.
ats/topcam/ATS_AIM_customer_data_analysis.js
View file @
1eaa49b3
...
...
@@ -134,7 +134,8 @@ var resultData = [];
var
ALL
=
{}
var
Omatrix
=
{};
try
{
script_info
({
result_severity
:
"analysis start"
})
script_info
({
progress
:
65
})
console
.
log
(
"=============================================>anaysis_start"
);
var
par
=
PAR
;
var
vc_src_01005_pad_result
=
par
.
vc_src_01005_pad_result
...
...
@@ -158,6 +159,8 @@ try {
if
(
step_list
.
indexOf
(
pcs_step
)
<
0
){
pcs_step
=
step_list
[
0
]
}
script_info
({
result_severity
:
"analysis update_matrix_info"
})
script_info
({
progress
:
65
})
var
matrix
=
UPLOAD_LAYER_MATRIX
({
job
:
job
})
// 分析matrix 获得分析后的matrix信息
GEN
.
openStep
({
job
:
job
,
name
:
pcs_step
})
_
.
values
(
matrix
).
forEach
(
function
(
v
){
...
...
@@ -209,6 +212,8 @@ try {
})
GEN
.
clearLayers
()
script_info
({
result_severity
:
"analysis drill_stack"
})
script_info
({
progress
:
70
})
// * new 钻孔叠构
var
cam_drill_structure
=
[]
var
stack_drills
=
_
.
values
(
matrix
).
filter
(
function
(
item
){
...
...
@@ -357,6 +362,8 @@ try {
}
}
GEN
.
closeStep
()
script_info
({
result_severity
:
"analysis panel_info"
})
script_info
({
progress
:
70
})
// * profile 和 拼版
var
pandle_step
=
step_list
.
map
(
function
(
v
){
var
type
=
"unknow"
;
...
...
@@ -429,6 +436,7 @@ try {
}
ALL
.
gold_fingers
=
gold_fingers
GEN
.
closeStep
()
script_info
({
result_severity
:
"analysis some_job_info"
})
var
config
=
{
jobInfo
:
{
layer_count
:
[
"signal"
,
"power_ground"
],
// Board属性的signal或者power_ground层
...
...
@@ -508,7 +516,8 @@ try {
console
.
log
(
"===================================> 5 save drill info"
)
script_info
({
result_severity
:
"analysis drill_info"
})
script_info
({
progress
:
75
})
// * 获取pcs_step 和 array_step的钻孔信息
var
drill_tool_info
=
{};
var
drillLayers
=
analysis_obj
.
matrixInfo
.
mDrills
;
...
...
@@ -630,7 +639,8 @@ try {
})
console
.
log
(
"=============================> 6 set smd bga"
)
script_info
({
result_severity
:
"analysis smd&bga"
})
script_info
({
progress
:
80
})
var
allStep
=
GEN
.
getStepList
({
job
:
job
})
allStep
.
forEach
(
function
(
step
){
GEN
.
openStep
({
job
:
job
,
name
:
step
})
...
...
@@ -780,6 +790,8 @@ try {
// jobpath = "/home/local_db/server_db/jobs/"+job
// }
mkPath
(
jobpath
,[
"user"
,
"opcam"
,
"steps"
])
script_info
({
result_severity
:
"analysis signal"
})
script_info
({
progress
:
85
})
stepList
.
forEach
(
function
(
step
){
GEN
.
openStep
({
job
:
job
,
name
:
step
})
// 曝光
...
...
@@ -791,6 +803,13 @@ try {
})
var
layer_gold_type
=
/top/ig
.
test
(
item
.
signalL
)
?
"top"
:
"bot"
if
(
tmp_gold_info
[
layer_gold_type
]){
var
tmp_area_layer
=
"gold_area_tmp"
if
(
GEN
.
isLayerExists
({
job
:
job
,
layer
:
tmp_area_layer
})){
GEN
.
deleteLayer
({
job
:
job
,
layer
:[
tmp_area_layer
]})
}
GEN
.
copyLayer
({
source_job
:
job
,
source_step
:
step
,
source_layer
:
tmp_gold_info
[
layer_gold_type
],
dest_layer
:
tmp_area_layer
,
mode
:
'replace'
,
invert
:
'no'
});
GEN
.
COM
(
"clip_area_strt"
)
GEN
.
COM
(
"clip_area_end,layers_mode=layer_name,layer="
+
tmp_area_layer
+
",area=profile,area_type=rectangle,inout=outside,contour_cut=yes,margin=0,feat_types=line
\
;pad
\
;surface
\
;arc
\
;text"
)
var
tmp_info
=
GEN
.
copperArea
({
layer1
:
tmp_gold_info
[
layer_gold_type
],
resolution_value
:
1
})
// var tmp_info = GEN.exposedArea({layer1:item.signalL,mask1:tmp_gold_info[layer_gold_type]})
var
tmp_data
=
{}
...
...
@@ -854,7 +873,7 @@ try {
return
{
layer
:
v
,
symbol
:
symbol
,
start
:
tmp_matrix
[
v
][
"drl_start"
],
end
:
tmp_matrix
[
v
][
"drl_end"
]}
})
var
drillRes
=
analysisDrill
(
drillToSignals
,
step
)
// 钻孔分析结果
fs
.
writeFile
(
"/home/toplinker/samba/scott_test/tmp"
,
_
.
toString
(
drillRes
))
//
fs.writeFile("/home/toplinker/samba/scott_test/tmp",_.toString(drillRes))
console
.
log
(
"===============drillRes:"
+
_
.
toString
(
drillRes
));
drillRes
.
forEach
(
function
(
item
){
save_layerinfo
({
...
...
@@ -892,6 +911,7 @@ try {
if
(
par
.
erf
){
tmpitem
.
erf
=
par
.
erf
}
script_info
({
result_severity
:
"analysis run_signal_chk"
})
createChklistAndRun
({
// 创建checklist并运行
layers
:
signalLayers
,
items
:
[
tmpitem
]
...
...
@@ -935,6 +955,8 @@ try {
IKM
.
msg
(
"export"
)
script_info
({
result_severity
:
"analysis export"
})
script_info
({
progress
:
95
})
// 导出
if
(
par
.
export_path
!=
""
&&
par
.
export_mode
!=
""
&&
par
.
export_submode
!=
""
){
if
(
fs
.
exists
(
par
.
export_path
)){
...
...
@@ -950,12 +972,13 @@ try {
}
}
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
33.33
result_severity
:
"analysis ok"
,
progress
:
100
},
where
:
{
id
:
$
.
task_id
}
});
...
...
@@ -1515,7 +1538,6 @@ function analysis(props){
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
]
...
...
@@ -2420,4 +2442,13 @@ function arcLength(x1,y1,x2,y2,x3,y3){
var
sin0
=
Math
.
sin
(
tmp
)
var
length
=
+
Math
.
sqrt
(
Math
.
pow
(
x2
-
x1
,
2
)
+
Math
.
pow
(
y2
-
y1
,
2
))
/
sin0
*
tmp
return
length
}
function
script_info
(
props
){
// result_severity progress
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
props
,
where
:
{
id
:
$
.
task_id
}
});
}
}
\ No newline at end of file
ats/topcam/ATS_AIM_
layer_rename_and_sor
t.js
→
ats/topcam/ATS_AIM_
data_forma
t.js
View file @
1eaa49b3
...
...
@@ -68,6 +68,8 @@ if (mode === "aimdfm") {
var
Status
=
'ok'
;
var
resultData
=
[];
try
{
script_info
({
result_severity
:
"format start"
})
script_info
({
progress
:
35
})
var
par
=
PAR
;
if
(
!
par
.
hasOwnProperty
(
"config_path"
)
||
par
.
config_path
==
""
){
console
.
log
(
"==============cfg"
);
...
...
@@ -213,6 +215,8 @@ try {
var
format_cfg
=
config
.
data_format
// 拿到数据标准化配置
// 排序和设属性
script_info
({
result_severity
:
"format sort"
})
script_info
({
progress
:
40
})
var
ret
=
sortLayer
({
job
:
job
,
rule
:
format_cfg
,
matrix
:
tl_name_matrix
})
if
(
ret
.
err
){
throw
err
}
var
after_sort_matrix
=
ret
.
sortNames
...
...
@@ -222,6 +226,8 @@ try {
if
(
err
){
throw
err
}
// 改名
script_info
({
result_severity
:
"format rename"
})
script_info
({
progress
:
50
})
err
=
reName
({
job
:
job
,
matrix
:
after_sort_matrix
,
cfg
:
format_cfg
})
if
(
err
){
throw
err
}
...
...
@@ -251,6 +257,8 @@ try {
}
})
script_info
({
result_severity
:
"format create profile"
})
script_info
({
progress
:
55
})
var
all_layer
=
Object
.
keys
(
tmp_matrix
)
// 没有outline层
if
(
all_layer
.
indexOf
(
"outline"
)
>=
0
)
{
profileRule
.
unshift
(
"outline"
)}
...
...
@@ -290,7 +298,8 @@ try {
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
33.33
result_severity
:
"format ok"
,
progress
:
60
},
where
:
{
id
:
$
.
task_id
}
});
...
...
@@ -696,4 +705,14 @@ function selCopyLayer(props){ // 拷贝选择的到辅助层
GEN.deleteLayer({job:job,layer:layer})
}
GEN.selCopyOther({dest:'layer_name',target_layer:layer})
}
function script_info(props){ // result_severity progress
if (mode === "
aimdfm
") {
$.QDfm.updateRow({
table: "
pdm_aimdfm_task
",
data: props,
where: { id: $.task_id }
});
}
}
\ No newline at end of file
ats/topcam/ATS_AIM_
input_data
.js
→
ats/topcam/ATS_AIM_
data_input
.js
View file @
1eaa49b3
...
...
@@ -52,6 +52,7 @@ console.log("=============================================>input_start");
var
$
=
require
(
'topcam.scriptfunc'
).
argv
();
var
fs
=
require
(
'fs'
);
var
_
=
require
(
'lodash'
);
var
zip
=
require
(
'topsin.zip'
);
var
mode
=
$
.
ikm
?
"topcam"
:
"aimdfm"
;
var
IKM
=
$
.
ikm
;
if
(
IKM
==
undefined
)
{
IKM
=
require
(
'topcam.ikm6'
)(
$
)
}
...
...
@@ -76,7 +77,8 @@ if (mode === "aimdfm") {
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
current_process_title
:
$
.
process_title
current_process_title
:
$
.
process_title
,
progress
:
0
},
where
:
{
id
:
$
.
task_id
}
});
...
...
@@ -86,6 +88,7 @@ var Status = 'ok';
var
resultData
=
[];
var
import_info
=
[]
try
{
script_info
({
result_severity
:
"import start"
})
var
par
=
PAR
;
// var db_path = db.query("",function(q){
// return q.selectValue({
...
...
@@ -162,11 +165,21 @@ try {
}
GEN
.
COM
(
"config_edit,name=iol_gbr_polygon_break,value=1,mode=user"
)
GEN
.
COM
(
"config_edit,name=iol_fix_ill_polygon,value=yes,mode=user"
)
// 将jobFile下的zip解压
jobFiles
.
forEach
(
function
(
item
){
if
(
item
.
suffix
===
"zip"
){
zip
.
unzip
(
item
.
path
);
}
})
// 分析料号文件 得到料号导入信息 导入类型
var
jobInfo
=
analyJobFiles
({
jobFiles
:
jobFiles
.
filter
(
function
(
v
){
return
v
.
isFile
}),
custCfg
:
custCfg
,
config
:
config
,
job
:
job
})
if
(
jobInfo
.
data
.
length
==
0
){
throw
"file error"
}
var
importOk
=
false
;
// 是否成功导入
script_info
({
progress
:
10
})
if
(
/odb/ig
.
test
(
jobInfo
.
type
)){
// odb导入
...
...
@@ -266,8 +279,10 @@ try {
importOk
=
true
}
if
(
!
importOk
){
throw
"import error"
}
if
(
!
importOk
){
script_info
({
result_severity
:
"import error"
})
throw
"import error"
}
script_info
({
progress
:
20
})
// 导入结束
var
matrix
=
GEN
.
getMatrix
({
job
:
job
});
comp
=
Object
.
keys
(
matrix
).
filter
(
function
(
v
){
// 如果有comp层 删除
...
...
@@ -302,24 +317,23 @@ try {
})
}
var
import_html
=
"<table border=1 align='center' cellpadding=5 cellspacing=0 style=
\"
text-align: center;
\"
><tr><th>导入状态/Import Status</th><th>文件/File</th><th>类型/Type</th><th>导入时间/Import Time</th><th>操作用户/User</th></tr>"
import_info
.
forEach
(
function
(
item
){
var
name
=
item
.
name
var
type
=
item
.
type
var
date
=
item
.
date
var
user
=
item
.
user
import_html
+=
"<tr><td>Readin</td><td>"
+
name
+
"</td><td>"
+
type
+
"</td><td>"
+
date
+
"</td><td>"
+
user
+
"</td></tr>"
})
import_html
+=
"</table>"
// name type date user
resultData
.
push
({
type
:
"info"
,
title
:
"导入资料列表"
,
detail
:
[{
desc
:
import_info
.
map
(
function
(
item
){
var
name
=
item
.
name
var
type
=
item
.
type
var
date
=
item
.
date
var
user
=
item
.
user
return
"导入资料:"
+
name
+
", 类型:"
+
type
+
", 导入时间:"
+
date
+
", 操作用户:"
+
user
}).
join
(
"
\n
"
)
}]
})
resultData
.
push
({
type
:
"info"
,
title
:
"导入资料列表"
,
detail
:
[{
desc
:
import_html
}]
})
script_info
({
result_severity
:
"import ok"
})
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
3
3.33
progress
:
3
0
},
where
:
{
id
:
$
.
task_id
}
});
...
...
@@ -476,4 +490,15 @@ function reNameStep(job) {
GEN
.
renameStep
({
job
:
job
,
name
:
v
,
new_name
:
'stp'
+
(
i
==
0
?
""
:
i
+
1
)})
}
})
}
function
script_info
(
props
){
// result_severity progress
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
props
,
where
:
{
id
:
$
.
task_id
}
});
}
}
\ No newline at end of file
config_ats.js
View file @
1eaa49b3
...
...
@@ -572,7 +572,7 @@
{
"orig_name"
:
[
"mask_top
\\
.art"
,
"psm
\\
.art"
,
"sm_top"
],
"tl_name"
:
"sm_top"
},
{
"orig_name"
:
[
"mask_bot
\\
.art"
,
"ssm
\\
.art"
,
"sm_bot"
],
"tl_name"
:
"sm_botm"
},
{
"orig_name"
:
[
"^top$"
,
"^top.art$"
],
"tl_name"
:
"top"
},
{
"orig_name"
:
[
"^0?(
\\
d+)_.*
\\
.art$"
,
"^l(
\\
d+)
\\
.art$"
,
"^0(
\\
d+).*ccp_ms"
,
"^s(
\\
d+)
\\
.art"
,
"lay(
\\
d+)
\\
.art"
,
"layer_(
\\
d+)"
],
"tl_name"
:
"l_($1)"
},
{
"orig_name"
:
[
"^
l(
\\
d+)_.*
\\
.art$"
,
"^
0?(
\\
d+)_.*
\\
.art$"
,
"^l(
\\
d+)
\\
.art$"
,
"^0(
\\
d+).*ccp_ms"
,
"^s(
\\
d+)
\\
.art"
,
"lay(
\\
d+)
\\
.art"
,
"layer_(
\\
d+)"
],
"tl_name"
:
"l_($1)"
},
{
"orig_name"
:
[
"^bottom$"
,
"^bottom
\\
.art$"
],
"tl_name"
:
"bottom"
},
{
"orig_name"
:
[
"-(
\\
d+)-(
\\
d+)
\\
.drl$"
,
"(
\\
d+)-(
\\
d+)-laser
\\
.drl$"
,
"d(
\\
d+)-(
\\
d+)"
],
"tl_name"
:
"d_($1)-($2)"
},
{
"orig_name"
:
[
"
\\
.rou$"
,
"^rout$"
],
"tl_name"
:
"rout"
},
...
...
public_script/scotttest.js
0 → 100644
View file @
1eaa49b3
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