@@ -757,19 +757,24 @@ def parse_netlist(net_info):
757757 return nets
758758
759759 def footprint_to_component (self , footprint , extra_fields ):
760+ # type: (pcbnew.FOOTPRINT, list) -> Component
760761 try :
761762 footprint_name = str (footprint .GetFPID ().GetFootprintName ())
762763 except AttributeError :
763764 footprint_name = str (footprint .GetFPID ().GetLibItemName ())
764765
766+ value = footprint .GetValue ()
767+ if hasattr (footprint , 'GetFieldValueForVariant' ):
768+ value = footprint .GetFieldValueForVariant (
769+ self .config .kicad_variant , 'Value' )
765770 attr = 'Normal'
766771 if hasattr (pcbnew , 'FP_EXCLUDE_FROM_BOM' ):
767- if footprint .GetAttributes () & pcbnew .FP_EXCLUDE_FROM_BOM :
768- attr = 'Virtual'
769772 if hasattr (footprint , 'GetExcludedFromBOMForVariant' ):
770773 if footprint .GetExcludedFromBOMForVariant (
771774 self .config .kicad_variant ):
772775 attr = 'Virtual'
776+ elif footprint .GetAttributes () & pcbnew .FP_EXCLUDE_FROM_BOM :
777+ attr = 'Virtual'
773778 elif hasattr (pcbnew , 'MOD_VIRTUAL' ):
774779 if footprint .GetAttributes () == pcbnew .MOD_VIRTUAL :
775780 attr = 'Virtual'
@@ -779,7 +784,7 @@ def footprint_to_component(self, footprint, extra_fields):
779784 }.get (footprint .GetLayer ())
780785
781786 return Component (footprint .GetReference (),
782- footprint . GetValue () ,
787+ value ,
783788 footprint_name ,
784789 layer ,
785790 attr ,
0 commit comments