mirror of https://github.com/KLayout/klayout.git
Fixed DRC texts methods, added tests.
This commit is contained in:
parent
854320d52d
commit
5795ec8b07
|
|
@ -669,20 +669,22 @@ CODE
|
||||||
|
|
||||||
if @data.is_a?(RBA::Texts)
|
if @data.is_a?(RBA::Texts)
|
||||||
if as_pattern
|
if as_pattern
|
||||||
DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Texts, :with_match, pattern, invert))
|
result = @engine._tcmd(@data, 0, RBA::Texts, :with_match, pattern, invert)
|
||||||
else
|
else
|
||||||
DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Texts, :with_text, pattern, invert))
|
result = @engine._tcmd(@data, 0, RBA::Texts, :with_text, pattern, invert)
|
||||||
end
|
end
|
||||||
if as_dots
|
if as_dots
|
||||||
DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Region, :edges))
|
return DRCLayer::new(@engine, @engine._tcmd(result, 0, RBA::Region, :edges))
|
||||||
elsif as_dots == false
|
elsif as_dots == false
|
||||||
DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Region, :polygons))
|
return DRCLayer::new(@engine, @engine._tcmd(result, 0, RBA::Region, :polygons))
|
||||||
|
else
|
||||||
|
return DRCLayer::new(@engine, result)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if as_dots
|
if as_dots
|
||||||
DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Region, :texts_dots, pattern, as_pattern))
|
return DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Region, :texts_dots, pattern, as_pattern))
|
||||||
else
|
else
|
||||||
DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Region, :texts, pattern, as_pattern))
|
return DRCLayer::new(@engine, @engine._tcmd(@data, 0, RBA::Region, :texts, pattern, as_pattern))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -3080,6 +3082,10 @@ CODE
|
||||||
@data.is_a?(RBA::Region) || @data.is_a?(RBA::Texts) || raise("#{f}: Requires a polygon or text layer")
|
@data.is_a?(RBA::Region) || @data.is_a?(RBA::Texts) || raise("#{f}: Requires a polygon or text layer")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def requires_texts(f)
|
||||||
|
@data.is_a?(RBA::Texts) || raise("#{f}: Requires a text layer")
|
||||||
|
end
|
||||||
|
|
||||||
def requires_edge_pairs(f)
|
def requires_edge_pairs(f)
|
||||||
@data.is_a?(RBA::EdgePairs) || raise("#{f}: Requires a edge pair layer")
|
@data.is_a?(RBA::EdgePairs) || raise("#{f}: Requires a edge pair layer")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
|
|
||||||
# Hierarchical antenna check
|
# Text handling - mixed mode and pure texts
|
||||||
|
|
||||||
source($drc_test_source, "TOP")
|
source($drc_test_source, "TOP")
|
||||||
target($drc_test_target)
|
target($drc_test_target)
|
||||||
|
|
||||||
# Flat mode
|
# Flat mode
|
||||||
|
|
||||||
flat_labels = labels(1, 0)
|
flat_labels = input(1, 1) # mixed mode, labels only
|
||||||
|
flat_texts = labels(1, 0) # text objects
|
||||||
flat_all = input(1, 0)
|
flat_all = input(1, 0)
|
||||||
flat_poly = polygons(1, 0)
|
flat_poly = polygons(1, 0)
|
||||||
|
|
||||||
flat_texts_from_labels1 = flat_labels.texts(text("XYZ"))
|
flat_texts_from_labels1 = flat_labels.texts(text("XYZ"))
|
||||||
flat_texts_from_labels2 = flat_labels.texts("*")
|
flat_texts_from_labels2 = flat_labels.texts("*")
|
||||||
|
flat_texts_from_texts1 = flat_texts.texts(text("XYZ"))
|
||||||
|
flat_texts_from_texts2 = flat_texts.texts("*")
|
||||||
|
flat_texts_from_texts3 = flat_texts.texts_not("U*")
|
||||||
flat_texts_from_all1 = flat_all.texts(text("XYZ"))
|
flat_texts_from_all1 = flat_all.texts(text("XYZ"))
|
||||||
flat_texts_from_all2 = flat_all.texts("*")
|
flat_texts_from_all2 = flat_all.texts("*")
|
||||||
flat_texts_from_poly1 = flat_poly.texts(text("XYZ"))
|
flat_texts_from_poly1 = flat_poly.texts(text("XYZ"))
|
||||||
|
|
@ -20,23 +24,31 @@ flat_texts_from_poly2 = flat_poly.texts("*")
|
||||||
flat_labels.output(100, 0)
|
flat_labels.output(100, 0)
|
||||||
flat_all.output(101, 0)
|
flat_all.output(101, 0)
|
||||||
flat_poly.output(102, 0)
|
flat_poly.output(102, 0)
|
||||||
|
flat_texts.output(103, 0)
|
||||||
flat_texts_from_labels1.output(110, 0)
|
flat_texts_from_labels1.output(110, 0)
|
||||||
flat_texts_from_labels2.output(111, 0)
|
flat_texts_from_labels2.output(111, 0)
|
||||||
flat_texts_from_all1.output(112, 0)
|
flat_texts_from_all1.output(112, 0)
|
||||||
flat_texts_from_all2.output(113, 0)
|
flat_texts_from_all2.output(113, 0)
|
||||||
flat_texts_from_poly1.output(114, 0)
|
flat_texts_from_poly1.output(114, 0)
|
||||||
flat_texts_from_poly2.output(115, 0)
|
flat_texts_from_poly2.output(115, 0)
|
||||||
|
flat_texts_from_texts1.output(116, 0)
|
||||||
|
flat_texts_from_texts2.output(117, 0)
|
||||||
|
flat_texts_from_texts3.output(118, 0)
|
||||||
|
|
||||||
# Deep mode
|
# Deep mode
|
||||||
|
|
||||||
deep
|
deep
|
||||||
|
|
||||||
deep_labels = labels(1, 0)
|
deep_labels = input(1, 1) # mixed mode, labels only
|
||||||
|
deep_texts = labels(1, 1) # text objects
|
||||||
deep_all = input(1, 0)
|
deep_all = input(1, 0)
|
||||||
deep_poly = polygons(1, 0)
|
deep_poly = polygons(1, 0)
|
||||||
|
|
||||||
deep_texts_from_labels1 = deep_labels.texts(text("XYZ"))
|
deep_texts_from_labels1 = deep_labels.texts(text("XYZ"))
|
||||||
deep_texts_from_labels2 = deep_labels.texts("*")
|
deep_texts_from_labels2 = deep_labels.texts("*")
|
||||||
|
deep_texts_from_texts1 = deep_texts.texts(text("XYZ"))
|
||||||
|
deep_texts_from_texts2 = deep_texts.texts("*")
|
||||||
|
deep_texts_from_texts3 = deep_texts.texts_not("U*")
|
||||||
deep_texts_from_all1 = deep_all.texts(text("XYZ"))
|
deep_texts_from_all1 = deep_all.texts(text("XYZ"))
|
||||||
deep_texts_from_all2 = deep_all.texts("*")
|
deep_texts_from_all2 = deep_all.texts("*")
|
||||||
deep_texts_from_poly1 = deep_poly.texts(text("XYZ"))
|
deep_texts_from_poly1 = deep_poly.texts(text("XYZ"))
|
||||||
|
|
@ -45,10 +57,14 @@ deep_texts_from_poly2 = deep_poly.texts("*")
|
||||||
deep_labels.output(200, 0)
|
deep_labels.output(200, 0)
|
||||||
deep_all.output(201, 0)
|
deep_all.output(201, 0)
|
||||||
deep_poly.output(202, 0)
|
deep_poly.output(202, 0)
|
||||||
|
deep_texts.output(203, 0)
|
||||||
deep_texts_from_labels1.output(210, 0)
|
deep_texts_from_labels1.output(210, 0)
|
||||||
deep_texts_from_labels2.output(211, 0)
|
deep_texts_from_labels2.output(211, 0)
|
||||||
deep_texts_from_all1.output(212, 0)
|
deep_texts_from_all1.output(212, 0)
|
||||||
deep_texts_from_all2.output(213, 0)
|
deep_texts_from_all2.output(213, 0)
|
||||||
deep_texts_from_poly1.output(214, 0)
|
deep_texts_from_poly1.output(214, 0)
|
||||||
deep_texts_from_poly2.output(215, 0)
|
deep_texts_from_poly2.output(215, 0)
|
||||||
|
deep_texts_from_texts1.output(216, 0)
|
||||||
|
deep_texts_from_texts2.output(217, 0)
|
||||||
|
deep_texts_from_texts3.output(218, 0)
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue