@@ -118,6 +118,8 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
118
118
# Minimum spacer for exposed edge panels
119
119
MINIMUM_SPACER = 6.35 # mm
120
120
121
+ INVALID_WIDTH = 999999999
122
+
121
123
# 'Extra' ordering instructions
122
124
# Any PCB_TEXT containing any of these keywords will be copied into the ordering instructions
123
125
possibleExtras = ['clean' , 'Clean' , 'CLEAN' ]
@@ -390,8 +392,8 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
390
392
# Array of tracks
391
393
# Note: Duplicate uses the same net name for the duplicated track.
392
394
# This creates DRC unconnected net errors. (KiKit does this properly...)
393
- minTrackWidth = 999999999
394
- minViaDrill = 999999999
395
+ minTrackWidth = INVALID_WIDTH
396
+ minViaDrill = INVALID_WIDTH
395
397
tracks = board .GetTracks ()
396
398
newTracks = []
397
399
for sourceTrack in tracks : # iterate through each track to be copied
@@ -1070,27 +1072,29 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
1070
1072
if material is not None :
1071
1073
report += material + "\n "
1072
1074
if solderMask is None :
1073
- solderMask = "Solder Mask: Red"
1075
+ solderMask = "Solder Mask: Red (Default) "
1074
1076
report += solderMask + "\n "
1075
1077
if silkscreen is None :
1076
- silkscreen = "Silkscreen: White"
1078
+ silkscreen = "Silkscreen: White (Default) "
1077
1079
report += silkscreen + "\n "
1078
1080
if numLayers is None :
1079
- numLayers = "Layers: 2"
1081
+ numLayers = "Layers: 2 (Default) "
1080
1082
report += numLayers + "\n "
1081
1083
if finish is None :
1082
- finish = "Finish: HASL Lead-free"
1084
+ finish = "Finish: HASL Lead-free (Default) "
1083
1085
report += finish + "\n "
1084
1086
if thickness is None :
1085
- thickness = "Thickness: 1.6mm"
1087
+ thickness = "Thickness: 1.6mm (Default) "
1086
1088
report += thickness + "\n "
1087
1089
if copperWeight is None :
1088
- copperWeight = "Copper weight: 1oz"
1090
+ copperWeight = "Copper weight: 1oz (Default) "
1089
1091
report += copperWeight + "\n "
1090
- report += "Minimum track width: {:.2f}mm ({:.2f}mil)\n " .format (
1091
- float (minTrackWidth ) / SCALE , float (minTrackWidth ) * 1000 / (SCALE * 25.4 ))
1092
- report += "Minimum via drill: {:.2f}mm ({:.2f}mil)\n " .format (
1093
- float (minViaDrill ) / SCALE , float (minViaDrill ) * 1000 / (SCALE * 25.4 ))
1092
+ if minTrackWidth < INVALID_WIDTH :
1093
+ report += "Minimum track width: {:.2f}mm ({:.2f}mil)\n " .format (
1094
+ float (minTrackWidth ) / SCALE , float (minTrackWidth ) * 1000 / (SCALE * 25.4 ))
1095
+ if minViaDrill < INVALID_WIDTH :
1096
+ report += "Minimum via drill: {:.2f}mm ({:.2f}mil)\n " .format (
1097
+ float (minViaDrill ) / SCALE , float (minViaDrill ) * 1000 / (SCALE * 25.4 ))
1094
1098
if orderingExtras is not None :
1095
1099
report += orderingExtras
1096
1100
else :
@@ -1110,66 +1114,69 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
1110
1114
if wx .GetApp () is not None and orderingInstructionsSeen :
1111
1115
resp = wx .MessageBox ("Solder mask color not found!" ,
1112
1116
'Warning' , wx .OK | wx .ICON_WARNING )
1113
- solderMask = "Solder Mask: Red"
1117
+ solderMask = "Solder Mask: Red (Default) "
1114
1118
oi .write (solderMask + "\n " )
1115
1119
if silkscreen is None :
1116
1120
if wx .GetApp () is not None and orderingInstructionsSeen :
1117
1121
resp = wx .MessageBox ("Silkscreen color not found!" ,
1118
1122
'Warning' , wx .OK | wx .ICON_WARNING )
1119
- silkscreen = "Silkscreen: White"
1123
+ silkscreen = "Silkscreen: White (Default) "
1120
1124
oi .write (silkscreen + "\n " )
1121
1125
if numLayers is None :
1122
1126
if wx .GetApp () is not None and orderingInstructionsSeen :
1123
1127
resp = wx .MessageBox ("Number of layers not found!" ,
1124
1128
'Warning' , wx .OK | wx .ICON_WARNING )
1125
- numLayers = "Layers: 2"
1129
+ numLayers = "Layers: 2 (Default) "
1126
1130
oi .write (numLayers + "\n " )
1127
1131
if finish is None :
1128
1132
if wx .GetApp () is not None and orderingInstructionsSeen :
1129
1133
resp = wx .MessageBox ("PCB finish not found!" ,
1130
1134
'Warning' , wx .OK | wx .ICON_WARNING )
1131
- finish = "Finish: HASL Lead-free"
1135
+ finish = "Finish: HASL Lead-free (Default) "
1132
1136
oi .write (finish + "\n " )
1133
1137
if thickness is None :
1134
1138
if wx .GetApp () is not None and orderingInstructionsSeen :
1135
1139
resp = wx .MessageBox ("PCB thickness not found!" ,
1136
1140
'Warning' , wx .OK | wx .ICON_WARNING )
1137
- thickness = "Thickness: 1.6mm"
1141
+ thickness = "Thickness: 1.6mm (Default) "
1138
1142
oi .write (thickness + "\n " )
1139
1143
if copperWeight is None :
1140
1144
if wx .GetApp () is not None and orderingInstructionsSeen :
1141
1145
resp = wx .MessageBox ("Copper weight not found!" ,
1142
1146
'Warning' , wx .OK | wx .ICON_WARNING )
1143
- copperWeight = "Copper weight: 1oz"
1147
+ copperWeight = "Copper weight: 1oz (Default) "
1144
1148
oi .write (copperWeight + "\n " )
1145
- oi .write ("Minimum track width: {:.2f}mm ({:.2f}mil)\n " .format (
1146
- float (minTrackWidth ) / SCALE , float (minTrackWidth ) * 1000 / (SCALE * 25.4 )))
1147
- oi .write ("Minimum via drill: {:.2f}mm ({:.2f}mil)\n " .format (
1148
- float (minViaDrill ) / SCALE , float (minViaDrill ) * 1000 / (SCALE * 25.4 )))
1149
+ if minTrackWidth < INVALID_WIDTH :
1150
+ oi .write ("Minimum track width: {:.2f}mm ({:.2f}mil)\n " .format (
1151
+ float (minTrackWidth ) / SCALE , float (minTrackWidth ) * 1000 / (SCALE * 25.4 )))
1152
+ if minViaDrill < INVALID_WIDTH :
1153
+ oi .write ("Minimum via drill: {:.2f}mm ({:.2f}mil)\n " .format (
1154
+ float (minViaDrill ) / SCALE , float (minViaDrill ) * 1000 / (SCALE * 25.4 )))
1149
1155
if orderingExtras is not None :
1150
1156
oi .write (orderingExtras )
1151
1157
except Exception as e :
1152
1158
# Don't throw exception if we can't save ordering instructions
1153
1159
pass
1154
1160
1155
- if (prodIDs is not None ) :
1161
+ if len (prodIDs ) > 0 :
1156
1162
emptyProdIDs = {}
1157
1163
for prodID in prodIDs :
1158
1164
if (prodID [0 ] == '' ) or (prodID [0 ] == ' ' ):
1159
1165
if prodID [1 ] not in emptyProdIDs :
1160
1166
emptyProdIDs [prodID [1 ]] = 1
1161
1167
else :
1162
1168
emptyProdIDs [prodID [1 ]] = emptyProdIDs [prodID [1 ]] + 1
1163
- if wx . GetApp () is not None and orderingInstructionsSeen and emptyProdIDs :
1169
+ if len ( emptyProdIDs ) > 0 :
1164
1170
refs = ""
1165
- for keys , value in emptyProdIDs .items ():
1171
+ for ref , num in emptyProdIDs .items ():
1166
1172
if refs == "" :
1167
- refs += keys
1173
+ refs += ref
1168
1174
else :
1169
- refs += "," + keys
1170
- resp = wx .MessageBox ("Empty (undefined) PROD_IDs found!\n " + refs ,
1171
- 'Warning' , wx .OK | wx .ICON_WARNING )
1172
- report += "Empty (undefined) PROD_IDs found!" + refs + "\n "
1175
+ refs += "," + ref
1176
+ if wx .GetApp () is not None and orderingInstructionsSeen :
1177
+ resp = wx .MessageBox ("Empty (undefined) PROD_IDs found!\n " + refs ,
1178
+ 'Warning' , wx .OK | wx .ICON_WARNING )
1179
+ report += "Empty (undefined) PROD_IDs found: " + refs + "\n "
1173
1180
sysExit = 1
1174
1181
1175
1182
if sysExit < 0 :
0 commit comments