@@ -37,7 +37,7 @@ class Config:
3737 html_config_fields = [
3838 'dark_mode' , 'show_pads' , 'show_fabrication' , 'show_silkscreen' ,
3939 'highlight_pin1' , 'redraw_on_drag' , 'board_rotation' , 'checkboxes' ,
40- 'bom_view' , 'layer_view'
40+ 'bom_view' , 'layer_view' , 'offset_back_rotation'
4141 ]
4242 default_show_group_fields = ["Value" , "Footprint" ]
4343
@@ -51,6 +51,7 @@ class Config:
5151 highlight_pin1 = False
5252 redraw_on_drag = True
5353 board_rotation = 0
54+ offset_back_rotation = False
5455 checkboxes = ',' .join (default_checkboxes )
5556 bom_view = bom_view_choices [1 ]
5657 layer_view = layer_view_choices [1 ]
@@ -114,6 +115,8 @@ def load_from_ini(self):
114115 self .highlight_pin1 = f .ReadBool ('highlight_pin1' , self .highlight_pin1 )
115116 self .redraw_on_drag = f .ReadBool ('redraw_on_drag' , self .redraw_on_drag )
116117 self .board_rotation = f .ReadInt ('board_rotation' , self .board_rotation )
118+ self .offset_back_rotation = f .ReadBool (
119+ 'offset_back_rotation' , self .offset_back_rotation )
117120 self .checkboxes = f .Read ('checkboxes' , self .checkboxes )
118121 self .bom_view = f .Read ('bom_view' , self .bom_view )
119122 self .layer_view = f .Read ('layer_view' , self .layer_view )
@@ -166,6 +169,7 @@ def save(self, locally):
166169 f .WriteBool ('highlight_pin1' , self .highlight_pin1 )
167170 f .WriteBool ('redraw_on_drag' , self .redraw_on_drag )
168171 f .WriteInt ('board_rotation' , self .board_rotation )
172+ f .WriteBool ('offset_back_rotation' , self .offset_back_rotation )
169173 f .Write ('checkboxes' , self .checkboxes )
170174 f .Write ('bom_view' , self .bom_view )
171175 f .Write ('layer_view' , self .layer_view )
@@ -210,6 +214,8 @@ def set_from_dialog(self, dlg):
210214 self .highlight_pin1 = dlg .html .highlightPin1Checkbox .IsChecked ()
211215 self .redraw_on_drag = dlg .html .continuousRedrawCheckbox .IsChecked ()
212216 self .board_rotation = dlg .html .boardRotationSlider .Value
217+ self .offset_back_rotation = \
218+ dlg .html .offsetBackRotationCheckbox .IsChecked ()
213219 self .checkboxes = dlg .html .bomCheckboxesCtrl .Value
214220 self .bom_view = self .bom_view_choices [dlg .html .bomDefaultView .Selection ]
215221 self .layer_view = self .layer_view_choices [
@@ -255,6 +261,7 @@ def transfer_to_dialog(self, dlg):
255261 dlg .html .highlightPin1Checkbox .Value = self .highlight_pin1
256262 dlg .html .continuousRedrawCheckbox .value = self .redraw_on_drag
257263 dlg .html .boardRotationSlider .Value = self .board_rotation
264+ dlg .html .offsetBackRotationCheckbox .Value = self .offset_back_rotation
258265 dlg .html .bomCheckboxesCtrl .Value = self .checkboxes
259266 dlg .html .bomDefaultView .Selection = self .bom_view_choices .index (
260267 self .bom_view )
@@ -332,6 +339,9 @@ def add_options(cls, parser, version):
332339 default = cls .board_rotation * 5 ,
333340 help = 'Board rotation in degrees (-180 to 180). '
334341 'Will be rounded to multiple of 5.' )
342+ parser .add_argument ('--offset-back-rotation' ,
343+ help = 'Offset the back of the pcb by 180 degrees' ,
344+ action = 'store_true' )
335345 parser .add_argument ('--checkboxes' ,
336346 default = cls .checkboxes ,
337347 help = 'Comma separated list of checkbox columns.' )
@@ -417,6 +427,7 @@ def set_from_args(self, args):
417427 self .highlight_pin1 = args .highlight_pin1
418428 self .redraw_on_drag = not args .no_redraw_on_drag
419429 self .board_rotation = math .fmod (args .board_rotation // 5 , 37 )
430+ self .offset_back_rotation = args .offset_back_rotation
420431 self .checkboxes = args .checkboxes
421432 self .bom_view = args .bom_view
422433 self .layer_view = args .layer_view
0 commit comments