@@ -215,7 +215,7 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
215
215
panelOutputFile = os .path .split (board .GetFileName ())[1 ] # Get the file path tail
216
216
panelOutputFile = os .path .join (panelOutputPath , os .path .splitext (panelOutputFile )[0 ] + "_panelized.kicad_pcb" )
217
217
218
- # Check if PCB needs to be saved
218
+ # Check if PCB needs to be saved first
219
219
#if board.IsModified(): # This doesn't work. Need to find something that does...
220
220
if wx .GetApp () is not None :
221
221
resp = wx .MessageBox ("Do you want to save the PCB first?" ,
@@ -226,6 +226,18 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
226
226
else :
227
227
board .Save (board .GetFileName ())
228
228
229
+ # Check if user wants to build zone fills
230
+ if wx .GetApp () is not None :
231
+ resp = wx .MessageBox ("Do you want to build the zone fills?" ,
232
+ 'Fill zones?' , wx .YES_NO | wx .ICON_INFORMATION )
233
+ if resp == wx .YES :
234
+ report += "Zones filled by user.\n "
235
+ fillerTool = pcbnew .ZONE_FILLER (board )
236
+ fillerTool .Fill (board .Zones ())
237
+ else :
238
+ fillerTool = pcbnew .ZONE_FILLER (board )
239
+ fillerTool .Fill (board .Zones ())
240
+
229
241
if board is None :
230
242
report += "Could not load board. Quitting.\n "
231
243
sysExit = 2
@@ -522,14 +534,15 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
522
534
ref = sourceModule .Reference ().GetText ()
523
535
prodIDs .append ([sourceModule .GetPropertyNative ("PROD_ID" ), ref ])
524
536
else : # Move source modules which are outside the bounding box
525
- # If the drawing is below the bottom edge and likely to clip the rail, move it below the rail
526
- if (pos .y > boardBottomEdge ) and (pos .y < (boardBottomEdge + (2 * int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))):
527
- sourceModule .Move (pcbnew .VECTOR2I (0 , int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))
528
- elif pos .y < boardTopEdge : # If the drawing is above the top edge, move it above the panel
537
+ # If the module is below the bottom edge and likely to clip the rail, move it below the rail
538
+ if pos .y > boardBottomEdge :
539
+ if pos .y < (boardBottomEdge + (2 * int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ))):
540
+ sourceModule .Move (pcbnew .VECTOR2I (0 , int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))
541
+ elif pos .y < boardTopEdge : # If the module is above the top edge, move it above the panel
529
542
sourceModule .Move (pcbnew .VECTOR2I (0 , int ((- (NUM_Y - 1 ) * boardHeight ) - (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ))))
530
- elif pos .x > boardRightEdge : # If the drawing is to the right, move it beyond the panel
543
+ elif pos .x > boardRightEdge : # If the module is to the right, move it beyond the panel
531
544
sourceModule .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
532
- else : # elif pos.x < boardLeftEdge: # If the drawing is to the left, move it outside the rail
545
+ else : # elif pos.x < boardLeftEdge: # If the module is to the left, move it outside the rail
533
546
sourceModule .Move (pcbnew .VECTOR2I (int (- VERTICAL_EDGE_RAIL_WIDTH * SCALE ), 0 ))
534
547
535
548
for module in newModules :
@@ -620,12 +633,12 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
620
633
#if txt is not None: # Copy all text outside the bounding box to the report
621
634
# report += txt + "\n"
622
635
if pos .y > boardBottomEdge : # If the drawing is below the bottom edge, move it below the rail
623
- if pos .y < (boardBottomEdge + (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )): # But only if in the way
636
+ if pos .y < (boardBottomEdge + (2 * int ( HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ) )): # But only if in the way
624
637
sourceDrawing .Move (pcbnew .VECTOR2I (0 , int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))
625
- elif pos .x > boardRightEdge : # If the drawing is to the right, move it beyond the panel
626
- sourceDrawing .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
627
638
elif pos .y < boardTopEdge : # If the drawing is above the top edge, move it above the panel
628
639
sourceDrawing .Move (pcbnew .VECTOR2I (0 , int ((- (NUM_Y - 1 ) * boardHeight ) - (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ))))
640
+ elif pos .x > boardRightEdge : # If the drawing is to the right, move it beyond the panel
641
+ sourceDrawing .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
629
642
else : # elif pos.x < boardLeftEdge: # If the drawing is to the left, move it outside the rail
630
643
sourceDrawing .Move (pcbnew .VECTOR2I (int (- VERTICAL_EDGE_RAIL_WIDTH * SCALE ), 0 ))
631
644
0 commit comments