Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions replicate_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self, board, src_anchor_fp_ref, update_func=update_progress):
# find anchor footprint and it's group
self.src_anchor_fp = self.get_fp_by_ref(src_anchor_fp_ref)
if self.src_anchor_fp.fp.GetParentGroup():
self.src_anchor_fp_group = self.src_anchor_fp.fp.GetParentGroup().GetName()
self.src_anchor_fp_group = self.src_anchor_fp.fp.GetParentGroup().this
else:
self.src_anchor_fp_group = None
# TODO check if there is any other footprint with same ID as anchor footprint
Expand Down Expand Up @@ -1278,7 +1278,7 @@ def get_footprints_for_replication(self, level, bounding_box, settings):
if not fp.fp.IsLocked() or settings.rep_locked_drawings:
if settings.group_only:
if fp.fp.GetParentGroup():
if fp.fp.GetParentGroup().GetName() == self.src_anchor_fp_group:
if fp.fp.GetParentGroup().this == self.src_anchor_fp_group:
fps_for_replication.append(fp)
else:
fps_for_replication.append(fp)
Expand All @@ -1303,7 +1303,7 @@ def get_tracks_for_replication(self, level, bounding_box, settings):
if not t.IsLocked() or settings.rep_locked_tracks:
if t.GetParentGroup():
logger.info(f"Track group: {t.GetParentGroup().GetName()}, src group:{self.src_anchor_fp_group}")
if t.GetParentGroup().GetName() == self.src_anchor_fp_group:
if t.GetParentGroup().this == self.src_anchor_fp_group:
if t.GetNetname() in nets_on_sheet:
tracks_for_replication.append(t)
else:
Expand All @@ -1324,7 +1324,7 @@ def get_tracks_for_replication(self, level, bounding_box, settings):
else:
if settings.group_items and t.GetNetname() in nets_on_sheet:
if t.GetParentGroup():
if self.src_anchor_fp_group == t.GetParentGroup().GetName():
if self.src_anchor_fp_group == t.GetParentGroup().this:
tracks_for_replication.append(t)
return tracks_for_replication

Expand All @@ -1347,7 +1347,7 @@ def get_zones_for_replication(self, level, bounding_box, settings):
for z in all_zones:
if not z.IsLocked() or settings.rep_locked_zones:
if z.GetParentGroup():
if z.GetParentGroup().GetName() == self.src_anchor_fp_group:
if z.GetParentGroup().this == self.src_anchor_fp_group:
if z.GetNetname() in nets_on_sheet:
zones_for_replication.append(z)
else:
Expand All @@ -1368,7 +1368,7 @@ def get_zones_for_replication(self, level, bounding_box, settings):
else:
if settings.group_items and (z.GetNetname() in nets_on_sheet or z.GetIsRuleArea()):
if z.GetParentGroup():
if self.src_anchor_fp_group == z.GetParentGroup().GetName():
if self.src_anchor_fp_group == z.GetParentGroup().this:
zones_for_replication.append(z)
return zones_for_replication

Expand All @@ -1386,7 +1386,7 @@ def get_text_for_replication(self, bounding_box, settings):
# get all drawings, and select only those belonging to group
for t_i in text_items:
if t_i.GetParentGroup():
if self.src_anchor_fp_group == t_i.GetParentGroup().GetName():
if self.src_anchor_fp_group == t_i.GetParentGroup().this:
if not t_i.IsLocked() or settings.rep_locked_text:
text_items_for_replication.append(t_i)
else:
Expand All @@ -1401,7 +1401,7 @@ def get_text_for_replication(self, bounding_box, settings):
else:
if settings.group_items:
if t_i.GetParentGroup():
if self.src_anchor_fp_group == t_i.GetParentGroup().GetName():
if self.src_anchor_fp_group == t_i.GetParentGroup().this:
if not t_i.IsLocked() or settings.rep_locked_drawings:
text_items_for_replication.append(t_i)
else:
Expand All @@ -1411,7 +1411,7 @@ def get_text_for_replication(self, bounding_box, settings):
else:
if settings.group_items:
if t_i.GetParentGroup():
if self.src_anchor_fp_group == t_i.GetParentGroup().GetName():
if self.src_anchor_fp_group == t_i.GetParentGroup().this:
if not t_i.IsLocked() or settings.rep_locked_drawings:
text_items_for_replication.append(t_i)
return text_items_for_replication
Expand All @@ -1430,7 +1430,7 @@ def get_drawings_for_replication(self, bounding_box, settings):
# get all drawings, and select only those belonging to group
for d in drawings:
if d.GetParentGroup():
if self.src_anchor_fp_group == d.GetParentGroup().GetName():
if self.src_anchor_fp_group == d.GetParentGroup().this:
if not d.IsLocked() or settings.rep_locked_drawings:
drawings_for_replication.append(d)
else:
Expand All @@ -1445,7 +1445,7 @@ def get_drawings_for_replication(self, bounding_box, settings):
else:
if settings.group_items:
if d.GetParentGroup():
if self.src_anchor_fp_group == d.GetParentGroup().GetName():
if self.src_anchor_fp_group == d.GetParentGroup().this:
if not d.IsLocked() or settings.rep_locked_drawings:
drawings_for_replication.append(d)
else:
Expand All @@ -1455,7 +1455,7 @@ def get_drawings_for_replication(self, bounding_box, settings):
else:
if settings.group_items:
if d.GetParentGroup():
if self.src_anchor_fp_group == d.GetParentGroup().GetName():
if self.src_anchor_fp_group == d.GetParentGroup().this:
if not d.IsLocked() or settings.rep_locked_drawings:
drawings_for_replication.append(d)
return drawings_for_replication
Expand Down