ultralcd.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. #ifndef ULTRALCD_H
  2. #define ULTRALCD_H
  3. #include "Marlin.h"
  4. #include "lcd.h"
  5. #include "conv2str.h"
  6. #include "menu.h"
  7. #include "mesh_bed_calibration.h"
  8. extern void menu_lcd_longpress_func(void);
  9. extern void menu_lcd_charsetup_func(void);
  10. extern void menu_lcd_lcdupdate_func(void);
  11. // Call with a false parameter to suppress the LCD update from various places like the planner or the temp control.
  12. void ultralcd_init();
  13. void lcd_setstatus(const char* message);
  14. void lcd_setstatuspgm(const char* message);
  15. //! return to the main status screen and display the alert message
  16. //! Beware - it has sideeffects:
  17. //! - always returns the display to the main status screen
  18. //! - always makes lcd_reset (which is slow and causes flicker)
  19. //! - does not update the message if there is already one (i.e. lcd_status_message_level > 0)
  20. void lcd_setalertstatuspgm(const char* message);
  21. //! only update the alert message on the main status screen
  22. //! has no sideeffects, may be called multiple times
  23. void lcd_updatestatuspgm(const char *message);
  24. void lcd_reset_alert_level();
  25. uint8_t get_message_level();
  26. void lcd_adjust_z();
  27. void lcd_pick_babystep();
  28. void lcd_alright();
  29. void show_preheat_nozzle_warning();
  30. void EEPROM_save_B(int pos, int* value);
  31. void EEPROM_read_B(int pos, int* value);
  32. void lcd_wait_interact();
  33. void lcd_loading_filament();
  34. void lcd_change_success();
  35. void lcd_loading_color();
  36. void lcd_sdcard_stop();
  37. void lcd_pause_print();
  38. void lcd_resume_print();
  39. void lcd_print_stop();
  40. void prusa_statistics(int _message, uint8_t _col_nr = 0);
  41. void lcd_confirm_print();
  42. unsigned char lcd_choose_color();
  43. void lcd_load_filament_color_check();
  44. //void lcd_mylang();
  45. extern bool lcd_selftest();
  46. void lcd_menu_statistics();
  47. void lcd_menu_extruder_info(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
  48. void lcd_menu_show_sensors_state(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
  49. #ifdef TMC2130
  50. bool lcd_crash_detect_enabled();
  51. void lcd_crash_detect_enable();
  52. void lcd_crash_detect_disable();
  53. #endif
  54. extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
  55. extern const char* lcd_display_message_fullscreen_P(const char *msg);
  56. extern void lcd_return_to_status();
  57. extern void lcd_wait_for_click();
  58. extern bool lcd_wait_for_click_delay(uint16_t nDelay);
  59. extern void lcd_show_fullscreen_message_and_wait_P(const char *msg);
  60. // 0: no, 1: yes, -1: timeouted
  61. extern int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
  62. extern int8_t lcd_show_multiscreen_message_two_choices_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes,
  63. const char *first_choice, const char *second_choice);
  64. extern int8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
  65. // Ask the user to move the Z axis up to the end stoppers and let
  66. // the user confirm that it has been done.
  67. #ifndef TMC2130
  68. extern bool lcd_calibrate_z_end_stop_manual(bool only_z);
  69. #endif
  70. // Show the result of the calibration process on the LCD screen.
  71. extern void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask);
  72. extern void lcd_diag_show_end_stops();
  73. #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
  74. #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
  75. #define LCD_MESSAGERPGM(x) lcd_setstatuspgm((x))
  76. #define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
  77. // To be used in lcd_commands_type.
  78. enum class LcdCommands : uint_least8_t
  79. {
  80. Idle,
  81. LoadFilament,
  82. StopPrint,
  83. FarmModeConfirm,
  84. LongPause,
  85. PidExtruder,
  86. Layer1Cal,
  87. };
  88. extern LcdCommands lcd_commands_type;
  89. extern int8_t FSensorStateMenu;
  90. enum class CustomMsg : uint_least8_t
  91. {
  92. Status, //!< status message from lcd_status_message variable
  93. MeshBedLeveling, //!< Mesh bed leveling in progress
  94. FilamentLoading, //!< Loading filament in progress
  95. PidCal, //!< PID tuning in progress
  96. TempCal, //!< PINDA temperature calibration
  97. TempCompPreheat, //!< Temperature compensation preheat
  98. };
  99. extern CustomMsg custom_message_type;
  100. extern unsigned int custom_message_state;
  101. extern uint8_t farm_mode;
  102. extern int farm_no;
  103. extern int farm_timer;
  104. extern uint8_t farm_status;
  105. #ifdef TMC2130
  106. #define SILENT_MODE_NORMAL 0
  107. #define SILENT_MODE_STEALTH 1
  108. #define SILENT_MODE_OFF SILENT_MODE_NORMAL
  109. #else
  110. #define SILENT_MODE_POWER 0
  111. #define SILENT_MODE_SILENT 1
  112. #define SILENT_MODE_AUTO 2
  113. #define SILENT_MODE_OFF SILENT_MODE_POWER
  114. #endif
  115. extern int8_t SilentModeMenu;
  116. extern uint8_t SilentModeMenu_MMU;
  117. extern bool cancel_heatup;
  118. extern bool isPrintPaused;
  119. void lcd_ignore_click(bool b=true);
  120. void lcd_commands();
  121. extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
  122. void lcd_hw_setup_menu(void); // NOT static due to using inside "util" module ("nozzle_diameter_check()")
  123. void change_extr(int extr);
  124. #ifdef SNMM
  125. void extr_unload_all();
  126. void extr_unload_used();
  127. #endif //SNMM
  128. void extr_unload();
  129. enum class FilamentAction : uint_least8_t
  130. {
  131. None, //!< 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state)
  132. Load,
  133. AutoLoad,
  134. UnLoad,
  135. MmuLoad,
  136. MmuUnLoad,
  137. MmuEject,
  138. MmuCut,
  139. };
  140. extern FilamentAction eFilamentAction;
  141. extern bool bFilamentFirstRun;
  142. extern bool bFilamentPreheatState;
  143. extern bool bFilamentAction;
  144. void mFilamentItem(uint16_t nTemp,uint16_t nTempBed);
  145. void mFilamentItemForce();
  146. void mFilamentMenu();
  147. void unload_filament();
  148. void stack_error();
  149. void lcd_printer_connected();
  150. void lcd_ping();
  151. void lcd_calibrate_extruder();
  152. void lcd_farm_sdcard_menu();
  153. //void getFileDescription(char *name, char *description);
  154. void lcd_farm_sdcard_menu_w();
  155. //void get_description();
  156. void lcd_wait_for_heater();
  157. void lcd_wait_for_cool_down();
  158. void lcd_extr_cal_reset();
  159. void lcd_temp_cal_show_result(bool result);
  160. bool lcd_wait_for_pinda(float temp);
  161. void bowden_menu();
  162. char reset_menu();
  163. uint8_t choose_menu_P(const char *header, const char *item, const char *last_item = nullptr);
  164. void lcd_pinda_calibration_menu();
  165. void lcd_calibrate_pinda();
  166. void lcd_temp_calibration_set();
  167. void display_loading();
  168. #if !SDSORT_USES_RAM
  169. void lcd_set_degree();
  170. void lcd_set_progress();
  171. #endif
  172. void lcd_language();
  173. void lcd_wizard();
  174. bool lcd_autoDepleteEnabled();
  175. //! @brief Wizard state
  176. enum class WizState : uint8_t
  177. {
  178. Run, //!< run wizard? Entry point.
  179. Restore, //!< restore calibration status
  180. Selftest,
  181. Xyz, //!< xyz calibration
  182. Z, //!< z calibration
  183. IsFil, //!< Is filament loaded? Entry point for 1st layer calibration
  184. PreheatPla, //!< waiting for preheat nozzle for PLA
  185. Preheat, //!< Preheat for any material
  186. Unload, //!< Unload filament
  187. LoadFil, //!< Load filament
  188. IsPla, //!< Is PLA filament?
  189. Lay1Cal, //!< First layer calibration
  190. RepeatLay1Cal, //!< Repeat first layer calibration?
  191. Finish, //!< Deactivate wizard
  192. };
  193. void lcd_wizard(WizState state);
  194. #endif //ULTRALCD_H