@@ -149,6 +149,13 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
149
149
# Any PCB_TEXT containing any of these keywords will be copied into the ordering instructions
150
150
possibleExtras = ['clean' , 'Clean' , 'CLEAN' , 'stackup' , 'Stackup' , 'STACKUP' ]
151
151
152
+ # Possible logos and their default mask and silkscreen colors: seen, mask, silk
153
+ possibleLogos = {
154
+ "SparkFun_Logo" : [False , "Red" , "White" ],
155
+ "SparkX_Logo" : [False , "Black" , "White" ],
156
+ "SparkPNT_Logo" : [False , "Red" , "White" ],
157
+ }
158
+
152
159
sysExit = - 1 # -1 indicates sysExit has not (yet) been set. The code below will set this to 0, 1, 2.
153
160
report = "\n START: " + datetime .now ().isoformat () + "\n "
154
161
@@ -457,8 +464,6 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
457
464
if PANEL_X or PANEL_Y :
458
465
report += "You can fit " + str (NUM_X ) + " x " + str (NUM_Y ) + " boards on the panel.\n "
459
466
460
- sparkfunLogoSeen = False
461
- sparkxLogoSeen = False
462
467
solderMask = None
463
468
silkscreen = None
464
469
copperLayers = "Layers: {}" .format (board .GetCopperLayerCount ()) # Should we trust the instructions or the tracks?!
@@ -508,10 +513,9 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
508
513
newModules = []
509
514
prodIDs = []
510
515
for sourceModule in modules :
511
- if "SparkFun_Logo" in sourceModule .GetFPIDAsString ():
512
- sparkfunLogoSeen = True
513
- if "SparkX_Logo" in sourceModule .GetFPIDAsString ():
514
- sparkxLogoSeen = True
516
+ for logo in possibleLogos .keys ():
517
+ if logo in sourceModule .GetFPIDAsString ():
518
+ possibleLogos [logo ][0 ] = True # Set 'seen' to True
515
519
pos = sourceModule .GetPosition () # Check if footprint is outside the bounding box
516
520
if pos .x >= boardLeftEdge and pos .x <= boardRightEdge and \
517
521
pos .y >= boardTopEdge and pos .y <= boardBottomEdge :
@@ -557,12 +561,11 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
557
561
for module in newModules :
558
562
board .Add (module )
559
563
560
- if sparkfunLogoSeen :
561
- solderMask = "Solder Mask: Red"
562
- silkscreen = "Silkscreen: White"
563
- if sparkxLogoSeen :
564
- solderMask = "Solder Mask: Black"
565
- silkscreen = "Silkscreen: White"
564
+ for logo in possibleLogos .keys ():
565
+ if possibleLogos [logo ][0 ] == True : # if seen
566
+ solderMask = "Solder Mask: " + possibleLogos [logo ][1 ]
567
+ silkscreen = "Silkscreen: " + possibleLogos [logo ][2 ]
568
+ break
566
569
567
570
# Array of zones
568
571
modules = board .GetFootprints ()
0 commit comments