Fixed KiCad 5 doesn't have LSET.Contains()

This commit is contained in:
Salvador E. Tropea 2022-04-26 12:14:24 -03:00
parent 9b18c5300a
commit e1586484f5
2 changed files with 8 additions and 2 deletions

View File

@ -273,6 +273,12 @@ class GS(object):
def zones():
return pcbnew.ZONES() if GS.ki6() else pcbnew.ZONE_CONTAINERS()
@staticmethod
def layers_contains(layers, id):
if GS.ki6():
return layers.Contains(id)
return id in layers.Seq()
@staticmethod
def expand_text_variables(text, extra_vars=None):
vars = GS.load_pro_variables()

View File

@ -532,7 +532,7 @@ class PCB_PrintOptions(VariantOptions):
if dr.x:
continue
layers = pad.GetLayerSet()
if layers.Contains(id):
if GS.layers_contains(layers, id):
layers.removeLayer(id)
pad.SetLayerSet(layers)
removed.append(pad)
@ -592,7 +592,7 @@ class PCB_PrintOptions(VariantOptions):
moved.append(gi)
for pad in m.Pads():
layers = pad.GetLayerSet()
if layers.Contains(id):
if GS.layers_contains(layers, id):
layers.removeLayer(id)
pad.SetLayerSet(layers)
removed.append(pad)