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
ddfff236
Commit
ddfff236
authored
Mar 24, 2021
by
Scott Sun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.topibd.net/scott.sun/scott
parents
ea6417a0
6007b550
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
58 deletions
+25
-58
template.js
template.js
+25
-58
No files found.
template.js
View file @
ddfff236
...
...
@@ -56,13 +56,11 @@ 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"
)
{
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
}
});
}
IKM
.
crud
(
"updateRow"
,
{
table
:
"pdm_aimdfm_task"
,
data
:
{
current_process_title
:
$
.
process_title
},
where
:
{
id
:
$
.
task_id
}
})
}
var
Status
=
'ok'
;
var
resultData
=
[];
...
...
@@ -94,54 +92,12 @@ try {
}
// 主体
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"
)
}
}
})
})
...
...
@@ -157,7 +113,11 @@ try {
// 结尾返回 固定写法
var
Return
=
"Done"
if
(
mode
===
"aimdfm"
)
{
$
.
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
100
},
where
:
{
id
:
$
.
task_id
}
});
IKM
.
crud
(
"updateRow"
,
{
table
:
"pdm_aimdfm_task"
,
data
:
{
progress
:
100
},
where
:
{
id
:
$
.
task_id
}
})
var
tmperr
=
{
type
:
"info"
,
title
:
"操作完成, 请注意检查!"
}
if
(
GEN
.
hasError
())
{
Status
=
'error'
;
...
...
@@ -177,8 +137,8 @@ try {
return
(
mode
===
"aimdfm"
)
?
{
status
:
Status
,
result_data
:
resultData
}
:
"Error"
;
}
// 获取层别
// func (Object) ([]string)
function
getLayer
(
props
){
// 获取层
if
(
!
props
)
{
return
...
...
@@ -191,13 +151,20 @@ function getLayer(props){ // 获取层
var
info
=
matrix
[
b
];
var
ret
=
true
;
for
(
var
key
in
props
)
{
if
(
!
Array
.
isArray
(
props
[
key
]))
{
props
[
key
]
=
[
props
[
key
]]
if
(
info
[
key
])
{
if
(
/string/ig
.
test
(
typeof
props
[
key
])){
var
reg
=
new
RegExp
(
props
[
key
],
"ig"
)
if
(
!
reg
.
test
(
info
[
key
])){
ret
=
false
}
}
if
(
info
[
key
]
&&
props
[
key
].
indexOf
(
info
[
key
])
<
0
)
{
if
(
/function/ig
.
test
(
typeof
props
[
key
])){
if
(
!
props
[
key
](
info
[
key
])){
ret
=
false
}
}
}
}
if
(
ret
)
{
a
.
push
(
props
.
res
==
"info"
?
info
:
b
)
}
...
...
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