ultralcd.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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 int lcd_puts_P(const char* str);
  9. extern int lcd_printf_P(const char* format, ...);
  10. extern void menu_lcd_longpress_func(void);
  11. extern void menu_lcd_charsetup_func(void);
  12. extern void menu_lcd_lcdupdate_func(void);
  13. // Call with a false parameter to suppress the LCD update from various places like the planner or the temp control.
  14. void ultralcd_init();
  15. void lcd_setstatus(const char* message);
  16. void lcd_setstatuspgm(const char* message);
  17. void lcd_setalertstatuspgm(const char* message);
  18. void lcd_reset_alert_level();
  19. uint8_t get_message_level();
  20. void lcd_adjust_z();
  21. void lcd_pick_babystep();
  22. void lcd_alright();
  23. void show_preheat_nozzle_warning();
  24. void EEPROM_save_B(int pos, int* value);
  25. void EEPROM_read_B(int pos, int* value);
  26. void lcd_wait_interact();
  27. void lcd_loading_filament();
  28. void lcd_change_success();
  29. void lcd_loading_color();
  30. void lcd_sdcard_stop();
  31. void lcd_pause_print();
  32. void lcd_resume_print();
  33. void lcd_print_stop();
  34. void prusa_statistics(int _message, uint8_t _col_nr = 0);
  35. void lcd_confirm_print();
  36. unsigned char lcd_choose_color();
  37. void lcd_load_filament_color_check();
  38. //void lcd_mylang();
  39. extern bool lcd_selftest();
  40. void lcd_menu_statistics();
  41. void lcd_menu_extruder_info(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
  42. extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
  43. extern const char* lcd_display_message_fullscreen_P(const char *msg);
  44. extern void lcd_return_to_status();
  45. extern void lcd_wait_for_click();
  46. extern bool lcd_wait_for_click_delay(uint16_t nDelay);
  47. extern void lcd_show_fullscreen_message_and_wait_P(const char *msg);
  48. // 0: no, 1: yes, -1: timeouted
  49. extern int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
  50. extern int8_t lcd_show_multiscreen_message_two_choices_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes,
  51. const char *first_choice, const char *second_choice);
  52. extern int8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
  53. // Ask the user to move the Z axis up to the end stoppers and let
  54. // the user confirm that it has been done.
  55. #ifndef TMC2130
  56. extern bool lcd_calibrate_z_end_stop_manual(bool only_z);
  57. #endif
  58. // Show the result of the calibration process on the LCD screen.
  59. extern void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask);
  60. extern void lcd_diag_show_end_stops();
  61. #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
  62. #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
  63. #define LCD_MESSAGERPGM(x) lcd_setstatuspgm((x))
  64. #define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
  65. // To be used in lcd_commands_type.
  66. #define LCD_COMMAND_IDLE 0
  67. #define LCD_COMMAND_LOAD_FILAMENT 1
  68. #define LCD_COMMAND_STOP_PRINT 2
  69. #define LCD_COMMAND_FARM_MODE_CONFIRM 4
  70. #define LCD_COMMAND_LONG_PAUSE 5
  71. #define LCD_COMMAND_PID_EXTRUDER 7
  72. #define LCD_COMMAND_V2_CAL 8
  73. extern int lcd_commands_type;
  74. extern int8_t FSensorStateMenu;
  75. #define CUSTOM_MSG_TYPE_STATUS 0 // status message from lcd_status_message variable
  76. #define CUSTOM_MSG_TYPE_MESHBL 1 // Mesh bed leveling in progress
  77. #define CUSTOM_MSG_TYPE_F_LOAD 2 // Loading filament in progress
  78. #define CUSTOM_MSG_TYPE_PIDCAL 3 // PID tuning in progress
  79. #define CUSTOM_MSG_TYPE_TEMCAL 4 // PINDA temp calibration
  80. #define CUSTOM_MSG_TYPE_TEMPRE 5 // Temp compensation preheat
  81. extern unsigned int custom_message_type;
  82. extern unsigned int custom_message_state;
  83. extern uint8_t farm_mode;
  84. extern int farm_no;
  85. extern int farm_timer;
  86. extern int farm_status;
  87. #ifdef TMC2130
  88. #define SILENT_MODE_NORMAL 0
  89. #define SILENT_MODE_STEALTH 1
  90. #define SILENT_MODE_OFF SILENT_MODE_NORMAL
  91. #else
  92. #define SILENT_MODE_POWER 0
  93. #define SILENT_MODE_SILENT 1
  94. #define SILENT_MODE_AUTO 2
  95. #define SILENT_MODE_OFF SILENT_MODE_POWER
  96. #endif
  97. extern int8_t SilentModeMenu;
  98. extern bool cancel_heatup;
  99. extern bool isPrintPaused;
  100. void lcd_ignore_click(bool b=true);
  101. void lcd_commands();
  102. void change_extr(int extr);
  103. void extr_adj(int extruder);
  104. #ifdef SNMM
  105. void extr_unload_all();
  106. void extr_unload_used();
  107. #endif //SNMM
  108. void extr_unload();
  109. typedef enum
  110. {
  111. e_FILAMENT_ACTION_none, //!< 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state)
  112. e_FILAMENT_ACTION_Load,
  113. e_FILAMENT_ACTION_autoLoad,
  114. e_FILAMENT_ACTION_unLoad,
  115. e_FILAMENT_ACTION_mmuLoad,
  116. e_FILAMENT_ACTION_mmuUnLoad,
  117. e_FILAMENT_ACTION_mmuEject,
  118. e_FILAMENT_ACTION_mmuCut,
  119. } eFILAMENT_ACTION;
  120. extern eFILAMENT_ACTION eFilamentAction;
  121. extern bool bFilamentFirstRun;
  122. extern bool bFilamentPreheatState;
  123. extern bool bFilamentAction;
  124. void mFilamentItem(uint16_t nTemp,uint16_t nTempBed);
  125. void mFilamentItemForce();
  126. void mFilamentMenu();
  127. void unload_filament();
  128. void stack_error();
  129. void lcd_printer_connected();
  130. void lcd_ping();
  131. void lcd_calibrate_extruder();
  132. void lcd_farm_sdcard_menu();
  133. //void getFileDescription(char *name, char *description);
  134. void lcd_farm_sdcard_menu_w();
  135. //void get_description();
  136. void lcd_wait_for_heater();
  137. void lcd_wait_for_cool_down();
  138. void lcd_extr_cal_reset();
  139. void lcd_temp_cal_show_result(bool result);
  140. bool lcd_wait_for_pinda(float temp);
  141. void bowden_menu();
  142. char reset_menu();
  143. uint8_t choose_menu_P(const char *header, const char *item, const char *last_item = nullptr);
  144. void lcd_pinda_calibration_menu();
  145. void lcd_calibrate_pinda();
  146. void lcd_temp_calibration_set();
  147. void display_loading();
  148. #if !SDSORT_USES_RAM
  149. void lcd_set_degree();
  150. void lcd_set_progress();
  151. #endif
  152. void lcd_language();
  153. void lcd_wizard();
  154. bool lcd_autoDepleteEnabled();
  155. //! @brief Wizard state
  156. enum class WizState : uint8_t
  157. {
  158. Run, //!< run wizard? Entry point.
  159. Restore, //!< restore calibration status
  160. Selftest,
  161. Xyz, //!< xyz calibration
  162. Z, //!< z calibration
  163. IsFil, //!< Is filament loaded? Entry point for 1st layer calibration
  164. PreheatPla, //!< waiting for preheat nozzle for PLA
  165. Preheat, //!< Preheat for any material
  166. Unload, //!< Unload filament
  167. LoadFil, //!< Load filament
  168. IsPla, //!< Is PLA filament?
  169. Lay1Cal, //!< First layer calibration
  170. RepeatLay1Cal, //!< Repeat first layer calibration?
  171. Finish, //!< Deactivate wizard
  172. };
  173. void lcd_wizard(WizState state);
  174. #endif //ULTRALCD_H