My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

nozzle_offsets_screen.cpp 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*****************************
  2. * nozzle_offsets_screen.cpp *
  3. *****************************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  7. * *
  8. * This program is free software: you can redistribute it and/or modify *
  9. * it under the terms of the GNU General Public License as published by *
  10. * the Free Software Foundation, either version 3 of the License, or *
  11. * (at your option) any later version. *
  12. * *
  13. * This program is distributed in the hope that it will be useful, *
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  16. * GNU General Public License for more details. *
  17. * *
  18. * To view a copy of the GNU General Public License, go to the following *
  19. * location: <http://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #if ENABLED(TOUCH_UI_FTDI_EVE) && HOTENDS > 1
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace ExtUI;
  26. void NozzleOffsetScreen::onEntry() {
  27. // Since we don't allow the user to edit the offsets for E0,
  28. // make sure they are all zero.
  29. normalizeNozzleOffset(X);
  30. normalizeNozzleOffset(Y);
  31. normalizeNozzleOffset(Z);
  32. }
  33. void NozzleOffsetScreen::onRedraw(draw_mode_t what) {
  34. widgets_t w(what);
  35. w.precision(2).units(GET_TEXT_F(MSG_UNITS_MM));
  36. w.heading( GET_TEXT_F(STR_OFFSETS_MENU));
  37. w.color(Theme::x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), ExtUI::getNozzleOffset_mm(X, E1));
  38. w.color(Theme::y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), ExtUI::getNozzleOffset_mm(Y, E1));
  39. w.color(Theme::z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), ExtUI::getNozzleOffset_mm(Z, E1));
  40. #if ENABLED(CALIBRATION_GCODE)
  41. w.button(8, GET_TEXT_F(MSG_MEASURE_AUTOMATICALLY), !isPrinting());
  42. #endif
  43. w.increments();
  44. }
  45. bool NozzleOffsetScreen::onTouchHeld(uint8_t tag) {
  46. const float increment = getIncrement();
  47. switch (tag) {
  48. case 2: UI_DECREMENT(NozzleOffset_mm, X, E1); break;
  49. case 3: UI_INCREMENT(NozzleOffset_mm, X, E1); break;
  50. case 4: UI_DECREMENT(NozzleOffset_mm, Y, E1); break;
  51. case 5: UI_INCREMENT(NozzleOffset_mm, Y, E1); break;
  52. case 6: UI_DECREMENT(NozzleOffset_mm, Z, E1); break;
  53. case 7: UI_INCREMENT(NozzleOffset_mm, Z, E1); break;
  54. #if ENABLED(CALIBRATION_GCODE)
  55. case 8: GOTO_SCREEN(ConfirmAutoCalibrationDialogBox); return true;
  56. #endif
  57. default:
  58. return false;
  59. }
  60. SaveSettingsDialogBox::settingsChanged();
  61. return true;
  62. }
  63. #endif // TOUCH_UI_FTDI_EVE