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
62b678fa
Commit
62b678fa
authored
Jan 25, 2021
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
c52da11a
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
606 additions
and
1394 deletions
+606
-1394
test.js
GUI测试/test.js
+60
-20
ATS_AIM_customer_data_analysis.js
ats/topcam/ATS_AIM_customer_data_analysis.js
+294
-93
ATS_AIM_data_format.js
ats/topcam/ATS_AIM_data_format.js
+110
-70
ATS_AIM_data_input.js
ats/topcam/ATS_AIM_data_input.js
+74
-18
config_ats.js
ats/topcam/config_ats.js
+47
-45
config_ats.js
config_ats.js
+0
-1124
template.js
template.js
+21
-24
No files found.
GUI测试/test.js
View file @
62b678fa
var
plugin
=
require
(
'topsin.gengui'
);
var
gui
=
plugin
.
newGui
();
var
gui
=
plugin
.
newGui
(
plugin
.
__dirname
);
var
tmplayers
=
gui
.
selectLayer
({
title
:
'请选择需拼片原稿层'
,
// var tmplayers = gui.selectLayer({
// title: '请选择需拼片原稿层',
// layermatrix: {
// layer1: {
// context:"board",
// row: 1,
// name: "layer1",
// layer_type: "inner"
// },
// layer2: {
// context:"misc",
// row: 2,
// name: "layer2",
// layer_type: "outer"
// }
// },
// layertype: "_default",
// layertypelist: [{
// name: "_default",
// display_name: "_default",
// filter: function (x) {
// return true
// }
// }, ],
// selectmode: 'multiple',
// filter: ".*", // regular expression
// selectmode: "single", // single, multiple
// context: "all", // all, board, misc
// defaultsize: [600, 400], // window size
// gen:null
// });
// console.log(tmplayers);
r
=
gui
.
selectLayer
({
title
:
"+1s"
,
filter
:
".*"
,
// regular expression
selectmode
:
"single"
,
// single, multiple
// context: "all", // all, board, misc
// layertype: "inner", // default type of layertypelist
defaultsize
:
[
600
,
400
],
// window size
layermatrix
:
{
layer1
:
{
context
:
"board"
,
row
:
1
,
name
:
"layer1"
,
layer_type
:
"inner"
...
...
@@ -15,22 +59,18 @@ var tmplayers = gui.selectLayer({
row
:
2
,
name
:
"layer2"
,
layer_type
:
"outer"
}
},
layertype
:
"_default"
,
layertypelist
:
[{
name
:
"_default"
,
display_name
:
"_default"
,
filter
:
function
(
x
)
{
return
true
layer3
:
{
context
:
"misc"
,
row
:
3
,
name
:
"layer3"
,
layer_type
:
"inner"
}
},
],
selectmode
:
'multiple'
,
filter
:
".*"
,
// regular expression
selectmode
:
"single"
,
// single, multiple
context
:
"all"
,
// all, board, misc
defaultsize
:
[
600
,
400
],
// window size
gen
:
null
},
layertypelist
:
[
{
name
:
"inner"
,
display_name
:
"Inner"
,
filter
:
function
(
x
)
{
return
x
[
"layer_type"
]
===
"inner"
;
}},
{
name
:
"all"
,
display_name
:
"All"
,
filter
:
function
(
x
)
{
return
true
;
}},
{
name
:
"outer"
,
display_name
:
"Outer"
,
filter
:
function
(
x
)
{
return
x
[
"layer_type"
]
===
"outer"
;
}}
],
gen
:
null
});
\ No newline at end of file
console
.
log
(
tmplayers
);
\ No newline at end of file
ats/topcam/ATS_AIM_customer_data_analysis.js
View file @
62b678fa
This diff is collapsed.
Click to expand it.
ats/topcam/ATS_AIM_data_format.js
View file @
62b678fa
...
...
@@ -420,22 +420,15 @@ try {
})
}
}
else
if
(
/^yucca$/ig
.
test
(
par
.
customer
))
{
if
(
profileRule
[
0
]
==
"outline"
&&
/1352/ig
.
test
(
PAR
.
customer
)
)
{
GEN
.
workLayer
({
name
:
'outline'
,
display_number
:
2
,
clear_before
:
'yes'
})
if
(
all_layer
.
indexOf
(
"outline"
)
>=
0
)
{
GEN
.
workLayer
({
name
:
"outline"
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
selAllFeat
()
if
(
GEN
.
getSelectCount
()
>
0
)
{
if
(
GEN
.
GEN_TYPE
==
"genesis"
){
GEN
.
selCreateProfile
()
// GEN.COM("sel_create_profile,create_profile_with_holes=no")
}
else
{
GEN
.
COM
(
"profile_limits,layers=outline,type=lyrfilter,margin=0"
)
}
}
var
hasProfile
=
GEN
.
getProfile
({
job
:
job
,
step
:
tmp_step
})
GEN
.
closeStep
()
if
(
hasProfile
.
match
(
/
\n
/ig
).
length
==
1
){
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:
profileRule
})
// cutting data
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:[
"^outline$"
]})
}
else
{
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:
profileRule
})
}
}
else
{
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:
profileRule
})
}
...
...
@@ -445,11 +438,18 @@ try {
if
(
all_layer
.
indexOf
(
"outline"
)
>=
0
){
GEN
.
workLayer
({
name
:
"outline"
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
selAllFeat
()
if
(
GEN
.
getSelectCount
()
>
0
)
{
GEN
.
COM
(
"sel_create_profile,create_profile_with_holes=no"
)
}
if
(
GEN
.
getSelectCount
()
>
0
)
{
// GEN.COM("sel_create_profile,create_profile_with_holes=no")
// cutting data
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:[
"^outline$"
]})
}
else
{
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:
profileRule
})
}
}
else
if
(
contours
.
length
)
{
// 过滤上下方的框
profileRule
.
unshift
(
"contour"
);
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:
profileRule
})
}
else
{
createOutline
({
job
:
job
,
step
:
tmp_step
,
profileRule
:
profileRule
})
}
}
else
if
(
/^vivo$/ig
.
test
(
par
.
customer
))
{
// 判断有没有line层
...
...
@@ -457,7 +457,11 @@ try {
GEN
.
workLayer
({
name
:
"line"
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
selAllFeat
()
if
(
GEN
.
getSelectCount
()
>
0
)
{
GEN
.
COM
(
"sel_create_profile,create_profile_with_holes=no"
)
}
}
else
if
(
all_layer
.
indexOf
(
"top"
)
>=
0
)
{
}
else
if
(
all_layer
.
indexOf
(
"array"
)
>=
0
)
{
GEN
.
workLayer
({
name
:
"array"
,
display_number
:
2
,
clear_before
:
'yes'
})
GEN
.
selAllFeat
()
if
(
GEN
.
getSelectCount
()
>
0
)
{
GEN
.
COM
(
"sel_create_profile,create_profile_with_holes=no"
)
}
}
else
if
(
all_layer
.
indexOf
(
"top"
)
>=
0
)
{
GEN
.
selClearFeature
()
GEN
.
workLayer
({
name
:
"top"
,
display_number
:
2
,
clear_before
:
'yes'
})
// 判断是否有外框
...
...
@@ -594,7 +598,25 @@ catch (e) {
IKM
.
msg
(
_
.
join
(
GEN
.
STATUS
,
"
\n
"
))
IKM
.
msg
(
e
)
if
(
global
.
_ERRORMAG
){
script_info
({
msg
:
global
.
_ERRORMAG
})
script_info
({
msg
:
global
.
_ERRORMAG
});
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
return
q
.
selectValue
({
table
:
'pdm_job'
,
field_format
:{
job_attrs
:
'json'
},
field
:
'job_attrs'
,
where
:{
id
:
JobId
}
})
});
if
(
!
job_attrs
)
{
job_attrs
=
{}}
job_attrs
.
readin_result
=
global
.
_ERRORMAG
db
.
query
(
""
,
function
(
q
){
return
q
.
updateRow
({
table
:
'pdm_job'
,
data
:{
job_attrs
:
job_attrs
},
update_policy
:{
attr_data
:
'json_merge'
},
where
:{
id
:
JobId
}
})
});
}
IKM
.
crud
(
"deleteRow"
,
{
table
:
"pdm_job_jobattr"
,
...
...
@@ -773,7 +795,11 @@ function setDrill(props){ // 设置钻孔
// findSignal 根据传入的数字找到对应的signal层 如 1 => top ; 2 => layer_2
function findSignal(num){
console.log(num)
return signalLayer[Number(num-1)].name
var tmpnum = Number(num-1)
if(tmpnum > signalLayer.length -1){
tmpnum = signalLayer.length -1
}
return signalLayer[tmpnum].name
}
function doDrill(drills){ // 分析钻孔层
return drills.map(function(v){
...
...
@@ -804,6 +830,17 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
var cfg = props.cfg
matrix = matrix.filter(function(v){return v.name != v.new_name})
matrix.forEach(function(v){
// 在数据库层信息里找v.name 找得到就直接改名
var new_name = IKM.get_layerinfo({jobid: JobId, layer: v.name, layerinfo: "
new_name
" })
var layers_tmp = Object.keys(GEN.getMatrix({job:job}));
if(new_name && new_name!="" && new_name != v.name && layers_tmp.indexOf(new_name) < 0){
GEN.renameLayer({job:job,layer:v.name,new_name:new_name})
}
})
if(matrix.length > 0){
var rename_list = matrix.map(function(item){
var new_name;
var tl_name = item.tl_name
...
...
@@ -854,14 +891,15 @@ function reName(props) { // 改名 par{job:要改名的料号, rule: {要改名
return flag
})
rename_list.forEach(function(v){
if(v.orig_name !== v.new_name && !GEN.isLayerExists({job:job, layer: v.new_name})){
if(
!GEN.isLayerExists({job:job, layer:v.new_name})
){
var layers_tmp = Object.keys(GEN.getMatrix({job:job}));
if(
v.orig_name !== v.new_name && layers_tmp.indexOf(v.new_name) < 0
){
GEN.renameLayer({job:job,layer:v.orig_name,new_name:v.new_name})
}
}
});
}
// 最后 如果第一个 最后一个不是top bottom 就手动修改
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
"})
signals = signals.sort(function(a,b){return afterMatrix[a].row - afterMatrix[b].row})
var topSignal = signals[0]
...
...
@@ -1072,7 +1110,9 @@ function createOutline(props){
}
function exportInfo(info){
fs.writeFile("
/
home
/
toplinker
/
samba
/
Test_Scott
/
tmp
", _.toString(info))
}
function touch(layer) {
GEN.selRefFeat({layers:layer,use:"
filter
",mode:"
touch
"})
if(GEN.getSelectCount() > 0) {
...
...
ats/topcam/ATS_AIM_data_input.js
View file @
62b678fa
...
...
@@ -159,7 +159,7 @@ try {
var
custCfg
=
config
.
customer
[
par
.
customer
]
if
(
!
custCfg
){
throw
"customer config error:"
+
par
.
customer
}
custCfg
.
db
=
par
.
db
||
custCfg
.
db
var
step
=
custCfg
.
step
.
toLowerCase
()
var
step
=
custCfg
.
step
.
toLowerCase
()
||
"cad"
;
// 获取路径下文件信息
var
path
=
par
.
path
if
(
!
fs
.
exists
(
path
)){
...
...
@@ -196,7 +196,10 @@ try {
// 将jobFile下的zip解压
script_info
({
msg
:
"unzip the file"
,
result_severity
:
"info"
})
global
.
_ERRORMAG
=
"Failed to unzip the file"
;
decompression
(
jobFile
[
0
].
path
,
[])
decompression
(
jobFile
[
0
].
path
,
[]);
changePath2
(
jobFile
[
0
].
path
)
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
return
q
.
selectValue
({
table
:
'pdm_job'
,
...
...
@@ -232,12 +235,15 @@ try {
script_info
({
msg
:
"Import odb++"
,
result_severity
:
"error"
});
global
.
_ERRORMAG
=
"Fail to import odb++"
;
if
(
jobInfo
.
data
.
length
==
1
){
// 只分析到一个tgz文件 直接导入
IKM
.
msg
(
"只分析到一个tgz文件 直接导入"
)
import_info
.
push
({
name
:
jobInfo
.
data
[
0
].
file
.
name
,
type
:
"odb++"
,
date
:
now
(),
user
:
$
.
user_name
})
var
err
=
importJob
({
name
:
job
,
db
:
custCfg
.
db
,
path
:
jobInfo
.
data
[
0
].
file
.
path
},
config
.
delSameJob
)
IKM
.
msg
(
"只分析到一个tgz文件 直接导入"
);
import_info
.
push
({
name
:
jobInfo
.
data
[
0
].
file
.
name
,
type
:
"odb++"
,
date
:
now
(),
user
:
$
.
user_name
});
var
err
=
importJob
({
name
:
job
,
db
:
custCfg
.
db
,
path
:
jobInfo
.
data
[
0
].
file
.
path
},
config
.
delSameJob
);
// 将step改名cad
var
step_tmp
=
GEN
.
getStepList
({
job
:
job
})[
0
];
if
(
step_tmp
!=
"cad"
){
GEN
.
renameStep
({
job
:
job
,
name
:
step_tmp
,
new_name
:
'cad'
})
}
if
(
err
){
throw
err
}
}
else
{
// 多个tgz文件 说明需要合并
console
.
log
(
"==========合并的情况"
);
var
jobs
=
jobInfo
.
data
.
map
(
function
(
item
,
i
){
...
...
@@ -384,7 +390,6 @@ try {
GEN
.
checkInout
({
job
:
job
,
mode
:
"in"
})
GEN
.
closeJob
({
job
:
job
})
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
;
...
...
@@ -426,7 +431,25 @@ try {
catch
(
e
)
{
script_info
({
result_severity
:
"error"
})
if
(
global
.
_ERRORMAG
){
script_info
({
msg
:
global
.
_ERRORMAG
})
script_info
({
msg
:
global
.
_ERRORMAG
});
var
job_attrs
=
db
.
query
(
""
,
function
(
q
){
return
q
.
selectValue
({
table
:
'pdm_job'
,
field_format
:{
job_attrs
:
'json'
},
field
:
'job_attrs'
,
where
:{
id
:
JobId
}
})
});
if
(
!
job_attrs
)
{
job_attrs
=
{}}
job_attrs
.
readin_result
=
global
.
_ERRORMAG
db
.
query
(
""
,
function
(
q
){
return
q
.
updateRow
({
table
:
'pdm_job'
,
data
:{
job_attrs
:
job_attrs
},
update_policy
:{
attr_data
:
'json_merge'
},
where
:{
id
:
JobId
}
})
});
}
IKM
.
crud
(
"deleteRow"
,
{
table
:
"pdm_job_jobattr"
,
...
...
@@ -522,6 +545,7 @@ function importJob(props,delSameJob){
}
}
props
.
path
=
changePath
(
props
.
path
)
// 如果path的tgz不符合规范 纠正一下
GEN
.
importJob
(
props
);
}
...
...
@@ -587,23 +611,31 @@ function decompression(path, zips) {
var
files
=
fs
.
listDir
(
path
)
var
count
=
0
;
var
zipfiles
=
files
.
filter
(
function
(
item
){
if
(
item
.
suffix
==
"zip"
||
item
.
suffix
==
"rar"
||
item
.
suffix
==
"7z
"
)
{
if
(
item
.
suffix
==
"zip"
||
item
.
suffix
==
"rar"
||
item
.
suffix
==
"7z"
||
item
.
suffix
==
"ZIP
"
)
{
inputState
.
push
(
item
.
suffix
);
console
.
log
(
"--->path:"
+
item
.
path
)
if
(
zips
.
indexOf
(
item
.
path
)
<
0
){
zips
.
push
(
item
.
path
)
if
(
item
.
name
.
length
>=
20
)
{
zips
.
push
(
item
.
path
)
;
if
(
item
.
name
.
length
>=
30
&&
!
/�|
\?
/
.
test
(
item
.
name
)
)
{
var
mvname
=
"custom"
+
count
+
"."
+
item
.
suffix
;
count
++
fs
.
rename
(
item
.
path
,
item
.
dir
+
"/"
+
mvname
)
count
++
;
fs
.
rename
(
item
.
path
,
item
.
dir
+
"/"
+
mvname
)
;
item
.
path
=
item
.
dir
+
"/"
+
mvname
}
var
dir_name
=
item
.
path
.
replace
(
/
\.(
zip|7z|rar
)
$/
,
""
);
var
dir_name
=
item
.
path
.
replace
(
/
\.(
zip|7z|rar
)
$/ig
,
""
);
autoUn
(
item
.
path
,
dir_name
);
return
true
}
}
// else if(/7z/.test(item.completeSuffix)){
// inputState.push("7z");
// if(zips.indexOf(item.path) < 0){
// zips.push(item.path);
// var dir_name = item.path.replace(".7z", "");
// autoUn(item.path, dir_name);
// return true
// }
// }
return
false
})
if
(
zipfiles
.
length
)
{
decompression
(
path
,
zips
)}
...
...
@@ -630,5 +662,29 @@ function autoUn(path, dirname) {
}
function
exportInfo
(
info
){
fs
.
writeFile
(
"/home/toplinker/samba/scott_test/tmp"
,
_
.
toString
(
info
))
fs
.
writeFile
(
"/home/toplinker/samba/Test_Scott/tmp"
,
_
.
toString
(
info
))
}
function
changePath2
(
filePath
){
var
fileList
=
fs
.
listDir
(
filePath
);
var
tmp
=
[];
for
(
var
i
=
0
;
i
<
fileList
.
length
;
i
++
){
if
(
fileList
[
i
].
isDir
){
var
path
=
fileList
[
i
].
path
;
var
fileName
=
fileList
[
i
].
baseName
;
var
obj
=
{
path
:
path
,
fileName
:
fileName
}
tmp
.
push
(
obj
);
}
}
var
list
=
[];
for
(
var
i
=
tmp
.
length
-
1
;
i
>=
0
;
i
--
){
var
newFileName
=
tmp
[
i
].
fileName
.
replace
(
/
\s
*/g
,
''
);
//去除文件名中空格
newFileName
=
newFileName
.
replace
(
/
\?
/g
,
''
);
//去除文件名中?
var
newPath
=
tmp
[
i
].
path
.
replace
(
/^
(
.*
)\/[^\/]
*$/
,
"$1"
);
var
file
=
fs
.
rename
(
tmp
[
i
].
path
,
newPath
+
'/'
+
newFileName
);
list
.
push
(
file
);
}
}
\ No newline at end of file
ats/topcam/config_ats.js
View file @
62b678fa
This diff is collapsed.
Click to expand it.
config_ats.js
deleted
100644 → 0
View file @
c52da11a
This diff is collapsed.
Click to expand it.
template.js
View file @
62b678fa
...
...
@@ -78,44 +78,41 @@ for(var key in default_par){ if (!par.hasOwnProperty(key) || par[key] == ""){ pa
var
job
=
Job
;
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(mode == "aimdfm"){ if(GEN.checkInout({job:job,mode:"test"}) != 0){ throw "the job check" } else { GEN.checkInout({job:job,mode:"out"}) } }
if
(
!
GEN
.
isJobExists
({
job
:
job
})){
throw
"料号"
+
job
+
"不存在"
}
if
(
!
GEN
.
isJobOpen
({
job
:
job
})){
GEN
.
openJob
({
job
:
job
})
}
if
(
mode
==
"aimdfm"
){
if
(
GEN
.
checkInout
({
job
:
job
,
mode
:
"test"
})
!=
0
){
throw
"the job check"
}
else
{
GEN
.
checkInout
({
job
:
job
,
mode
:
"out"
})
}
}
GEN
.
openStep
({
job
:
job
,
name
:
"cad"
})
var
matrix
=
GEN
.
getMatrix
({
job
:
job
})
exportInfo
(
"getMatrix"
);
// 获取matrix
GEN
.
INFO
({
entity_type
:
'matrix'
,
entity_path
:
job
+
'/matrix'
,
data_type
:
'row'
,
parameters
:
'name'
});
exportInfo
({
matrix
:
Object
.
keys
(
matrix
),
infores
:
GEN
.
INFO_RESULT
});
// var stepList = GEN.getStepList({job:job})
// stepList = stepList.filter(function(step){
// var reg = new RegExp(par.step,"ig")
// process.exec('7za', ['x' ,"/tmp/topcamtest/custom0.zip", "-o/tmp/topcamtest/custom0", "-aoa"])
// return reg.test(step)
// })
process
.
exec
(
'/usr/local/lib/p7zip/7za'
,
[
'x'
,
"/tmp/tmp/custom0.zip"
,
"-o/tmp/tmp/custom0"
,
"-aoa"
])
// /usr/local/lib/p7zip/7za x /tmp/topcamtest/custom0.zip -o/tmp/topcamtest/custom0 -aoa
// /usr/bin/sudo -u genesis -b -s /usr/bin/id -un > /tmp/topcamtest/test.txt
// mkdir /tmp/test
// exportInfo(ret)
// /usr/bin/sudo -u genesis -b -s /usr/local/lib/p7zip/7za x /tmp/topcamtest/custom0.zip -o/tmp/topcamtest/custom0 -aoa
// sudo -u genesis -b -s /bin/csh -c "setenv DISPLAY ':0.0';cd /opt/toplinker/aimdfmserver/bin;./aimdfmserver > /dev/null"
// stepList.forEach(function(step){
// GEN.openStep({job:job,name:step});
// GEN.COM("tools_set,layer=ftdrill,slots=by_length")
// var tool = GEN.getTool({job:job,step:step,layer:"ftdrill",units:"mm"},true); // {"1":{"count":"01156","num":"1","type":"plated","min_tol":"0","max_tol":"0","finish_size":"100.31","drill_size":"100.31","slot_len":"0","type2":"standard","shape":"hole","bit":0}}
// fs.writeFile("/home/toplinker/samba/scott_test/tmp", _.toString(tool))
// })
// 保存
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
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
33.33
},
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
"
)
}]
});
return
{
status
:
Status
,
result_data
:
resultData
};
}
else
{
resultData
.
push
({
type
:
"info"
,
title
:
"操作完成, 请注意检查!"
});
return
{
status
:
Status
,
result_data
:
resultData
};
}
}
else
{
return
"Done"
}
}
catch
(
e
)
{
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'
;
resultData
.
push
({
type
:
"error"
,
title
:
"脚本执行出错!"
,
detail
:
[{
desc
:
_
.
toString
(
e
)}]});
return
(
mode
===
"aimdfm"
)
?
{
status
:
Status
,
result_data
:
resultData
}
:
"Error"
;
}
function
exportInfo
(
info
){
fs
.
writeFile
(
"/home/toplinker/samba/
scott_tes
t/tmp"
,
_
.
toString
(
info
))
fs
.
writeFile
(
"/home/toplinker/samba/
Test_Scot
t/tmp"
,
_
.
toString
(
info
))
}
\ No newline at end of file
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