File tree 3 files changed +13
-7
lines changed
SparkFunKiCadBOMGenerator
3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1
- # SparkFun PCB BOM Generator plugin for KiCad 7
1
+ # SparkFun PCB BOM Generator plugin for KiCad 7 / 8
2
2
3
- This plugin generates the Bill Of Materials (BOM) for a KiCad 7 PCB.
3
+ This plugin generates the Bill Of Materials (BOM) for a KiCad 7 / 8 PCB.
4
4
5
5
![ BOM Generator] ( ./img/bom_generator.png )
6
6
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def __init__(self):
36
36
37
37
self ._pcbnew_frame = None
38
38
39
- self .kicad_build_version = pcbnew .GetBuildVersion ()
39
+ self .baseVersion = pcbnew .GetBuildVersion (). split ( '.' )[ 0 ] # Use GetBuildVersion. GetBaseVersion is only available in KiCad 8
40
40
41
41
def Run (self ):
42
42
if self ._pcbnew_frame is None :
@@ -77,9 +77,15 @@ def Run(self):
77
77
name = name .split (":" )[1 ]
78
78
prod_id = ""
79
79
hasProdID = False
80
- if sourceModule .HasFieldByName ("PROD_ID" ): # Breaking change for KiCad 8
81
- prod_id = sourceModule .GetFieldText ("PROD_ID" ) # Breaking change for KiCad 8
82
- hasProdID = True
80
+ if self .baseVersion < '8' :
81
+ if hasattr (sourceModule , "HasProperty" ):
82
+ if sourceModule .HasProperty ("PROD_ID" ):
83
+ prod_id = sourceModule .GetPropertyNative ("PROD_ID" )
84
+ hasProdID = True
85
+ else :
86
+ if sourceModule .HasFieldByName ("PROD_ID" ): # Breaking change for KiCad 8
87
+ prod_id = sourceModule .GetFieldText ("PROD_ID" ) # Breaking change for KiCad 8
88
+ hasProdID = True
83
89
if hasProdID :
84
90
if prod_id == "" :
85
91
prod_id = ">> EMPTY <<"
Original file line number Diff line number Diff line change 1
- __version__ = "1.1.0 "
1
+ __version__ = "1.1.1 "
You can’t perform that action at this time.
0 commit comments