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
7c261950
Commit
7c261950
authored
Jun 11, 2020
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scott
parent
cf08b85d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
82 deletions
+114
-82
analysis_test.js
ats/scott_test/analysis_test.js
+20
-15
config_ats.js
config_ats.js
+2
-2
index.d.ts
test/node_modules/@types/topcam.ikm6/index.d.ts
+8
-0
scott_test.js
test/scott_test.js
+84
-65
No files found.
ats/scott_test/analysis_test.js
View file @
7c261950
...
...
@@ -318,9 +318,7 @@ try {
var
analysis_obj
=
analysis
({
job
:
job
,
jobId
:
JobId
,
pcs_step
:
pcs_step
,
array_step
:
array_step
,
matrix
:
matrix
})
// 创建profile
var
tmp_matrix
=
GEN
.
getMatrix
({
job
:
job
})
var
board_layer
=
Object
.
keys
(
tmp_matrix
).
filter
(
function
(
v
){
return
tmp_matrix
[
v
].
context
==
"board"
})
GEN
.
openStep
({
job
:
job
,
name
:
pcs_step
})
var
now_profile
=
GEN
.
getProfile
({
job
:
job
,
step
:
pcs_step
})
console
.
log
(
"profile:===============>"
+
now_profile
);
...
...
@@ -330,15 +328,21 @@ try {
var
hasProfile
=
GEN
.
getProfile
({
job
:
job
,
step
:
pcs_step
})
if
(
hasProfile
.
match
(
/
\n
/ig
).
length
==
1
){
throw
"创建profile失败"
}
else
{
GEN
.
affectedLayer
({
affected
:
'yes'
,
mode
:
'all'
})
GEN
.
selectByFilter
({
profile
:
"out"
})
if
(
GEN
.
getSelectCount
()
>
0
){
GEN
.
selDelete
()
}
}
}
else
{
GEN
.
affectedLayer
({
affected
:
'yes'
,
layer
:
board_layer
,
clear_before
:
"yes"
})
GEN
.
affectedLayer
({
affected
:
'yes'
,
mode
:
'all'
})
GEN
.
selectByFilter
({
profile
:
"out"
})
if
(
GEN
.
getSelectCount
()
>
0
){
GEN
.
selDelete
()
}
}
GEN
.
closeStep
()
// * profile 和 拼版
var
pandle_step
=
step_list
.
map
(
function
(
v
){
var
type
=
"unknow"
;
...
...
@@ -745,16 +749,16 @@ try {
jobid
:
JobId
,
jobinfohash
:
{
ATS_surface_area_base_on
:
"Card"
}
})
var
jobpath
if
(
GEN
.
GEN_TYPE
==
"genesis"
){
jobpath
=
GEN
.
getJobPath
({
job
:
job
})
}
else
{
jobpath
=
"/home/local_db/server_db/jobs/"
+
job
}
var
jobpath
=
GEN
.
getJobPath
({
job
:
job
})
//
if(GEN.GEN_TYPE == "genesis"){
//
jobpath = GEN.getJobPath({job:job})
//
} else {
//
jobpath = "/home/local_db/server_db/jobs/"+job
//
}
mkPath
(
jobpath
,[
"user"
,
"opcam"
,
"steps"
])
stepList
.
forEach
(
function
(
step
){
GEN
.
openStep
({
job
:
job
,
name
:
step
})
//
GEN.units({type:'mm'})
GEN
.
units
({
type
:
'mm'
})
// 曝光
analysis_obj
.
matrixInfo
.
mOuters
.
forEach
(
function
(
item
){
if
(
ALL
.
gold_fingers
.
length
>
0
){
...
...
@@ -764,7 +768,7 @@ try {
})
var
layer_gold_type
=
/top/ig
.
test
(
item
.
signalL
)
?
"top"
:
"bot"
if
(
tmp_gold_info
[
layer_gold_type
]){
var
tmp_info
=
GEN
.
copperArea
({
layer1
:
tmp_gold_info
[
layer_gold_type
],
resolution_value
:
1
})
var
tmp_info
=
GEN
.
copperArea
({
layer1
:
tmp_gold_info
[
layer_gold_type
],
resolution_value
:
25.4
})
// var tmp_info = GEN.exposedArea({layer1:item.signalL,mask1:tmp_gold_info[layer_gold_type]})
var
tmp_data
=
{}
if
(
layer_gold_type
==
"top"
)
{
...
...
@@ -790,7 +794,8 @@ try {
}
}
if
(
item
.
solderL
){
var
tmp_info
=
GEN
.
exposedArea
({
layer1
:
item
.
signalL
,
mask1
:
item
.
solderL
})
var
tmp_info
=
GEN
.
copperArea
({
layer1
:
item
.
solderL
,
resolution_value
:
25.4
})
// var tmp_info = GEN.exposedArea({layer1:item.signalL,mask1:item.solderL})
// {"area":"0.73817","percent":"8.986"}
var
tmp_area
=
tmp_info
.
area
var
tmp_percent
=
tmp_info
.
percent
;
...
...
@@ -811,7 +816,7 @@ try {
})
GEN
.
clearLayers
()
GEN
.
affectedLayer
({
affected
:
'no'
,
mode
:
'all'
})
//
GEN.units({type:'inch'})
GEN
.
units
({
type
:
'inch'
})
console
.
log
(
"==================================> Drill analysis"
)
// 钻孔
...
...
config_ats.js
View file @
7c261950
...
...
@@ -579,8 +579,8 @@
{
"orig_name"
:
"fab.art"
,
"tl_name"
:
"fab.art"
},
{
"orig_name"
:
[
"multipack.art"
,
"^array$"
],
"tl_name"
:
"array"
},
{
"orig_name"
:
[
"^outline"
],
"tl_name"
:
"outline"
},
{
"orig_name"
:
[
"top-enig"
,
"enig_top"
],
"tl_name"
:
"enig_top"
},
{
"orig_name"
:
[
"bot-enig"
,
"enig_bot"
],
"tl_name"
:
"enig_bot"
},
{
"orig_name"
:
[
"
^pst
\\
.art$"
,
"
top-enig"
,
"enig_top"
],
"tl_name"
:
"enig_top"
},
{
"orig_name"
:
[
"
^sst
\\
.art$"
,
"
bot-enig"
,
"enig_bot"
],
"tl_name"
:
"enig_bot"
},
]
},
"New_data"
:
{
...
...
test/node_modules/@types/topcam.ikm6/index.d.ts
View file @
7c261950
...
...
@@ -134,6 +134,14 @@ declare class TopCamIkm6 {
* @returns 返回IKM的DB连接参数
*/
getIkmConnectParameter
():
JSON
/**
* 获取料号info
*
* @param
* @returns 返回料号info
*/
get_jobinfo
(
p
:{
jobid
:
number
,
jobinfo
:
string
}):
any
;
}
export
=
TopCamIkm6
;
...
...
test/scott_test.js
View file @
7c261950
/*
NAME:
DESCRIPTION: ;
PARAMETER:
[
{
name : 'auto_save',
title : '自动保存',
type : 'RadioBox',
property : {
item_list:[
{name:'yes',text:'YES'},
{name:'no',text:'NO'},
],
tool_tip:'是否自动保存料号开关'
}
}
]
VERSION_HISTORY:
V1.00 2020-04-
17
Scott Sun
V1.00 2020-04-
20
Scott Sun
1.新版本
HELP:
<html><body bgcolor="#DDECFE">
<font size="3" color="#003DB2"><p>功能简介</p></font>
<p>
数据标准化
</p>
<p>
scott test
</p>
<br>
<font size="3" color="#003DB2"><p>参数配置</p></font>
<p>
客户配置
</p>
<p>
外形层
</p>
<br>
<font size="3" color="#003DB2"><p>注意事项</p></font>
<p> 无 </p>
<br>
</body></html>
*/
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
console
.
log
(
"---------------scott----------------"
);
// 引入模块 包
console
.
log
(
"==============================================>scott test"
)
var
$
=
require
(
'topcam.scriptfunc'
).
argv
();
var
fs
=
require
(
'fs'
);
var
_
=
require
(
'lodash'
);
var
database
=
require
(
"topsin.database"
);
database
.
addConnection
(
$
.
conf
.
database_conf
,
"DFM"
);
var
QDfm
=
database
.
query
(
"DFM"
);
if
(
$
.
conf
.
product_type
==
"aimdfm"
)
{
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
current_process_title
:
$
.
process_title
},
where
:
{
id
:
$
.
task_id
}
});
}
var
mode
=
$
.
ikm
?
"topcam"
:
"aimdfm"
;
var
IKM
=
$
.
ikm
;
if
(
IKM
==
undefined
)
{
IKM
=
require
(
'topcam.ikm6'
)(
$
)
}
var
GEN
=
$
.
gen
;
var
Job
=
$
.
job_name
;
var
db
=
$
.
db
;
var
GUI
=
$
.
gui
||
{}
;
var
Job
=
$
.
job
||
$
.
job_name
;
var
JobId
=
$
.
job_id
;
var
process
=
require
(
'process'
);
var
Status
=
'ok'
;
var
resultData
=
[];
var
PAR
=
{};
if
(
$
.
hasOwnProperty
(
'script_parameter'
)){
var
db
=
$
.
db
||
{}
var
PAR
=
{}
if
(
$
.
par
)
{
PAR
=
$
.
par
}
else
if
(
$
.
hasOwnProperty
(
'script_parameter'
)){
PAR
=
JSON
.
parse
(
$
.
script_parameter
);
}
if
(
mode
===
"aimdfm"
)
{
var
database
=
require
(
"topsin.database"
);
database
.
addConnection
(
$
.
conf
.
database_conf
,
"DFM"
);
var
QDfm
=
database
.
query
(
"DFM"
);
$
.
QDfm
=
QDfm
;
if
(
$
.
conf
.
product_type
==
"aimdfm"
)
{
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
current_process_title
:
$
.
process_title
},
where
:
{
id
:
$
.
task_id
}
});
}
}
var
Status
=
'ok'
;
var
resultData
=
[];
try
{
var
job
=
Job
.
toLowerCase
()
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
var
sm
=
Object
.
keys
(
matrix
).
filter
(
function
(
v
){
var
item
=
matrix
[
v
]
return
item
.
context
==
"board"
&&
item
.
layer_type
==
"solder_mask"
})
GEN
.
openStep
({
job
:
job
,
name
:
"cad"
})
sm
.
forEach
(
function
(
layer
){
GEN
.
PAUSE
(
layer
)
var
info
=
GEN
.
copperArea
({
layer
:
layer
})
GEN
.
PAUSE
(
_
.
toString
(
info
))
})
var
path
=
GEN
.
getJobPath
({
job
:
Job
})
console
.
log
(
"----------------path---------------"
);
console
.
log
(
path
);
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
33.33
},
where
:
{
id
:
$
.
task_id
}
});
if
(
GEN
.
hasError
())
{
Status
=
'error'
;
resultData
.
push
({
type
:
"error"
,
title
:
"GEN错误!"
,
detail
:
[{
desc
:
_
.
join
(
GEN
.
STATUS
,
"
\n
"
)
}]
});
return
{
status
:
Status
,
result_data
:
resultData
};
}
else
{
resultData
.
push
({
type
:
"info"
,
title
:
"操作完成, 请注意检查!"
});
return
{
status
:
Status
,
result_data
:
resultData
};
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
33.33
},
where
:
{
id
:
$
.
task_id
}
});
if
(
GEN
.
hasError
())
{
Status
=
'error'
;
resultData
.
push
({
type
:
"error"
,
title
:
"GEN错误!"
,
detail
:
[{
desc
:
_
.
join
(
GEN
.
STATUS
,
"
\n
"
)
}]
});
return
{
status
:
Status
,
result_data
:
resultData
};
}
else
{
resultData
.
push
({
type
:
"info"
,
title
:
"操作完成, 请注意检查!"
});
return
{
status
:
Status
,
result_data
:
resultData
};
}
}
else
{
return
"Done"
}
}
catch
(
e
)
{
}
catch
(
e
)
{
Status
=
'error'
;
resultData
.
push
({
type
:
"error"
,
title
:
"脚本执行出错!"
,
detail
:
[{
desc
:
_
.
toString
(
e
)}]});
return
{
status
:
Status
,
result_data
:
resultData
}
;
resultData
.
push
({
type
:
"error"
,
title
:
"脚本执行出错!"
,
detail
:
[{
desc
:
_
.
toString
(
e
)}]});
return
(
mode
===
"aimdfm"
)
?
{
status
:
Status
,
result_data
:
resultData
}
:
"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