Tools2sidedPrefGroupUI.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. from PyQt5 import QtWidgets
  2. from flatcamGUI.GUIElements import FCDoubleSpinner, RadioSet
  3. from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
  4. class Tools2sidedPrefGroupUI(OptionsGroupUI):
  5. def __init__(self, decimals=4, parent=None):
  6. # OptionsGroupUI.__init__(self, "2sided Tool Options", parent=parent)
  7. super(Tools2sidedPrefGroupUI, self).__init__(self)
  8. self.setTitle(str(_("2Sided Tool Options")))
  9. self.decimals = decimals
  10. # ## Board cuttout
  11. self.dblsided_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
  12. self.dblsided_label.setToolTip(
  13. _("A tool to help in creating a double sided\n"
  14. "PCB using alignment holes.")
  15. )
  16. self.layout.addWidget(self.dblsided_label)
  17. grid0 = QtWidgets.QGridLayout()
  18. self.layout.addLayout(grid0)
  19. # ## Drill diameter for alignment holes
  20. self.drill_dia_entry = FCDoubleSpinner()
  21. self.drill_dia_entry.set_range(0.000001, 9999.9999)
  22. self.drill_dia_entry.set_precision(self.decimals)
  23. self.drill_dia_entry.setSingleStep(0.1)
  24. self.dd_label = QtWidgets.QLabel('%s:' % _("Drill dia"))
  25. self.dd_label.setToolTip(
  26. _("Diameter of the drill for the "
  27. "alignment holes.")
  28. )
  29. grid0.addWidget(self.dd_label, 0, 0)
  30. grid0.addWidget(self.drill_dia_entry, 0, 1)
  31. # ## Alignment Axis
  32. self.align_ax_label = QtWidgets.QLabel('%s:' % _("Align Axis"))
  33. self.align_ax_label.setToolTip(
  34. _("Mirror vertically (X) or horizontally (Y).")
  35. )
  36. self.align_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
  37. {'label': 'Y', 'value': 'Y'}])
  38. grid0.addWidget(self.align_ax_label, 1, 0)
  39. grid0.addWidget(self.align_axis_radio, 1, 1)
  40. # ## Axis
  41. self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
  42. {'label': 'Y', 'value': 'Y'}])
  43. self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:"))
  44. self.mirax_label.setToolTip(
  45. _("Mirror vertically (X) or horizontally (Y).")
  46. )
  47. self.empty_lb1 = QtWidgets.QLabel("")
  48. grid0.addWidget(self.empty_lb1, 2, 0)
  49. grid0.addWidget(self.mirax_label, 3, 0)
  50. grid0.addWidget(self.mirror_axis_radio, 3, 1)
  51. # ## Axis Location
  52. self.axis_location_radio = RadioSet([{'label': _('Point'), 'value': 'point'},
  53. {'label': _('Box'), 'value': 'box'}])
  54. self.axloc_label = QtWidgets.QLabel('%s:' % _("Axis Ref"))
  55. self.axloc_label.setToolTip(
  56. _("The axis should pass through a <b>point</b> or cut\n "
  57. "a specified <b>box</b> (in a FlatCAM object) through \n"
  58. "the center.")
  59. )
  60. grid0.addWidget(self.axloc_label, 4, 0)
  61. grid0.addWidget(self.axis_location_radio, 4, 1)
  62. self.layout.addStretch()