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
b7f23e92
Commit
b7f23e92
authored
Mar 12, 2021
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scott
parent
2014f1f6
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
405 additions
and
158 deletions
+405
-158
gui.js
GUI测试/gui.js
+0
-0
x.js
GUI测试/x.js
+22
-14
ATS_AIM_customer_data_analysis.js
ats/topcam/ATS_AIM_customer_data_analysis.js
+55
-36
ATS_AIM_data_format.js
ats/topcam/ATS_AIM_data_format.js
+90
-33
ATS_AIM_data_input.js
ats/topcam/ATS_AIM_data_input.js
+88
-30
config_ats.js
ats/topcam/config_ats.js
+3
-2
input_jsc.jsc
ats/topcam/input_jsc.jsc
+0
-0
ZDA_PNL_run_map.pl
public_script/板框/ZDA_PNL_run_map.pl
+0
-0
ZDA_PNL_run_overlay.pl
public_script/板框/ZDA_PNL_run_overlay.pl
+0
-0
template.js
template.js
+146
-43
1.js
需求/1.js
+1
-0
No files found.
GUI测试/gui.js
View file @
b7f23e92
GUI测试/x.js
View file @
b7f23e92
...
@@ -7,19 +7,29 @@ function gen() {
...
@@ -7,19 +7,29 @@ function gen() {
console
.
log
(
"pause"
);
console
.
log
(
"pause"
);
}
}
}
}
var
str
=
"-------
\n
xxxx xxxx
\n
aslkdankdassadddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
gui
.
setLang
(
"zhtw"
);
// zhcn, zhtw, en
gui
.
setLang
(
"zhtw"
);
// zhcn, zhtw, en
var
r
=
gui
.
msgBox
({
// var r = gui.msgBox({
title
:
"info"
,
// title: "info",
icon
:
"info"
,
// icon: "info",
text
:
"are you ok?"
,
// text: str,
buttons
:
[
"Ok"
,
"Cancel"
],
// buttons: ["Ok", "Cancel"],
// gen: new gen()
// });
// console.log(r);
// r = gui.confirm(str, "");
x
=
gui
.
debug
({
title
:
" 检查"
,
text
:
str
,
defaultsize
:
[
800
,
600
],
size
:
[
800
,
600
],
gen
:
new
gen
()
gen
:
new
gen
()
});
});
console
.
log
(
r
);
r
=
gui
.
confirm
(
"are you ok?"
,
""
);
/*
console.log(r);
console.log(r);
var selected = gui.selectFromTreeview({
var selected = gui.selectFromTreeview({
title: "test",
title: "test",
...
@@ -416,12 +426,7 @@ r = gui.selectJobLayer({
...
@@ -416,12 +426,7 @@ r = gui.selectJobLayer({
console.log(r);
console.log(r);
x
=
gui
.
debug
({
title
:
"debug"
,
text
:
"ciao"
,
size
:
[
400
,
300
],
gen
:
new
gen
()
});
var DB = require('topsin.database');
var DB = require('topsin.database');
DB.addConnection({
DB.addConnection({
...
@@ -445,3 +450,5 @@ x = gui.showSendMail({
...
@@ -445,3 +450,5 @@ x = gui.showSendMail({
console.log(x);
console.log(x);
*/
\ No newline at end of file
ats/topcam/ATS_AIM_customer_data_analysis.js
View file @
b7f23e92
This diff is collapsed.
Click to expand it.
ats/topcam/ATS_AIM_data_format.js
View file @
b7f23e92
...
@@ -102,9 +102,8 @@ try {
...
@@ -102,9 +102,8 @@ try {
if
(
cam_workflow_info
&&
cam_workflow_info
!=
""
){
if
(
cam_workflow_info
&&
cam_workflow_info
!=
""
){
throw
cam_workflow_info
throw
cam_workflow_info
}
}
script_info
({
msg
:
"Data formatting"
,
result_severity
:
"info"
})
script_info
({
msg
:
"Data formatting"
,
result_severity
:
"info"
,
progress
:
35
})
global
.
_ERRORMAG
=
"Failed to data format"
;
global
.
_ERRORMAG
=
"Failed to data format"
;
script_info
({
progress
:
35
})
var
par
=
PAR
;
var
par
=
PAR
;
if
(
!
par
.
hasOwnProperty
(
"config_path"
)
||
par
.
config_path
==
""
){
if
(
!
par
.
hasOwnProperty
(
"config_path"
)
||
par
.
config_path
==
""
){
console
.
log
(
"=========== ===cfg"
);
console
.
log
(
"=========== ===cfg"
);
...
@@ -261,20 +260,20 @@ try {
...
@@ -261,20 +260,20 @@ try {
var
format_cfg
=
config
.
data_format
// 拿到数据标准化配置
var
format_cfg
=
config
.
data_format
// 拿到数据标准化配置
// 排序和设属性
// 排序和设属性
script_info
({
progress
:
40
})
script_info
({
progress
:
40
,
msg
:
"Sort layer"
,
result_severity
:
"info"
})
var
ret
=
sortLayer
({
job
:
job
,
rule
:
format_cfg
,
matrix
:
tl_name_matrix
})
var
ret
=
sortLayer
({
job
:
job
,
rule
:
format_cfg
,
matrix
:
tl_name_matrix
})
if
(
ret
.
err
){
throw
err
}
if
(
ret
.
err
){
throw
err
}
var
after_sort_matrix
=
ret
.
sortNames
var
after_sort_matrix
=
ret
.
sortNames
// 改名
// 改名
script_info
({
msg
:
"Change the name"
,
result_severity
:
"info"
})
script_info
({
msg
:
"Change the name"
,
result_severity
:
"info"
,
progress
:
50
})
global
.
_ERRORMAG
=
"Failed to change name"
;
global
.
_ERRORMAG
=
"Failed to change name"
;
script_info
({
progress
:
50
})
var
tmp_step
=
GEN
.
getStepList
({
job
:
job
})
GEN
.
openStep
({
job
:
job
,
name
:
tmp_step
[
0
]})
err
=
reName
({
job
:
job
,
matrix
:
after_sort_matrix
,
cfg
:
format_cfg
})
err
=
reName
({
job
:
job
,
matrix
:
after_sort_matrix
,
cfg
:
format_cfg
})
if
(
err
){
throw
err
}
if
(
err
){
throw
err
}
// 处理 yu cca ftdrillx-x-np
// 处理 yu cca ftdrillx-x-np
var
tmp_step
=
GEN
.
getStepList
({
job
:
job
})
GEN
.
openStep
({
job
:
job
,
name
:
tmp_step
[
0
]})
var
layers
=
Object
.
keys
(
GEN
.
getMatrix
({
job
:
job
}))
var
layers
=
Object
.
keys
(
GEN
.
getMatrix
({
job
:
job
}))
layers
.
forEach
(
function
(
layer
)
{
layers
.
forEach
(
function
(
layer
)
{
if
(
/^ftdrill
(\d
+
)
-
(\d
+
)
-np$/ig
.
test
(
layer
))
{
if
(
/^ftdrill
(\d
+
)
-
(\d
+
)
-np$/ig
.
test
(
layer
))
{
...
@@ -379,6 +378,37 @@ try {
...
@@ -379,6 +378,37 @@ try {
GEN
.
closeStep
()
GEN
.
closeStep
()
}
}
// 新增规则 通孔层小于 0.15mm的孔移到每一层镭射层
var
pcs_step
=
GEN
.
getStepList
({
job
:
job
})[
0
];
GEN
.
openStep
({
job
:
job
,
name
:
pcs_step
})
if
(
GEN
.
isLayerExists
({
job
:
job
,
layer
:
"ftdrill"
})){
GEN
.
workLayer
({
name
:
"ftdrill"
,
display_number
:
2
,
clear_before
:
'yes'
})
var
syms_tmp
=
GEN
.
getLayerSymsHist
({
job
:
job
,
step
:
pcs_step
,
layer
:
'ftdrill'
});
var
laser_sym
=
[];
for
(
var
key
in
syms_tmp
)
{
var
syms_info
=
syms_tmp
[
key
];
if
(
syms_info
.
size
&&
syms_info
.
size
<=
5.906
){
laser_sym
.
push
(
key
)
}
}
if
(
laser_sym
.
length
){
_
.
values
(
matrix
).
forEach
(
function
(
v
){
if
(
v
.
context
==
"board"
&&
v
.
layer_type
==
"drill"
&&
v
.
type
==
"laser_drill"
){
GEN
.
selectByFilter
({
include_syms
:
laser_sym
.
join
(
"
\\
;"
)})
if
(
GEN
.
getSelectCount
()
>
0
)
{
GEN
.
selCopyOther
({
dest
:
'layer_name'
,
target_layer
:
v
.
name
,
invert
:
'no'
,
dx
:
0
,
dy
:
0
,
size
:
0
})
}
}
});
GEN
.
selectByFilter
({
include_syms
:
laser_sym
.
join
(
"
\\
;"
)})
if
(
GEN
.
getSelectCount
()
>
0
)
{
GEN
.
selDelete
()
}
}
}
GEN
.
closeStep
()
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
return
q
.
selectValue
({
return
q
.
selectValue
({
table
:
'pdm_job'
,
table
:
'pdm_job'
,
...
@@ -395,15 +425,26 @@ try {
...
@@ -395,15 +425,26 @@ try {
GEN
.
closeJob
({
job
:
job
});
GEN
.
closeJob
({
job
:
job
});
GEN
.
COM
(
"open_job,job="
+
job
);
GEN
.
COM
(
"open_job,job="
+
job
);
script_info
({
msg
:
"Creating Profile"
,
result_severity
:
"info"
})
script_info
({
msg
:
"Creating Profile"
,
result_severity
:
"info"
,
progress
:
55
})
global
.
_ERRORMAG
=
"Failed to create profile"
;
global
.
_ERRORMAG
=
"Failed to create profile"
;
script_info
({
progress
:
55
})
var
all_layer
=
Object
.
keys
(
GEN
.
getMatrix
({
job
:
job
}));
var
all_layer
=
Object
.
keys
(
GEN
.
getMatrix
({
job
:
job
}));
// 没有outline层
// 没有outline层
// 判断有没有profile
// 判断有没有profile
var
tmp_step
=
GEN
.
getStepList
({
job
:
job
})[
0
]
var
tmp_step
=
GEN
.
getStepList
({
job
:
job
})[
0
]
;
GEN
.
openStep
({
job
:
job
,
name
:
tmp_step
})
GEN
.
openStep
({
job
:
job
,
name
:
tmp_step
})
if
(
!
hasProfle
({
job
:
job
,
step
:
tmp_step
})){
// 如果没有profile
if
(
!
hasProfle
({
job
:
job
,
step
:
tmp_step
})){
// 如果没有profile
if
(
/^2171$/ig
.
test
(
par
.
customer
)){
if
(
/^2171$/ig
.
test
(
par
.
customer
)){
// 看看有没有 outline 层或者rout层
// 看看有没有 outline 层或者rout层
...
@@ -680,14 +721,20 @@ catch (e) {
...
@@ -680,14 +721,20 @@ catch (e) {
}
}
function
checkIn
(){
function
checkIn
(){
GEN
.
COM
(
"open_job,job="
+
Job
+
",open_win=no,disk_map=,job_map="
)
db
.
query
(
""
,
function
(
q
){
GEN
.
AUX
(
"set_group,group=99"
)
return
q
.
insertRow
({
GEN
.
COM
(
"close_job,job="
+
Job
+
""
)
table
:
'pdm_aimdfm_task'
,
GEN
.
COM
(
"disp_on"
)
data
:{
GEN
.
COM
(
"origin_on"
)
job_id
:
JobId
,
GEN
.
COM
(
"disp_on"
)
flow_id
:
13
,
GEN
.
COM
(
"origin_on"
)
task_title
:
Job
+
":checkin"
,
GEN
.
COM
(
"checkin_closed_job,job="
+
Job
);
status
:
'waiting'
,
user_name
:
"Admin"
,
user_id
:
1
}
})
});
}
}
function
tlNameMatrix
(
props
){
// 设置标准名
function
tlNameMatrix
(
props
){
// 设置标准名
...
@@ -717,6 +764,7 @@ function tlNameMatrix(props){ // 设置标准名
...
@@ -717,6 +764,7 @@ function tlNameMatrix(props){ // 设置标准名
if
(
/^comp_
\+
_/
.
test
(
key
)){
if
(
/^comp_
\+
_/
.
test
(
key
)){
return
_
.
assign
(
val
,{
tl_name
:
key
})
return
_
.
assign
(
val
,{
tl_name
:
key
})
}
}
IKM
.
save_layerinfo
({
jobid
:
JobId
,
layer
:
key
,
layerinfohash
:
{
layer_name_final
:
key
}})
return
val
return
val
}
}
for
(
var
i
=
0
;
i
<
tlRule
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
tlRule
.
length
;
i
++
){
...
@@ -872,7 +920,7 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
...
@@ -872,7 +920,7 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
var job = props.job
var job = props.job
var matrix = props.matrix
var matrix = props.matrix
var cfg = props.cfg
var cfg = props.cfg
var step = GEN.getStepList({job:job})[0]
matrix = matrix.filter(function(v){
matrix = matrix.filter(function(v){
if(v.name == v.new_name){
if(v.name == v.new_name){
IKM.save_layerinfo({ jobid: JobId, layer: v.name, layerinfohash: { layer_name_final: v.new_name }})
IKM.save_layerinfo({ jobid: JobId, layer: v.name, layerinfohash: { layer_name_final: v.new_name }})
...
@@ -887,7 +935,10 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
...
@@ -887,7 +935,10 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
if(new_name && new_name!="" && new_name != v.name && layers_tmp.indexOf(new_name) < 0){
if(new_name && new_name!="" && new_name != v.name && layers_tmp.indexOf(new_name) < 0){
IKM.save_layerinfo({ jobid: JobId, layer: v.name, layerinfohash: { layer_name_final: new_name }})
IKM.save_layerinfo({ jobid: JobId, layer: v.name, layerinfohash: { layer_name_final: new_name }})
tmp.push(v.name + "
----
" +new_name)
tmp.push(v.name + "
----
" +new_name)
GEN.renameLayer({job:job,layer:v.name,new_name:new_name})
GEN.copyLayer({source_job:job,source_step:step,source_layer:v.name,dest_layer:v.name+"
_bk
",mode:"
replace
"})
GEN.renameLayer({job:job,layer:v.name,new_name:new_name});
return false
return false
} else {
} else {
return true
return true
...
@@ -948,6 +999,9 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
...
@@ -948,6 +999,9 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
var layers_tmp = Object.keys(GEN.getMatrix({job:job}));
var layers_tmp = Object.keys(GEN.getMatrix({job:job}));
if(v.orig_name !== v.new_name && layers_tmp.indexOf(v.new_name) < 0){
if(v.orig_name !== v.new_name && layers_tmp.indexOf(v.new_name) < 0){
IKM.save_layerinfo({ jobid: JobId, layer: v.orig_name, layerinfohash: { layer_name_final: v.new_name }})
IKM.save_layerinfo({ jobid: JobId, layer: v.orig_name, layerinfohash: { layer_name_final: v.new_name }})
GEN.copyLayer({source_job:job,source_step:step,source_layer:v.orig_name,dest_layer:v.orig_name+"
_bk
",mode:"
replace
"})
GEN.renameLayer({job:job,layer:v.orig_name,new_name:v.new_name})
GEN.renameLayer({job:job,layer:v.orig_name,new_name:v.new_name})
}
}
});
});
...
@@ -957,6 +1011,7 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
...
@@ -957,6 +1011,7 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
var afterMatrix = GEN.getMatrix({job:job});
var afterMatrix = GEN.getMatrix({job:job});
var signals = Object.keys(afterMatrix).filter(function(v){return afterMatrix[v].layer_type=="
signal
" && afterMatrix[v].context=="
board
"})
var signals = Object.keys(afterMatrix).filter(function(v){return afterMatrix[v].layer_type=="
signal
" && afterMatrix[v].context=="
board
"})
signals = signals.sort(function(a,b){return afterMatrix[a].row - afterMatrix[b].row})
signals = signals.sort(function(a,b){return afterMatrix[a].row - afterMatrix[b].row})
if(signals.length > 0){
var topSignal = signals[0]
var topSignal = signals[0]
var botSignal = signals[signals.length -1]
var botSignal = signals[signals.length -1]
if(topSignal !== "
top
"){
if(topSignal !== "
top
"){
...
@@ -971,6 +1026,7 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
...
@@ -971,6 +1026,7 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
GEN.renameLayer({job:job,layer:botSignal,new_name:"
bottom
"})
GEN.renameLayer({job:job,layer:botSignal,new_name:"
bottom
"})
}
}
}
}
}
}
}
function mergeLaser(props){ // 合并钻孔
function mergeLaser(props){ // 合并钻孔
...
@@ -1222,3 +1278,4 @@ function hasProfle(props) {
...
@@ -1222,3 +1278,4 @@ function hasProfle(props) {
var now_profile = GEN.getProfile({job:props.job, step:props.step})
var now_profile = GEN.getProfile({job:props.job, step:props.step})
return now_profile && now_profile.match(/
\n
/ig) && now_profile.match(/
\n
/ig).length != 1
return now_profile && now_profile.match(/
\n
/ig) && now_profile.match(/
\n
/ig).length != 1
}
}
ats/topcam/ATS_AIM_data_input.js
View file @
b7f23e92
...
@@ -190,15 +190,19 @@ try {
...
@@ -190,15 +190,19 @@ try {
}
else
{
}
else
{
jobFiles
=
fs
.
listDir
(
jobFile
[
0
].
path
)
jobFiles
=
fs
.
listDir
(
jobFile
[
0
].
path
)
}
}
// GEN.COM("config_edit,name=iol_gbr_polygon_break,value=1,mode=user")
// 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")
// GEN.COM("config_edit,name=iol_fix_ill_polygon,value=yes,mode=user")
// 将jobFile下的zip解压
// 将jobFile下的zip解压
script_info
({
msg
:
"unzip the file"
,
result_severity
:
"info"
})
script_info
({
msg
:
"unzip the file"
,
result_severity
:
"info"
})
global
.
_ERRORMAG
=
"Failed to unzip the file"
;
global
.
_ERRORMAG
=
"Failed to unzip the file"
;
decompression
(
jobFile
[
0
].
path
,
[]);
changePath2
(
jobFile
[
0
].
path
)
var
change_files
=
[];
decompression
(
jobFile
[
0
].
path
,
[],
change_files
);
changePath2
(
jobFile
[
0
].
path
);
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
return
q
.
selectValue
({
return
q
.
selectValue
({
...
@@ -219,8 +223,7 @@ try {
...
@@ -219,8 +223,7 @@ try {
})
})
});
});
jobFiles
=
fs
.
listDir
(
jobFile
[
0
].
path
);
jobFiles
=
fs
.
listDir
(
jobFile
[
0
].
path
)
// 分析料号文件 得到料号导入信息 导入类型
// 分析料号文件 得到料号导入信息 导入类型
var
jobInfo
=
analyJobFiles
({
jobFiles
:
jobFiles
.
filter
(
function
(
v
){
return
v
.
isFile
}),
custCfg
:
custCfg
,
config
:
config
,
job
:
job
})
var
jobInfo
=
analyJobFiles
({
jobFiles
:
jobFiles
.
filter
(
function
(
v
){
return
v
.
isFile
}),
custCfg
:
custCfg
,
config
:
config
,
job
:
job
})
...
@@ -230,8 +233,7 @@ try {
...
@@ -230,8 +233,7 @@ try {
throw
"file error"
}
throw
"file error"
}
var
importOk
=
false
;
// 是否成功导入
var
importOk
=
false
;
// 是否成功导入
script_info
({
progress
:
10
});
script_info
({
progress
:
10
,
result_severity
:
"ok"
,
msg
:
""
});
script_info
({
result_severity
:
"ok"
})
if
(
/odb/ig
.
test
(
jobInfo
.
type
)){
// odb导入
if
(
/odb/ig
.
test
(
jobInfo
.
type
)){
// odb导入
script_info
({
msg
:
"Import odb++"
,
result_severity
:
"error"
});
script_info
({
msg
:
"Import odb++"
,
result_severity
:
"error"
});
...
@@ -379,9 +381,27 @@ try {
...
@@ -379,9 +381,27 @@ try {
}
}
importOk
=
true
importOk
=
true
}
}
// [{
// "ori_dirname": "/home/toplinker/samba/1352/13520028_128/TLK0802/1streceived20200422/zip_custom0",
// "dirname": "/home/toplinker/samba/1352/13520028_128/TLK0802/1streceived20200422/custom1615366305861",
// "newpath": "/home/toplinker/samba/1352/13520028_128/TLK0802/1streceived20200422/custom1615366305861.zip"
// }, {
// "ori_dirname": "/home/toplinker/samba/1352/13520028_128/TLK0802/1streceived20200422/custom1615366305861/sh1scmnrlmSMD_VB",
// "dirname": "/home/toplinker/samba/1352/13520028_128/TLK0802/1streceived20200422/custom1615366305861/custom1615366305954",
// "newpath": "/home/toplinker/samba/1352/13520028_128/TLK0802/1streceived20200422/custom1615366305861/custom1615366305954.zip"
// }]
change_files
.
reverse
().
forEach
(
function
(
item
){
fs
.
unlink
(
item
.
newpath
);
if
(
fs
.
exists
(
item
.
ori_dirname
)){
fs
.
rename
(
item
.
ori_dirname
,
item
.
ori_dirname
+
"_bk"
);
}
fs
.
rename
(
item
.
dirname
,
item
.
ori_dirname
);
})
if
(
!
importOk
){
throw
"import error"
}
if
(
!
importOk
){
throw
"import error"
}
script_info
({
progress
:
20
})
script_info
({
result_severity
:
"ok"
})
script_info
({
progress
:
20
,
result_severity
:
"ok"
,
msg
:
""
});
global
.
_ERRORMAG
=
null
;
global
.
_ERRORMAG
=
null
;
reNameStep
(
job
)
reNameStep
(
job
)
...
@@ -408,6 +428,7 @@ try {
...
@@ -408,6 +428,7 @@ try {
GEN
.
openStep
({
job
:
job
,
name
:
steplist
[
0
]})
GEN
.
openStep
({
job
:
job
,
name
:
steplist
[
0
]})
// 额外操作
// 额外操作
if
(
custCfg
.
extra
)
{
if
(
custCfg
.
extra
)
{
global
.
_extra
=
true
;
custCfg
.
extra
.
forEach
(
function
(
item
){
custCfg
.
extra
.
forEach
(
function
(
item
){
var
props
=
{
var
props
=
{
type
:
jobInfo
.
type
,
type
:
jobInfo
.
type
,
...
@@ -436,8 +457,7 @@ try {
...
@@ -436,8 +457,7 @@ try {
import_html
+=
"</table>"
import_html
+=
"</table>"
// name type date user
// name type date user
resultData
.
push
({
type
:
"info"
,
title
:
"导入资料列表"
,
detail
:
[{
desc
:
import_html
}]
})
resultData
.
push
({
type
:
"info"
,
title
:
"导入资料列表"
,
detail
:
[{
desc
:
import_html
}]
})
script_info
({
msg
:
"Data Readin"
})
script_info
({
msg
:
"Data Readin"
,
result_severity
:
"ok"
})
script_info
({
result_severity
:
"ok"
})
if
(
mode
===
"aimdfm"
)
{
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
$
.
QDfm
.
updateRow
({
...
@@ -466,7 +486,7 @@ try {
...
@@ -466,7 +486,7 @@ try {
}
}
}
}
catch
(
e
)
{
catch
(
e
)
{
script_info
({
result_severity
:
"error"
})
script_info
({
result_severity
:
"error"
,
msg
:
""
})
if
(
global
.
_ERRORMAG
){
if
(
global
.
_ERRORMAG
){
script_info
({
msg
:
global
.
_ERRORMAG
});
script_info
({
msg
:
global
.
_ERRORMAG
});
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
...
@@ -607,8 +627,8 @@ function now(){
...
@@ -607,8 +627,8 @@ function now(){
function
reNameStep
(
job
)
{
function
reNameStep
(
job
)
{
var
stepList
=
GEN
.
getStepList
({
job
:
job
})
var
stepList
=
GEN
.
getStepList
({
job
:
job
})
if
(
!
stepList
){
return
}
if
(
!
stepList
){
return
}
var
pcs
=
[]
var
pcs
=
[]
;
var
arr
=
[]
var
arr
=
[]
;
stepList
.
forEach
(
function
(
v
){
stepList
.
forEach
(
function
(
v
){
if
(
v
){
if
(
v
){
if
(
v
===
"cad"
){
if
(
v
===
"cad"
){
...
@@ -644,23 +664,33 @@ function script_info(props){ // result_severity progress
...
@@ -644,23 +664,33 @@ function script_info(props){ // result_severity progress
}
}
}
}
function
decompression
(
path
,
zips
)
{
function
decompression
(
path
,
zips
,
change_files
)
{
var
files
=
fs
.
listDir
(
path
)
var
files
=
fs
.
listDir
(
path
)
var
count
=
0
;
var
zipfiles
=
files
.
filter
(
function
(
item
){
var
zipfiles
=
files
.
filter
(
function
(
item
){
if
(
/zip/ig
.
test
(
item
.
suffix
)
||
item
.
suffix
==
"rar"
||
item
.
suffix
==
"7z"
||
item
.
suffix
==
"ZIP"
)
{
if
(
/zip/ig
.
test
(
item
.
suffix
)
||
item
.
suffix
==
"rar"
||
item
.
suffix
==
"7z"
)
{
inputState
.
push
(
item
.
suffix
);
inputState
.
push
(
item
.
suffix
);
console
.
log
(
"--->path:"
+
item
.
path
)
console
.
log
(
"--->path:"
+
item
.
path
)
if
(
zips
.
indexOf
(
item
.
path
)
<
0
){
if
(
zips
.
indexOf
(
item
.
path
)
<
0
){
zips
.
push
(
item
.
path
);
zips
.
push
(
item
.
path
);
if
(
item
.
name
.
length
>=
30
&&
!
/�|
\?
/
.
test
(
item
.
name
))
{
//if(item.name.length >= 30 && !/�|\?/.test(item.name)) {
var
mvname
=
"custom"
+
count
+
"."
+
item
.
suffix
;
if
(
/
[^\d
a-zA-Z_
]
/
.
test
(
item
.
name
)){
count
++
;
var
tmp_code
=
new
Date
().
getTime
()
fs
.
rename
(
item
.
path
,
item
.
dir
+
"/"
+
mvname
);
var
ori_dirname
=
item
.
path
.
replace
(
/
\.(
zipx|zip|7z|rar
)
$/ig
,
""
);
item
.
path
=
item
.
dir
+
"/"
+
mvname
var
mvname
=
"custom"
+
tmp_code
+
"."
+
item
.
suffix
;
// fs.rename(item.path, item.dir + "/" + mvname);
fs
.
copyFile
(
item
.
path
,
item
.
dir
+
"/"
+
mvname
,
true
);
item
.
path
=
item
.
dir
+
"/"
+
mvname
;
change_files
.
push
({
ori_dirname
:
ori_dirname
,
dirname
:
item
.
path
.
replace
(
/
\.(
zipx|zip|7z|rar
)
$/ig
,
""
),
newpath
:
item
.
path
// 后续删除
})
zips
.
push
(
item
.
path
);
}
}
var
dir_name
=
item
.
path
.
replace
(
/
\.(
zipx|zip|7z|rar
)
$/ig
,
""
);
var
dir_name
=
item
.
path
.
replace
(
/
\.(
zipx|zip|7z|rar
)
$/ig
,
""
);
autoUn
(
item
.
path
,
dir_name
);
autoUn
(
item
.
path
,
dir_name
,
item
.
dir
);
return
true
return
true
}
}
}
}
...
@@ -675,13 +705,13 @@ function decompression(path, zips) {
...
@@ -675,13 +705,13 @@ function decompression(path, zips) {
// }
// }
return
false
return
false
})
})
if
(
zipfiles
.
length
)
{
decompression
(
path
,
zips
)}
if
(
zipfiles
.
length
)
{
decompression
(
path
,
zips
,
change_files
)}
}
}
function
changePath
(
path
)
{
function
changePath
(
path
)
{
return
path
.
replace
(
/
[^/]
+
\/
/ig
,
function
(
v
){
return
path
.
replace
(
/
[^/]
+
\/
/ig
,
function
(
v
){
if
(
v
.
length
>=
10
&&
/
\s
/ig
.
test
(
v
))
{
if
(
v
.
length
>=
10
&&
/
\s
/ig
.
test
(
v
))
{
v
=
v
.
replace
(
" "
,
"
\\
"
)
v
=
v
.
replace
(
" "
,
"
\\
"
)
;
return
v
.
slice
(
0
,
6
)
+
"~1/"
return
v
.
slice
(
0
,
6
)
+
"~1/"
}
else
{
}
else
{
return
v
return
v
...
@@ -689,13 +719,41 @@ function changePath(path) {
...
@@ -689,13 +719,41 @@ function changePath(path) {
})
})
}
}
function
autoUn
(
path
,
dirname
)
{
function
autoUn
(
path
,
dirname
,
dir
)
{
// 解压密码逻辑 先获取 /home/toplinker/samba/unzip_pwd.txt
var
pw
=
"/home/toplinker/samba/unzip_pwd.txt"
;
var
pws
=
fs
.
readFile
(
pw
);
var
strs
=
pws
.
split
(
"
\n
"
)
var
ret
=
{};
strs
.
map
(
function
(
v
)
{
var
tmp
=
v
.
split
(
/
\s
+/
);
ret
[
tmp
[
0
].
trim
()]
=
tmp
[
1
].
trim
()
});
var
pwd
;
if
(
ret
[
Job
]){
pwd
=
ret
[
Job
]
}
if
(
fs
.
exists
(
dir
+
"/pw.txt"
)){
pwd
=
fs
.
readFile
(
dir
+
"/pw.txt"
);
}
if
(
/
\.
rar$/
.
test
(
path
)){
if
(
/
\.
rar$/
.
test
(
path
)){
fs
.
mkdir
(
dirname
)
fs
.
mkdir
(
dirname
);
if
(
pwd
){
process
.
exec
(
'/opt/rar/unrar'
,
[
'x'
,
path
,
dirname
,
"-o+"
,
"-p"
+
pwd
])
}
else
{
process
.
exec
(
'/opt/rar/unrar'
,
[
'x'
,
path
,
dirname
,
"-o+"
])
process
.
exec
(
'/opt/rar/unrar'
,
[
'x'
,
path
,
dirname
,
"-o+"
])
}
}
else
{
if
(
pwd
){
process
.
exec
(
'/usr/local/lib/p7zip/7za'
,
[
'x'
,
path
,
"-o"
+
dirname
,
"-aoa"
,
"-p"
+
pwd
])
}
else
{
}
else
{
process
.
exec
(
'/usr/local/lib/p7zip/7za'
,
[
'x'
,
path
,
"-o"
+
dirname
,
"-aoa"
])
process
.
exec
(
'/usr/local/lib/p7zip/7za'
,
[
'x'
,
path
,
"-o"
+
dirname
,
"-aoa"
])
}
}
}
}
}
function
exportInfo
(
info
){
function
exportInfo
(
info
){
...
@@ -721,9 +779,9 @@ function changePath2(filePath){
...
@@ -721,9 +779,9 @@ function changePath2(filePath){
newFileName
=
newFileName
.
replace
(
/
\?
/g
,
''
);
//去除文件名中?
newFileName
=
newFileName
.
replace
(
/
\?
/g
,
''
);
//去除文件名中?
var
newPath
=
tmp
[
i
].
path
.
replace
(
/^
(
.*
)\/[^\/]
*$/
,
"$1"
);
var
newPath
=
tmp
[
i
].
path
.
replace
(
/^
(
.*
)\/[^\/]
*$/
,
"$1"
);
if
(
tmp
[
i
].
path
!=
(
newPath
+
'/'
+
newFileName
)){
if
(
tmp
[
i
].
path
!=
(
newPath
+
'/'
+
newFileName
)){
fs
.
rmdir
(
newPath
+
'/'
+
newFileName
)
// fs.rmdir(newPath+'/'+newFileName)
// fs.rename(newPath+'/'+newFileName, newPath+'/'+newFileName+"_bk");
fs
.
rename
(
tmp
[
i
].
path
,
newPath
+
'/'
+
newFileName
);
fs
.
rename
(
tmp
[
i
].
path
,
newPath
+
'/'
+
newFileName
);
}
}
}
}
}
}
\ No newline at end of file
ats/topcam/config_ats.js
View file @
b7f23e92
...
@@ -639,11 +639,12 @@
...
@@ -639,11 +639,12 @@
var
step
=
props
.
step
;
var
step
=
props
.
step
;
fileInfo
.
forEach
(
function
(
item
){
fileInfo
.
forEach
(
function
(
item
){
var
layer
=
item
.
file
.
name
.
toLowerCase
().
split
(
" "
).
join
(
"-"
)
var
layer
=
item
.
file
.
name
.
toLowerCase
().
split
(
" "
).
join
(
"-"
)
var
path
=
item
.
file
.
path
var
path
=
item
.
file
.
path
var
filectx
=
fs
.
readFile
(
path
)
var
filectx
=
fs
.
readFile
(
path
)
var
tmp
=
filectx
.
match
(
/Holesize
\d\.
=
[\d\.]
+ Tolerance =
[\S]
+
[\S]
+
[\S]
+ Quantity =
\d
+
\n
/igm
)
var
tmp
=
filectx
.
match
(
/Holesize
\d\.
=
[\d\.]
+ Tolerance =
[\S]
+
[\S]
+
[\S]
+ Quantity =
\d
+
\n
/igm
)
if
(
tmp
&&
tmp
.
length
)
{
if
(
tmp
&&
tmp
.
length
)
{
var
units
=
"mm"
var
units
=
"mm"
;
var
res
=
tmp
.
map
(
function
(
v
,
i
)
{
var
res
=
tmp
.
map
(
function
(
v
,
i
)
{
var
tmp2
=
/Holesize
\d\.
=
([\d\.]
+
)
Tolerance =
([\S]
+
)
([\S]
+
)
([\S]
+
)
Quantity =
\d
+
\n
/igm
.
exec
(
v
);
var
tmp2
=
/Holesize
\d\.
=
([\d\.]
+
)
Tolerance =
([\S]
+
)
([\S]
+
)
([\S]
+
)
Quantity =
\d
+
\n
/igm
.
exec
(
v
);
if
(
/MILS/ig
.
test
(
tmp2
[
4
])){
if
(
/MILS/ig
.
test
(
tmp2
[
4
])){
...
@@ -682,7 +683,7 @@
...
@@ -682,7 +683,7 @@
})
})
GEN
.
COM
(
"tools_set,layer="
+
layer
+
",thickness=0,user_params=,slots=by_length"
)
GEN
.
COM
(
"tools_set,layer="
+
layer
+
",thickness=0,user_params=,slots=by_length"
)
}
}
})
})
;
GEN
.
saveJob
({
job
:
job
});
GEN
.
saveJob
({
job
:
job
});
}
}
}
}
...
...
ats/topcam/input_jsc.jsc
0 → 100644
View file @
b7f23e92
File added
public_script/板框/
TL
_PNL_run_map.pl
→
public_script/板框/
ZDA
_PNL_run_map.pl
View file @
b7f23e92
File moved
public_script/板框/
TL
_PNL_run_overlay.pl
→
public_script/板框/
ZDA
_PNL_run_overlay.pl
View file @
b7f23e92
File moved
template.js
View file @
b7f23e92
/*
/*
NAME:
NAME:
DESCRIPTION: ;
DESCRIPTION:
描述
;
PARAMETER:
PARAMETER:
[
[
{
{
name : 'step',
name : 'step',
title : 'step',
title : 'step',
type : 'LineEdit',
type : 'LineEdit',
property : {tool_tip : '目标step,默认是orig'}
,
property : {tool_tip : '目标step,默认是orig'}
},
},
{
{
name : 'auto_save',
name : 'auto_save',
...
@@ -24,7 +24,7 @@ PARAMETER:
...
@@ -24,7 +24,7 @@ PARAMETER:
]
]
VERSION_HISTORY:
VERSION_HISTORY:
V1.00 2021-0
2-19
Scott Sun
V1.00 2021-0
3-08
Scott Sun
1.新版本
1.新版本
HELP:
HELP:
...
@@ -40,22 +40,21 @@ PARAMETER:
...
@@ -40,22 +40,21 @@ PARAMETER:
<br>
<br>
</body></html>
</body></html>
*/
*/
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// 引入模块 包 外部参数
console
.
log
(
"==============================>template"
);
// 引入模块 包
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
mode
=
$
.
ikm
?
"topcam"
:
"aimdfm"
;
var
mode
=
$
.
ikm
?
"topcam"
:
"aimdfm"
;
var
IKM
=
$
.
ikm
;
var
IKM
=
$
.
ikm
?
$
.
ikm
:
require
(
'topcam.ikm6'
)(
$
);
if
(
IKM
==
undefined
)
{
IKM
=
require
(
'topcam.ikm6'
)(
$
)
}
var
GEN
=
$
.
gen
;
var
GEN
=
$
.
gen
;
var
Job
=
$
.
job
||
$
.
job_name
;
var
Job
=
$
.
job
||
$
.
job_name
;
var
JobId
=
$
.
job_id
;
var
JobId
=
$
.
job_id
;
var
db
=
$
.
db
||
IKM
.
db
var
db
=
$
.
db
||
IKM
.
db
;
var
PAR
=
{}
var
gui_piug
=
require
(
'topsin.gengui'
);
if
(
$
.
par
)
{
PAR
=
$
.
par
}
else
if
(
$
.
hasOwnProperty
(
'script_parameter'
)){
PAR
=
JSON
.
parse
(
$
.
script_parameter
);
}
var
GUI
=
gui_piug
.
newGui
(
gui_piug
.
__dirname
);
var
PAR
=
{};
if
(
$
.
par
)
{
PAR
=
$
.
par
}
else
if
(
$
.
hasOwnProperty
(
'script_parameter'
))
{
PAR
=
JSON
.
parse
(
$
.
script_parameter
);
}
if
(
mode
===
"aimdfm"
)
{
if
(
mode
===
"aimdfm"
)
{
var
database
=
require
(
"topsin.database"
);
var
database
=
require
(
"topsin.database"
);
database
.
addConnection
(
$
.
conf
.
database_conf
,
"DFM"
);
database
.
addConnection
(
$
.
conf
.
database_conf
,
"DFM"
);
...
@@ -67,37 +66,141 @@ if (mode === "aimdfm") {
...
@@ -67,37 +66,141 @@ if (mode === "aimdfm") {
}
}
var
Status
=
'ok'
;
var
Status
=
'ok'
;
var
resultData
=
[];
var
resultData
=
[];
var
par
=
PAR
;
var
par
=
PAR
;
// 接收参数
var
default_par
=
{
var
default_par
=
{
// 设置默认参数
step
:
"orig"
,
step
:
"orig"
,
auto_save
:
"No"
,
auto_save
:
"No"
,
units
:
"mm"
units
:
"mm"
}
for
(
var
key
in
default_par
)
{
if
(
!
par
.
hasOwnProperty
(
key
)
||
par
[
key
]
==
""
)
{
par
[
key
]
=
default_par
[
key
]
}
}
}
for
(
var
key
in
default_par
){
if
(
!
par
.
hasOwnProperty
(
key
)
||
par
[
key
]
==
""
){
par
[
key
]
=
default_par
[
key
]
}}
// 定义变量
var
job
=
Job
;
var
job
=
Job
;
try
{
try
{
if
(
_
.
isEmpty
(
job
)){
throw
"参数job不存在"
}
else
{
job
=
job
.
toLowerCase
()
}
// 常规验证 准备工作
if
(
!
GEN
.
isJobExists
({
job
:
job
})){
throw
"料号"
+
job
+
"不存在"
}
if
(
!
GEN
.
isJobOpen
({
job
:
job
})){
GEN
.
openJob
({
job
:
job
})
}
if
(
!
GEN
.
isJobExists
({
job
:
job
}))
{
throw
"料号"
+
job
+
"不存在"
}
if
(
mode
==
"aimdfm"
){
if
(
GEN
.
checkInout
({
job
:
job
,
mode
:
"test"
})
!=
0
){
throw
"the job check"
}
else
{
GEN
.
checkInout
({
job
:
job
,
mode
:
"out"
})
}
}
if
(
!
GEN
.
isJobOpen
({
job
:
job
}))
{
GEN
.
openJob
({
job
:
job
})
}
if
(
mode
==
"aimdfm"
)
{
if
(
GEN
.
checkInout
({
job
:
job
,
mode
:
"test"
})
!=
0
)
{
throw
"the job check"
}
GEN
.
checkInout
({
job
:
job
,
mode
:
"out"
});
}
// 主体
var
stepList
=
GEN
.
getStepList
({
job
:
job
})
// 工作step列表
stepList
=
stepList
.
filter
(
function
(
step
){
var
reg
=
new
RegExp
(
par
.
step
,
"ig"
);
return
reg
.
test
(
step
);
})
var
verification
=
function
(
size
)
{
return
size
<=
500
}
var
drills
=
getLayer
({
layer_type
:
"drill"
,
name
:
"drl"
})
stepList
.
forEach
(
function
(
step
)
{
GEN
.
openStep
({
job
:
job
,
name
:
step
});
GEN
.
clearLayers
();
//清除层显示
GEN
.
affectedLayer
({
mode
:
'all'
,
affected
:
'no'
});
//设置影响层全部不影响
GEN
.
COM
(
"sel_options,clear_mode=clear_after,display_mode=all_layers,area_inout=inside,area_select=select,select_mode=standard,area_touching_mode=exclude"
);
GEN
.
units
({
type
:
par
.
units
});
//单位初始化
GEN
.
zoomHome
();
//窗口显示回到原始位置
GEN
.
selClearFeature
()
drills
.
forEach
(
function
(
drl
)
{
GEN
.
workLayer
({
name
:
drl
,
display_number
:
2
,
clear_before
:
'yes'
})
var
sys
=
GEN
.
getLayerSymsHist
({
job
:
Job
,
step
:
'net'
,
layer
:
drl
,
units
:
'mm'
})
var
includesys
=
[];
// r700":{"symbol":"r700","line":"0","pad":"400","arc":"0","size":"700"},
Object
.
keys
(
sys
).
forEach
(
function
(
key
){
var
symbolinfo
=
sys
[
key
];
if
(
!
symbolinfo
.
size
&&
symbolinfo
.
width
){
symbolinfo
.
size
=
symbolinfo
.
width
>
symbolinfo
.
height
?
symbolinfo
.
width
:
symbolinfo
.
height
;
}
if
(
symbolinfo
.
size
){
symbolinfo
.
size
=
symbolinfo
.
size
-
0
;
if
(
verification
(
symbolinfo
.
size
)){
includesys
.
push
(
symbolinfo
.
symbol
)
}
}
})
if
(
includesys
.
length
){
GEN
.
selectByFilter
({
include_syms
:
includesys
.
join
(
";"
)})
if
(
GEN
.
getSelectCount
()
>
0
){
GEN
.
COM
(
"cur_atr_set,attribute=.drill,option=via"
)
GEN
.
COM
(
"sel_change_atr,mode=add"
)
}
}
})
})
console
.
log
(
"=================test=============="
);
// 保存
// 保存料号
if
(
/yes/ig
.
test
(
par
.
auto_save
)){
GEN
.
checkInout
({
job
:
job
,
mode
:
"out"
});
GEN
.
saveJob
({
job
:
job
});
GEN
.
checkInout
({
job
:
job
,
mode
:
"in"
});
GEN
.
closeJob
({
job
:
job
});}
else
{
GEN
.
checkInout
({
job
:
job
,
mode
:
"in"
})}
if
(
/yes/ig
.
test
(
par
.
auto_save
))
{
GEN
.
checkInout
({
job
:
job
,
mode
:
"out"
});
GEN
.
saveJob
({
job
:
job
});
}
GEN
.
checkInout
({
job
:
job
,
mode
:
"in"
});
// 结尾返回 固定写法
var
Return
=
"Done"
if
(
mode
===
"aimdfm"
)
{
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
100
},
where
:
{
id
:
$
.
task_id
}});
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
100
},
where
:
{
id
:
$
.
task_id
}
});
if
(
GEN
.
hasError
())
{
Status
=
'error'
;
resultData
.
push
({
type
:
"error"
,
title
:
"GEN错误!"
,
detail
:
[{
desc
:
_
.
join
(
GEN
.
STATUS
,
"
\n
"
)
}]
});
var
tmperr
=
{
type
:
"info"
,
title
:
"操作完成, 请注意检查!"
}
return
{
status
:
Status
,
result_data
:
resultData
};
if
(
GEN
.
hasError
())
{
}
else
{
resultData
.
push
({
type
:
"info"
,
title
:
"操作完成, 请注意检查!"
});
return
{
status
:
Status
,
result_data
:
resultData
};
}
Status
=
'error'
;
}
else
{
return
"Done"
}
tmperr
=
{
type
:
"error"
,
title
:
"GEN错误!"
,
detail
:
[{
desc
:
GEN
.
STATUS
.
join
(
"
\n
"
)
}]
}
}
resultData
.
push
(
tmperr
);
Return
=
{
status
:
Status
,
result_data
:
resultData
};
}
return
Return
}
catch
(
e
)
{
}
catch
(
e
)
{
if
(
GEN
.
STATUS
.
length
>
0
)
{
IKM
.
msg
(
GEN
.
STATUS
.
join
(
"
\n
"
));
}
IKM
.
msg
(
e
);
Status
=
'error'
;
resultData
.
push
({
type
:
"error"
,
title
:
"脚本执行出错!"
,
detail
:
[{
desc
:
_
.
toString
(
e
)
}]
});
return
(
mode
===
"aimdfm"
)
?
{
status
:
Status
,
result_data
:
resultData
}
:
"Error"
;
}
GEN
.
COM
(
"disp_on"
)
GEN
.
COM
(
"origin_on"
)
GEN
.
COM
(
"checkin_closed_job,job="
+
job
);
IKM
.
msg
(
_
.
join
(
GEN
.
STATUS
,
"
\n
"
));
IKM
.
msg
(
e
);
Status
=
'error'
;
function
getLayer
(
props
){
// 获取层
resultData
.
push
({
type
:
"error"
,
title
:
"脚本执行出错!"
,
detail
:
[{
desc
:
_
.
toString
(
e
)}]});
if
(
!
props
)
{
return
(
mode
===
"aimdfm"
)
?
{
status
:
Status
,
result_data
:
resultData
}
:
"Error"
;
return
}
if
(
!
props
.
context
)
{
props
.
context
=
"board"
}
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
return
Object
.
keys
(
matrix
).
reduce
(
function
(
a
,
b
){
var
info
=
matrix
[
b
];
var
ret
=
true
;
for
(
var
key
in
props
)
{
if
(
!
Array
.
isArray
(
props
[
key
]))
{
props
[
key
]
=
[
props
[
key
]]
}
if
(
info
[
key
]
&&
props
[
key
].
indexOf
(
info
[
key
])
<
0
)
{
ret
=
false
}
}
if
(
ret
)
{
a
.
push
(
props
.
res
==
"info"
?
info
:
b
)
}
return
a
},[])
}
}
\ No newline at end of file
需求/1.js
View file @
b7f23e92
...
@@ -31,6 +31,7 @@ try {
...
@@ -31,6 +31,7 @@ try {
if
(
!
GEN
.
isChklistExists
({
job
:
JOB
,
step
:
step
,
chklist
:
config
.
check
})){
if
(
!
GEN
.
isChklistExists
({
job
:
JOB
,
step
:
step
,
chklist
:
config
.
check
})){
GEN
.
COM
(
"chklist_from_lib,chklist="
+
config
.
check
);
// 不存在要从lib copy一个
GEN
.
COM
(
"chklist_from_lib,chklist="
+
config
.
check
);
// 不存在要从lib copy一个
}
}
GEN
.
chklistShow
({
chklist
:
config
.
check
})
GEN
.
chklistShow
({
chklist
:
config
.
check
})
_
.
forEach
(
config
.
nacts
,
function
(
nact
){
_
.
forEach
(
config
.
nacts
,
function
(
nact
){
GEN
.
chklistRun
({
chklist
:
config
.
check
,
nact
:
nact
})
// 运行checklist
GEN
.
chklistRun
({
chklist
:
config
.
check
,
nact
:
nact
})
// 运行checklist
...
...
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