GeometryAdvOptPrefGroupUI.py 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. from PyQt5 import QtWidgets
  2. from flatcamGUI.GUIElements import FCEntry, FloatEntry, FCDoubleSpinner, FCCheckBox, RadioSet
  3. from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
  4. class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
  5. def __init__(self, decimals=4, parent=None):
  6. # OptionsGroupUI.__init__(self, "Geometry Advanced Options Preferences", parent=parent)
  7. super(GeometryAdvOptPrefGroupUI, self).__init__(self)
  8. self.setTitle(str(_("Geometry Adv. Options")))
  9. self.decimals = decimals
  10. # ------------------------------
  11. # ## Advanced Options
  12. # ------------------------------
  13. self.geo_label = QtWidgets.QLabel('<b>%s:</b>' % _('Advanced Options'))
  14. self.geo_label.setToolTip(
  15. _("A list of Geometry advanced parameters.\n"
  16. "Those parameters are available only for\n"
  17. "Advanced App. Level.")
  18. )
  19. self.layout.addWidget(self.geo_label)
  20. grid1 = QtWidgets.QGridLayout()
  21. self.layout.addLayout(grid1)
  22. # Toolchange X,Y
  23. toolchange_xy_label = QtWidgets.QLabel('%s:' % _('Toolchange X-Y'))
  24. toolchange_xy_label.setToolTip(
  25. _("Toolchange X,Y position.")
  26. )
  27. grid1.addWidget(toolchange_xy_label, 1, 0)
  28. self.toolchangexy_entry = FCEntry()
  29. grid1.addWidget(self.toolchangexy_entry, 1, 1)
  30. # Start move Z
  31. startzlabel = QtWidgets.QLabel('%s:' % _('Start Z'))
  32. startzlabel.setToolTip(
  33. _("Height of the tool just after starting the work.\n"
  34. "Delete the value if you don't need this feature.")
  35. )
  36. grid1.addWidget(startzlabel, 2, 0)
  37. self.gstartz_entry = FloatEntry()
  38. grid1.addWidget(self.gstartz_entry, 2, 1)
  39. # Feedrate rapids
  40. fr_rapid_label = QtWidgets.QLabel('%s:' % _('Feedrate Rapids'))
  41. fr_rapid_label.setToolTip(
  42. _("Cutting speed in the XY plane\n"
  43. "(in units per minute).\n"
  44. "This is for the rapid move G00.\n"
  45. "It is useful only for Marlin,\n"
  46. "ignore for any other cases.")
  47. )
  48. self.feedrate_rapid_entry = FCDoubleSpinner()
  49. self.feedrate_rapid_entry.set_range(0, 99999.9999)
  50. self.feedrate_rapid_entry.set_precision(self.decimals)
  51. self.feedrate_rapid_entry.setSingleStep(0.1)
  52. self.feedrate_rapid_entry.setWrapping(True)
  53. grid1.addWidget(fr_rapid_label, 4, 0)
  54. grid1.addWidget(self.feedrate_rapid_entry, 4, 1)
  55. # End move extra cut
  56. self.extracut_cb = FCCheckBox('%s' % _('Re-cut'))
  57. self.extracut_cb.setToolTip(
  58. _("In order to remove possible\n"
  59. "copper leftovers where first cut\n"
  60. "meet with last cut, we generate an\n"
  61. "extended cut over the first cut section.")
  62. )
  63. self.e_cut_entry = FCDoubleSpinner()
  64. self.e_cut_entry.set_range(0, 99999)
  65. self.e_cut_entry.set_precision(self.decimals)
  66. self.e_cut_entry.setSingleStep(0.1)
  67. self.e_cut_entry.setWrapping(True)
  68. self.e_cut_entry.setToolTip(
  69. _("In order to remove possible\n"
  70. "copper leftovers where first cut\n"
  71. "meet with last cut, we generate an\n"
  72. "extended cut over the first cut section.")
  73. )
  74. grid1.addWidget(self.extracut_cb, 5, 0)
  75. grid1.addWidget(self.e_cut_entry, 5, 1)
  76. # Probe depth
  77. self.pdepth_label = QtWidgets.QLabel('%s:' % _("Probe Z depth"))
  78. self.pdepth_label.setToolTip(
  79. _("The maximum depth that the probe is allowed\n"
  80. "to probe. Negative value, in current units.")
  81. )
  82. self.pdepth_entry = FCDoubleSpinner()
  83. self.pdepth_entry.set_range(-99999, 0.0000)
  84. self.pdepth_entry.set_precision(self.decimals)
  85. self.pdepth_entry.setSingleStep(0.1)
  86. self.pdepth_entry.setWrapping(True)
  87. grid1.addWidget(self.pdepth_label, 6, 0)
  88. grid1.addWidget(self.pdepth_entry, 6, 1)
  89. # Probe feedrate
  90. self.feedrate_probe_label = QtWidgets.QLabel('%s:' % _("Feedrate Probe"))
  91. self.feedrate_probe_label.setToolTip(
  92. _("The feedrate used while the probe is probing.")
  93. )
  94. self.feedrate_probe_entry = FCDoubleSpinner()
  95. self.feedrate_probe_entry.set_range(0, 99999.9999)
  96. self.feedrate_probe_entry.set_precision(self.decimals)
  97. self.feedrate_probe_entry.setSingleStep(0.1)
  98. self.feedrate_probe_entry.setWrapping(True)
  99. grid1.addWidget(self.feedrate_probe_label, 7, 0)
  100. grid1.addWidget(self.feedrate_probe_entry, 7, 1)
  101. # Spindle direction
  102. spindle_dir_label = QtWidgets.QLabel('%s:' % _('Spindle direction'))
  103. spindle_dir_label.setToolTip(
  104. _("This sets the direction that the spindle is rotating.\n"
  105. "It can be either:\n"
  106. "- CW = clockwise or\n"
  107. "- CCW = counter clockwise")
  108. )
  109. self.spindledir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'},
  110. {'label': _('CCW'), 'value': 'CCW'}])
  111. grid1.addWidget(spindle_dir_label, 8, 0)
  112. grid1.addWidget(self.spindledir_radio, 8, 1)
  113. # Fast Move from Z Toolchange
  114. self.fplunge_cb = FCCheckBox('%s' % _('Fast Plunge'))
  115. self.fplunge_cb.setToolTip(
  116. _("By checking this, the vertical move from\n"
  117. "Z_Toolchange to Z_move is done with G0,\n"
  118. "meaning the fastest speed available.\n"
  119. "WARNING: the move is done at Toolchange X,Y coords.")
  120. )
  121. grid1.addWidget(self.fplunge_cb, 9, 0, 1, 2)
  122. # Size of trace segment on X axis
  123. segx_label = QtWidgets.QLabel('%s:' % _("Segment X size"))
  124. segx_label.setToolTip(
  125. _("The size of the trace segment on the X axis.\n"
  126. "Useful for auto-leveling.\n"
  127. "A value of 0 means no segmentation on the X axis.")
  128. )
  129. self.segx_entry = FCDoubleSpinner()
  130. self.segx_entry.set_range(0, 99999)
  131. self.segx_entry.set_precision(self.decimals)
  132. self.segx_entry.setSingleStep(0.1)
  133. self.segx_entry.setWrapping(True)
  134. grid1.addWidget(segx_label, 10, 0)
  135. grid1.addWidget(self.segx_entry, 10, 1)
  136. # Size of trace segment on Y axis
  137. segy_label = QtWidgets.QLabel('%s:' % _("Segment Y size"))
  138. segy_label.setToolTip(
  139. _("The size of the trace segment on the Y axis.\n"
  140. "Useful for auto-leveling.\n"
  141. "A value of 0 means no segmentation on the Y axis.")
  142. )
  143. self.segy_entry = FCDoubleSpinner()
  144. self.segy_entry.set_range(0, 99999)
  145. self.segy_entry.set_precision(self.decimals)
  146. self.segy_entry.setSingleStep(0.1)
  147. self.segy_entry.setWrapping(True)
  148. grid1.addWidget(segy_label, 11, 0)
  149. grid1.addWidget(self.segy_entry, 11, 1)
  150. self.layout.addStretch()