@@ -39,7 +39,7 @@ class Config:
3939 'dark_mode' , 'show_pads' , 'show_fabrication' , 'show_silkscreen' ,
4040 'highlight_pin1' , 'redraw_on_drag' , 'board_rotation' , 'checkboxes' ,
4141 'bom_view' , 'layer_view' , 'offset_back_rotation' ,
42- 'kicad_text_formatting'
42+ 'kicad_text_formatting' , 'mark_when_checked'
4343 ]
4444 default_show_group_fields = ["Value" , "Footprint" ]
4545
@@ -55,6 +55,7 @@ class Config:
5555 board_rotation = 0
5656 offset_back_rotation = False
5757 checkboxes = ',' .join (default_checkboxes )
58+ mark_when_checked = ''
5859 bom_view = bom_view_choices [1 ]
5960 layer_view = layer_view_choices [1 ]
6061 compression = True
@@ -121,6 +122,7 @@ def load_from_ini(self):
121122 self .offset_back_rotation = f .ReadBool (
122123 'offset_back_rotation' , self .offset_back_rotation )
123124 self .checkboxes = f .Read ('checkboxes' , self .checkboxes )
125+ self .mark_when_checked = f .Read ('mark_when_checked' , self .mark_when_checked )
124126 self .bom_view = f .Read ('bom_view' , self .bom_view )
125127 self .layer_view = f .Read ('layer_view' , self .layer_view )
126128 self .compression = f .ReadBool ('compression' , self .compression )
@@ -180,6 +182,7 @@ def save(self, locally):
180182 f .WriteInt ('board_rotation' , self .board_rotation )
181183 f .WriteBool ('offset_back_rotation' , self .offset_back_rotation )
182184 f .Write ('checkboxes' , self .checkboxes )
185+ f .Write ('mark_when_checked' , self .mark_when_checked )
183186 f .Write ('bom_view' , self .bom_view )
184187 f .Write ('layer_view' , self .layer_view )
185188 f .WriteBool ('compression' , self .compression )
@@ -226,6 +229,7 @@ def set_from_dialog(self, dlg):
226229 self .offset_back_rotation = \
227230 dlg .html .offsetBackRotationCheckbox .IsChecked ()
228231 self .checkboxes = dlg .html .bomCheckboxesCtrl .Value
232+ # No dialog for mark_when_checked ...
229233 self .bom_view = self .bom_view_choices [dlg .html .bomDefaultView .Selection ]
230234 self .layer_view = self .layer_view_choices [
231235 dlg .html .layerDefaultView .Selection ]
@@ -275,6 +279,7 @@ def transfer_to_dialog(self, dlg):
275279 dlg .html .boardRotationSlider .Value = self .board_rotation
276280 dlg .html .offsetBackRotationCheckbox .Value = self .offset_back_rotation
277281 dlg .html .bomCheckboxesCtrl .Value = self .checkboxes
282+ # No dialog for mark_when_checked ...
278283 dlg .html .bomDefaultView .Selection = self .bom_view_choices .index (
279284 self .bom_view )
280285 dlg .html .layerDefaultView .Selection = self .layer_view_choices .index (
@@ -360,6 +365,10 @@ def add_options(cls, parser, version):
360365 parser .add_argument ('--checkboxes' ,
361366 default = cls .checkboxes ,
362367 help = 'Comma separated list of checkbox columns.' )
368+ parser .add_argument ('--mark-when-checked' ,
369+ default = cls .mark_when_checked ,
370+ help = 'Name of the checkbox column used to mark '
371+ 'components when checked.' )
363372 parser .add_argument ('--bom-view' , default = cls .bom_view ,
364373 choices = cls .bom_view_choices ,
365374 help = 'Default BOM view.' )
@@ -446,6 +455,7 @@ def set_from_args(self, args):
446455 self .board_rotation = math .fmod (args .board_rotation // 5 , 37 )
447456 self .offset_back_rotation = args .offset_back_rotation
448457 self .checkboxes = args .checkboxes
458+ self .mark_when_checked = args .mark_when_checked
449459 self .bom_view = args .bom_view
450460 self .layer_view = args .layer_view
451461 self .compression = not args .no_compression
0 commit comments