ExcellonAdvOptPrefGroupUI.py 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. from flatcamGUI.preferences.OptionUI import *
  2. from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI2
  3. import gettext
  4. import FlatCAMTranslation as fcTranslate
  5. import builtins
  6. fcTranslate.apply_language('strings')
  7. if '_' not in builtins.__dict__:
  8. _ = gettext.gettext
  9. class ExcellonAdvOptPrefGroupUI(OptionsGroupUI2):
  10. def __init__(self, decimals=4, **kwargs):
  11. self.decimals = decimals
  12. super().__init__(**kwargs)
  13. self.setTitle(str(_("Excellon Adv. Options")))
  14. def build_options(self) -> [OptionUI]:
  15. return [
  16. HeadingOptionUI(
  17. label_text="Advanced Options",
  18. label_tooltip="A list of Excellon advanced parameters.\n"
  19. "Those parameters are available only for\n"
  20. "Advanced App. Level."
  21. ),
  22. DoubleSpinnerOptionUI(
  23. option="excellon_offset",
  24. label_text="Offset Z",
  25. label_tooltip="Some drill bits (the larger ones) need to drill deeper\n"
  26. "to create the desired exit hole diameter due of the tip shape.\n"
  27. "The value here can compensate the Cut Z parameter.",
  28. min_value=-999.9999, max_value=999.9999, step=0.1, decimals=self.decimals
  29. ),
  30. LineEntryOptionUI(
  31. option="excellon_toolchangexy",
  32. label_text="Toolchange X,Y",
  33. label_tooltip="Toolchange X,Y position."
  34. ),
  35. FloatEntryOptionUI(
  36. option="excellon_startz",
  37. label_text="Start Z",
  38. label_tooltip="Height of the tool just after start.\n"
  39. "Delete the value if you don't need this feature."
  40. ),
  41. DoubleSpinnerOptionUI(
  42. option="excellon_feedrate_rapid",
  43. label_text="Feedrate Rapids",
  44. label_tooltip="Tool speed while drilling\n"
  45. "(in units per minute).\n"
  46. "This is for the rapid move G00.\n"
  47. "It is useful only for Marlin,\n"
  48. "ignore for any other cases.",
  49. min_value=0.0001, max_value=99999.9999, step=50, decimals=self.decimals
  50. ),
  51. DoubleSpinnerOptionUI(
  52. option="excellon_z_pdepth",
  53. label_text="Probe Z depth",
  54. label_tooltip="The maximum depth that the probe is allowed\n"
  55. "to probe. Negative value, in current units.",
  56. min_value=-99999.9999, max_value=0.0, step=0.1, decimals=self.decimals
  57. ),
  58. DoubleSpinnerOptionUI(
  59. option="excellon_feedrate_probe",
  60. label_text="Feedrate Probe",
  61. label_tooltip="The feedrate used while the probe is probing.",
  62. min_value=0.0001, max_value=99999.9999, step=0.1, decimals=self.decimals
  63. ),
  64. RadioSetOptionUI(
  65. option="excellon_spindledir",
  66. label_text="Spindle direction",
  67. label_tooltip="This sets the direction that the spindle is rotating.\n"
  68. "It can be either:\n"
  69. "- CW = clockwise or\n"
  70. "- CCW = counter clockwise",
  71. choices=[{'label': _('CW'), 'value': 'CW'},
  72. {'label': _('CCW'), 'value': 'CCW'}]
  73. ),
  74. CheckboxOptionUI(
  75. option="excellon_f_plunge",
  76. label_text="Fast Plunge",
  77. label_tooltip="By checking this, the vertical move from\n"
  78. "Z_Toolchange to Z_move is done with G0,\n"
  79. "meaning the fastest speed available.\n"
  80. "WARNING: the move is done at Toolchange X,Y coords."
  81. ),
  82. CheckboxOptionUI(
  83. option="excellon_f_retract",
  84. label_text="Fast Retract",
  85. label_tooltip="Exit hole strategy.\n"
  86. " - When uncheked, while exiting the drilled hole the drill bit\n"
  87. "will travel slow, with set feedrate (G1), up to zero depth and then\n"
  88. "travel as fast as possible (G0) to the Z Move (travel height).\n"
  89. " - When checked the travel from Z cut (cut depth) to Z_move\n"
  90. "(travel height) is done as fast as possible (G0) in one move."
  91. )
  92. ]