mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-03 07:03:05 +02:00
Some enhancements to layer and cell mapping
* Modification of the mapping is possible now (#map used to ignore mappings if there was one already) * Added DropCell mapping (also for RBA) * Added unit tests for cell mapping, layer mapping db::merge_layouts, db::copy_shapes and db::move_shapes
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+13
-1
@@ -28,7 +28,12 @@ def mapping_to_s(ly1, ly2, cm)
|
||||
ly1.each_cell_top_down do |c|
|
||||
s = ly1.cell(c).name
|
||||
if cm.has_mapping?(c)
|
||||
s += "=>" + ly2.cell(cm.cell_mapping(c)).name
|
||||
t = cm.cell_mapping(c)
|
||||
if t == RBA::CellMapping::DropCell
|
||||
s += "=>(0)"
|
||||
else
|
||||
s += "=>" + ly2.cell(t).name
|
||||
end
|
||||
end
|
||||
r == "" || (r += ";")
|
||||
r += s
|
||||
@@ -50,6 +55,8 @@ class DBCellMapping_TestClass < TestBase
|
||||
assert_equal(mp.has_mapping?(1), false)
|
||||
mp.map(1, 2)
|
||||
assert_equal(mp.cell_mapping(1), 2)
|
||||
mp.map(1, 3)
|
||||
assert_equal(mp.cell_mapping(1), 3)
|
||||
|
||||
ly = RBA::Layout::new
|
||||
|
||||
@@ -170,6 +177,11 @@ class DBCellMapping_TestClass < TestBase
|
||||
assert_equal(mapping_to_s(ly2, ly1dup, mp), "c0;c2=>c2;c1=>c1;c3=>c3$1")
|
||||
assert_equal(nc.inspect, "[3]")
|
||||
|
||||
mp.clear
|
||||
mp.from_geometry(ly1, top1, ly2, top2)
|
||||
mp.map(ci2, RBA::CellMapping::DropCell)
|
||||
assert_equal(mapping_to_s(ly2, ly1, mp), "c0;c2=>(0);c1=>c1;c3")
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Vendored
+2
@@ -50,6 +50,8 @@ class DBLayerMapping_TestClass < TestBase
|
||||
assert_equal(mp.has_mapping?(1), false)
|
||||
mp.map(1, 2)
|
||||
assert_equal(mp.layer_mapping(1), 2)
|
||||
mp.map(1, 3)
|
||||
assert_equal(mp.layer_mapping(1), 3)
|
||||
|
||||
ly1 = RBA::Layout::new
|
||||
|
||||
|
||||
Reference in New Issue
Block a user