@@ -148,14 +148,6 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
148
148
# Any PCB_TEXT containing any of these keywords will be copied into the ordering instructions
149
149
possibleExtras = ['clean' , 'Clean' , 'CLEAN' , 'stackup' , 'Stackup' , 'STACKUP' ]
150
150
151
- # Permutations for Ordering Instructions
152
- possibleOrderingInstructions = [
153
- "Ordering_Instructions" ,
154
- "ORDERING_INSTRUCTIONS" ,
155
- "Ordering Instructions" ,
156
- "ORDERING INSTRUCTIONS"
157
- ]
158
-
159
151
sysExit = - 1 # -1 indicates sysExit has not (yet) been set. The code below will set this to 0, 1, 2.
160
152
report = "\n START: " + datetime .now ().isoformat () + "\n "
161
153
@@ -444,7 +436,6 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
444
436
if PANEL_X or PANEL_Y :
445
437
report += "You can fit " + str (NUM_X ) + " x " + str (NUM_Y ) + " boards on the panel.\n "
446
438
447
- orderingInstructionsSeen = False
448
439
sparkfunLogoSeen = False
449
440
sparkxLogoSeen = False
450
441
solderMask = None
@@ -496,9 +487,6 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
496
487
newModules = []
497
488
prodIDs = []
498
489
for sourceModule in modules :
499
- for instruction in possibleOrderingInstructions :
500
- if instruction in sourceModule .GetFPIDAsString ():
501
- orderingInstructionsSeen = True
502
490
if "SparkFun_Logo" in sourceModule .GetFPIDAsString ():
503
491
sparkfunLogoSeen = True
504
492
if "SparkX_Logo" in sourceModule .GetFPIDAsString ():
@@ -534,12 +522,13 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
534
522
ref = sourceModule .Reference ().GetText ()
535
523
prodIDs .append ([sourceModule .GetPropertyNative ("PROD_ID" ), ref ])
536
524
else : # Move source modules which are outside the bounding box
537
- if pos .y > boardBottomEdge : # If the drawing is below the bottom edge, move it below the rail
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 )))):
538
527
sourceModule .Move (pcbnew .VECTOR2I (0 , int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))
539
- elif pos .x > boardRightEdge : # If the drawing is to the right, move it beyond the panel
540
- sourceModule .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
541
528
elif pos .y < boardTopEdge : # If the drawing is above the top edge, move it above the panel
542
529
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
531
+ sourceModule .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
543
532
else : # elif pos.x < boardLeftEdge: # If the drawing is to the left, move it outside the rail
544
533
sourceModule .Move (pcbnew .VECTOR2I (int (- VERTICAL_EDGE_RAIL_WIDTH * SCALE ), 0 ))
545
534
@@ -1191,13 +1180,6 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
1191
1180
sysExit = 1
1192
1181
1193
1182
# Add ordering instructions:
1194
- if not orderingInstructionsSeen :
1195
- if wx .GetApp () is not None :
1196
- resp = wx .MessageBox ("Ordering Instructions not found!\n No futher warnings will be given." ,
1197
- 'Warning' , wx .OK | wx .ICON_WARNING )
1198
- report += "Ordering Instructions not found! No futher ordering warnings will be given.\n "
1199
- sysExit = 1
1200
-
1201
1183
if ordering is None :
1202
1184
report += "\n Ordering Instructions:\n "
1203
1185
report += (
@@ -1237,6 +1219,7 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
1237
1219
report += orderingExtras
1238
1220
else :
1239
1221
try :
1222
+ defaultsUsed = False
1240
1223
with open (ordering , 'w' ) as oi :
1241
1224
oi .write ("Ordering Instructions:\n " )
1242
1225
oi .write (
@@ -1249,39 +1232,27 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
1249
1232
if material is not None :
1250
1233
oi .write (material + "\n " )
1251
1234
if solderMask is None :
1252
- if wx .GetApp () is not None and orderingInstructionsSeen :
1253
- resp = wx .MessageBox ("Solder mask color not found!" ,
1254
- 'Warning' , wx .OK | wx .ICON_WARNING )
1235
+ defaultsUsed = True
1255
1236
solderMask = "Solder Mask: Red (Default)"
1256
1237
oi .write (solderMask + "\n " )
1257
1238
if silkscreen is None :
1258
- if wx .GetApp () is not None and orderingInstructionsSeen :
1259
- resp = wx .MessageBox ("Silkscreen color not found!" ,
1260
- 'Warning' , wx .OK | wx .ICON_WARNING )
1239
+ defaultsUsed = True
1261
1240
silkscreen = "Silkscreen: White (Default)"
1262
1241
oi .write (silkscreen + "\n " )
1263
1242
if copperLayers is None :
1264
- if wx .GetApp () is not None and orderingInstructionsSeen :
1265
- resp = wx .MessageBox ("Number of layers not found!" ,
1266
- 'Warning' , wx .OK | wx .ICON_WARNING )
1243
+ defaultsUsed = True
1267
1244
copperLayers = "Layers: 2 (Default)"
1268
1245
oi .write (copperLayers + "\n " )
1269
1246
if finish is None :
1270
- if wx .GetApp () is not None and orderingInstructionsSeen :
1271
- resp = wx .MessageBox ("PCB finish not found!" ,
1272
- 'Warning' , wx .OK | wx .ICON_WARNING )
1247
+ defaultsUsed = True
1273
1248
finish = "Finish: HASL Lead-free (Default)"
1274
1249
oi .write (finish + "\n " )
1275
1250
if thickness is None :
1276
- if wx .GetApp () is not None and orderingInstructionsSeen :
1277
- resp = wx .MessageBox ("PCB thickness not found!" ,
1278
- 'Warning' , wx .OK | wx .ICON_WARNING )
1251
+ defaultsUsed = True
1279
1252
thickness = "Thickness: 1.6mm (Default)"
1280
1253
oi .write (thickness + "\n " )
1281
1254
if copperWeight is None :
1282
- if wx .GetApp () is not None and orderingInstructionsSeen :
1283
- resp = wx .MessageBox ("Copper weight not found!" ,
1284
- 'Warning' , wx .OK | wx .ICON_WARNING )
1255
+ defaultsUsed = True
1285
1256
copperWeight = "Copper weight: 1oz (Default)"
1286
1257
oi .write (copperWeight + "\n " )
1287
1258
if minTrackWidth < INVALID_WIDTH :
@@ -1292,6 +1263,9 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
1292
1263
float (minViaDrill ) / SCALE , float (minViaDrill ) * 1000 / (SCALE * 25.4 )))
1293
1264
if orderingExtras is not None :
1294
1265
oi .write (orderingExtras )
1266
+ if defaultsUsed :
1267
+ report += "Warning: Ordering Instructions contains default values.\n "
1268
+ sysExit = 1
1295
1269
except Exception as e :
1296
1270
# Don't throw exception if we can't save ordering instructions
1297
1271
pass
@@ -1311,7 +1285,7 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
1311
1285
refs += ref
1312
1286
else :
1313
1287
refs += "," + ref
1314
- if wx .GetApp () is not None and orderingInstructionsSeen :
1288
+ if wx .GetApp () is not None :
1315
1289
resp = wx .MessageBox ("Empty (undefined) PROD_IDs found!\n " + refs ,
1316
1290
'Warning' , wx .OK | wx .ICON_WARNING )
1317
1291
report += "Empty (undefined) PROD_IDs found: " + refs + "\n "
0 commit comments