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