Skip to content

Commit

Permalink
[Drill Map][Fixed] Seg fault when setting group parent
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyen-v committed Jan 1, 2025
1 parent c8a8ba3 commit 7cb24fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 0 additions & 2 deletions kibot/kicad/pcb_draw_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ def draw_drill_map(g, layer, layer_pair_idx, merge_PTH_NPTH=True, group_slots_an
if isinstance(item, pcbnew.PCB_SHAPE):
dummy_shape = item.Duplicate()
dummy_shape.SetLayer(layer)
dummy_shape.SetParentGroup(g)
g.AddItem(dummy_shape)
GS.board.Add(dummy_shape)

Expand All @@ -216,7 +215,6 @@ def draw_drill_map(g, layer, layer_pair_idx, merge_PTH_NPTH=True, group_slots_an
if isinstance(item, pcbnew.PCB_SHAPE):
dummy_shape = item.Duplicate()
dummy_shape.SetLayer(layer)
dummy_shape.SetParentGroup(g)
g.AddItem(dummy_shape)
GS.board.Add(dummy_shape)

Expand Down
24 changes: 13 additions & 11 deletions kibot/out_pcb_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,12 @@ def generate_output(self, output):
pages = []
for n, p in enumerate(self._pages):
if not GS.ki5:
g_drill_map = PCB_GROUP(GS.board)
self.add_drill_map_drawing(p, g_drill_map)
# We skipped the outputs marked as drill before, so now we draw the tables for each drill pair
if select_output == 'no_drill' and p._is_drill and has_drill_output:
update_table(self._include_table, self, 'drill_only', force_index=p._drill_pair_index)
if p._is_drill:
g_drill_map = PCB_GROUP(GS.board)
self.add_drill_map_drawing(p, g_drill_map)
# We skipped the outputs marked as drill before, so now we draw the tables for each drill pair
if select_output == 'no_drill' and p._is_drill and has_drill_output:
update_table(self._include_table, self, 'drill_only', force_index=p._drill_pair_index)
# Make visible only the layers we need
# This is very important when scaling, otherwise the results are controlled by the .kicad_prl (See #407)
if self.individual_page_scaling:
Expand Down Expand Up @@ -1559,13 +1560,14 @@ def generate_output(self, output):
# self.kicad7_scale_workaround(id, temp_dir, filelist[-1][0], filelist[-1][1], p.mirror, p.scaling)
# remove the drill map drawing
if not GS.ki5:
items = g_drill_map.GetItems()
if not isinstance(items, list):
items = list[items]
if p._is_drill:
items = g_drill_map.GetItems()
if not isinstance(items, list):
items = list[items]

for item in items:
if isinstance(item, PCB_SHAPE):
GS.board.Delete(item)
for item in items:
if isinstance(item, PCB_SHAPE):
GS.board.Delete(item)
# 2) Plot the frame using an empty layer and 1.0 scale
po.SetMirror(False)
if self.plot_sheet_reference:
Expand Down

0 comments on commit 7cb24fd

Please sign in to comment.