GeometryAdvOptPrefGroupUI.py 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 GeometryAdvOptPrefGroupUI(OptionsGroupUI2):
  10. def __init__(self, decimals=4, **kwargs):
  11. self.decimals = decimals
  12. super().__init__(**kwargs)
  13. self.setTitle(str(_("Geometry Adv. Options")))
  14. def build_options(self) -> [OptionUI]:
  15. return [
  16. HeadingOptionUI(
  17. label_text="Advanced Options",
  18. label_tooltip="A list of Geometry advanced parameters.\n"
  19. "Those parameters are available only for\n"
  20. "Advanced App. Level."
  21. ),
  22. LineEntryOptionUI(
  23. option="geometry_toolchangexy",
  24. label_text="Toolchange X-Y",
  25. label_tooltip="Toolchange X,Y position."
  26. ),
  27. FloatEntryOptionUI(
  28. option="geometry_startz",
  29. label_text="Start Z",
  30. label_tooltip="Height of the tool just after starting the work.\n"
  31. "Delete the value if you don't need this feature."
  32. ),
  33. DoubleSpinnerOptionUI(
  34. option="geometry_feedrate_rapid",
  35. label_text="Feedrate Rapids",
  36. label_tooltip="Cutting speed in the XY plane\n"
  37. "(in units per minute).\n"
  38. "This is for the rapid move G00.\n"
  39. "It is useful only for Marlin,\n"
  40. "ignore for any other cases.",
  41. min_value=0, max_value=99999.9999, step=10, decimals=self.decimals
  42. ),
  43. CheckboxOptionUI(
  44. option="geometry_extracut",
  45. label_text="Re-cut",
  46. label_tooltip="In order to remove possible\n"
  47. "copper leftovers where first cut\n"
  48. "meet with last cut, we generate an\n"
  49. "extended cut over the first cut section."
  50. ),
  51. DoubleSpinnerOptionUI(
  52. option="geometry_extracut_length",
  53. label_text="Re-cut length",
  54. label_tooltip="In order to remove possible\n"
  55. "copper leftovers where first cut\n"
  56. "meet with last cut, we generate an\n"
  57. "extended cut over the first cut section.",
  58. min_value=0, max_value=99999, step=0.1, decimals=self.decimals
  59. ),
  60. DoubleSpinnerOptionUI(
  61. option="geometry_z_pdepth",
  62. label_text="Probe Z depth",
  63. label_tooltip="The maximum depth that the probe is allowed\n"
  64. "to probe. Negative value, in current units.",
  65. min_value=-99999, max_value=0.0, step=0.1, decimals=self.decimals
  66. ),
  67. DoubleSpinnerOptionUI(
  68. option="geometry_feedrate_probe",
  69. label_text="Feedrate Probe",
  70. label_tooltip="The feedrate used while the probe is probing.",
  71. min_value=0, max_value=99999.9999, step=0.1, decimals=self.decimals
  72. ),
  73. RadioSetOptionUI(
  74. option="geometry_spindledir",
  75. label_text="Spindle direction",
  76. label_tooltip="This sets the direction that the spindle is rotating.\n"
  77. "It can be either:\n"
  78. "- CW = clockwise or\n"
  79. "- CCW = counter clockwise",
  80. choices=[{'label': _('CW'), 'value': 'CW'},
  81. {'label': _('CCW'), 'value': 'CCW'}]
  82. ),
  83. CheckboxOptionUI(
  84. option="geometry_f_plunge",
  85. label_text="Fast Plunge",
  86. label_tooltip="By checking this, the vertical move from\n"
  87. "Z_Toolchange to Z_move is done with G0,\n"
  88. "meaning the fastest speed available.\n"
  89. "WARNING: the move is done at Toolchange X,Y coords."
  90. ),
  91. DoubleSpinnerOptionUI(
  92. option="geometry_segx",
  93. label_text="Segment X size",
  94. label_tooltip="The size of the trace segment on the X axis.\n"
  95. "Useful for auto-leveling.\n"
  96. "A value of 0 means no segmentation on the X axis.",
  97. min_value=0, max_value=99999, step=0.1, decimals=self.decimals
  98. ),
  99. DoubleSpinnerOptionUI(
  100. option="geometry_segy",
  101. label_text="Segment Y size",
  102. label_tooltip="The size of the trace segment on the Y axis.\n"
  103. "Useful for auto-leveling.\n"
  104. "A value of 0 means no segmentation on the Y axis.",
  105. min_value=0, max_value=99999, step=0.1, decimals=self.decimals
  106. ),
  107. HeadingOptionUI(
  108. label_text="Area Exclusion",
  109. label_tooltip="Area exclusion parameters.\n"
  110. "Those parameters are available only for\n"
  111. "Advanced App. Level."
  112. ),
  113. CheckboxOptionUI(
  114. option="geometry_area_exclusion",
  115. label_text="Exclusion areas",
  116. label_tooltip="Include exclusion areas.\n"
  117. "In those areas the travel of the tools\n"
  118. "is forbidden."
  119. ),
  120. RadioSetOptionUI(
  121. option="geometry_area_shape",
  122. label_text="Shape",
  123. label_tooltip="The kind of selection shape used for area selection.",
  124. choices=[{'label': _("Square"), 'value': 'square'},
  125. {'label': _("Polygon"), 'value': 'polygon'}]
  126. ),
  127. RadioSetOptionUI(
  128. option="geometry_area_strategy",
  129. label_text="Strategy",
  130. label_tooltip="The strategy followed when encountering an exclusion area.\n"
  131. "Can be:\n"
  132. "- Over -> when encountering the area, the tool will go to a set height\n"
  133. "- Around -> will avoid the exclusion area by going around the area",
  134. choices=[{'label': _('Over'), 'value': 'over'},
  135. {'label': _('Around'), 'value': 'around'}]
  136. ),
  137. DoubleSpinnerOptionUI(
  138. option="geometry_area_overz",
  139. label_text="Over Z",
  140. label_tooltip="The height Z to which the tool will rise in order to avoid\n"
  141. "an interdiction area.",
  142. min_value=0.0, max_value=9999.9999, step=0.5, decimals=self.decimals
  143. )
  144. ]