@@ -598,25 +598,43 @@ class PlotSettings():
598598 where the plot files will be saved"""
599599
600600 # Available since KiCad v9
601- # TODO Update docs
602601
603- pdf_front_fp_property_popups : Optional [str ] = None
602+ pdf_front_fp_property_popups : Optional [bool ] = None
603+ """The optional ``pdf_front_fp_property_popups`` token defines if interactive popups for
604+ front-side footprint properties are included in PDF output"""
605+
606+ pdf_back_fp_property_popups : Optional [bool ] = None
607+ """The optional ``pdf_back_fp_property_popups`` token defines if interactive popups for
608+ back-side footprint properties are included in PDF output"""
604609
605- pdf_back_fp_property_popups : Optional [str ] = None
610+ pdf_metadata : Optional [bool ] = None
611+ """The optional ``pdf_metadata`` token defines if document metadata should be embedded
612+ in the PDF output"""
606613
607- pdf_metadata : Optional [str ] = None
614+ pdf_single_document : Optional [bool ] = None
615+ """The optional ``pdf_single_document`` token defines if all layers should be plotted
616+ into a single PDF document"""
608617
609- pdf_single_document : Optional [str ] = None
618+ plot_black_and_white : Optional [bool ] = None
619+ """The optional ``plot_black_and_white`` token defines if the plot should be generated
620+ in black and white"""
610621
611- plot_black_and_white : Optional [str ] = None
622+ hide_dnp_on_fab : Optional [bool ] = None
623+ """The optional ``hide_dnp_on_fab`` token defines if 'Do Not Populate' footprints should
624+ be hidden on fabrication plots"""
612625
613- hide_dnp_on_fab : Optional [str ] = None
626+ crossout_dnp_on_fab : Optional [bool ] = None
627+ """The optional ``crossout_dnp_on_fab`` token defines if 'Do Not Populate' footprints
628+ should be crossed out on fabrication plots"""
614629
615- crossout_dnp_on_fab : Optional [str ] = None
630+ sketch_dnp_on_fab : Optional [bool ] = None
631+ """The optional ``sketch_dnp_on_fab`` token defines if 'Do Not Populate' footprints should
632+ be drawn in sketch mode on fabrication plots"""
616633
617- sketch_dnp_on_fab : Optional [str ] = None
634+ plot_pad_numbers : Optional [bool ] = None
635+ """The optional ``plot_pad_numbers`` token defines if pad numbers should be plotted
636+ on fabrication layers"""
618637
619- plot_pad_numbers : Optional [str ] = None
620638
621639 @classmethod
622640 def from_sexpr (cls , exp : list ) -> PlotSettings :
@@ -676,15 +694,15 @@ def from_sexpr(cls, exp: list) -> PlotSettings:
676694 elif item [0 ] == 'drillshape' : object .drillShape = item [1 ]
677695 elif item [0 ] == 'scaleselection' : object .scaleSelection = item [1 ]
678696 elif item [0 ] == 'outputdirectory' : object .outputDirectory = item [1 ]
679- elif item [0 ] == 'pdf_front_fp_property_popups' : object .pdf_front_fp_property_popups = item [ 1 ]
680- elif item [0 ] == 'pdf_back_fp_property_popups' : object .pdf_back_fp_property_popups = item [ 1 ]
681- elif item [0 ] == 'pdf_metadata' : object .pdf_metadata = item [ 1 ]
682- elif item [0 ] == 'pdf_single_document' : object .pdf_single_document = item [ 1 ]
683- elif item [0 ] == 'plot_black_and_white' : object .plot_black_and_white = item [ 1 ]
684- elif item [0 ] == 'hidednponfab' : object .hide_dnp_on_fab = item [ 1 ]
685- elif item [0 ] == 'sketchdnponfab' : object .sketch_dnp_on_fab = item [ 1 ]
686- elif item [0 ] == 'crossoutdnponfab' : object .crossout_dnp_on_fab = item [ 1 ]
687- elif item [0 ] == 'plotpadnumbers' : object .plot_pad_numbers = item [ 1 ]
697+ elif item [0 ] == 'pdf_front_fp_property_popups' : object .pdf_front_fp_property_popups = parse_bool ( item , 'pdf_front_fp_property_popups' )
698+ elif item [0 ] == 'pdf_back_fp_property_popups' : object .pdf_back_fp_property_popups = parse_bool ( item , 'pdf_back_fp_property_popups' )
699+ elif item [0 ] == 'pdf_metadata' : object .pdf_metadata = parse_bool ( item , 'pdf_metadata' )
700+ elif item [0 ] == 'pdf_single_document' : object .pdf_single_document = parse_bool ( item , 'pdf_single_document' )
701+ elif item [0 ] == 'plot_black_and_white' : object .plot_black_and_white = parse_bool ( item , 'plot_black_and_white' )
702+ elif item [0 ] == 'hidednponfab' : object .hide_dnp_on_fab = parse_bool ( item , 'hidednponfab' )
703+ elif item [0 ] == 'sketchdnponfab' : object .sketch_dnp_on_fab = parse_bool ( item , 'sketchdnponfab' )
704+ elif item [0 ] == 'crossoutdnponfab' : object .crossout_dnp_on_fab = parse_bool ( item , 'crossoutdnponfab' )
705+ elif item [0 ] == 'plotpadnumbers' : object .plot_pad_numbers = parse_bool ( item , 'plotpadnumbers' )
688706 else :
689707 raise ValueError ("Unrecognized property key: {item[0]}" )
690708
@@ -735,22 +753,22 @@ def _to_sexpr_raw(self):
735753 expr .append (['viasonmask' , self .viasOnMask ])
736754
737755 expr .append (['mode' , self .mode ])
738- expr .append (['useauxorigin' , 'no' ])
756+ expr .append (['useauxorigin' , self . useAuxOrigin ])
739757 expr .append (['hpglpennumber' , self .hpglPenNumber ])
740758 expr .append (['hpglpenspeed' , self .hpglPenSpeed ])
741759 expr .append (['hpglpendiameter' , (f"{ self .hpglPenDiameter :.6f} " )])
742760
743761 if self .pdf_front_fp_property_popups is not None :
744- expr .append ([ 'pdf_front_fp_property_popups' , self .pdf_front_fp_property_popups ] )
762+ expr .append (format_bool ( 'pdf_front_fp_property_popups' , self .pdf_front_fp_property_popups , yesno = True ) )
745763
746764 if self .pdf_back_fp_property_popups is not None :
747- expr .append ([ 'pdf_back_fp_property_popups' , self .pdf_back_fp_property_popups ] )
765+ expr .append (format_bool ( 'pdf_back_fp_property_popups' , self .pdf_back_fp_property_popups , yesno = True ) )
748766
749767 if self .pdf_metadata is not None :
750- expr .append ([ 'pdf_metadata' , self .pdf_metadata ] )
768+ expr .append (format_bool ( 'pdf_metadata' , self .pdf_metadata , yesno = True ) )
751769
752770 if self .pdf_single_document is not None :
753- expr .append ([ 'pdf_single_document' , self .pdf_single_document ] )
771+ expr .append (format_bool ( 'pdf_single_document' , self .pdf_single_document , yesno = True ) )
754772
755773 expr .append (['dxfpolygonmode' , self .dxfPolygonMode ])
756774 expr .append (['dxfimperialunits' , self .dxfImperialUnits ])
@@ -759,21 +777,21 @@ def _to_sexpr_raw(self):
759777 expr .append (['psa4output' , self .psA4Output ])
760778
761779 if self .plot_black_and_white is not None :
762- expr .append ([ 'plot_black_and_white' , self .plot_black_and_white ] )
780+ expr .append (format_bool ( 'plot_black_and_white' , self .plot_black_and_white , yesno = True ) )
763781
764782 expr .append (['sketchpadsonfab' , self .sketchPadsOnFab ])
765783
766784 if self .plot_pad_numbers is not None :
767- expr .append ([ 'plotpadnumbers' , self .plot_pad_numbers ] )
785+ expr .append (format_bool ( 'plotpadnumbers' , self .plot_pad_numbers , yesno = True ) )
768786
769787 if self .hide_dnp_on_fab is not None :
770- expr .append ([ 'hidednponfab' , self .hide_dnp_on_fab ] )
788+ expr .append (format_bool ( 'hidednponfab' , self .hide_dnp_on_fab , yesno = True ) )
771789
772790 if self .sketch_dnp_on_fab is not None :
773- expr .append ([ 'sketchdnponfab' , self .sketch_dnp_on_fab ] )
791+ expr .append (format_bool ( 'sketchdnponfab' , self .sketch_dnp_on_fab , yesno = True ) )
774792
775793 if self .crossout_dnp_on_fab is not None :
776- expr .append ([ 'crossoutdnponfab' , self .crossout_dnp_on_fab ] )
794+ expr .append (format_bool ( 'crossoutdnponfab' , self .crossout_dnp_on_fab , yesno = True ) )
777795
778796 if self .plotReference == 'yes' :
779797 expr .append (['plotreference' , self .plotReference ])
@@ -1139,6 +1157,7 @@ def from_sexpr(cls, exp: list) -> Via:
11391157 elif item [0 ] == 'net' : object .net = item [1 ]
11401158 elif item [0 ] == 'tstamp' : object .tstamp = item [1 ]
11411159 elif item [0 ] == 'uuid' : object .tstamp = item [1 ] # Haha :)
1160+ # elif item[0] == 'teardrops': continue
11421161 else :
11431162 raise ValueError (f"Unrecognized property key: { item [0 ]} . Full expression: { item } " )
11441163
0 commit comments