mirror of https://github.com/KLayout/klayout.git
DRC enhancement: allow @+ to create a new layout for output.
This commit is contained in:
parent
211524a0c0
commit
814b8df516
|
|
@ -894,8 +894,9 @@ module DRC
|
||||||
# "what" specifies what input to use. "what" be either
|
# "what" specifies what input to use. "what" be either
|
||||||
#
|
#
|
||||||
# @ul
|
# @ul
|
||||||
# @li A string "\@n" specifying output to a layout in the current panel @/li
|
# @li A string "\@n" (n is an integer) specifying output to a layout in the current panel @/li
|
||||||
# @li A layout filename @/li
|
# @li A string "\@+" specifying output to a new layout in the current panel @/li
|
||||||
|
# @li A layout filename @/li
|
||||||
# @li A RBA::Layout object @/li
|
# @li A RBA::Layout object @/li
|
||||||
# @li A RBA::Cell object @/li
|
# @li A RBA::Cell object @/li
|
||||||
# @/ul
|
# @/ul
|
||||||
|
|
@ -912,15 +913,21 @@ module DRC
|
||||||
|
|
||||||
if arg.is_a?(String)
|
if arg.is_a?(String)
|
||||||
|
|
||||||
if arg =~ /^@(\d+)/
|
if arg =~ /^@(\d+|\+)/
|
||||||
n = $1.to_i - 1
|
|
||||||
view = RBA::LayoutView::current
|
view = RBA::LayoutView::current
|
||||||
view || raise("No view open")
|
view || raise("No view open")
|
||||||
|
if $1 == "+"
|
||||||
|
n = view.create_layout(true)
|
||||||
|
cellname ||= (@def_cell ? @def_cell.name : "TOP")
|
||||||
|
else
|
||||||
|
n = $1.to_i - 1
|
||||||
|
end
|
||||||
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
|
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
|
||||||
cv = view.cellview(n)
|
cv = view.cellview(n)
|
||||||
cv.is_valid? || raise("Invalid layout @#{n + 1}")
|
cv.is_valid? || raise("Invalid layout @#{n + 1}")
|
||||||
@output_layout = cv.layout
|
@output_layout = cv.layout
|
||||||
@output_cell = cellname ? (@output_layout.cell(cellname.to_s) || @output_layout.create_cell(cellname.to_s)) : cv.cell
|
@output_cell = cellname ? (@output_layout.cell(cellname.to_s) || @output_layout.create_cell(cellname.to_s)) : cv.cell
|
||||||
|
cv.cell = @output_cell
|
||||||
@output_layout_file = nil
|
@output_layout_file = nil
|
||||||
else
|
else
|
||||||
@output_layout = RBA::Layout::new
|
@output_layout = RBA::Layout::new
|
||||||
|
|
@ -1545,7 +1552,7 @@ CODE
|
||||||
|
|
||||||
@output_layers.each do |li|
|
@output_layers.each do |li|
|
||||||
if !present_layers[li]
|
if !present_layers[li]
|
||||||
info = @def_layout.get_info(li)
|
info = output.get_info(li)
|
||||||
lp = RBA::LayerProperties::new
|
lp = RBA::LayerProperties::new
|
||||||
lp.source_layer = info.layer
|
lp.source_layer = info.layer
|
||||||
lp.source_datatype = info.datatype
|
lp.source_datatype = info.datatype
|
||||||
|
|
|
||||||
|
|
@ -767,7 +767,8 @@ a new target will be set up.
|
||||||
"what" specifies what input to use. "what" be either
|
"what" specifies what input to use. "what" be either
|
||||||
</p><p>
|
</p><p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>A string "@n" specifying output to a layout in the current panel </li>
|
<li>A string "@n" (n is an integer) specifying output to a layout in the current panel </li>
|
||||||
|
<li>A string "@+" specifying output to a new layout in the current panel</li>
|
||||||
<li>A layout filename </li>
|
<li>A layout filename </li>
|
||||||
<li>A <class_doc href="Layout">Layout</class_doc> object </li>
|
<li>A <class_doc href="Layout">Layout</class_doc> object </li>
|
||||||
<li>A <class_doc href="Cell">Cell</class_doc> object </li>
|
<li>A <class_doc href="Cell">Cell</class_doc> object </li>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue