CNCJobOptPrefGroupUI.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 CNCJobOptPrefGroupUI(OptionsGroupUI2):
  10. def __init__(self, decimals=4, **kwargs):
  11. self.decimals = decimals
  12. super().__init__(**kwargs)
  13. self.setTitle(str(_("CNC Job Options")))
  14. def build_options(self) -> [OptionUI]:
  15. return [
  16. HeadingOptionUI(
  17. label_text="Export G-Code",
  18. label_tooltip="Export and save G-Code to\n"
  19. "make this object to a file."
  20. ),
  21. TextAreaOptionUI(
  22. option="cncjob_prepend",
  23. label_text="Prepend to G-Code",
  24. label_tooltip="Type here any G-Code commands you would\n"
  25. "like to add at the beginning of the G-Code file."
  26. ),
  27. TextAreaOptionUI(
  28. option="cncjob_append",
  29. label_text="Append to G-Code",
  30. label_tooltip="Type here any G-Code commands you would\n"
  31. "like to append to the generated file.\n"
  32. "I.e.: M2 (End of program)"
  33. )
  34. ]