2016-07-22 15:28:01 +02:00
|
|
|
#ifndef ULTRALCD_H
|
|
|
|
#define ULTRALCD_H
|
|
|
|
|
|
|
|
#include "Marlin.h"
|
2018-07-16 19:29:27 +02:00
|
|
|
#include "lcd.h"
|
2018-07-16 17:23:35 +02:00
|
|
|
#include "conv2str.h"
|
2018-08-01 22:37:10 +02:00
|
|
|
#include "menu.h"
|
2018-08-07 15:46:23 +02:00
|
|
|
#include "mesh_bed_calibration.h"
|
2019-07-29 15:55:42 +03:00
|
|
|
#include "config.h"
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2019-09-16 00:43:37 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
2018-07-16 02:13:52 +02:00
|
|
|
extern void menu_lcd_longpress_func(void);
|
|
|
|
extern void menu_lcd_charsetup_func(void);
|
|
|
|
extern void menu_lcd_lcdupdate_func(void);
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
// Call with a false parameter to suppress the LCD update from various places like the planner or the temp control.
|
|
|
|
void ultralcd_init();
|
|
|
|
void lcd_setstatus(const char* message);
|
|
|
|
void lcd_setstatuspgm(const char* message);
|
2019-05-24 08:46:44 +02:00
|
|
|
//! return to the main status screen and display the alert message
|
|
|
|
//! Beware - it has sideeffects:
|
|
|
|
//! - always returns the display to the main status screen
|
|
|
|
//! - always makes lcd_reset (which is slow and causes flicker)
|
|
|
|
//! - does not update the message if there is already one (i.e. lcd_status_message_level > 0)
|
2020-07-31 20:19:51 +02:00
|
|
|
void lcd_setalertstatus(const char* message);
|
2018-08-19 18:34:57 +02:00
|
|
|
void lcd_setalertstatuspgm(const char* message);
|
2019-05-24 08:46:44 +02:00
|
|
|
//! only update the alert message on the main status screen
|
|
|
|
//! has no sideeffects, may be called multiple times
|
2020-07-31 20:19:51 +02:00
|
|
|
void lcd_updatestatus(const char *message);
|
2019-05-24 08:46:44 +02:00
|
|
|
void lcd_updatestatuspgm(const char *message);
|
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
void lcd_reset_alert_level();
|
|
|
|
uint8_t get_message_level();
|
|
|
|
void lcd_adjust_z();
|
|
|
|
void lcd_pick_babystep();
|
|
|
|
void lcd_alright();
|
2018-11-01 16:29:09 +01:00
|
|
|
void show_preheat_nozzle_warning();
|
2018-08-19 18:34:57 +02:00
|
|
|
void EEPROM_save_B(int pos, int* value);
|
|
|
|
void EEPROM_read_B(int pos, int* value);
|
|
|
|
void lcd_wait_interact();
|
|
|
|
void lcd_loading_filament();
|
|
|
|
void lcd_change_success();
|
|
|
|
void lcd_loading_color();
|
|
|
|
void lcd_sdcard_stop();
|
2018-09-06 08:32:50 +02:00
|
|
|
void lcd_pause_print();
|
|
|
|
void lcd_resume_print();
|
2018-08-19 18:34:57 +02:00
|
|
|
void lcd_print_stop();
|
|
|
|
void prusa_statistics(int _message, uint8_t _col_nr = 0);
|
|
|
|
void lcd_confirm_print();
|
|
|
|
unsigned char lcd_choose_color();
|
2018-10-31 21:48:05 +01:00
|
|
|
void lcd_load_filament_color_check();
|
2018-06-08 00:20:28 +02:00
|
|
|
//void lcd_mylang();
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2019-06-20 00:09:55 +02:00
|
|
|
extern void lcd_belttest();
|
2018-08-19 18:34:57 +02:00
|
|
|
extern bool lcd_selftest();
|
2018-07-23 13:35:38 +02:00
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
void lcd_menu_statistics();
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2020-03-02 19:07:23 +01:00
|
|
|
void lcd_status_screen(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
|
2019-03-04 12:52:35 +01:00
|
|
|
void lcd_menu_extruder_info(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
|
2019-03-11 20:43:07 +01:00
|
|
|
void lcd_menu_show_sensors_state(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
|
2020-03-02 17:52:25 +01:00
|
|
|
|
2019-08-20 17:22:27 +02:00
|
|
|
#ifdef TMC2130
|
|
|
|
bool lcd_crash_detect_enabled();
|
|
|
|
void lcd_crash_detect_enable();
|
|
|
|
void lcd_crash_detect_disable();
|
|
|
|
#endif
|
2019-03-04 12:52:35 +01:00
|
|
|
|
2018-08-02 18:54:00 +02:00
|
|
|
extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
|
|
|
|
extern const char* lcd_display_message_fullscreen_P(const char *msg);
|
2016-09-01 10:44:24 +02:00
|
|
|
|
2018-08-27 20:57:57 +02:00
|
|
|
extern void lcd_return_to_status();
|
2018-08-19 18:34:57 +02:00
|
|
|
extern void lcd_wait_for_click();
|
2018-11-02 23:03:14 +01:00
|
|
|
extern bool lcd_wait_for_click_delay(uint16_t nDelay);
|
2018-08-19 18:34:57 +02:00
|
|
|
extern void lcd_show_fullscreen_message_and_wait_P(const char *msg);
|
|
|
|
// 0: no, 1: yes, -1: timeouted
|
|
|
|
extern int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
|
2018-09-14 16:06:25 +02:00
|
|
|
extern int8_t lcd_show_multiscreen_message_two_choices_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes,
|
|
|
|
const char *first_choice, const char *second_choice);
|
2018-08-19 18:34:57 +02:00
|
|
|
extern int8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
|
|
|
|
// Ask the user to move the Z axis up to the end stoppers and let
|
|
|
|
// the user confirm that it has been done.
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
#ifndef TMC2130
|
|
|
|
extern bool lcd_calibrate_z_end_stop_manual(bool only_z);
|
|
|
|
#endif
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
// Show the result of the calibration process on the LCD screen.
|
2018-08-21 17:56:34 +02:00
|
|
|
extern void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask);
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
extern void lcd_diag_show_end_stops();
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
|
|
|
|
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
|
|
|
|
#define LCD_MESSAGERPGM(x) lcd_setstatuspgm((x))
|
|
|
|
#define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
|
|
|
|
|
|
|
|
|
|
|
|
// To be used in lcd_commands_type.
|
2019-06-12 18:42:55 +02:00
|
|
|
enum class LcdCommands : uint_least8_t
|
2019-06-12 18:22:57 +02:00
|
|
|
{
|
|
|
|
Idle,
|
|
|
|
LoadFilament,
|
|
|
|
StopPrint,
|
|
|
|
FarmModeConfirm,
|
|
|
|
LongPause,
|
|
|
|
PidExtruder,
|
|
|
|
Layer1Cal,
|
2019-06-12 09:58:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern LcdCommands lcd_commands_type;
|
2018-09-04 08:06:03 +02:00
|
|
|
extern int8_t FSensorStateMenu;
|
2018-08-19 18:34:57 +02:00
|
|
|
|
2019-06-12 18:42:55 +02:00
|
|
|
enum class CustomMsg : uint_least8_t
|
|
|
|
{
|
|
|
|
Status, //!< status message from lcd_status_message variable
|
|
|
|
MeshBedLeveling, //!< Mesh bed leveling in progress
|
|
|
|
FilamentLoading, //!< Loading filament in progress
|
|
|
|
PidCal, //!< PID tuning in progress
|
|
|
|
TempCal, //!< PINDA temperature calibration
|
|
|
|
TempCompPreheat, //!< Temperature compensation preheat
|
2019-06-12 09:58:42 +02:00
|
|
|
};
|
2018-08-19 18:34:57 +02:00
|
|
|
|
2019-06-12 18:42:55 +02:00
|
|
|
extern CustomMsg custom_message_type;
|
2018-08-19 18:34:57 +02:00
|
|
|
extern unsigned int custom_message_state;
|
|
|
|
|
|
|
|
extern uint8_t farm_mode;
|
|
|
|
extern int farm_no;
|
|
|
|
extern int farm_timer;
|
2019-06-12 09:58:42 +02:00
|
|
|
extern uint8_t farm_status;
|
2018-08-19 18:34:57 +02:00
|
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
|
#define SILENT_MODE_NORMAL 0
|
|
|
|
#define SILENT_MODE_STEALTH 1
|
|
|
|
#define SILENT_MODE_OFF SILENT_MODE_NORMAL
|
|
|
|
#else
|
|
|
|
#define SILENT_MODE_POWER 0
|
|
|
|
#define SILENT_MODE_SILENT 1
|
|
|
|
#define SILENT_MODE_AUTO 2
|
|
|
|
#define SILENT_MODE_OFF SILENT_MODE_POWER
|
|
|
|
#endif
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2020-03-26 14:40:47 +01:00
|
|
|
#ifdef IR_SENSOR_ANALOG
|
2020-03-02 19:07:23 +01:00
|
|
|
extern bool bMenuFSDetect;
|
2020-06-03 16:14:56 +02:00
|
|
|
void printf_IRSensorAnalogBoardChange();
|
2020-03-02 19:07:23 +01:00
|
|
|
#endif //IR_SENSOR_ANALOG
|
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
extern int8_t SilentModeMenu;
|
2019-03-11 12:33:22 +01:00
|
|
|
extern uint8_t SilentModeMenu_MMU;
|
2016-08-11 10:42:53 +02:00
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
extern bool cancel_heatup;
|
|
|
|
extern bool isPrintPaused;
|
2016-07-22 15:28:01 +02:00
|
|
|
|
|
|
|
|
2018-08-19 18:34:57 +02:00
|
|
|
void lcd_ignore_click(bool b=true);
|
|
|
|
void lcd_commands();
|
2016-07-22 15:28:01 +02:00
|
|
|
|
2017-03-24 19:47:50 +01:00
|
|
|
|
2019-07-16 20:10:49 +02:00
|
|
|
extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
|
|
|
|
void lcd_hw_setup_menu(void); // NOT static due to using inside "util" module ("nozzle_diameter_check()")
|
2019-07-10 16:29:40 +02:00
|
|
|
|
|
|
|
|
2017-03-24 19:47:50 +01:00
|
|
|
void change_extr(int extr);
|
2018-07-23 13:35:38 +02:00
|
|
|
|
2018-10-31 21:48:05 +01:00
|
|
|
#ifdef SNMM
|
2017-06-29 18:35:43 +02:00
|
|
|
void extr_unload_all();
|
|
|
|
void extr_unload_used();
|
2018-10-31 21:48:05 +01:00
|
|
|
#endif //SNMM
|
2017-06-29 18:35:43 +02:00
|
|
|
void extr_unload();
|
2017-03-24 19:47:50 +01:00
|
|
|
|
2019-06-12 19:11:41 +02:00
|
|
|
enum class FilamentAction : uint_least8_t
|
2019-02-25 11:12:39 +01:00
|
|
|
{
|
2019-06-12 19:11:41 +02:00
|
|
|
None, //!< 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state)
|
|
|
|
Load,
|
|
|
|
AutoLoad,
|
|
|
|
UnLoad,
|
|
|
|
MmuLoad,
|
|
|
|
MmuUnLoad,
|
|
|
|
MmuEject,
|
|
|
|
MmuCut,
|
2019-08-26 20:11:52 +02:00
|
|
|
Preheat,
|
2019-09-12 17:54:05 +02:00
|
|
|
Lay1Cal,
|
2019-06-12 09:58:42 +02:00
|
|
|
};
|
|
|
|
|
2019-06-12 19:11:41 +02:00
|
|
|
extern FilamentAction eFilamentAction;
|
2019-02-06 01:58:05 +01:00
|
|
|
extern bool bFilamentFirstRun;
|
|
|
|
extern bool bFilamentPreheatState;
|
2019-02-20 03:01:33 +01:00
|
|
|
extern bool bFilamentAction;
|
|
|
|
void mFilamentItem(uint16_t nTemp,uint16_t nTempBed);
|
2019-02-26 17:33:37 +01:00
|
|
|
void mFilamentItemForce();
|
2019-09-12 18:15:15 +02:00
|
|
|
void lcd_generic_preheat_menu();
|
2018-07-31 12:24:22 +02:00
|
|
|
void unload_filament();
|
|
|
|
|
2017-03-24 19:47:50 +01:00
|
|
|
void stack_error();
|
|
|
|
void lcd_printer_connected();
|
|
|
|
void lcd_ping();
|
|
|
|
|
|
|
|
void lcd_calibrate_extruder();
|
|
|
|
void lcd_farm_sdcard_menu();
|
|
|
|
|
|
|
|
//void getFileDescription(char *name, char *description);
|
|
|
|
|
|
|
|
void lcd_farm_sdcard_menu_w();
|
|
|
|
//void get_description();
|
|
|
|
|
2018-01-15 11:30:28 +01:00
|
|
|
void lcd_wait_for_heater();
|
2017-12-14 19:36:32 +01:00
|
|
|
void lcd_wait_for_cool_down();
|
2017-03-24 19:47:50 +01:00
|
|
|
void lcd_extr_cal_reset();
|
|
|
|
|
2018-04-24 13:43:51 +02:00
|
|
|
void lcd_temp_cal_show_result(bool result);
|
2019-09-17 20:26:03 +02:00
|
|
|
#ifdef PINDA_THERMISTOR
|
2018-04-24 13:43:51 +02:00
|
|
|
bool lcd_wait_for_pinda(float temp);
|
2019-09-17 20:26:03 +02:00
|
|
|
#endif //PINDA_THERMISTOR
|
2018-04-24 13:43:51 +02:00
|
|
|
|
|
|
|
|
2017-06-29 18:35:43 +02:00
|
|
|
void bowden_menu();
|
2017-03-24 19:47:50 +01:00
|
|
|
char reset_menu();
|
2018-09-11 22:33:13 +02:00
|
|
|
uint8_t choose_menu_P(const char *header, const char *item, const char *last_item = nullptr);
|
2017-06-29 18:35:43 +02:00
|
|
|
|
|
|
|
void lcd_pinda_calibration_menu();
|
|
|
|
void lcd_calibrate_pinda();
|
|
|
|
void lcd_temp_calibration_set();
|
|
|
|
|
|
|
|
void display_loading();
|
|
|
|
|
2017-12-10 11:08:50 +01:00
|
|
|
#if !SDSORT_USES_RAM
|
2018-08-19 18:34:57 +02:00
|
|
|
void lcd_set_degree();
|
|
|
|
void lcd_set_progress();
|
2017-12-10 11:08:50 +01:00
|
|
|
#endif
|
|
|
|
|
2019-07-29 15:55:42 +03:00
|
|
|
#if (LANG_MODE != 0)
|
2018-06-10 16:04:32 +02:00
|
|
|
void lcd_language();
|
2019-07-29 15:55:42 +03:00
|
|
|
#endif
|
2018-06-10 16:04:32 +02:00
|
|
|
|
2017-11-07 16:49:04 +01:00
|
|
|
void lcd_wizard();
|
2018-11-05 17:43:07 +01:00
|
|
|
bool lcd_autoDepleteEnabled();
|
2018-09-13 16:07:19 +02:00
|
|
|
|
|
|
|
//! @brief Wizard state
|
|
|
|
enum class WizState : uint8_t
|
|
|
|
{
|
2019-09-17 18:58:59 +02:00
|
|
|
Run, //!< run wizard? Main entry point.
|
2018-09-13 16:07:19 +02:00
|
|
|
Restore, //!< restore calibration status
|
2019-09-17 18:58:59 +02:00
|
|
|
Selftest, //!< self test
|
2018-09-13 16:07:19 +02:00
|
|
|
Xyz, //!< xyz calibration
|
|
|
|
Z, //!< z calibration
|
2019-09-17 18:58:59 +02:00
|
|
|
IsFil, //!< Is filament loaded? First step of 1st layer calibration
|
2018-09-14 18:29:14 +02:00
|
|
|
PreheatPla, //!< waiting for preheat nozzle for PLA
|
|
|
|
Preheat, //!< Preheat for any material
|
2019-09-16 21:14:17 +02:00
|
|
|
LoadFilCold, //!< Load filament for MMU
|
|
|
|
LoadFilHot, //!< Load filament without MMU
|
2018-09-13 16:07:19 +02:00
|
|
|
IsPla, //!< Is PLA filament?
|
2019-09-16 21:14:17 +02:00
|
|
|
Lay1CalCold, //!< First layer calibration, temperature not selected yet
|
|
|
|
Lay1CalHot, //!< First layer calibration, temperature already selected
|
2018-09-13 16:07:19 +02:00
|
|
|
RepeatLay1Cal, //!< Repeat first layer calibration?
|
|
|
|
Finish, //!< Deactivate wizard
|
|
|
|
};
|
|
|
|
|
|
|
|
void lcd_wizard(WizState state);
|
2017-11-07 16:49:04 +01:00
|
|
|
|
2020-07-29 11:23:24 +03:00
|
|
|
extern void lcd_experimental_toggle();
|
2020-07-20 19:35:25 +03:00
|
|
|
extern void lcd_experimental_menu();
|
|
|
|
|
2020-12-08 17:50:04 +01:00
|
|
|
#ifdef PINDA_TEMP_COMP
|
2020-12-07 15:32:19 +01:00
|
|
|
extern void lcd_pinda_temp_compensation_toggle();
|
2020-12-08 17:50:04 +01:00
|
|
|
#endif //PINDA_TEMP_COMP
|
2020-12-07 15:32:19 +01:00
|
|
|
|
2018-03-28 18:53:37 +02:00
|
|
|
#endif //ULTRALCD_H
|