Merge upstream changes from Marlin 2.1.1
This commit is contained in:
@@ -48,7 +48,7 @@ void MarlinGame::draw_game_over() {
|
||||
u8g.setColorIndex(0);
|
||||
u8g.drawBox(lx - 1, ly - gohigh - 1, gowide + 2, gohigh + 2);
|
||||
u8g.setColorIndex(1);
|
||||
if (ui.get_blink()) lcd_put_u8str_P(lx, ly, PSTR("GAME OVER"));
|
||||
if (ui.get_blink()) lcd_put_u8str(lx, ly, F("GAME OVER"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
|
||||
//#define MUTE_GAMES
|
||||
|
||||
#if ENABLED(MUTE_GAMES) || !HAS_BUZZER
|
||||
#if ENABLED(MUTE_GAMES) || !HAS_SOUND
|
||||
#define _BUZZ(D,F) NOOP
|
||||
#else
|
||||
#define _BUZZ(D,F) BUZZ(D,F)
|
||||
|
@@ -22,15 +22,16 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#include "menu.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/printcounter.h"
|
||||
#include "../../module/temperature.h"
|
||||
#include "../../gcode/queue.h"
|
||||
|
||||
#if HAS_BUZZER
|
||||
#if HAS_SOUND
|
||||
#include "../../libs/buzzer.h"
|
||||
#endif
|
||||
|
||||
@@ -38,7 +39,7 @@
|
||||
#include "../../module/probe.h"
|
||||
#endif
|
||||
|
||||
#if EITHER(ENABLE_LEVELING_FADE_HEIGHT, AUTO_BED_LEVELING_UBL)
|
||||
#if HAS_LEVELING
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#endif
|
||||
|
||||
@@ -46,6 +47,13 @@
|
||||
///////////// Global Variables /////////////
|
||||
////////////////////////////////////////////
|
||||
|
||||
#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION)
|
||||
bool leveling_was_active; // = false
|
||||
#endif
|
||||
#if ANY(PROBE_MANUALLY, MESH_BED_LEVELING, X_AXIS_TWIST_COMPENSATION)
|
||||
uint8_t manual_probe_index; // = 0
|
||||
#endif
|
||||
|
||||
// Menu Navigation
|
||||
int8_t encoderTopLine, encoderLine, screen_items;
|
||||
|
||||
@@ -60,12 +68,13 @@ typedef struct {
|
||||
menuPosition screen_history[6];
|
||||
uint8_t screen_history_depth = 0;
|
||||
|
||||
int8_t MenuItemBase::itemIndex; // Index number for draw and action
|
||||
PGM_P MenuItemBase::itemString; // A PSTR for substitution
|
||||
chimera_t editable; // Value Editing
|
||||
int8_t MenuItemBase::itemIndex; // Index number for draw and action
|
||||
FSTR_P MenuItemBase::itemStringF; // A string for substitution
|
||||
const char *MenuItemBase::itemStringC;
|
||||
chimera_t editable; // Value Editing
|
||||
|
||||
// Menu Edit Items
|
||||
PGM_P MenuEditItemBase::editLabel;
|
||||
FSTR_P MenuEditItemBase::editLabel;
|
||||
void* MenuEditItemBase::editValue;
|
||||
int32_t MenuEditItemBase::minEditValue,
|
||||
MenuEditItemBase::maxEditValue;
|
||||
@@ -103,44 +112,30 @@ void MarlinUI::_goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_b
|
||||
/////////// Menu Editing Actions ///////////
|
||||
////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Functions for editing single values
|
||||
*
|
||||
* The "DEFINE_MENU_EDIT_ITEM" macro generates the classes needed to edit a numerical value.
|
||||
*
|
||||
* The prerequisite is that in the header the type was already declared:
|
||||
*
|
||||
* DEFINE_MENU_EDIT_ITEM_TYPE(int3, int16_t, i16tostr3rj, 1)
|
||||
*
|
||||
* For example, DEFINE_MENU_EDIT_ITEM(int3) expands into:
|
||||
*
|
||||
* template class TMenuEditItem<MenuEditItemInfo_int3>
|
||||
*
|
||||
* You can then use one of the menu macros to present the edit interface:
|
||||
* EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
|
||||
*
|
||||
* This expands into a more primitive menu item:
|
||||
* _MENU_ITEM_P(int3, false, GET_TEXT(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
*
|
||||
* ...which calls:
|
||||
* MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::draw(encoderLine == _thisItemNr, _lcdLineNr, plabel, &feedrate_percentage, 10, 999)
|
||||
*/
|
||||
// All Edit Screens run the same way, but `draw_edit_screen` is implementation-specific
|
||||
void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) {
|
||||
// Reset repeat_delay for Touch Buttons
|
||||
TERN_(HAS_TOUCH_BUTTONS, ui.repeat_delay = BUTTON_DELAY_EDIT);
|
||||
// Constrain ui.encoderPosition to 0 ... maxEditValue (calculated in encoder steps)
|
||||
if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0;
|
||||
if (int32_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue;
|
||||
// If drawing is flagged then redraw the (whole) edit screen
|
||||
if (ui.should_draw())
|
||||
draw_edit_screen(strfunc(ui.encoderPosition + minEditValue));
|
||||
// If there was a click or "live editing" and encoder moved...
|
||||
if (ui.lcd_clicked || (liveEdit && ui.should_draw())) {
|
||||
// Pass the editValue pointer to the loadfunc along with the encoder plus min
|
||||
if (editValue) loadfunc(editValue, ui.encoderPosition + minEditValue);
|
||||
// If a callbackFunc was set, call it for click or always for "live editing"
|
||||
if (callbackFunc && (liveEdit || ui.lcd_clicked)) (*callbackFunc)();
|
||||
// Use up the click to finish editing and go to the previous screen
|
||||
if (ui.use_click()) ui.goto_previous_screen();
|
||||
}
|
||||
}
|
||||
|
||||
// Going to an edit screen sets up some persistent values first
|
||||
void MenuEditItemBase::goto_edit_screen(
|
||||
PGM_P const el, // Edit label
|
||||
FSTR_P const el, // Edit label
|
||||
void * const ev, // Edit value pointer
|
||||
const int32_t minv, // Encoder minimum
|
||||
const int32_t maxv, // Encoder maximum
|
||||
@@ -169,15 +164,12 @@ void MenuEditItemBase::goto_edit_screen(
|
||||
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
bool printer_busy() {
|
||||
return planner.movesplanned() || printingIsActive();
|
||||
}
|
||||
|
||||
/**
|
||||
* General function to go directly to a screen
|
||||
*/
|
||||
void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
|
||||
if (currentScreen != screen) {
|
||||
thermalManager.set_menu_cold_override(false);
|
||||
|
||||
TERN_(IS_DWIN_MARLINUI, did_first_redraw = false);
|
||||
|
||||
@@ -199,7 +191,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
||||
else {
|
||||
#if ENABLED(MOVE_Z_WHEN_IDLE)
|
||||
ui.manual_move.menu_scale = MOVE_Z_IDLE_MULTIPLICATOR;
|
||||
screen = lcd_move_z;
|
||||
screen = []{ lcd_move_axis(Z_AXIS); };
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -212,14 +204,14 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
||||
if (on_status_screen()) {
|
||||
defer_status_screen(false);
|
||||
clear_menu_history();
|
||||
TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false);
|
||||
TERN_(AUTO_BED_LEVELING_UBL, bedlevel.lcd_map_control = false);
|
||||
}
|
||||
|
||||
clear_lcd();
|
||||
|
||||
// Re-initialize custom characters that may be re-used
|
||||
#if HAS_MARLINUI_HD44780
|
||||
if (TERN1(AUTO_BED_LEVELING_UBL, !ubl.lcd_map_control))
|
||||
if (TERN1(AUTO_BED_LEVELING_UBL, !bedlevel.lcd_map_control))
|
||||
set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU);
|
||||
#endif
|
||||
|
||||
@@ -227,7 +219,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
||||
screen_changed = true;
|
||||
TERN_(HAS_MARLINUI_U8GLIB, drawing_screen = false);
|
||||
|
||||
TERN_(HAS_LCD_MENU, encoder_direction_normal());
|
||||
TERN_(HAS_MARLINUI_MENU, encoder_direction_normal());
|
||||
|
||||
set_selection(false);
|
||||
}
|
||||
@@ -241,8 +233,8 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
||||
// Display a "synchronize" screen with a custom message until
|
||||
// all moves are finished. Go back to calling screen when done.
|
||||
//
|
||||
void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) {
|
||||
static PGM_P sync_message = msg ?: GET_TEXT(MSG_MOVING);
|
||||
void MarlinUI::synchronize(FSTR_P const fmsg/*=nullptr*/) {
|
||||
static FSTR_P sync_message = fmsg ?: GET_TEXT_F(MSG_MOVING);
|
||||
push_current_screen();
|
||||
goto_screen([]{
|
||||
if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message);
|
||||
@@ -257,9 +249,6 @@ void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) {
|
||||
*
|
||||
* encoderLine is the position based on the encoder
|
||||
* encoderTopLine is the top menu line to display
|
||||
* _lcdLineNr is the index of the LCD line (e.g., 0-3)
|
||||
* _menuLineNr is the menu item to draw and process
|
||||
* _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM
|
||||
* screen_items is the total number of items in the menu (after one call)
|
||||
*/
|
||||
void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
@@ -283,14 +272,10 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
encoderTopLine = encoderLine;
|
||||
}
|
||||
|
||||
#if HAS_BUZZER
|
||||
#if HAS_SOUND
|
||||
void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
||||
TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up on rotary encoder click...
|
||||
if (good) {
|
||||
BUZZ(100, 659);
|
||||
BUZZ(100, 698);
|
||||
}
|
||||
else BUZZ(20, 440);
|
||||
if (good) OKAY_BUZZ(); else ERR_BUZZ();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -335,12 +320,12 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
}
|
||||
if (ui.should_draw()) {
|
||||
if (do_probe) {
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z));
|
||||
TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(probe.offset.z));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z));
|
||||
TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z));
|
||||
}
|
||||
else {
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -351,12 +336,11 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
void _lcd_draw_homing() {
|
||||
if (ui.should_draw()) {
|
||||
constexpr uint8_t line = (LCD_HEIGHT - 1) / 2;
|
||||
MenuItem_static::draw(line, GET_TEXT(MSG_LEVEL_BED_HOMING));
|
||||
MenuItem_static::draw(line, GET_TEXT_F(MSG_LEVEL_BED_HOMING));
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS))
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); }
|
||||
#endif
|
||||
|
||||
@@ -374,12 +358,13 @@ bool MarlinUI::update_selection() {
|
||||
}
|
||||
|
||||
void MenuItem_confirm::select_screen(
|
||||
PGM_P const yes, PGM_P const no,
|
||||
FSTR_P const yes, FSTR_P const no,
|
||||
selectFunc_t yesFunc, selectFunc_t noFunc,
|
||||
PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/
|
||||
FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/
|
||||
) {
|
||||
ui.defer_status_screen();
|
||||
const bool ui_selection = ui.update_selection(), got_click = ui.use_click();
|
||||
const bool ui_selection = !yes ? false : !no || ui.update_selection(),
|
||||
got_click = ui.use_click();
|
||||
if (got_click || ui.should_draw()) {
|
||||
draw_select_screen(yes, no, ui_selection, pref, string, suff);
|
||||
if (got_click) {
|
||||
@@ -389,4 +374,4 @@ void MenuItem_confirm::select_screen(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
@@ -30,7 +30,6 @@
|
||||
extern int8_t encoderLine, encoderTopLine, screen_items;
|
||||
|
||||
void scroll_screen(const uint8_t limit, const bool is_menu);
|
||||
bool printer_busy();
|
||||
|
||||
typedef void (*selectFunc_t)();
|
||||
|
||||
@@ -39,10 +38,6 @@ typedef void (*selectFunc_t)();
|
||||
#define SS_INVERT 0x02
|
||||
#define SS_DEFAULT SS_CENTER
|
||||
|
||||
#if EITHER(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI) && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
void _lcd_zoffset_overlay_gfx(const_float_t zvalue);
|
||||
#endif
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) && Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9
|
||||
#define BABYSTEP_TO_STR(N) ftostr43sign(N)
|
||||
#elif ENABLED(BABYSTEPPING)
|
||||
@@ -58,71 +53,79 @@ class MenuItemBase {
|
||||
// Index to interject in the item label and/or for use by its action.
|
||||
static int8_t itemIndex;
|
||||
|
||||
// An optional pointer for use in display or by the action
|
||||
static PGM_P itemString;
|
||||
// Optional pointers for use in display or by the action
|
||||
static FSTR_P itemStringF;
|
||||
static const char* itemStringC;
|
||||
|
||||
// Store the index of the item ahead of use by indexed items
|
||||
FORCE_INLINE static void init(const int8_t ind=0, PGM_P const pstr=nullptr) { itemIndex = ind; itemString = pstr; }
|
||||
// Store an index and string for later substitution
|
||||
FORCE_INLINE static void init(const int8_t ind=0, FSTR_P const fstr=nullptr) { itemIndex = ind; itemStringF = fstr; itemStringC = nullptr; }
|
||||
FORCE_INLINE static void init(const int8_t ind, const char * const cstr) { itemIndex = ind; itemStringC = cstr; itemStringF = nullptr; }
|
||||
|
||||
// Implementation-specific:
|
||||
// Draw an item either selected (pre_char) or not (space) with post_char
|
||||
static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char);
|
||||
// Menus may set up itemIndex, itemStringC/F and pass them to string-building or string-emitting functions
|
||||
static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char);
|
||||
|
||||
// Draw an item either selected ('>') or not (space) with post_char
|
||||
FORCE_INLINE static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char post_char) {
|
||||
_draw(sel, row, pstr, '>', post_char);
|
||||
FORCE_INLINE static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char post_char) {
|
||||
_draw(sel, row, fstr, '>', post_char);
|
||||
}
|
||||
};
|
||||
|
||||
// STATIC_ITEM(LABEL,...)
|
||||
class MenuItem_static : public MenuItemBase {
|
||||
public:
|
||||
static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr);
|
||||
static void draw(const uint8_t row, FSTR_P const fstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr);
|
||||
};
|
||||
|
||||
// BACK_ITEM(LABEL)
|
||||
class MenuItem_back : public MenuItemBase {
|
||||
public:
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) {
|
||||
_draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]);
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr) {
|
||||
_draw(sel, row, fstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]);
|
||||
}
|
||||
// Back Item action goes back one step in history
|
||||
FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); }
|
||||
FORCE_INLINE static void action(FSTR_P const=nullptr) { ui.go_back(); }
|
||||
};
|
||||
|
||||
// CONFIRM_ITEM(LABEL,Y,N,FY,FN,...),
|
||||
// YESNO_ITEM(LABEL,FY,FN,...)
|
||||
class MenuItem_confirm : public MenuItemBase {
|
||||
public:
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]);
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, ...) {
|
||||
_draw(sel, row, ftpl, '>', LCD_STR_ARROW_RIGHT[0]);
|
||||
}
|
||||
// Implemented for HD44780 and DOGM
|
||||
// Draw the prompt, buttons, and state
|
||||
static void draw_select_screen(
|
||||
PGM_P const yes, // Right option label
|
||||
PGM_P const no, // Left option label
|
||||
FSTR_P const yes, // Right option label
|
||||
FSTR_P const no, // Left option label
|
||||
const bool yesno, // Is "yes" selected?
|
||||
PGM_P const pref, // Prompt prefix
|
||||
FSTR_P const pref, // Prompt prefix
|
||||
const char * const string, // Prompt runtime string
|
||||
PGM_P const suff // Prompt suffix
|
||||
FSTR_P const suff // Prompt suffix
|
||||
);
|
||||
static void select_screen(
|
||||
PGM_P const yes, PGM_P const no,
|
||||
FSTR_P const yes, FSTR_P const no,
|
||||
selectFunc_t yesFunc, selectFunc_t noFunc,
|
||||
PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr
|
||||
FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr
|
||||
);
|
||||
static inline void select_screen(
|
||||
PGM_P const yes, PGM_P const no,
|
||||
static void select_screen(
|
||||
FSTR_P const yes, FSTR_P const no,
|
||||
selectFunc_t yesFunc, selectFunc_t noFunc,
|
||||
PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr
|
||||
FSTR_P const pref, FSTR_P const fstr, FSTR_P const suff=nullptr
|
||||
) {
|
||||
char str[strlen_P((PGM_P)string) + 1];
|
||||
strcpy_P(str, (PGM_P)string);
|
||||
select_screen(yes, no, yesFunc, noFunc, pref, str, suff);
|
||||
#ifdef __AVR__
|
||||
char str[strlen_P(FTOP(fstr)) + 1];
|
||||
strcpy_P(str, FTOP(fstr));
|
||||
select_screen(yes, no, yesFunc, noFunc, pref, str, suff);
|
||||
#else
|
||||
select_screen(yes, no, yesFunc, noFunc, pref, FTOP(fstr), suff);
|
||||
#endif
|
||||
}
|
||||
// Shortcut for prompt with "NO"/ "YES" labels
|
||||
FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) {
|
||||
select_screen(GET_TEXT(MSG_YES), GET_TEXT(MSG_NO), yesFunc, noFunc, pref, string, suff);
|
||||
FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr) {
|
||||
select_screen(GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO), yesFunc, noFunc, pref, string, suff);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -151,7 +154,7 @@ class MenuEditItemBase : public MenuItemBase {
|
||||
// The action() method acts like the instantiator. The entire lifespan
|
||||
// of a menu item is within its declaration, so all these values decompose
|
||||
// into behavior and unused items get optimized out.
|
||||
static PGM_P editLabel;
|
||||
static FSTR_P editLabel;
|
||||
static void *editValue;
|
||||
static int32_t minEditValue, maxEditValue; // Encoder value range
|
||||
static screenFunc_t callbackFunc;
|
||||
@@ -160,7 +163,7 @@ class MenuEditItemBase : public MenuItemBase {
|
||||
typedef const char* (*strfunc_t)(const int32_t);
|
||||
typedef void (*loadfunc_t)(void *, const int32_t);
|
||||
static void goto_edit_screen(
|
||||
PGM_P const el, // Edit label
|
||||
FSTR_P const el, // Edit label
|
||||
void * const ev, // Edit value pointer
|
||||
const int32_t minv, // Encoder minimum
|
||||
const int32_t maxv, // Encoder maximum
|
||||
@@ -171,16 +174,20 @@ class MenuEditItemBase : public MenuItemBase {
|
||||
);
|
||||
static void edit_screen(strfunc_t, loadfunc_t); // Edit value handler
|
||||
public:
|
||||
// Implemented for HD44780 and DOGM
|
||||
// Implementation-specific:
|
||||
// Draw the current item at specified row with edit data
|
||||
static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm=false);
|
||||
static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm=false);
|
||||
|
||||
// Implemented for HD44780 and DOGM
|
||||
static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, FSTR_P const fstr) {
|
||||
draw(sel, row, ftpl, FTOP(fstr), true);
|
||||
}
|
||||
|
||||
// Implementation-specific:
|
||||
// This low-level method is good to draw from anywhere
|
||||
static void draw_edit_screen(PGM_P const pstr, const char * const value);
|
||||
static void draw_edit_screen(FSTR_P const fstr, const char * const value);
|
||||
|
||||
// This method is for the current menu item
|
||||
static inline void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); }
|
||||
static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); }
|
||||
};
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
@@ -188,7 +195,7 @@ class MenuEditItemBase : public MenuItemBase {
|
||||
class MenuItem_sdbase {
|
||||
public:
|
||||
// Implemented for HD44780 and DOGM
|
||||
static void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir);
|
||||
static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard, const bool isDir);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -207,10 +214,9 @@ void menu_move();
|
||||
//////// Menu Item Helper Functions ////////
|
||||
////////////////////////////////////////////
|
||||
|
||||
void lcd_move_z();
|
||||
void _lcd_draw_homing();
|
||||
|
||||
#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LEVEL_BED_CORNERS)
|
||||
#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LCD_BED_TRAMMING)
|
||||
|
||||
#if HAS_LINE_TO_Z
|
||||
void line_to_z(const_float_t z);
|
||||
@@ -220,6 +226,11 @@ void _lcd_draw_homing();
|
||||
void goto_probe_offset_wizard();
|
||||
#endif
|
||||
|
||||
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
|
||||
void xatc_wizard_continue();
|
||||
void menu_advanced_settings();
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS))
|
||||
void _lcd_toggle_bed_leveling();
|
||||
#endif
|
||||
@@ -251,3 +262,11 @@ extern uint8_t screen_history_depth;
|
||||
inline void clear_menu_history() { screen_history_depth = 0; }
|
||||
|
||||
#define STICKY_SCREEN(S) []{ ui.defer_status_screen(); ui.goto_screen(S); }
|
||||
|
||||
#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION)
|
||||
extern bool leveling_was_active;
|
||||
#endif
|
||||
|
||||
#if ANY(PROBE_MANUALLY, MESH_BED_LEVELING, X_AXIS_TWIST_COMPENSATION)
|
||||
extern uint8_t manual_probe_index;
|
||||
#endif
|
||||
|
@@ -26,9 +26,10 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#include "../../module/planner.h"
|
||||
|
||||
#if DISABLED(NO_VOLUMETRICS)
|
||||
@@ -39,7 +40,7 @@
|
||||
#include "../../module/probe.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(PIDTEMP)
|
||||
#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER)
|
||||
#include "../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
@@ -67,8 +68,10 @@ void menu_backlash();
|
||||
LOOP_LOGICAL_AXES(i) driverPercent[i] = stepper_dac.get_current_percent((AxisEnum)i);
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
#define EDIT_DAC_PERCENT(A) EDIT_ITEM(uint8, MSG_DAC_PERCENT_##A, &driverPercent[_AXIS(A)], 0, 100, []{ stepper_dac.set_current_percents(driverPercent); })
|
||||
LOGICAL_AXIS_CODE(EDIT_DAC_PERCENT(E), EDIT_DAC_PERCENT(A), EDIT_DAC_PERCENT(B), EDIT_DAC_PERCENT(C), EDIT_DAC_PERCENT(I), EDIT_DAC_PERCENT(J), EDIT_DAC_PERCENT(K));
|
||||
|
||||
LOOP_LOGICAL_AXES(a)
|
||||
EDIT_ITEM_N(uint8, a, MSG_DAC_PERCENT_N, &driverPercent[a], 0, 100, []{ stepper_dac.set_current_percents(driverPercent); });
|
||||
|
||||
ACTION_ITEM(MSG_DAC_EEPROM_WRITE, stepper_dac.commit_eeprom);
|
||||
END_MENU();
|
||||
}
|
||||
@@ -82,12 +85,12 @@ void menu_backlash();
|
||||
void menu_pwm() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
#define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power)
|
||||
#define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_F(long5, F(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power)
|
||||
#if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y)
|
||||
EDIT_CURRENT_PWM(STR_X STR_Y, 0);
|
||||
EDIT_CURRENT_PWM(STR_A STR_B, 0);
|
||||
#endif
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
|
||||
EDIT_CURRENT_PWM(STR_Z, 1);
|
||||
EDIT_CURRENT_PWM(STR_C, 1);
|
||||
#endif
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
|
||||
EDIT_CURRENT_PWM(STR_E, 2);
|
||||
@@ -109,8 +112,8 @@ void menu_backlash();
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10);
|
||||
#elif HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10);
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -120,16 +123,16 @@ void menu_backlash();
|
||||
#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
|
||||
EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits);
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_FAST_N(float42_52, n, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[n], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits);
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_FAST_N(float42_52, e, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[e], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (parser.volumetric_enabled) {
|
||||
EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_FAST_N(float43, n, MSG_FILAMENT_DIAM_E, &planner.filament_size[n], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_FAST_N(float43, e, MSG_FILAMENT_DIAM_E, &planner.filament_size[e], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -139,14 +142,14 @@ void menu_backlash();
|
||||
|
||||
EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength);
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_FAST_N(float4, e, MSG_FILAMENTUNLOAD_E, &fc_settings[e].unload_length, 0, extrude_maxlength);
|
||||
#endif
|
||||
|
||||
EDIT_ITEM_FAST(float4, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength);
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength);
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_FAST_N(float4, e, MSG_FILAMENTLOAD_E, &fc_settings[e].load_length, 0, extrude_maxlength);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -190,7 +193,12 @@ void menu_backlash();
|
||||
#if ENABLED(PIDTEMPCHAMBER)
|
||||
case H_CHAMBER: tune_temp = autotune_temp_chamber; break;
|
||||
#endif
|
||||
default: tune_temp = autotune_temp[hid]; break;
|
||||
default:
|
||||
#if ENABLED(PIDTEMP)
|
||||
tune_temp = autotune_temp[hid]; break;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), hid, tune_temp);
|
||||
queue.inject(cmd);
|
||||
@@ -205,43 +213,41 @@ void menu_backlash();
|
||||
|
||||
// Helpers for editing PID Ki & Kd values
|
||||
// grab the PID value out of the temp variable; scale it; then update the PID driver
|
||||
void copy_and_scalePID_i(int16_t e) {
|
||||
UNUSED(e);
|
||||
PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
|
||||
thermalManager.updatePID();
|
||||
void copy_and_scalePID_i(const int8_t e) {
|
||||
switch (e) {
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
case H_BED: thermalManager.temp_bed.pid.Ki = scalePID_i(raw_Ki); break;
|
||||
#endif
|
||||
#if ENABLED(PIDTEMPCHAMBER)
|
||||
case H_CHAMBER: thermalManager.temp_chamber.pid.Ki = scalePID_i(raw_Ki); break;
|
||||
#endif
|
||||
default:
|
||||
#if ENABLED(PIDTEMP)
|
||||
PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
|
||||
thermalManager.updatePID();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
void copy_and_scalePID_d(int16_t e) {
|
||||
UNUSED(e);
|
||||
PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
|
||||
thermalManager.updatePID();
|
||||
void copy_and_scalePID_d(const int8_t e) {
|
||||
switch (e) {
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
case H_BED: thermalManager.temp_bed.pid.Kd = scalePID_d(raw_Kd); break;
|
||||
#endif
|
||||
#if ENABLED(PIDTEMPCHAMBER)
|
||||
case H_CHAMBER: thermalManager.temp_chamber.pid.Kd = scalePID_d(raw_Kd); break;
|
||||
#endif
|
||||
default:
|
||||
#if ENABLED(PIDTEMP)
|
||||
PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
|
||||
thermalManager.updatePID();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) \
|
||||
void copy_and_scalePID_i_E##N() { copy_and_scalePID_i(N); } \
|
||||
void copy_and_scalePID_d_E##N() { copy_and_scalePID_d(N); }
|
||||
|
||||
#else
|
||||
|
||||
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) //
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define DEFINE_PIDTEMP_FUNCS(N) \
|
||||
_DEFINE_PIDTEMP_BASE_FUNCS(N); \
|
||||
void lcd_autotune_callback_E##N() { _lcd_autotune(heater_id_t(N)); }
|
||||
#else
|
||||
#define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N);
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND
|
||||
DEFINE_PIDTEMP_FUNCS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, DEFINE_PIDTEMP_FUNCS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU)
|
||||
#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU, MPC_AUTOTUNE_MENU, MPC_EDIT_MENU)
|
||||
#define SHOW_MENU_ADVANCED_TEMPERATURE 1
|
||||
#endif
|
||||
|
||||
@@ -250,9 +256,20 @@ void menu_backlash();
|
||||
//
|
||||
#if SHOW_MENU_ADVANCED_TEMPERATURE
|
||||
|
||||
#if ENABLED(MPC_EDIT_MENU)
|
||||
#define MPC_EDIT_DEFS(N) \
|
||||
MPC_t &c = thermalManager.temp_hotend[N].constants; \
|
||||
TERN_(MPC_INCLUDE_FAN, editable.decimal = c.ambient_xfer_coeff_fan0 + c.fan255_adjustment)
|
||||
#endif
|
||||
|
||||
void menu_advanced_temperature() {
|
||||
#if ENABLED(MPC_EDIT_MENU) && !HAS_MULTI_HOTEND
|
||||
MPC_EDIT_DEFS(0);
|
||||
#endif
|
||||
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
|
||||
//
|
||||
// Autotemp, Min, Max, Fact
|
||||
//
|
||||
@@ -272,14 +289,7 @@ void menu_backlash();
|
||||
// PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5
|
||||
//
|
||||
|
||||
#if ENABLED(PID_EDIT_MENU)
|
||||
#define _PID_EDIT_ITEMS_TMPL(N,T) \
|
||||
raw_Ki = unscalePID_i(T.pid.Ki); \
|
||||
raw_Kd = unscalePID_d(T.pid.Kd); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \
|
||||
EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
|
||||
#if BOTH(PIDTEMP, PID_EDIT_MENU)
|
||||
#define __PID_HOTEND_MENU_ITEMS(N) \
|
||||
raw_Ki = unscalePID_i(PID_PARAM(Ki, N)); \
|
||||
raw_Kd = unscalePID_d(PID_PARAM(Kd, N)); \
|
||||
@@ -309,17 +319,68 @@ void menu_backlash();
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) \
|
||||
_HOTEND_PID_EDIT_MENU_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
|
||||
#else
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N);
|
||||
#if ENABLED(PID_EDIT_MENU) && EITHER(PIDTEMPBED, PIDTEMPCHAMBER)
|
||||
#define _PID_EDIT_ITEMS_TMPL(N,T) \
|
||||
raw_Ki = unscalePID_i(T.pid.Ki); \
|
||||
raw_Kd = unscalePID_d(T.pid.Kd); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \
|
||||
EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
#endif
|
||||
|
||||
HOTEND_PID_EDIT_MENU_ITEMS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS)
|
||||
#if ENABLED(PIDTEMP)
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) \
|
||||
_HOTEND_PID_EDIT_MENU_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
|
||||
#else
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N);
|
||||
#endif
|
||||
|
||||
HOTEND_PID_EDIT_MENU_ITEMS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(MPC_EDIT_MENU)
|
||||
|
||||
#define _MPC_EDIT_ITEMS(N) \
|
||||
EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &c.heater_power, 1, 200); \
|
||||
EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &c.block_heat_capacity, 0, 40); \
|
||||
EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &c.sensor_responsiveness, 0, 1); \
|
||||
EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &c.ambient_xfer_coeff_fan0, 0, 1)
|
||||
|
||||
#if ENABLED(MPC_INCLUDE_FAN)
|
||||
#define MPC_EDIT_ITEMS(N) \
|
||||
_MPC_EDIT_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \
|
||||
MPC_t &c = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \
|
||||
c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \
|
||||
})
|
||||
#else
|
||||
#define MPC_EDIT_ITEMS _MPC_EDIT_ITEMS
|
||||
#endif
|
||||
|
||||
#if HAS_MULTI_HOTEND
|
||||
static auto mpc_edit_hotend = [](const uint8_t e) {
|
||||
MPC_EDIT_DEFS(e);
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_TEMPERATURE);
|
||||
MPC_EDIT_ITEMS(e);
|
||||
END_MENU();
|
||||
};
|
||||
#define MPC_ENTRY(N) SUBMENU_N(N, MSG_MPC_EDIT, []{ mpc_edit_hotend(MenuItemBase::itemIndex); });
|
||||
#else
|
||||
#define MPC_ENTRY MPC_EDIT_ITEMS
|
||||
#endif
|
||||
|
||||
REPEAT(HOTENDS, MPC_ENTRY);
|
||||
|
||||
#endif // MPC_EDIT_MENU
|
||||
|
||||
#if ENABLED(MPC_AUTOTUNE_MENU)
|
||||
ACTION_ITEM(MSG_MPC_AUTOTUNE, []{ queue.inject(F("M306 T")); ui.return_to_status(); });
|
||||
#endif
|
||||
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
@@ -356,7 +417,7 @@ void menu_backlash();
|
||||
#elif ENABLED(LIMITED_MAX_FR_EDITING)
|
||||
DEFAULT_MAX_FEEDRATE
|
||||
#else
|
||||
LOGICAL_AXIS_ARRAY(9999, 9999, 9999, 9999, 9999, 9999, 9999)
|
||||
LOGICAL_AXIS_ARRAY_1(9999)
|
||||
#endif
|
||||
;
|
||||
#if ENABLED(LIMITED_MAX_FR_EDITING) && !defined(MAX_FEEDRATE_EDIT_VALUES)
|
||||
@@ -368,11 +429,11 @@ void menu_backlash();
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
|
||||
#define EDIT_VMAX(N) EDIT_ITEM_FAST(float5, MSG_VMAX_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, max_fr_edit_scaled[_AXIS(N)])
|
||||
LINEAR_AXIS_CODE(EDIT_VMAX(A), EDIT_VMAX(B), EDIT_VMAX(C), EDIT_VMAX(I), EDIT_VMAX(J), EDIT_VMAX(K));
|
||||
LOOP_NUM_AXES(a)
|
||||
EDIT_ITEM_FAST_N(float5, a, MSG_VMAX_N, &planner.settings.max_feedrate_mm_s[a], 1, max_fr_edit_scaled[a]);
|
||||
|
||||
#if E_STEPPERS
|
||||
EDIT_ITEM_FAST(float5, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e);
|
||||
EDIT_ITEM_FAST_N(float5, E_AXIS, MSG_VMAX_N, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e);
|
||||
#endif
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
@@ -399,7 +460,7 @@ void menu_backlash();
|
||||
#elif ENABLED(LIMITED_MAX_ACCEL_EDITING)
|
||||
DEFAULT_MAX_ACCELERATION
|
||||
#else
|
||||
LOGICAL_AXIS_ARRAY(99000, 99000, 99000, 99000, 99000, 99000, 99000)
|
||||
LOGICAL_AXIS_ARRAY_1(99000)
|
||||
#endif
|
||||
;
|
||||
#if ENABLED(LIMITED_MAX_ACCEL_EDITING) && !defined(MAX_ACCEL_EDIT_VALUES)
|
||||
@@ -422,21 +483,22 @@ void menu_backlash();
|
||||
// M204 T Travel Acceleration
|
||||
EDIT_ITEM_FAST(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, max_accel);
|
||||
|
||||
#define EDIT_AMAX(Q,L) EDIT_ITEM_FAST(long5_25, MSG_AMAX_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.reset_acceleration_rates(); })
|
||||
LINEAR_AXIS_CODE(
|
||||
#define EDIT_AMAX(Q,L) EDIT_ITEM_FAST_N(long5_25, _AXIS(Q), MSG_AMAX_N, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.refresh_acceleration_rates(); })
|
||||
NUM_AXIS_CODE(
|
||||
EDIT_AMAX(A, 100), EDIT_AMAX(B, 100), EDIT_AMAX(C, 10),
|
||||
EDIT_AMAX(I, 10), EDIT_AMAX(J, 10), EDIT_AMAX(K, 10)
|
||||
EDIT_AMAX(I, 10), EDIT_AMAX(J, 10), EDIT_AMAX(K, 10),
|
||||
EDIT_AMAX(U, 10), EDIT_AMAX(V, 10), EDIT_AMAX(W, 10)
|
||||
);
|
||||
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
|
||||
EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.refresh_acceleration_rates(); });
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
EDIT_ITEM_FAST_N(long5_25, n, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(n)], 100, max_accel_edit_scaled.e, []{
|
||||
if (MenuItemBase::itemIndex == active_extruder)
|
||||
planner.reset_acceleration_rates();
|
||||
planner.refresh_acceleration_rates();
|
||||
});
|
||||
#elif E_STEPPERS
|
||||
EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
|
||||
EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.refresh_acceleration_rates(); });
|
||||
#endif
|
||||
|
||||
#ifdef XY_FREQUENCY_LIMIT
|
||||
@@ -455,38 +517,28 @@ void menu_backlash();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f, planner.recalculate_max_e_jerk);
|
||||
#else
|
||||
EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.5f);
|
||||
#endif
|
||||
EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, TERN(LIN_ADVANCE, 0.3f, 0.5f)
|
||||
OPTARG(LIN_ADVANCE, planner.recalculate_max_e_jerk)
|
||||
);
|
||||
#endif
|
||||
|
||||
constexpr xyze_float_t max_jerk_edit =
|
||||
#ifdef MAX_JERK_EDIT_VALUES
|
||||
MAX_JERK_EDIT_VALUES
|
||||
#elif ENABLED(LIMITED_JERK_EDITING)
|
||||
{ LOGICAL_AXIS_LIST((DEFAULT_EJERK) * 2,
|
||||
(DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2,
|
||||
(DEFAULT_IJERK) * 2, (DEFAULT_JJERK) * 2, (DEFAULT_KJERK) * 2) }
|
||||
#define _JERK2(N) DEFAULT_##N##JERK * 2
|
||||
{ MAPLIST(_JERK2, LOGICAL_AXIS_NAMES) }
|
||||
#else
|
||||
{ LOGICAL_AXIS_LIST(990, 990, 990, 990, 990, 990, 990) }
|
||||
LOGICAL_AXIS_ARRAY_1(990)
|
||||
#endif
|
||||
;
|
||||
#define EDIT_JERK(N) EDIT_ITEM_FAST(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, max_jerk_edit[_AXIS(N)])
|
||||
#if ENABLED(DELTA)
|
||||
#define EDIT_JERK_C() EDIT_JERK(C)
|
||||
#else
|
||||
#define EDIT_JERK_C() EDIT_ITEM_FAST(float52sign, MSG_VC_JERK, &planner.max_jerk.c, 0.1f, max_jerk_edit.c)
|
||||
#endif
|
||||
LINEAR_AXIS_CODE(
|
||||
EDIT_JERK(A), EDIT_JERK(B), EDIT_JERK_C(),
|
||||
EDIT_JERK(I), EDIT_JERK(J), EDIT_JERK(K)
|
||||
);
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
EDIT_ITEM_FAST(float52sign, MSG_VE_JERK, &planner.max_jerk.e, 0.1f, max_jerk_edit.e);
|
||||
#endif
|
||||
LOOP_LOGICAL_AXES(a) {
|
||||
if (a == C_AXIS || TERN0(HAS_EXTRUDERS, a == E_AXIS))
|
||||
EDIT_ITEM_FAST_N(float52sign, a, MSG_VN_JERK, &planner.max_jerk[a], 0.1f, max_jerk_edit[a]);
|
||||
else
|
||||
EDIT_ITEM_FAST_N(float3, a, MSG_VN_JERK, &planner.max_jerk[a], 1.0f, max_jerk_edit[a]);
|
||||
}
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
@@ -508,6 +560,10 @@ void menu_backlash();
|
||||
SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard);
|
||||
#endif
|
||||
|
||||
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
|
||||
SUBMENU(MSG_XATC, xatc_wizard_continue);
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
#endif
|
||||
@@ -519,15 +575,12 @@ void menu_advanced_steps_per_mm() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
|
||||
#define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float51, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); })
|
||||
LINEAR_AXIS_CODE(
|
||||
EDIT_QSTEPS(A), EDIT_QSTEPS(B), EDIT_QSTEPS(C),
|
||||
EDIT_QSTEPS(I), EDIT_QSTEPS(J), EDIT_QSTEPS(K)
|
||||
);
|
||||
LOOP_NUM_AXES(a)
|
||||
EDIT_ITEM_FAST_N(float61, a, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[a], 5, 9999, []{ planner.refresh_positioning(); });
|
||||
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{
|
||||
EDIT_ITEM_FAST_N(float61, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{
|
||||
const uint8_t e = MenuItemBase::itemIndex;
|
||||
if (e == active_extruder)
|
||||
planner.refresh_positioning();
|
||||
@@ -535,7 +588,7 @@ void menu_advanced_steps_per_mm() {
|
||||
planner.mm_per_step[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)];
|
||||
});
|
||||
#elif E_STEPPERS
|
||||
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
|
||||
EDIT_ITEM_FAST_N(float61, E_AXIS, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
@@ -557,11 +610,11 @@ void menu_advanced_settings() {
|
||||
//
|
||||
// Set Home Offsets
|
||||
//
|
||||
ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject_P(PSTR("M428")); ui.return_to_status(); });
|
||||
ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject(F("M428")); ui.return_to_status(); });
|
||||
#endif
|
||||
|
||||
// M203 / M205 - Feedrate items
|
||||
SUBMENU(MSG_VELOCITY, menu_advanced_velocity);
|
||||
SUBMENU(MSG_MAX_SPEED, menu_advanced_velocity);
|
||||
|
||||
// M201 - Acceleration items
|
||||
SUBMENU(MSG_ACCELERATION, menu_advanced_acceleration);
|
||||
@@ -630,7 +683,7 @@ void menu_advanced_settings() {
|
||||
didset = settings.set_sd_update_status(new_state);
|
||||
ui.completion_feedback(didset);
|
||||
ui.return_to_status();
|
||||
if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else ui.reset_status();
|
||||
if (new_state) LCD_MESSAGE(MSG_RESET_PRINTER); else ui.reset_status();
|
||||
});
|
||||
#endif
|
||||
|
||||
@@ -642,11 +695,11 @@ void menu_advanced_settings() {
|
||||
CONFIRM_ITEM(MSG_INIT_EEPROM,
|
||||
MSG_BUTTON_INIT, MSG_BUTTON_CANCEL,
|
||||
ui.init_eeprom, nullptr,
|
||||
GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?")
|
||||
GET_TEXT_F(MSG_INIT_EEPROM), (const char *)nullptr, F("?")
|
||||
);
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, BACKLASH_GCODE)
|
||||
#if BOTH(HAS_MARLINUI_MENU, BACKLASH_GCODE)
|
||||
|
||||
#include "menu_item.h"
|
||||
|
||||
@@ -36,14 +36,20 @@ void menu_backlash() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MAIN);
|
||||
|
||||
EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on);
|
||||
editable.uint8 = backlash.get_correction_uint8();
|
||||
EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &editable.uint8, backlash.all_off, backlash.all_on, []{ backlash.set_correction_uint8(editable.uint8); });
|
||||
|
||||
#if DISABLED(CORE_BACKLASH) || ENABLED(MARKFORGED_XY)
|
||||
#if DISABLED(CORE_BACKLASH) || EITHER(MARKFORGED_XY, MARKFORGED_YX)
|
||||
#define _CAN_CALI AXIS_CAN_CALIBRATE
|
||||
#else
|
||||
#define _CAN_CALI(A) true
|
||||
#endif
|
||||
#define EDIT_BACKLASH_DISTANCE(N) EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &backlash.distance_mm[_AXIS(N)], 0.0f, 9.9f);
|
||||
|
||||
#define EDIT_BACKLASH_DISTANCE(N) do { \
|
||||
editable.decimal = backlash.get_distance_mm(_AXIS(N)); \
|
||||
EDIT_ITEM_FAST_N(float43, _AXIS(N), MSG_BACKLASH_N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \
|
||||
} while (0);
|
||||
|
||||
if (_CAN_CALI(A)) EDIT_BACKLASH_DISTANCE(A);
|
||||
#if HAS_Y_AXIS && _CAN_CALI(B)
|
||||
EDIT_BACKLASH_DISTANCE(B);
|
||||
@@ -51,21 +57,31 @@ void menu_backlash() {
|
||||
#if HAS_Z_AXIS && _CAN_CALI(C)
|
||||
EDIT_BACKLASH_DISTANCE(C);
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4 && _CAN_CALI(I)
|
||||
#if HAS_I_AXIS && _CAN_CALI(I)
|
||||
EDIT_BACKLASH_DISTANCE(I);
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 && _CAN_CALI(J)
|
||||
#if HAS_J_AXIS && _CAN_CALI(J)
|
||||
EDIT_BACKLASH_DISTANCE(J);
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && _CAN_CALI(K)
|
||||
#if HAS_K_AXIS && _CAN_CALI(K)
|
||||
EDIT_BACKLASH_DISTANCE(K);
|
||||
#endif
|
||||
#if HAS_U_AXIS && _CAN_CALI(U)
|
||||
EDIT_BACKLASH_DISTANCE(U);
|
||||
#endif
|
||||
#if HAS_V_AXIS && _CAN_CALI(V)
|
||||
EDIT_BACKLASH_DISTANCE(V);
|
||||
#endif
|
||||
#if HAS_W_AXIS && _CAN_CALI(W)
|
||||
EDIT_BACKLASH_DISTANCE(W);
|
||||
#endif
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &backlash.smoothing_mm, 0.0f, 9.9f);
|
||||
editable.decimal = backlash.get_smoothing_mm();
|
||||
EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_smoothing_mm(editable.decimal); });
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && BACKLASH_GCODE
|
||||
#endif // HAS_MARLINUI_MENU && BACKLASH_GCODE
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, LEVEL_BED_CORNERS)
|
||||
#if BOTH(HAS_MARLINUI_MENU, LCD_BED_TRAMMING)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/motion.h"
|
||||
@@ -36,21 +36,21 @@
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#endif
|
||||
|
||||
#ifndef LEVEL_CORNERS_Z_HOP
|
||||
#define LEVEL_CORNERS_Z_HOP 4.0
|
||||
#ifndef BED_TRAMMING_Z_HOP
|
||||
#define BED_TRAMMING_Z_HOP 4.0
|
||||
#endif
|
||||
#ifndef LEVEL_CORNERS_HEIGHT
|
||||
#define LEVEL_CORNERS_HEIGHT 0.0
|
||||
#ifndef BED_TRAMMING_HEIGHT
|
||||
#define BED_TRAMMING_HEIGHT 0.0
|
||||
#endif
|
||||
|
||||
#if ENABLED(LEVEL_CORNERS_USE_PROBE)
|
||||
#if ENABLED(BED_TRAMMING_USE_PROBE)
|
||||
#include "../../module/probe.h"
|
||||
#include "../../module/endstops.h"
|
||||
#if ENABLED(BLTOUCH)
|
||||
#include "../../feature/bltouch.h"
|
||||
#endif
|
||||
#ifndef LEVEL_CORNERS_PROBE_TOLERANCE
|
||||
#define LEVEL_CORNERS_PROBE_TOLERANCE 0.2
|
||||
#ifndef BED_TRAMMING_PROBE_TOLERANCE
|
||||
#define BED_TRAMMING_PROBE_TOLERANCE 0.2
|
||||
#endif
|
||||
float last_z;
|
||||
int good_points;
|
||||
@@ -64,36 +64,32 @@
|
||||
|
||||
#endif
|
||||
|
||||
static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration.");
|
||||
static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration.");
|
||||
|
||||
#if HAS_LEVELING
|
||||
static bool leveling_was_active = false;
|
||||
#endif
|
||||
|
||||
#ifndef LEVEL_CORNERS_LEVELING_ORDER
|
||||
#define LEVEL_CORNERS_LEVELING_ORDER { LF, RF, LB, RB } // Default
|
||||
//#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points
|
||||
//#define LEVEL_CORNERS_LEVELING_ORDER { LF, RF } // 3-Point tramming - Rear
|
||||
//#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB } // 3-Point tramming - Right
|
||||
//#define LEVEL_CORNERS_LEVELING_ORDER { RF, RB } // 3-Point tramming - Left
|
||||
//#define LEVEL_CORNERS_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front
|
||||
#ifndef BED_TRAMMING_LEVELING_ORDER
|
||||
#define BED_TRAMMING_LEVELING_ORDER { LF, RF, LB, RB } // Default
|
||||
//#define BED_TRAMMING_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points
|
||||
//#define BED_TRAMMING_LEVELING_ORDER { LF, RF } // 3-Point tramming - Rear
|
||||
//#define BED_TRAMMING_LEVELING_ORDER { LF, LB } // 3-Point tramming - Right
|
||||
//#define BED_TRAMMING_LEVELING_ORDER { RF, RB } // 3-Point tramming - Left
|
||||
//#define BED_TRAMMING_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front
|
||||
#endif
|
||||
|
||||
#define LF 1
|
||||
#define RF 2
|
||||
#define RB 3
|
||||
#define LB 4
|
||||
constexpr int lco[] = LEVEL_CORNERS_LEVELING_ORDER;
|
||||
constexpr int lco[] = BED_TRAMMING_LEVELING_ORDER;
|
||||
constexpr bool level_corners_3_points = COUNT(lco) == 2;
|
||||
static_assert(level_corners_3_points || COUNT(lco) == 4, "LEVEL_CORNERS_LEVELING_ORDER must have exactly 2 or 4 corners.");
|
||||
static_assert(level_corners_3_points || COUNT(lco) == 4, "BED_TRAMMING_LEVELING_ORDER must have exactly 2 or 4 corners.");
|
||||
|
||||
constexpr int lcodiff = ABS(lco[0] - lco[1]);
|
||||
static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two LEVEL_CORNERS_LEVELING_ORDER corners must be on the same edge.");
|
||||
static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two BED_TRAMMING_LEVELING_ORDER corners must be on the same edge.");
|
||||
|
||||
constexpr int nr_edge_points = level_corners_3_points ? 3 : 4;
|
||||
constexpr int available_points = nr_edge_points + ENABLED(LEVEL_CENTER_TOO);
|
||||
constexpr int center_index = TERN(LEVEL_CENTER_TOO, available_points - 1, -1);
|
||||
constexpr float inset_lfrb[4] = LEVEL_CORNERS_INSET_LFRB;
|
||||
constexpr int available_points = nr_edge_points + ENABLED(BED_TRAMMING_INCLUDE_CENTER);
|
||||
constexpr int center_index = TERN(BED_TRAMMING_INCLUDE_CENTER, available_points - 1, -1);
|
||||
constexpr float inset_lfrb[4] = BED_TRAMMING_INSET_LFRB;
|
||||
constexpr xy_pos_t lf { (X_MIN_BED) + inset_lfrb[0], (Y_MIN_BED) + inset_lfrb[1] },
|
||||
rb { (X_MAX_BED) - inset_lfrb[2], (Y_MAX_BED) - inset_lfrb[3] };
|
||||
|
||||
@@ -124,12 +120,12 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
if ((lco[0] == LF && lco[1] == LB) || (lco[0] == LB && lco[1] == LF)) current_position.x = rb.x; // Center Right
|
||||
if ((lco[0] == RF && lco[1] == RB) || (lco[0] == RB && lco[1] == RF)) current_position.x = lf.x; // Left Center
|
||||
if ((lco[0] == LF && lco[1] == RF) || (lco[0] == RF && lco[1] == LF)) current_position.y = rb.y; // Center Back
|
||||
#if DISABLED(LEVEL_CENTER_TOO) && ENABLED(LEVEL_CORNERS_USE_PROBE)
|
||||
#if DISABLED(BED_TRAMMING_INCLUDE_CENTER) && ENABLED(BED_TRAMMING_USE_PROBE)
|
||||
bed_corner++; // Must increment the count to ensure it resets the loop if the 3rd point is out of tolerance
|
||||
#endif
|
||||
break;
|
||||
|
||||
#if ENABLED(LEVEL_CENTER_TOO)
|
||||
#if ENABLED(BED_TRAMMING_INCLUDE_CENTER)
|
||||
case 3:
|
||||
current_position.set(X_CENTER, Y_CENTER);
|
||||
break;
|
||||
@@ -138,9 +134,9 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
}
|
||||
else {
|
||||
// Four-Corner Bed Tramming with optional center
|
||||
if (TERN0(LEVEL_CENTER_TOO, bed_corner == center_index)) {
|
||||
if (TERN0(BED_TRAMMING_INCLUDE_CENTER, bed_corner == center_index)) {
|
||||
current_position.set(X_CENTER, Y_CENTER);
|
||||
TERN_(LEVEL_CORNERS_USE_PROBE, good_points--); // Decrement to allow one additional probe point
|
||||
TERN_(BED_TRAMMING_USE_PROBE, good_points--); // Decrement to allow one additional probe point
|
||||
}
|
||||
else {
|
||||
current_position = lf; // Left front
|
||||
@@ -156,10 +152,10 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
/**
|
||||
* Level corners, starting in the front-left corner.
|
||||
*/
|
||||
#if ENABLED(LEVEL_CORNERS_USE_PROBE)
|
||||
#if ENABLED(BED_TRAMMING_USE_PROBE)
|
||||
|
||||
#define VALIDATE_POINT(X, Y, STR) static_assert(Probe::build_time::can_reach((X), (Y)), \
|
||||
"LEVEL_CORNERS_INSET_LFRB " STR " inset is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
|
||||
"BED_TRAMMING_INSET_LFRB " STR " inset is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
|
||||
VALIDATE_POINT(lf.x, Y_CENTER, "left"); VALIDATE_POINT(X_CENTER, lf.y, "front");
|
||||
VALIDATE_POINT(rb.x, Y_CENTER, "right"); VALIDATE_POINT(X_CENTER, rb.y, "back");
|
||||
|
||||
@@ -172,17 +168,17 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
|
||||
TERN_(HAS_MARLINUI_U8GLIB, ui.set_font(FONT_MENU)); // Set up the font for extra info
|
||||
|
||||
MenuItem_static::draw(0, GET_TEXT(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading
|
||||
MenuItem_static::draw(0, GET_TEXT_F(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading
|
||||
|
||||
uint8_t cy = TERN(TFT_COLOR_UI, 3, LCD_HEIGHT - 1), y = LCD_ROW_Y(cy);
|
||||
|
||||
// Display # of good points found vs total needed
|
||||
if (PAGE_CONTAINS(y - (MENU_FONT_HEIGHT), y)) {
|
||||
SETCURSOR(TERN(TFT_COLOR_UI, 2, 0), cy);
|
||||
lcd_put_u8str_P(GET_TEXT(MSG_BED_TRAMMING_GOOD_POINTS));
|
||||
lcd_put_u8str(GET_TEXT_F(MSG_BED_TRAMMING_GOOD_POINTS));
|
||||
IF_ENABLED(TFT_COLOR_UI, lcd_moveto(12, cy));
|
||||
lcd_put_u8str(GOOD_POINTS_TO_STR(good_points));
|
||||
lcd_put_wchar('/');
|
||||
lcd_put_lchar('/');
|
||||
lcd_put_u8str(GOOD_POINTS_TO_STR(nr_edge_points));
|
||||
}
|
||||
|
||||
@@ -192,7 +188,7 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
// Display the Last Z value
|
||||
if (PAGE_CONTAINS(y - (MENU_FONT_HEIGHT), y)) {
|
||||
SETCURSOR(TERN(TFT_COLOR_UI, 2, 0), cy);
|
||||
lcd_put_u8str_P(GET_TEXT(MSG_BED_TRAMMING_LAST_Z));
|
||||
lcd_put_u8str(GET_TEXT_F(MSG_BED_TRAMMING_LAST_Z));
|
||||
IF_ENABLED(TFT_COLOR_UI, lcd_moveto(12, 2));
|
||||
lcd_put_u8str(LAST_Z_TO_STR(last_z));
|
||||
}
|
||||
@@ -201,35 +197,35 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
void _lcd_draw_raise() {
|
||||
if (!ui.should_draw()) return;
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT(MSG_BUTTON_DONE), GET_TEXT(MSG_BUTTON_SKIP)
|
||||
GET_TEXT_F(MSG_BUTTON_DONE), GET_TEXT_F(MSG_BUTTON_SKIP)
|
||||
, []{ corner_probing_done = true; wait_for_probe = false; }
|
||||
, []{ wait_for_probe = false; }
|
||||
, GET_TEXT(MSG_BED_TRAMMING_RAISE)
|
||||
, (const char*)nullptr, NUL_STR
|
||||
, GET_TEXT_F(MSG_BED_TRAMMING_RAISE)
|
||||
);
|
||||
}
|
||||
|
||||
void _lcd_draw_level_prompt() {
|
||||
if (!ui.should_draw()) return;
|
||||
MenuItem_confirm::confirm_screen(
|
||||
[]{ queue.inject_P(TERN(HAS_LEVELING, PSTR("G29N"), G28_STR)); ui.return_to_status(); }
|
||||
, []{ ui.goto_previous_screen_no_defer(); }
|
||||
, GET_TEXT(MSG_BED_TRAMMING_IN_RANGE)
|
||||
, (const char*)nullptr, PSTR("?")
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT_F(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)),
|
||||
TERN(HAS_LEVELING, GET_TEXT_F(MSG_BUTTON_BACK), nullptr)
|
||||
, []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); }
|
||||
, TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{})
|
||||
, GET_TEXT_F(MSG_BED_TRAMMING_IN_RANGE)
|
||||
);
|
||||
}
|
||||
|
||||
bool _lcd_level_bed_corners_probe(bool verify=false) {
|
||||
if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
|
||||
TERN_(BLTOUCH_SLOW_MODE, bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
|
||||
do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
|
||||
if (verify) do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP); // do clearance if needed
|
||||
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
|
||||
do_blocking_move_to_z(last_z - BED_TRAMMING_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
|
||||
if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
|
||||
endstops.hit_on_purpose();
|
||||
set_current_from_steppers_for_axis(Z_AXIS);
|
||||
sync_plan_position();
|
||||
TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
|
||||
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
|
||||
// Triggered outside tolerance range?
|
||||
if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) {
|
||||
if (ABS(current_position.z - last_z) > BED_TRAMMING_PROBE_TOLERANCE) {
|
||||
last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
|
||||
good_points = 0; // ...and start over
|
||||
}
|
||||
@@ -249,34 +245,35 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
probe_triggered = PROBE_TRIGGERED();
|
||||
if (probe_triggered) {
|
||||
endstops.hit_on_purpose();
|
||||
TERN_(LEVEL_CORNERS_AUDIO_FEEDBACK, ui.buzz(200, 600));
|
||||
TERN_(BED_TRAMMING_AUDIO_FEEDBACK, BUZZ(200, 600));
|
||||
}
|
||||
idle();
|
||||
}
|
||||
TERN_(BLTOUCH_SLOW_MODE, bltouch.stow());
|
||||
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow());
|
||||
ui.goto_screen(_lcd_draw_probing);
|
||||
return (probe_triggered);
|
||||
}
|
||||
|
||||
void _lcd_test_corners() {
|
||||
bed_corner = TERN(LEVEL_CENTER_TOO, center_index, 0);
|
||||
last_z = LEVEL_CORNERS_HEIGHT;
|
||||
bed_corner = TERN(BED_TRAMMING_INCLUDE_CENTER, center_index, 0);
|
||||
last_z = BED_TRAMMING_HEIGHT;
|
||||
endstops.enable_z_probe(true);
|
||||
good_points = 0;
|
||||
ui.goto_screen(_lcd_draw_probing);
|
||||
do {
|
||||
ui.refresh(LCDVIEW_REDRAW_NOW);
|
||||
_lcd_draw_probing(); // update screen with # of good points
|
||||
do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, current_position.z + LEVEL_CORNERS_Z_HOP, 7)); // clearance
|
||||
|
||||
do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
|
||||
|
||||
_lcd_level_bed_corners_get_next_position(); // Select next corner coordinates
|
||||
current_position -= probe.offset_xy; // Account for probe offsets
|
||||
do_blocking_move_to_xy(current_position); // Goto corner
|
||||
|
||||
TERN_(BLTOUCH_HS_MODE, bltouch.deploy()); // Deploy in HIGH SPEED MODE
|
||||
TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE
|
||||
if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance
|
||||
if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
|
||||
#if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify
|
||||
#if ENABLED(BED_TRAMMING_VERIFY_RAISED) // Verify
|
||||
while (!_lcd_level_bed_corners_probe(true)) { // Loop while corner verified
|
||||
if (!_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
|
||||
if (corner_probing_done) return; // Done was selected
|
||||
@@ -294,35 +291,37 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
|
||||
} while (good_points < nr_edge_points); // loop until all points within tolerance
|
||||
|
||||
#if ENABLED(BLTOUCH_HS_MODE)
|
||||
// In HIGH SPEED MODE do clearance and stow at the very end
|
||||
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
|
||||
bltouch.stow();
|
||||
#if ENABLED(BLTOUCH)
|
||||
if (bltouch.high_speed_mode) {
|
||||
// In HIGH SPEED MODE do clearance and stow at the very end
|
||||
do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP);
|
||||
bltouch.stow();
|
||||
}
|
||||
#endif
|
||||
|
||||
ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling
|
||||
ui.set_selection(true);
|
||||
}
|
||||
|
||||
#else // !LEVEL_CORNERS_USE_PROBE
|
||||
#else // !BED_TRAMMING_USE_PROBE
|
||||
|
||||
static void _lcd_goto_next_corner() {
|
||||
line_to_z(LEVEL_CORNERS_Z_HOP);
|
||||
line_to_z(BED_TRAMMING_Z_HOP);
|
||||
|
||||
// Select next corner coordinates
|
||||
_lcd_level_bed_corners_get_next_position();
|
||||
|
||||
line_to_current_position(manual_feedrate_mm_s.x);
|
||||
line_to_z(LEVEL_CORNERS_HEIGHT);
|
||||
line_to_z(BED_TRAMMING_HEIGHT);
|
||||
if (++bed_corner >= available_points) bed_corner = 0;
|
||||
}
|
||||
|
||||
#endif // !LEVEL_CORNERS_USE_PROBE
|
||||
#endif // !BED_TRAMMING_USE_PROBE
|
||||
|
||||
static void _lcd_level_bed_corners_homing() {
|
||||
_lcd_draw_homing();
|
||||
if (!all_axes_homed()) return;
|
||||
#if ENABLED(LEVEL_CORNERS_USE_PROBE)
|
||||
#if ENABLED(BED_TRAMMING_USE_PROBE)
|
||||
_lcd_test_corners();
|
||||
if (corner_probing_done) ui.goto_previous_screen_no_defer();
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
|
||||
@@ -331,15 +330,15 @@ static void _lcd_level_bed_corners_homing() {
|
||||
bed_corner = 0;
|
||||
ui.goto_screen([]{
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE)
|
||||
GET_TEXT_F(MSG_BUTTON_NEXT), GET_TEXT_F(MSG_BUTTON_DONE)
|
||||
, _lcd_goto_next_corner
|
||||
, []{
|
||||
line_to_z(LEVEL_CORNERS_Z_HOP); // Raise Z off the bed when done
|
||||
line_to_z(BED_TRAMMING_Z_HOP); // Raise Z off the bed when done
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
|
||||
ui.goto_previous_screen_no_defer();
|
||||
}
|
||||
, GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER))
|
||||
, (const char*)nullptr, PSTR("?")
|
||||
, GET_TEXT_F(TERN(BED_TRAMMING_INCLUDE_CENTER, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER))
|
||||
, (const char*)nullptr, F("?")
|
||||
);
|
||||
});
|
||||
ui.set_selection(true);
|
||||
@@ -363,4 +362,4 @@ void _lcd_level_bed_corners() {
|
||||
ui.goto_screen(_lcd_level_bed_corners_homing);
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && LEVEL_BED_CORNERS
|
||||
#endif // HAS_MARLINUI_MENU && LCD_BED_TRAMMING
|
||||
|
@@ -52,8 +52,6 @@
|
||||
// Motion > Level Bed handlers
|
||||
//
|
||||
|
||||
static uint8_t manual_probe_index;
|
||||
|
||||
// LCD probed points are from defaults
|
||||
constexpr uint8_t total_probe_points = TERN(AUTO_BED_LEVELING_3POINT, 3, GRID_MAX_POINTS);
|
||||
|
||||
@@ -73,12 +71,12 @@
|
||||
#if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING)
|
||||
// Display "Done" screen and wait for moves to complete
|
||||
line_to_z(Z_AFTER_PROBING);
|
||||
ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE));
|
||||
ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE));
|
||||
#endif
|
||||
ui.goto_previous_screen_no_defer();
|
||||
ui.completion_feedback();
|
||||
}
|
||||
if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE));
|
||||
if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_LEVEL_BED_DONE));
|
||||
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
}
|
||||
|
||||
@@ -103,9 +101,9 @@
|
||||
ui.wait_for_move = true;
|
||||
ui.goto_screen(_lcd_level_bed_done);
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
queue.inject_P(PSTR("G29S2"));
|
||||
queue.inject(F("G29S2"));
|
||||
#elif ENABLED(PROBE_MANUALLY)
|
||||
queue.inject_P(PSTR("G29V1"));
|
||||
queue.inject(F("G29V1"));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -129,7 +127,7 @@
|
||||
//
|
||||
if (ui.should_draw()) {
|
||||
const float v = current_position.z;
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+'));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +138,7 @@
|
||||
if (ui.should_draw()) {
|
||||
char msg[10];
|
||||
sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points);
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg);
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg);
|
||||
}
|
||||
ui.refresh(LCDVIEW_CALL_NO_REDRAW);
|
||||
if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z);
|
||||
@@ -155,9 +153,9 @@
|
||||
// G29 Records Z, moves, and signals when it pauses
|
||||
ui.wait_for_move = true;
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
queue.inject_P(manual_probe_index ? PSTR("G29S2") : PSTR("G29S1"));
|
||||
queue.inject(manual_probe_index ? F("G29S2") : F("G29S1"));
|
||||
#elif ENABLED(PROBE_MANUALLY)
|
||||
queue.inject_P(PSTR("G29V1"));
|
||||
queue.inject(F("G29V1"));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -167,7 +165,7 @@
|
||||
//
|
||||
void _lcd_level_bed_homing_done() {
|
||||
if (ui.should_draw()) {
|
||||
MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING));
|
||||
MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING));
|
||||
// Color UI needs a control to detect a touch
|
||||
#if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
|
||||
touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
|
||||
@@ -216,7 +214,7 @@
|
||||
BACK_ITEM(MSG_BED_LEVELING);
|
||||
EDIT_ITEM(uint8, MSG_MESH_X, &xind, 0, (GRID_MAX_POINTS_X) - 1);
|
||||
EDIT_ITEM(uint8, MSG_MESH_Y, &yind, 0, (GRID_MAX_POINTS_Y) - 1);
|
||||
EDIT_ITEM_FAST(float43, MSG_MESH_EDIT_Z, &Z_VALUES(xind, yind), -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner);
|
||||
EDIT_ITEM_FAST(float43, MSG_MESH_EDIT_Z, &bedlevel.z_values[xind][yind], -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner);
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -232,7 +230,7 @@
|
||||
* Mesh Z Offset: --- (Req: MESH_BED_LEVELING)
|
||||
* Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET)
|
||||
* Level Bed >
|
||||
* Level Corners > (if homed)
|
||||
* Bed Tramming > (if homed)
|
||||
* Load Settings (Req: EEPROM_SETTINGS)
|
||||
* Save Settings (Req: EEPROM_SETTINGS)
|
||||
*/
|
||||
@@ -245,7 +243,7 @@ void menu_bed_leveling() {
|
||||
|
||||
// Auto Home if not using manual probing
|
||||
#if NONE(PROBE_MANUALLY, MESH_BED_LEVELING)
|
||||
if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
|
||||
if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
|
||||
#endif
|
||||
|
||||
// Level Bed
|
||||
@@ -254,7 +252,7 @@ void menu_bed_leveling() {
|
||||
SUBMENU(MSG_LEVEL_BED, _lcd_level_bed_continue);
|
||||
#else
|
||||
// Automatic leveling can just run the G-code
|
||||
GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G29N"));
|
||||
GCODES_ITEM(MSG_LEVEL_BED, is_homed ? F("G29") : F("G29N"));
|
||||
#endif
|
||||
|
||||
#if ENABLED(MESH_EDIT_MENU)
|
||||
@@ -283,7 +281,7 @@ void menu_bed_leveling() {
|
||||
#else
|
||||
#define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99
|
||||
#endif
|
||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_BED_Z, &mbl.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_BED_Z, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
#endif
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
@@ -292,7 +290,7 @@ void menu_bed_leveling() {
|
||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
#endif
|
||||
|
||||
#if ENABLED(LEVEL_BED_CORNERS)
|
||||
#if ENABLED(LCD_BED_TRAMMING)
|
||||
SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners);
|
||||
#endif
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, CANCEL_OBJECTS)
|
||||
#if BOTH(HAS_MARLINUI_MENU, CANCEL_OBJECTS)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "menu_addon.h"
|
||||
@@ -47,8 +47,8 @@ static void lcd_cancel_object_confirm() {
|
||||
ui.completion_feedback();
|
||||
ui.goto_previous_screen();
|
||||
},
|
||||
ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_CANCEL_OBJECT), item_num, PSTR("?")
|
||||
nullptr,
|
||||
GET_TEXT_F(MSG_CANCEL_OBJECT), item_num, F("?")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,4 +71,4 @@ void menu_cancelobject() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && CANCEL_OBJECTS
|
||||
#endif // HAS_MARLINUI_MENU && CANCEL_OBJECTS
|
||||
|
@@ -26,14 +26,20 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#include "menu_item.h"
|
||||
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#include "../../feature/runout.h"
|
||||
#endif
|
||||
|
||||
#if HAS_FANCHECK
|
||||
#include "../../feature/fancheck.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../feature/powerloss.h"
|
||||
#endif
|
||||
@@ -49,6 +55,8 @@
|
||||
#include "../../libs/buzzer.h"
|
||||
#endif
|
||||
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
#define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
|
||||
|
||||
void menu_advanced_settings();
|
||||
@@ -64,24 +72,20 @@ void menu_advanced_settings();
|
||||
static int8_t bar_percent = 0;
|
||||
if (ui.use_click()) {
|
||||
ui.goto_previous_screen();
|
||||
#if HAS_MARLINUI_HD44780
|
||||
ui.set_custom_characters(CHARSET_MENU);
|
||||
#endif
|
||||
TERN_(HAS_MARLINUI_HD44780, ui.set_custom_characters(CHARSET_MENU));
|
||||
return;
|
||||
}
|
||||
bar_percent += (int8_t)ui.encoderPosition;
|
||||
LIMIT(bar_percent, 0, 100);
|
||||
ui.encoderPosition = 0;
|
||||
MenuItem_static::draw(0, GET_TEXT(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT);
|
||||
lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%');
|
||||
MenuItem_static::draw(0, GET_TEXT_F(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT);
|
||||
lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_lchar('%');
|
||||
lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent);
|
||||
}
|
||||
|
||||
void _progress_bar_test() {
|
||||
ui.goto_screen(progress_bar_test);
|
||||
#if HAS_MARLINUI_HD44780
|
||||
ui.set_custom_characters(CHARSET_INFO);
|
||||
#endif
|
||||
TERN_(HAS_MARLINUI_HD44780, ui.set_custom_characters(CHARSET_INFO));
|
||||
}
|
||||
|
||||
#endif // LCD_PROGRESS_BAR_TEST
|
||||
@@ -120,8 +124,8 @@ void menu_advanced_settings();
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_UNRETRACT_SPEED, &toolchange_settings.unretract_speed, 10, 5400);
|
||||
EDIT_ITEM(float3, MSG_FILAMENT_PURGE_LENGTH, &toolchange_settings.extra_prime, 0, max_extrude);
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_PRIME_SPEED, &toolchange_settings.prime_speed, 10, 5400);
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_SPEED, &toolchange_settings.fan_speed, 0, 255);
|
||||
EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_TIME, &toolchange_settings.fan_time, 1, 30);
|
||||
EDIT_ITEM_FAST(uint8, MSG_SINGLENOZZLE_FAN_SPEED, &toolchange_settings.fan_speed, 0, 255);
|
||||
EDIT_ITEM_FAST(uint8, MSG_SINGLENOZZLE_FAN_TIME, &toolchange_settings.fan_time, 1, 30);
|
||||
#endif
|
||||
EDIT_ITEM(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10);
|
||||
END_MENU();
|
||||
@@ -133,7 +137,7 @@ void menu_advanced_settings();
|
||||
#include "../../gcode/queue.h"
|
||||
|
||||
void menu_toolchange_migration() {
|
||||
PGM_P const msg_migrate = GET_TEXT(MSG_TOOL_MIGRATION_SWAP);
|
||||
FSTR_P const msg_migrate = GET_TEXT_F(MSG_TOOL_MIGRATION_SWAP);
|
||||
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_CONFIGURATION);
|
||||
@@ -143,9 +147,9 @@ void menu_advanced_settings();
|
||||
EDIT_ITEM(uint8, MSG_TOOL_MIGRATION_END, &migration.last, 0, EXTRUDERS - 1);
|
||||
|
||||
// Migrate to a chosen extruder
|
||||
LOOP_L_N(s, EXTRUDERS) {
|
||||
if (s != active_extruder) {
|
||||
ACTION_ITEM_N_P(s, msg_migrate, []{
|
||||
EXTRUDER_LOOP() {
|
||||
if (e != active_extruder) {
|
||||
ACTION_ITEM_N_F(e, msg_migrate, []{
|
||||
char cmd[12];
|
||||
sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex));
|
||||
queue.inject(cmd);
|
||||
@@ -174,12 +178,12 @@ void menu_advanced_settings();
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_CONFIGURATION);
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_X, &hotend_offset[1].x, float(X2_HOME_POS - 25), float(X2_HOME_POS + 25), _recalc_offsets);
|
||||
EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, float(X2_HOME_POS - 25), float(X2_HOME_POS + 25), _recalc_offsets);
|
||||
#else
|
||||
EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_X, &hotend_offset[1].x, -99.0, 99.0, _recalc_offsets);
|
||||
EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, -99.0, 99.0, _recalc_offsets);
|
||||
#endif
|
||||
EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_Y, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets);
|
||||
EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_Z, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets);
|
||||
EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets);
|
||||
EDIT_ITEM_FAST_N(float42_52, Z_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets);
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
|
||||
#endif
|
||||
@@ -195,16 +199,16 @@ void menu_advanced_settings();
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_CONFIGURATION);
|
||||
|
||||
GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605S1\nG28X\nG1X0"));
|
||||
GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, F("M605S1\nG28X\nG1X0"));
|
||||
GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28
|
||||
? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first
|
||||
: PSTR("M605S1\nT0\nM605S2\nG28X\nG1X0")
|
||||
? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first
|
||||
: F("M605S1\nT0\nM605S2\nG28X\nG1X0")
|
||||
);
|
||||
GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28
|
||||
? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first
|
||||
: PSTR("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3")
|
||||
? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first
|
||||
: F("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3")
|
||||
);
|
||||
GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605S0\nG28X"));
|
||||
GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, F("M605S0\nG28X"));
|
||||
|
||||
EDIT_ITEM(float42_52, MSG_IDEX_DUPE_GAP, &duplicate_extruder_x_offset, (X2_MIN_POS) - (X1_MIN_POS), (X_BED_SIZE) - 20);
|
||||
|
||||
@@ -217,11 +221,14 @@ void menu_advanced_settings();
|
||||
|
||||
#if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
|
||||
void bltouch_report() {
|
||||
SERIAL_ECHOLNPGM("EEPROM Last BLTouch Mode - ", bltouch.last_written_mode);
|
||||
SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD"));
|
||||
PGMSTR(mode0, "OD");
|
||||
PGMSTR(mode1, "5V");
|
||||
DEBUG_ECHOPGM("BLTouch Mode: ");
|
||||
DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
|
||||
DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
|
||||
char mess[21];
|
||||
strcpy_P(mess, PSTR("BLTouch Mode - "));
|
||||
strcpy_P(&mess[15], bltouch.last_written_mode ? PSTR("5V") : PSTR("OD"));
|
||||
strcpy_P(mess, PSTR("BLTouch Mode: "));
|
||||
strcpy_P(&mess[15], bltouch.od_5v_mode ? mode1 : mode0);
|
||||
ui.set_status(mess);
|
||||
ui.return_to_status();
|
||||
}
|
||||
@@ -235,12 +242,15 @@ void menu_advanced_settings();
|
||||
ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy);
|
||||
ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow);
|
||||
ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode);
|
||||
#ifdef BLTOUCH_HS_MODE
|
||||
EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode);
|
||||
#endif
|
||||
#if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
|
||||
ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store);
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
|
||||
CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE));
|
||||
ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report);
|
||||
#endif
|
||||
END_MENU();
|
||||
@@ -254,10 +264,10 @@ void menu_advanced_settings();
|
||||
ui.defer_status_screen();
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_CONFIGURATION);
|
||||
GCODES_ITEM(MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0"));
|
||||
GCODES_ITEM(MSG_TOUCHMI_INIT, F("M851 Z0\nG28\nG1 F200 Z0"));
|
||||
SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
||||
GCODES_ITEM(MSG_TOUCHMI_SAVE, PSTR("M500\nG1 F200 Z10"));
|
||||
GCODES_ITEM(MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0"));
|
||||
GCODES_ITEM(MSG_TOUCHMI_SAVE, F("M500\nG1 F200 Z10"));
|
||||
GCODES_ITEM(MSG_TOUCHMI_ZTEST, F("G28\nG1 F200 Z0"));
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -270,10 +280,10 @@ void menu_advanced_settings();
|
||||
void menu_controller_fan() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_CONFIGURATION);
|
||||
EDIT_ITEM_FAST(percent, MSG_CONTROLLER_FAN_IDLE_SPEED, &controllerFan.settings.idle_speed, _MAX(1, CONTROLLERFAN_SPEED_MIN) - 1, 255);
|
||||
EDIT_ITEM_FAST(percent, MSG_CONTROLLER_FAN_IDLE_SPEED, &controllerFan.settings.idle_speed, CONTROLLERFAN_SPEED_MIN, 255);
|
||||
EDIT_ITEM(bool, MSG_CONTROLLER_FAN_AUTO_ON, &controllerFan.settings.auto_mode);
|
||||
if (controllerFan.settings.auto_mode) {
|
||||
EDIT_ITEM_FAST(percent, MSG_CONTROLLER_FAN_SPEED, &controllerFan.settings.active_speed, _MAX(1, CONTROLLERFAN_SPEED_MIN) - 1, 255);
|
||||
EDIT_ITEM_FAST(percent, MSG_CONTROLLER_FAN_SPEED, &controllerFan.settings.active_speed, CONTROLLERFAN_SPEED_MIN, 255);
|
||||
EDIT_ITEM(uint16_4, MSG_CONTROLLER_FAN_DURATION, &controllerFan.settings.duration, 0, 4800);
|
||||
}
|
||||
END_MENU();
|
||||
@@ -310,7 +320,7 @@ void menu_advanced_settings();
|
||||
|
||||
#endif
|
||||
|
||||
#if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS)
|
||||
#if HAS_PREHEAT && DISABLED(SLIM_LCD_MENUS)
|
||||
|
||||
void _menu_configuration_preheat_settings() {
|
||||
#define _MINTEMP_ITEM(N) HEATER_##N##_MINTEMP,
|
||||
@@ -319,7 +329,7 @@ void menu_advanced_settings();
|
||||
#define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0)
|
||||
const uint8_t m = MenuItemBase::itemIndex;
|
||||
START_MENU();
|
||||
STATIC_ITEM_P(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT);
|
||||
STATIC_ITEM_F(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT);
|
||||
BACK_ITEM(MSG_CONFIGURATION);
|
||||
#if HAS_FAN
|
||||
editable.uint8 = uint8_t(ui.material_preset[m].fan_speed);
|
||||
@@ -341,8 +351,8 @@ void menu_advanced_settings();
|
||||
|
||||
#if ENABLED(CUSTOM_MENU_CONFIG)
|
||||
|
||||
void _lcd_custom_menus_configuration_gcode(PGM_P const cmd) {
|
||||
queue.inject_P(cmd);
|
||||
void _lcd_custom_menus_configuration_gcode(FSTR_P const fstr) {
|
||||
queue.inject(fstr);
|
||||
TERN_(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK, ui.completion_feedback());
|
||||
TERN_(CUSTOM_MENU_CONFIG_SCRIPT_RETURN, ui.return_to_status());
|
||||
}
|
||||
@@ -358,15 +368,14 @@ void menu_advanced_settings();
|
||||
#else
|
||||
#define _DONE_SCRIPT ""
|
||||
#endif
|
||||
#define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(PSTR(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N));
|
||||
#define _CUSTOM_ITEM_CONF_CONFIRM(N) \
|
||||
SUBMENU_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), []{ \
|
||||
MenuItem_confirm::confirm_screen( \
|
||||
GCODE_LAMBDA_CONF(N), \
|
||||
ui.goto_previous_screen, \
|
||||
PSTR(CONFIG_MENU_ITEM_##N##_DESC "?") \
|
||||
); \
|
||||
#define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(F(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_F(F(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N));
|
||||
#define _CUSTOM_ITEM_CONF_CONFIRM(N) \
|
||||
SUBMENU_F(F(CONFIG_MENU_ITEM_##N##_DESC), []{ \
|
||||
MenuItem_confirm::confirm_screen( \
|
||||
GCODE_LAMBDA_CONF(N), nullptr, \
|
||||
F(CONFIG_MENU_ITEM_##N##_DESC "?") \
|
||||
); \
|
||||
})
|
||||
|
||||
#define CUSTOM_ITEM_CONF(N) do{ \
|
||||
@@ -474,7 +483,7 @@ void menu_configuration() {
|
||||
#if ENABLED(CUSTOM_MENU_CONFIG)
|
||||
if (TERN1(CUSTOM_MENU_CONFIG_ONLY_IDLE, !busy)) {
|
||||
#ifdef CUSTOM_MENU_CONFIG_TITLE
|
||||
SUBMENU_P(PSTR(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration);
|
||||
SUBMENU_F(F(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration);
|
||||
#else
|
||||
SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_configuration);
|
||||
#endif
|
||||
@@ -531,9 +540,19 @@ void menu_configuration() {
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
EDIT_ITEM_FAST(uint8, MSG_BRIGHTNESS, &ui.brightness, LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.refresh_brightness, true);
|
||||
#endif
|
||||
#if HAS_LCD_CONTRAST
|
||||
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX
|
||||
EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set display backlight / sleep timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX
|
||||
EDIT_ITEM(uint16_4, MSG_LCD_TIMEOUT_SEC, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.sleep_timeout_minutes, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX, ui.refresh_screen_timeout);
|
||||
#endif
|
||||
|
||||
#if ENABLED(FWRETRACT)
|
||||
SUBMENU(MSG_RETRACT, menu_config_retract);
|
||||
#endif
|
||||
@@ -542,18 +561,22 @@ void menu_configuration() {
|
||||
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
|
||||
#endif
|
||||
|
||||
#if HAS_FANCHECK
|
||||
EDIT_ITEM(bool, MSG_FANCHECK, &fan_check.enabled);
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed);
|
||||
#endif
|
||||
|
||||
// Preheat configurations
|
||||
#if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS)
|
||||
#if HAS_PREHEAT && DISABLED(SLIM_LCD_MENUS)
|
||||
LOOP_L_N(m, PREHEAT_COUNT)
|
||||
SUBMENU_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings);
|
||||
SUBMENU_N_f(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SOUND_MENU_ITEM)
|
||||
EDIT_ITEM(bool, MSG_SOUND, &ui.buzzer_enabled, []{ ui.chirp(); });
|
||||
EDIT_ITEM(bool, MSG_SOUND, &ui.sound_on, []{ ui.chirp(); });
|
||||
#endif
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
@@ -566,4 +589,4 @@ void menu_configuration() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
|
||||
#if HAS_MARLINUI_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/delta.h"
|
||||
@@ -41,6 +41,10 @@
|
||||
#include "../extui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#if HAS_PROBE_XY_OFFSET
|
||||
#include "../../module/probe.h"
|
||||
#endif
|
||||
|
||||
void _man_probe_pt(const xy_pos_t &xy) {
|
||||
if (!ui.wait_for_move) {
|
||||
ui.wait_for_move = true;
|
||||
@@ -48,7 +52,7 @@ void _man_probe_pt(const xy_pos_t &xy) {
|
||||
ui.wait_for_move = false;
|
||||
ui.synchronize();
|
||||
ui.manual_move.menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / planner.settings.axis_steps_per_mm[0]); // Use first axis as for delta XYZ should always match
|
||||
ui.goto_screen(lcd_move_z);
|
||||
ui.goto_screen([]{ lcd_move_axis(Z_AXIS); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,14 +62,14 @@ void _man_probe_pt(const xy_pos_t &xy) {
|
||||
#include "../../MarlinCore.h" // for wait_for_user_response()
|
||||
#endif
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
#include "../../feature/host_actions.h" // for host_prompt_do
|
||||
#include "../../feature/host_actions.h" // for hostui.prompt_do
|
||||
#endif
|
||||
|
||||
float lcd_probe_pt(const xy_pos_t &xy) {
|
||||
_man_probe_pt(xy);
|
||||
ui.defer_status_screen();
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress")));
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Delta Calibration in progress")));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
||||
ui.goto_previous_screen_no_defer();
|
||||
return current_position.z;
|
||||
@@ -88,7 +92,9 @@ void _man_probe_pt(const xy_pos_t &xy) {
|
||||
}
|
||||
|
||||
void _goto_tower_a(const_float_t a) {
|
||||
constexpr float dcr = DELTA_PRINTABLE_RADIUS;
|
||||
float dcr = DELTA_PRINTABLE_RADIUS - PROBING_MARGIN;
|
||||
TERN_(HAS_PROBE_XY_OFFSET, dcr -= HYPOT(probe.offset_xy.x, probe.offset_xy.y));
|
||||
TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor);
|
||||
xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) };
|
||||
_man_probe_pt(tower_vec * dcr);
|
||||
}
|
||||
@@ -107,12 +113,12 @@ void lcd_delta_settings() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_DELTA_CALIBRATE);
|
||||
EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings);
|
||||
#define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings)
|
||||
#define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings)
|
||||
EDIT_ENDSTOP_ADJ("Ex", a);
|
||||
EDIT_ENDSTOP_ADJ("Ey", b);
|
||||
EDIT_ENDSTOP_ADJ("Ez", c);
|
||||
EDIT_ITEM(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings);
|
||||
#define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings)
|
||||
#define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings)
|
||||
EDIT_ANGLE_TRIM("Tx", a);
|
||||
EDIT_ANGLE_TRIM("Ty", b);
|
||||
EDIT_ANGLE_TRIM("Tz", c);
|
||||
@@ -129,7 +135,7 @@ void menu_delta_calibrate() {
|
||||
BACK_ITEM(MSG_MAIN);
|
||||
|
||||
#if ENABLED(DELTA_AUTO_CALIBRATION)
|
||||
GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
|
||||
GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, F("G33"));
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
|
||||
ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
|
||||
@@ -151,4 +157,4 @@ void menu_delta_calibrate() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && (DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION)
|
||||
#endif // HAS_MARLINUI_MENU && (DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION)
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
|
||||
#if BOTH(HAS_MARLINUI_MENU, ADVANCED_PAUSE_FEATURE)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/temperature.h"
|
||||
@@ -35,6 +35,9 @@
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#include "../../feature/runout.h"
|
||||
#endif
|
||||
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
#include "../../MarlinCore.h"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Change Filament > Change/Unload/Load Filament
|
||||
@@ -42,29 +45,31 @@
|
||||
static PauseMode _change_filament_mode; // = PAUSE_MODE_PAUSE_PRINT
|
||||
static int8_t _change_filament_extruder; // = 0
|
||||
|
||||
inline PGM_P _change_filament_command() {
|
||||
inline FSTR_P _change_filament_command() {
|
||||
switch (_change_filament_mode) {
|
||||
case PAUSE_MODE_LOAD_FILAMENT: return PSTR("M701 T%d");
|
||||
case PAUSE_MODE_LOAD_FILAMENT: return F("M701 T%d");
|
||||
case PAUSE_MODE_UNLOAD_FILAMENT: return _change_filament_extruder >= 0
|
||||
? PSTR("M702 T%d") : PSTR("M702 ;%d");
|
||||
? F("M702 T%d") : F("M702 ;%d");
|
||||
case PAUSE_MODE_CHANGE_FILAMENT:
|
||||
case PAUSE_MODE_PAUSE_PRINT:
|
||||
default: break;
|
||||
}
|
||||
return PSTR("M600 B0 T%d");
|
||||
return F("M600 B0 T%d");
|
||||
}
|
||||
|
||||
// Initiate Filament Load/Unload/Change at the specified temperature
|
||||
static void _change_filament_with_temp(const uint16_t celsius) {
|
||||
char cmd[11];
|
||||
sprintf_P(cmd, _change_filament_command(), _change_filament_extruder);
|
||||
sprintf_P(cmd, FTOP(_change_filament_command()), _change_filament_extruder);
|
||||
thermalManager.setTargetHotend(celsius, _change_filament_extruder);
|
||||
queue.inject(cmd);
|
||||
}
|
||||
|
||||
static void _change_filament_with_preset() {
|
||||
_change_filament_with_temp(ui.material_preset[MenuItemBase::itemIndex].hotend_temp);
|
||||
}
|
||||
#if HAS_PREHEAT
|
||||
static void _change_filament_with_preset() {
|
||||
_change_filament_with_temp(ui.material_preset[MenuItemBase::itemIndex].hotend_temp);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void _change_filament_with_custom() {
|
||||
_change_filament_with_temp(thermalManager.degTargetHotend(MenuItemBase::itemIndex));
|
||||
@@ -74,13 +79,13 @@ static void _change_filament_with_custom() {
|
||||
// Menu to choose the temperature and start Filament Change
|
||||
//
|
||||
|
||||
inline PGM_P change_filament_header(const PauseMode mode) {
|
||||
inline FSTR_P change_filament_header(const PauseMode mode) {
|
||||
switch (mode) {
|
||||
case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT(MSG_FILAMENTLOAD);
|
||||
case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT(MSG_FILAMENTUNLOAD);
|
||||
case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENTLOAD);
|
||||
case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENTUNLOAD);
|
||||
default: break;
|
||||
}
|
||||
return GET_TEXT(MSG_FILAMENTCHANGE);
|
||||
return GET_TEXT_F(MSG_FILAMENTCHANGE);
|
||||
}
|
||||
|
||||
void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
||||
@@ -88,11 +93,11 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
||||
_change_filament_extruder = extruder;
|
||||
const int8_t old_index = MenuItemBase::itemIndex;
|
||||
START_MENU();
|
||||
if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_DEFAULT|SS_INVERT);
|
||||
if (LCD_HEIGHT >= 4) STATIC_ITEM_F(change_filament_header(mode), SS_DEFAULT|SS_INVERT);
|
||||
BACK_ITEM(MSG_BACK);
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LOOP_L_N(m, PREHEAT_COUNT)
|
||||
ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset);
|
||||
ACTION_ITEM_N_f(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset);
|
||||
#endif
|
||||
EDIT_ITEM_FAST_N(int3, extruder, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[extruder].target,
|
||||
EXTRUDE_MINTEMP, thermalManager.hotend_max_target(extruder),
|
||||
@@ -129,18 +134,18 @@ void menu_change_filament() {
|
||||
|
||||
// Change filament
|
||||
#if E_STEPPERS == 1
|
||||
PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE);
|
||||
FSTR_P const fmsg = GET_TEXT_F(MSG_FILAMENTCHANGE);
|
||||
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
||||
SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
|
||||
SUBMENU_F(fmsg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
|
||||
else
|
||||
GCODES_ITEM_P(msg, PSTR("M600 B0"));
|
||||
GCODES_ITEM_F(fmsg, F("M600 B0"));
|
||||
#else
|
||||
PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E);
|
||||
FSTR_P const fmsg = GET_TEXT_F(MSG_FILAMENTCHANGE_E);
|
||||
LOOP_L_N(s, E_STEPPERS) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
|
||||
SUBMENU_N_F(s, fmsg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
ACTION_ITEM_N_P(s, msg, []{
|
||||
ACTION_ITEM_N_F(s, fmsg, []{
|
||||
PGM_P const cmdpstr = PSTR("M600 B0 T%i");
|
||||
char cmd[strlen_P(cmdpstr) + 3 + 1];
|
||||
sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex));
|
||||
@@ -154,18 +159,18 @@ void menu_change_filament() {
|
||||
if (!is_busy) {
|
||||
// Load filament
|
||||
#if E_STEPPERS == 1
|
||||
PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD);
|
||||
FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD);
|
||||
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
||||
SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
|
||||
SUBMENU_F(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
|
||||
else
|
||||
GCODES_ITEM_P(msg_load, PSTR("M701"));
|
||||
GCODES_ITEM_F(msg_load, F("M701"));
|
||||
#else
|
||||
PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E);
|
||||
FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD_E);
|
||||
LOOP_L_N(s, E_STEPPERS) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
SUBMENU_N_F(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
ACTION_ITEM_N_P(s, msg_load, []{
|
||||
ACTION_ITEM_N_F(s, msg_load, []{
|
||||
char cmd[12];
|
||||
sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex));
|
||||
queue.inject(cmd);
|
||||
@@ -176,24 +181,24 @@ void menu_change_filament() {
|
||||
|
||||
// Unload filament
|
||||
#if E_STEPPERS == 1
|
||||
PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD);
|
||||
FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD);
|
||||
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
||||
SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
|
||||
SUBMENU_F(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
|
||||
else
|
||||
GCODES_ITEM_P(msg_unload, PSTR("M702"));
|
||||
GCODES_ITEM_F(msg_unload, F("M702"));
|
||||
#else
|
||||
#if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
|
||||
if (too_cold)
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); });
|
||||
else
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702"));
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, F("M702"));
|
||||
#endif
|
||||
PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E);
|
||||
FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD_E);
|
||||
LOOP_L_N(s, E_STEPPERS) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
SUBMENU_N_F(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
ACTION_ITEM_N_P(s, msg_unload, []{
|
||||
ACTION_ITEM_N_F(s, msg_unload, []{
|
||||
char cmd[12];
|
||||
sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex));
|
||||
queue.inject(cmd);
|
||||
@@ -209,7 +214,7 @@ void menu_change_filament() {
|
||||
#else
|
||||
|
||||
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
|
||||
queue.inject_P(PSTR("M600B0"));
|
||||
queue.inject(F("M600B0"));
|
||||
else
|
||||
ui.goto_screen([]{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
|
||||
|
||||
@@ -218,21 +223,21 @@ void menu_change_filament() {
|
||||
|
||||
static uint8_t hotend_status_extruder = 0;
|
||||
|
||||
static PGM_P pause_header() {
|
||||
static FSTR_P pause_header() {
|
||||
switch (pause_mode) {
|
||||
case PAUSE_MODE_CHANGE_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER);
|
||||
case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_LOAD);
|
||||
case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_UNLOAD);
|
||||
case PAUSE_MODE_CHANGE_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER);
|
||||
case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_LOAD);
|
||||
case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_UNLOAD);
|
||||
default: break;
|
||||
}
|
||||
return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_PAUSE);
|
||||
return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_PAUSE);
|
||||
}
|
||||
|
||||
// Portions from STATIC_ITEM...
|
||||
#define HOTEND_STATUS_ITEM() do { \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
if (ui.should_draw()) { \
|
||||
IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \
|
||||
IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT_F(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \
|
||||
ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \
|
||||
} \
|
||||
if (_skipStatic && encoderLine <= _thisItemNr) { \
|
||||
@@ -268,41 +273,41 @@ void menu_pause_option() {
|
||||
//
|
||||
// ADVANCED_PAUSE_FEATURE message screens
|
||||
//
|
||||
// Warning: msg must have three null bytes to delimit lines!
|
||||
// Warning: fmsg must have three null bytes to delimit lines!
|
||||
//
|
||||
void _lcd_pause_message(PGM_P const msg) {
|
||||
PGM_P const msg1 = msg;
|
||||
void _lcd_pause_message(FSTR_P const fmsg) {
|
||||
PGM_P const msg1 = FTOP(fmsg);
|
||||
PGM_P const msg2 = msg1 + strlen_P(msg1) + 1;
|
||||
PGM_P const msg3 = msg2 + strlen_P(msg2) + 1;
|
||||
const bool has2 = msg2[0], has3 = msg3[0],
|
||||
skip1 = !has2 && (LCD_HEIGHT) >= 5;
|
||||
|
||||
START_SCREEN();
|
||||
STATIC_ITEM_P(pause_header(), SS_DEFAULT|SS_INVERT); // 1: Header
|
||||
STATIC_ITEM_F(pause_header(), SS_DEFAULT|SS_INVERT); // 1: Header
|
||||
if (skip1) SKIP_ITEM(); // Move a single-line message down
|
||||
STATIC_ITEM_P(msg1); // 2: Message Line 1
|
||||
if (has2) STATIC_ITEM_P(msg2); // 3: Message Line 2
|
||||
if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); // 4: Message Line 3 (if LCD has 5 lines)
|
||||
STATIC_ITEM_F(FPSTR(msg1)); // 2: Message Line 1
|
||||
if (has2) STATIC_ITEM_F(FPSTR(msg2)); // 3: Message Line 2
|
||||
if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_F(FPSTR(msg3)); // 4: Message Line 3 (if LCD has 5 lines)
|
||||
if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM(); // Push Hotend Status down, if needed
|
||||
HOTEND_STATUS_ITEM(); // 5: Hotend Status
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_PARKING)); }
|
||||
void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INIT)); }
|
||||
void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); }
|
||||
void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); }
|
||||
void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT)); }
|
||||
void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); }
|
||||
void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); }
|
||||
void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING)); }
|
||||
void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); }
|
||||
void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); }
|
||||
void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); }
|
||||
void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); }
|
||||
void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); }
|
||||
void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); }
|
||||
void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); }
|
||||
void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); }
|
||||
void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); }
|
||||
void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); }
|
||||
|
||||
void lcd_pause_purge_message() {
|
||||
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
|
||||
_lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE));
|
||||
_lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_CONT_PURGE));
|
||||
#else
|
||||
_lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE));
|
||||
_lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -342,4 +347,4 @@ void MarlinUI::pause_show_message(
|
||||
ui.return_to_status();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && ADVANCED_PAUSE_FEATURE
|
||||
#endif // HAS_MARLINUI_MENU && ADVANCED_PAUSE_FEATURE
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, LCD_INFO_MENU)
|
||||
#if BOTH(HAS_MARLINUI_MENU, LCD_INFO_MENU)
|
||||
|
||||
#include "menu_item.h"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#endif
|
||||
|
||||
#define VALUE_ITEM(MSG, VALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy(msg + 2, VALUE); STATIC_ITEM(MSG, STYL, msg); }while(0)
|
||||
#define VALUE_ITEM_P(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0)
|
||||
#define VALUE_ITEM_F(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0)
|
||||
|
||||
#if ENABLED(PRINTCOUNTER)
|
||||
|
||||
@@ -56,35 +56,35 @@
|
||||
VALUE_ITEM(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT); // Completed : 666
|
||||
|
||||
STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT); // Total print Time:
|
||||
STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s
|
||||
STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s
|
||||
|
||||
STATIC_ITEM(MSG_INFO_PRINT_LONGEST, SS_LEFT); // Longest job time:
|
||||
STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s
|
||||
STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s
|
||||
|
||||
STATIC_ITEM(MSG_INFO_PRINT_FILAMENT, SS_LEFT); // Extruded total:
|
||||
sprintf_P(buffer, PSTR("%ld.%im")
|
||||
, long(stats.filamentUsed / 1000)
|
||||
, int16_t(stats.filamentUsed / 100) % 10
|
||||
);
|
||||
STATIC_ITEM_P(PSTR("> "), SS_LEFT, buffer); // > 125m
|
||||
STATIC_ITEM_F(F("> "), SS_LEFT, buffer); // > 125m
|
||||
|
||||
#if SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0
|
||||
strcpy_P(buffer, GET_TEXT(MSG_SERVICE_IN));
|
||||
#endif
|
||||
|
||||
#if SERVICE_INTERVAL_1 > 0
|
||||
STATIC_ITEM_P(PSTR(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in:
|
||||
STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s
|
||||
STATIC_ITEM_F(F(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in:
|
||||
STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s
|
||||
#endif
|
||||
|
||||
#if SERVICE_INTERVAL_2 > 0
|
||||
STATIC_ITEM_P(PSTR(SERVICE_NAME_2 " "), SS_LEFT, buffer);
|
||||
STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer));
|
||||
STATIC_ITEM_F(F(SERVICE_NAME_2 " "), SS_LEFT, buffer);
|
||||
STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer));
|
||||
#endif
|
||||
|
||||
#if SERVICE_INTERVAL_3 > 0
|
||||
STATIC_ITEM_P(PSTR(SERVICE_NAME_3 " "), SS_LEFT, buffer);
|
||||
STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer));
|
||||
STATIC_ITEM_F(F(SERVICE_NAME_3 " "), SS_LEFT, buffer);
|
||||
STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer));
|
||||
#endif
|
||||
|
||||
END_SCREEN();
|
||||
@@ -103,7 +103,7 @@ void menu_info_thermistors() {
|
||||
#if HAS_EXTRUDERS
|
||||
#define THERMISTOR_ID TEMP_SENSOR_0
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E0 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E0 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -113,7 +113,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_1
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E1 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E1 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -123,7 +123,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_2
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E2 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E2 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -133,7 +133,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_3
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E3 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E3 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -143,7 +143,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_4
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E4 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E4 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -153,7 +153,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_5
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E5 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E5 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -163,7 +163,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_6
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E6 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E6 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_6_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_6_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -173,7 +173,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_7
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR(LCD_STR_E7 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F(STR_E7 ": " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_7_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_7_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -183,7 +183,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_BED
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR("BED: " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F("BED: " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_BED, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -193,7 +193,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_CHAMBER
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR("CHAM: " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F("CHAM: " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_CHAMBER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -203,7 +203,7 @@ void menu_info_thermistors() {
|
||||
#undef THERMISTOR_ID
|
||||
#define THERMISTOR_ID TEMP_SENSOR_COOLER
|
||||
#include "../thermistornames.h"
|
||||
STATIC_ITEM_P(PSTR("COOL: " THERMISTOR_NAME), SS_INVERT);
|
||||
STATIC_ITEM_F(F("COOL: " THERMISTOR_NAME), SS_INVERT);
|
||||
PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(COOLER_MINTEMP), SS_LEFT);
|
||||
PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(COOLER_MAXTEMP), SS_LEFT);
|
||||
STATIC_ITEM(TERN(WATCH_COOLER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT);
|
||||
@@ -219,9 +219,9 @@ void menu_info_board() {
|
||||
if (ui.use_click()) return ui.go_back();
|
||||
|
||||
START_SCREEN();
|
||||
STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT); // MyPrinterController
|
||||
STATIC_ITEM_F(F(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT); // MyPrinterController
|
||||
#ifdef BOARD_WEBSITE_URL
|
||||
STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com
|
||||
STATIC_ITEM_F(F(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com
|
||||
#endif
|
||||
PSTRING_ITEM(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000
|
||||
PSTRING_ITEM(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER); // Protocol: 1.0
|
||||
@@ -251,11 +251,11 @@ void menu_info_board() {
|
||||
void menu_info_printer() {
|
||||
if (ui.use_click()) return ui.go_back();
|
||||
START_SCREEN();
|
||||
STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT); // Marlin
|
||||
STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION)); // x.x.x-Branch
|
||||
STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM
|
||||
STATIC_ITEM_P(PSTR(MACHINE_NAME), SS_DEFAULT|SS_INVERT); // My3DPrinter
|
||||
STATIC_ITEM_P(PSTR(WEBSITE_URL)); // www.my3dprinter.com
|
||||
STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT); // Marlin
|
||||
STATIC_ITEM_F(F(SHORT_BUILD_VERSION)); // x.x.x-Branch
|
||||
STATIC_ITEM_F(F(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM
|
||||
STATIC_ITEM_F(F(MACHINE_NAME), SS_DEFAULT|SS_INVERT); // My3DPrinter
|
||||
STATIC_ITEM_F(F(WEBSITE_URL)); // www.my3dprinter.com
|
||||
PSTRING_ITEM(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2
|
||||
#if HAS_LEVELING
|
||||
STATIC_ITEM(
|
||||
@@ -317,4 +317,4 @@ void menu_info() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && LCD_INFO_MENU
|
||||
#endif // HAS_MARLINUI_MENU && LCD_INFO_MENU
|
||||
|
@@ -23,11 +23,13 @@
|
||||
|
||||
#include "menu.h"
|
||||
#include "../marlinui.h"
|
||||
#include "../../gcode/queue.h" // for inject_P
|
||||
#include "../../gcode/queue.h" // for inject
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
void lcd_move_z();
|
||||
#if ENABLED(LASER_SYNCHRONOUS_M106_M107)
|
||||
#include "../../module/planner.h"
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////
|
||||
///////////// Base Menu Items //////////////
|
||||
@@ -36,36 +38,36 @@ void lcd_move_z();
|
||||
// SUBMENU(LABEL, screen_handler)
|
||||
class MenuItem_submenu : public MenuItemBase {
|
||||
public:
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]);
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) {
|
||||
_draw(sel, row, fstr, '>', LCD_STR_ARROW_RIGHT[0]);
|
||||
}
|
||||
static inline void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); }
|
||||
static void action(FSTR_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); }
|
||||
};
|
||||
|
||||
// Any menu item that invokes an immediate action
|
||||
class MenuItem_button : public MenuItemBase {
|
||||
public:
|
||||
// Button-y Items are selectable lines with no other indicator
|
||||
static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', ' ');
|
||||
static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) {
|
||||
_draw(sel, row, fstr, '>', ' ');
|
||||
}
|
||||
};
|
||||
|
||||
// ACTION_ITEM(LABEL, FUNC)
|
||||
class MenuItem_function : public MenuItem_button {
|
||||
public:
|
||||
//static inline void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); };
|
||||
static inline void action(PGM_P const, const menuAction_t func) { (*func)(); };
|
||||
//static void action(FSTR_P const, const uint8_t, const menuAction_t func) { (*func)(); };
|
||||
static void action(FSTR_P const, const menuAction_t func) { if (func) (*func)(); };
|
||||
};
|
||||
|
||||
// GCODES_ITEM(LABEL, GCODES)
|
||||
class MenuItem_gcode : public MenuItem_button {
|
||||
public:
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', ' ');
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) {
|
||||
_draw(sel, row, fstr, '>', ' ');
|
||||
}
|
||||
static void action(PGM_P const, PGM_P const pgcode) { queue.inject_P(pgcode); }
|
||||
static inline void action(PGM_P const pstr, const uint8_t, const char * const pgcode) { action(pstr, pgcode); }
|
||||
static void action(FSTR_P const, FSTR_P const fgcode) { queue.inject(fgcode); }
|
||||
static void action(FSTR_P const fstr, const uint8_t, FSTR_P const fgcode) { action(fstr, fgcode); }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////
|
||||
@@ -77,21 +79,21 @@ template<typename NAME>
|
||||
class TMenuEditItem : MenuEditItemBase {
|
||||
private:
|
||||
typedef typename NAME::type_t type_t;
|
||||
static inline float scale(const_float_t value) { return NAME::scale(value); }
|
||||
static inline float unscale(const_float_t value) { return NAME::unscale(value); }
|
||||
static float scale(const_float_t value) { return NAME::scale(value); }
|
||||
static float unscale(const_float_t value) { return NAME::unscale(value); }
|
||||
static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); }
|
||||
static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); }
|
||||
public:
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t * const data, ...) {
|
||||
MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(*(data)));
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t * const data, ...) {
|
||||
MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(*(data)));
|
||||
}
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t (*pget)(), ...) {
|
||||
MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(pget()));
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t (*pget)(), ...) {
|
||||
MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(pget()));
|
||||
}
|
||||
// Edit screen for this type of item
|
||||
static void edit_screen() { MenuEditItemBase::edit_screen(to_string, load); }
|
||||
static void action(
|
||||
PGM_P const pstr, // Edit label
|
||||
FSTR_P const fstr, // Edit label
|
||||
type_t * const ptr, // Value pointer
|
||||
const type_t minValue, // Value range
|
||||
const type_t maxValue,
|
||||
@@ -101,22 +103,36 @@ class TMenuEditItem : MenuEditItemBase {
|
||||
// Make sure minv and maxv fit within int32_t
|
||||
const int32_t minv = _MAX(scale(minValue), INT32_MIN),
|
||||
maxv = _MIN(scale(maxValue), INT32_MAX);
|
||||
goto_edit_screen(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv,
|
||||
goto_edit_screen(fstr, ptr, minv, maxv - minv, scale(*ptr) - minv,
|
||||
edit_screen, callback, live);
|
||||
}
|
||||
};
|
||||
|
||||
// Provide a set of Edit Item Types which encompass a primitive
|
||||
// type, a string function, and a scale factor for edit and display.
|
||||
// These items call the Edit Item draw method passing the prepared string.
|
||||
/**
|
||||
* DEFINE_MENU_EDIT_ITEM_TYPE(int3, int16_t, i16tostr3rj, 1)
|
||||
*
|
||||
* Define struct types for use by EDIT_ITEM(...) macros, which encompass
|
||||
* a primitive storage type, a string function, and a scale factor for edit / display.
|
||||
* The EDIT_ITEM macros take care of calling action and draw methods as needed.
|
||||
*
|
||||
* For example, DEFINE_MENU_EDIT_ITEM_TYPE(percent, uint8_t, ui8tostr4pctrj, 100.f/255.f, +0.5f) expands into:
|
||||
*
|
||||
* struct MenuEditItemInfo_percent {
|
||||
* typedef uint8_t type_t;
|
||||
* static float scale(const_float_t value) { return value * (100.f/255.f) +0.5f; }
|
||||
* static float unscale(const_float_t value) { return value / (100.f/255.f) +0.5f; }
|
||||
* static const char* strfunc(const_float_t value) { return ui8tostr4pctrj(_DOFIX(uint8_t,value)); }
|
||||
* };
|
||||
* typedef TMenuEditItem<MenuEditItemInfo_percent> MenuItem_percent
|
||||
*/
|
||||
#define __DOFIXfloat PROBE()
|
||||
#define _DOFIX(TYPE,V) TYPE(TERN(IS_PROBE(__DOFIX##TYPE),FIXFLOAT(V),(V)))
|
||||
#define DEFINE_MENU_EDIT_ITEM_TYPE(NAME, TYPE, STRFUNC, SCALE, ETC...) \
|
||||
struct MenuEditItemInfo_##NAME { \
|
||||
typedef TYPE type_t; \
|
||||
static inline float scale(const_float_t value) { return value * (SCALE) ETC; } \
|
||||
static inline float unscale(const_float_t value) { return value / (SCALE) ETC; } \
|
||||
static inline const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \
|
||||
static float scale(const_float_t value) { return value * (SCALE) ETC; } \
|
||||
static float unscale(const_float_t value) { return value / (SCALE) ETC; } \
|
||||
static const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \
|
||||
}; \
|
||||
typedef TMenuEditItem<MenuEditItemInfo_##NAME> MenuItem_##NAME
|
||||
|
||||
@@ -136,7 +152,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(float43 ,float ,ftostr43sign ,1000 );
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float4 ,float ,ftostr4sign , 1 ); // 1234 right-justified
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float5 ,float ,ftostr5rj , 1 ); // 12345 right-justified
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float5_25 ,float ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment)
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float51 ,float ,ftostr51rj , 10 ); // 1234.5 right-justified
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float61 ,float ,ftostr61rj , 10 ); // 12345.6 right-justified
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float31sign ,float ,ftostr31sign , 10 ); // +12.3
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float41sign ,float ,ftostr41sign , 10 ); // +123.4
|
||||
DEFINE_MENU_EDIT_ITEM_TYPE(float51sign ,float ,ftostr51sign , 10 ); // +1234.5
|
||||
@@ -154,16 +170,16 @@ DEFINE_MENU_EDIT_ITEM_TYPE(long5_25 ,uint32_t ,ftostr5rj , 0.04f );
|
||||
|
||||
class MenuItem_bool : public MenuEditItemBase {
|
||||
public:
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const bool onoff) {
|
||||
MenuEditItemBase::draw(sel, row, pstr, onoff ? GET_TEXT(MSG_LCD_ON) : GET_TEXT(MSG_LCD_OFF), true);
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, const bool onoff) {
|
||||
MenuEditItemBase::draw(sel, row, fstr, onoff ? GET_TEXT_F(MSG_LCD_ON) : GET_TEXT_F(MSG_LCD_OFF));
|
||||
}
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, bool * const data, ...) {
|
||||
draw(sel, row, pstr, *data);
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, bool * const data, ...) {
|
||||
draw(sel, row, fstr, *data);
|
||||
}
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const, bool (*pget)(), ...) {
|
||||
draw(sel, row, pstr, pget());
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, FSTR_P const, bool (*pget)(), ...) {
|
||||
draw(sel, row, fstr, pget());
|
||||
}
|
||||
static void action(PGM_P const pstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) {
|
||||
static void action(FSTR_P const fstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) {
|
||||
*ptr ^= true; ui.refresh();
|
||||
if (callbackFunc) (*callbackFunc)();
|
||||
}
|
||||
@@ -236,16 +252,16 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
*
|
||||
* Examples:
|
||||
* BACK_ITEM(MSG_INFO_SCREEN)
|
||||
* MenuItem_back::action(plabel, ...)
|
||||
* MenuItem_back::draw(sel, row, plabel, ...)
|
||||
* MenuItem_back::action(flabel, ...)
|
||||
* MenuItem_back::draw(sel, row, flabel, ...)
|
||||
*
|
||||
* ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause)
|
||||
* MenuItem_function::action(plabel, lcd_sdcard_pause)
|
||||
* MenuItem_function::draw(sel, row, plabel, lcd_sdcard_pause)
|
||||
* MenuItem_function::action(flabel, lcd_sdcard_pause)
|
||||
* MenuItem_function::draw(sel, row, flabel, lcd_sdcard_pause)
|
||||
*
|
||||
* EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::draw(sel, row, plabel, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::action(flabel, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::draw(sel, row, flabel, &feedrate_percentage, 10, 999)
|
||||
*/
|
||||
|
||||
#if ENABLED(ENCODER_RATE_MULTIPLIER)
|
||||
@@ -254,52 +270,73 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
#define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER)
|
||||
#endif
|
||||
|
||||
#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \
|
||||
PGM_P const plabel = PLABEL; \
|
||||
#define _MENU_INNER_F(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \
|
||||
FSTR_P const flabel = FLABEL; \
|
||||
if (encoderLine == _thisItemNr && ui.use_click()) { \
|
||||
_MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \
|
||||
MenuItem_##TYPE::action(plabel, ##V); \
|
||||
MenuItem_##TYPE::action(flabel, ##V); \
|
||||
if (ui.screen_changed) return; \
|
||||
} \
|
||||
if (ui.should_draw()) \
|
||||
MenuItem_##TYPE::draw \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, flabel, ##V); \
|
||||
}while(0)
|
||||
|
||||
#define _MENU_ITEM_P(TYPE, V...) do { \
|
||||
// Item with optional data
|
||||
#define _MENU_ITEM_F(TYPE, V...) do { \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
_MENU_INNER_P(TYPE, ##V); \
|
||||
_MENU_INNER_F(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Indexed items set a global index value and optional data
|
||||
#define _MENU_ITEM_N_S_P(TYPE, N, S, V...) do{ \
|
||||
// Item with index value, C-string, and optional data
|
||||
#define _MENU_ITEM_N_S_F(TYPE, N, S, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
MenuItemBase::init(N, S); \
|
||||
_MENU_INNER_P(TYPE, ##V); \
|
||||
_MENU_INNER_F(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Indexed items set a global index value
|
||||
#define _MENU_ITEM_N_P(TYPE, N, V...) do{ \
|
||||
// Item with index value and F-string
|
||||
#define _MENU_ITEM_N_f_F(TYPE, N, f, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
MenuItemBase::init(N, f); \
|
||||
_MENU_INNER_F(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Item with index value
|
||||
#define _MENU_ITEM_N_F(TYPE, N, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
MenuItemBase::itemIndex = N; \
|
||||
_MENU_INNER_P(TYPE, ##V); \
|
||||
MenuItemBase::init(N); \
|
||||
_MENU_INNER_F(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Items with a unique string
|
||||
#define _MENU_ITEM_S_P(TYPE, S, V...) do{ \
|
||||
#define _MENU_ITEM_S_F(TYPE, S, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
MenuItemBase::itemString = S; \
|
||||
_MENU_INNER_P(TYPE, ##V); \
|
||||
MenuItemBase::init(0, S); \
|
||||
_MENU_INNER_F(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Items with a unique F-string
|
||||
#define _MENU_ITEM_f_F(TYPE, f, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
MenuItemBase::init(0, f); \
|
||||
_MENU_INNER_F(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
@@ -307,25 +344,25 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
// STATIC_ITEM draws a styled string with no highlight.
|
||||
// Parameters: label [, style [, char *value] ]
|
||||
|
||||
#define STATIC_ITEM_INNER_P(PLABEL, V...) do{ \
|
||||
#define STATIC_ITEM_INNER_F(FLABEL, V...) do{ \
|
||||
if (_skipStatic && encoderLine <= _thisItemNr) { \
|
||||
ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
|
||||
++encoderLine; \
|
||||
} \
|
||||
if (ui.should_draw()) \
|
||||
MenuItem_static::draw(_lcdLineNr, PLABEL, ##V); \
|
||||
MenuItem_static::draw(_lcdLineNr, FLABEL, ##V); \
|
||||
} while(0)
|
||||
|
||||
#define STATIC_ITEM_P(PLABEL, V...) do{ \
|
||||
#define STATIC_ITEM_F(FLABEL, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) \
|
||||
STATIC_ITEM_INNER_P(PLABEL, ##V); \
|
||||
STATIC_ITEM_INNER_F(FLABEL, ##V); \
|
||||
NEXT_ITEM(); \
|
||||
} while(0)
|
||||
|
||||
#define STATIC_ITEM_N_P(PLABEL, N, V...) do{ \
|
||||
#define STATIC_ITEM_N_F(N, FLABEL, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
MenuItemBase::init(N); \
|
||||
STATIC_ITEM_INNER_P(PLABEL, ##V); \
|
||||
STATIC_ITEM_INNER_F(FLABEL, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
@@ -333,126 +370,167 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
// PSTRING_ITEM is like STATIC_ITEM but it takes
|
||||
// two PSTRs with the style as the last parameter.
|
||||
|
||||
#define PSTRING_ITEM_P(PLABEL, PVAL, STYL) do{ \
|
||||
#define PSTRING_ITEM_F(FLABEL, PVAL, STYL) do{ \
|
||||
constexpr int m = 20; \
|
||||
char msg[m+1]; \
|
||||
msg[0] = ':'; msg[1] = ' '; \
|
||||
strncpy_P(msg+2, PSTR(PVAL), m-2); \
|
||||
if (msg[m-1] & 0x80) msg[m-1] = '\0'; \
|
||||
STATIC_ITEM_P(PLABEL, STYL, msg); \
|
||||
STATIC_ITEM_F(FLABEL, STYL, msg); \
|
||||
}while(0)
|
||||
|
||||
#define PSTRING_ITEM(LABEL, V...) PSTRING_ITEM_P(GET_TEXT(LABEL), ##V)
|
||||
#define PSTRING_ITEM(LABEL, V...) PSTRING_ITEM_F(GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_P(GET_TEXT(LABEL), ##V)
|
||||
#define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_P(GET_TEXT(LABEL), N, ##V)
|
||||
#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_F(GET_TEXT_F(LABEL), ##V)
|
||||
#define STATIC_ITEM_N(N, LABEL, V...) STATIC_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define MENU_ITEM_N_S_P(TYPE, N, S, PLABEL, V...) _MENU_ITEM_N_S_P(TYPE, N, S, false, PLABEL, ##V)
|
||||
#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...) MENU_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V)
|
||||
#define MENU_ITEM_S_P(TYPE, S, PLABEL, V...) _MENU_ITEM_S_P(TYPE, S, false, PLABEL, ##V)
|
||||
#define MENU_ITEM_S(TYPE, S, LABEL, V...) MENU_ITEM_S_P(TYPE, S, GET_TEXT(LABEL), ##V)
|
||||
#define MENU_ITEM_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, false, PLABEL, ##V)
|
||||
#define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V)
|
||||
#define MENU_ITEM_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, false, PLABEL, ##V)
|
||||
#define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_P(TYPE, GET_TEXT(LABEL), ##V)
|
||||
// Menu item with index and composed C-string substitution
|
||||
#define MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, false, FLABEL, ##V)
|
||||
#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...) MENU_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define BACK_ITEM_P(PLABEL) MENU_ITEM_P(back, PLABEL)
|
||||
// Menu item with composed C-string substitution
|
||||
#define MENU_ITEM_S_F(TYPE, S, FLABEL, V...) _MENU_ITEM_S_F(TYPE, S, false, FLABEL, ##V)
|
||||
#define MENU_ITEM_S(TYPE, S, LABEL, V...) MENU_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
// Menu item substitution, indexed
|
||||
#define MENU_ITEM_N_F(TYPE, N, FLABEL, V...) _MENU_ITEM_N_F(TYPE, N, false, FLABEL, ##V)
|
||||
#define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
// Basic menu items, no substitution
|
||||
#define MENU_ITEM_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, false, FLABEL, ##V)
|
||||
#define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
// Predefined menu item types //
|
||||
|
||||
#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL)
|
||||
#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
|
||||
|
||||
#define ACTION_ITEM_N_S_P(N, S, PLABEL, ACTION) MENU_ITEM_N_S_P(function, N, S, PLABEL, ACTION)
|
||||
#define ACTION_ITEM_N_S(N, S, LABEL, ACTION) ACTION_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ACTION)
|
||||
#define ACTION_ITEM_S_P(S, PLABEL, ACTION) MENU_ITEM_S_P(function, S, PLABEL, ACTION)
|
||||
#define ACTION_ITEM_S(S, LABEL, ACTION) ACTION_ITEM_S_P(S, GET_TEXT(LABEL), ACTION)
|
||||
#define ACTION_ITEM_N_P(N, PLABEL, ACTION) MENU_ITEM_N_P(function, N, PLABEL, ACTION)
|
||||
#define ACTION_ITEM_N(N, LABEL, ACTION) ACTION_ITEM_N_P(N, GET_TEXT(LABEL), ACTION)
|
||||
#define ACTION_ITEM_P(PLABEL, ACTION) MENU_ITEM_P(function, PLABEL, ACTION)
|
||||
#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_P(GET_TEXT(LABEL), ACTION)
|
||||
#define ACTION_ITEM_N_S_F(N, S, FLABEL, ACTION) MENU_ITEM_N_S_F(function, N, S, FLABEL, ACTION)
|
||||
#define ACTION_ITEM_N_S(N, S, LABEL, ACTION) ACTION_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ACTION)
|
||||
#define ACTION_ITEM_S_F(S, FLABEL, ACTION) MENU_ITEM_S_F(function, S, FLABEL, ACTION)
|
||||
#define ACTION_ITEM_S(S, LABEL, ACTION) ACTION_ITEM_S_F(S, GET_TEXT_F(LABEL), ACTION)
|
||||
#define ACTION_ITEM_N_F(N, FLABEL, ACTION) MENU_ITEM_N_F(function, N, FLABEL, ACTION)
|
||||
#define ACTION_ITEM_N(N, LABEL, ACTION) ACTION_ITEM_N_F(N, GET_TEXT_F(LABEL), ACTION)
|
||||
#define ACTION_ITEM_F(FLABEL, ACTION) MENU_ITEM_F(function, FLABEL, ACTION)
|
||||
#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_F(GET_TEXT_F(LABEL), ACTION)
|
||||
|
||||
#define GCODES_ITEM_N_S_P(N, S, PLABEL, GCODES) MENU_ITEM_N_S_P(gcode, N, S, PLABEL, GCODES)
|
||||
#define GCODES_ITEM_N_S(N, S, LABEL, GCODES) GCODES_ITEM_N_S_P(N, S, GET_TEXT(LABEL), GCODES)
|
||||
#define GCODES_ITEM_S_P(S, PLABEL, GCODES) MENU_ITEM_S_P(gcode, S, PLABEL, GCODES)
|
||||
#define GCODES_ITEM_S(S, LABEL, GCODES) GCODES_ITEM_S_P(S, GET_TEXT(LABEL), GCODES)
|
||||
#define GCODES_ITEM_N_P(N, PLABEL, GCODES) MENU_ITEM_N_P(gcode, N, PLABEL, GCODES)
|
||||
#define GCODES_ITEM_N(N, LABEL, GCODES) GCODES_ITEM_N_P(N, GET_TEXT(LABEL), GCODES)
|
||||
#define GCODES_ITEM_P(PLABEL, GCODES) MENU_ITEM_P(gcode, PLABEL, GCODES)
|
||||
#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_P(GET_TEXT(LABEL), GCODES)
|
||||
#define GCODES_ITEM_N_S_F(N, S, FLABEL, GCODES) MENU_ITEM_N_S_F(gcode, N, S, FLABEL, GCODES)
|
||||
#define GCODES_ITEM_N_S(N, S, LABEL, GCODES) GCODES_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), GCODES)
|
||||
#define GCODES_ITEM_S_F(S, FLABEL, GCODES) MENU_ITEM_S_F(gcode, S, FLABEL, GCODES)
|
||||
#define GCODES_ITEM_S(S, LABEL, GCODES) GCODES_ITEM_S_F(S, GET_TEXT_F(LABEL), GCODES)
|
||||
#define GCODES_ITEM_N_F(N, FLABEL, GCODES) MENU_ITEM_N_F(gcode, N, FLABEL, GCODES)
|
||||
#define GCODES_ITEM_N(N, LABEL, GCODES) GCODES_ITEM_N_F(N, GET_TEXT_F(LABEL), GCODES)
|
||||
#define GCODES_ITEM_F(FLABEL, GCODES) MENU_ITEM_F(gcode, FLABEL, GCODES)
|
||||
#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_F(GET_TEXT_F(LABEL), GCODES)
|
||||
|
||||
#define SUBMENU_N_S_P(N, S, PLABEL, DEST) MENU_ITEM_N_S_P(submenu, N, S, PLABEL, DEST)
|
||||
#define SUBMENU_N_S(N, S, LABEL, DEST) SUBMENU_N_S_P(N, S, GET_TEXT(LABEL), DEST)
|
||||
#define SUBMENU_S_P(S, PLABEL, DEST) MENU_ITEM_S_P(submenu, S, PLABEL, DEST)
|
||||
#define SUBMENU_S(S, LABEL, DEST) SUBMENU_S_P(S, GET_TEXT(LABEL), DEST)
|
||||
#define SUBMENU_N_P(N, PLABEL, DEST) MENU_ITEM_N_P(submenu, N, PLABEL, DEST)
|
||||
#define SUBMENU_N(N, LABEL, DEST) SUBMENU_N_P(N, GET_TEXT(LABEL), DEST)
|
||||
#define SUBMENU_P(PLABEL, DEST) MENU_ITEM_P(submenu, PLABEL, DEST)
|
||||
#define SUBMENU(LABEL, DEST) SUBMENU_P(GET_TEXT(LABEL), DEST)
|
||||
#define SUBMENU_N_S_F(N, S, FLABEL, DEST) MENU_ITEM_N_S_F(submenu, N, S, FLABEL, DEST)
|
||||
#define SUBMENU_N_S(N, S, LABEL, DEST) SUBMENU_N_S_F(N, S, GET_TEXT_F(LABEL), DEST)
|
||||
#define SUBMENU_S_F(S, FLABEL, DEST) MENU_ITEM_S_F(submenu, S, FLABEL, DEST)
|
||||
#define SUBMENU_S(S, LABEL, DEST) SUBMENU_S_F(S, GET_TEXT_F(LABEL), DEST)
|
||||
#define SUBMENU_N_F(N, FLABEL, DEST) MENU_ITEM_N_F(submenu, N, FLABEL, DEST)
|
||||
#define SUBMENU_N(N, LABEL, DEST) SUBMENU_N_F(N, GET_TEXT_F(LABEL), DEST)
|
||||
#define SUBMENU_F(FLABEL, DEST) MENU_ITEM_F(submenu, FLABEL, DEST)
|
||||
#define SUBMENU(LABEL, DEST) SUBMENU_F(GET_TEXT_F(LABEL), DEST)
|
||||
|
||||
#define EDIT_ITEM_N_S_P(TYPE, N, S, PLABEL, V...) MENU_ITEM_N_S_P(TYPE, N, S, PLABEL, ##V)
|
||||
#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_S_P(TYPE, S, PLABEL, V...) MENU_ITEM_S_P(TYPE, S, PLABEL, ##V)
|
||||
#define EDIT_ITEM_S(TYPE, S, LABEL, V...) EDIT_ITEM_S_P(TYPE, S, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_N_P(TYPE, N, PLABEL, V...) MENU_ITEM_N_P(TYPE, N, PLABEL, ##V)
|
||||
#define EDIT_ITEM_N(TYPE, N, LABEL, V...) EDIT_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_P(TYPE, PLABEL, V...) MENU_ITEM_P(TYPE, PLABEL, ##V)
|
||||
#define EDIT_ITEM(TYPE, LABEL, V...) EDIT_ITEM_P(TYPE, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, ##V)
|
||||
#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_S_F(TYPE, S, FLABEL, V...) MENU_ITEM_S_F(TYPE, S, FLABEL, ##V)
|
||||
#define EDIT_ITEM_S(TYPE, S, LABEL, V...) EDIT_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_N_F(TYPE, N, FLABEL, V...) MENU_ITEM_N_F(TYPE, N, FLABEL, ##V)
|
||||
#define EDIT_ITEM_N(TYPE, N, LABEL, V...) EDIT_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_F(TYPE, FLABEL, V...) MENU_ITEM_F(TYPE, FLABEL, ##V)
|
||||
#define EDIT_ITEM(TYPE, LABEL, V...) EDIT_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define EDIT_ITEM_FAST_N_S_P(TYPE, N, S, PLABEL, V...) _MENU_ITEM_N_S_P(TYPE, N, S, true, PLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_P(TYPE, N, S, true, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_S_P(TYPE, S, PLABEL, V...) _MENU_ITEM_S_P(TYPE, S, true, PLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...) EDIT_ITEM_FAST_S_P(TYPE, S, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, true, PLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...) EDIT_ITEM_FAST_N_P(TYPE, N, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, true, PLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_P(TYPE, GET_TEXT(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, true, FLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_F(TYPE, N, S, true, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_S_F(TYPE, S, FLABEL, V...) _MENU_ITEM_S_F(TYPE, S, true, FLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...) EDIT_ITEM_FAST_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_N_F(TYPE, N, FLABEL, V...) _MENU_ITEM_N_F(TYPE, N, true, FLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...) EDIT_ITEM_FAST_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, true, FLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_F(TYPE, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \
|
||||
// F-string substitution instead of C-string //
|
||||
|
||||
#define MENU_ITEM_N_f_F(TYPE, N, f, FLABEL, V...) _MENU_ITEM_N_f_F(TYPE, N, f, false, FLABEL, ##V)
|
||||
#define MENU_ITEM_N_f(TYPE, N, f, LABEL, V...) MENU_ITEM_N_f_F(TYPE, N, f, GET_TEXT_F(LABEL), ##V)
|
||||
#define MENU_ITEM_f_F(TYPE, f, FLABEL, V...) _MENU_ITEM_f_F(TYPE, f, false, FLABEL, ##V)
|
||||
#define MENU_ITEM_f(TYPE, f, LABEL, V...) MENU_ITEM_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define ACTION_ITEM_N_f_F(N, f, FLABEL, ACTION) MENU_ITEM_N_f_F(function, N, f, FLABEL, ACTION)
|
||||
#define ACTION_ITEM_N_f(N, f, LABEL, ACTION) ACTION_ITEM_N_f_F(N, f, GET_TEXT_F(LABEL), ACTION)
|
||||
#define ACTION_ITEM_f_F(f, FLABEL, ACTION) MENU_ITEM_f_F(function, f, FLABEL, ACTION)
|
||||
#define ACTION_ITEM_f(f, LABEL, ACTION) ACTION_ITEM_f_F(f, GET_TEXT_F(LABEL), ACTION)
|
||||
|
||||
#define GCODES_ITEM_N_f_F(N, f, FLABEL, GCODES) MENU_ITEM_N_f_F(gcode, N, f, FLABEL, GCODES)
|
||||
#define GCODES_ITEM_N_f(N, f, LABEL, GCODES) GCODES_ITEM_N_f_F(N, f, GET_TEXT_F(LABEL), GCODES)
|
||||
#define GCODES_ITEM_f_F(f, FLABEL, GCODES) MENU_ITEM_f_F(gcode, f, FLABEL, GCODES)
|
||||
#define GCODES_ITEM_f(f, LABEL, GCODES) GCODES_ITEM_f_F(f, GET_TEXT_F(LABEL), GCODES)
|
||||
|
||||
#define SUBMENU_N_f_F(N, f, FLABEL, DEST) MENU_ITEM_N_f_F(submenu, N, f, FLABEL, DEST)
|
||||
#define SUBMENU_N_f(N, f, LABEL, DEST) SUBMENU_N_f_F(N, f, GET_TEXT_F(LABEL), DEST)
|
||||
#define SUBMENU_f_F(f, FLABEL, DEST) MENU_ITEM_f_F(submenu, f, FLABEL, DEST)
|
||||
#define SUBMENU_f(f, LABEL, DEST) SUBMENU_f_F(f, GET_TEXT_F(LABEL), DEST)
|
||||
|
||||
#define EDIT_ITEM_N_f_F(TYPE, N, f, FLABEL, V...) MENU_ITEM_N_f_F(TYPE, N, f, FLABEL, ##V)
|
||||
#define EDIT_ITEM_N_f(TYPE, N, f, LABEL, V...) EDIT_ITEM_N_f_F(TYPE, N, f, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_f_F(TYPE, f, FLABEL, V...) MENU_ITEM_f_F(TYPE, f, FLABEL, ##V)
|
||||
#define EDIT_ITEM_f(TYPE, f, LABEL, V...) EDIT_ITEM_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define EDIT_ITEM_FAST_N_f_F(TYPE, N, f, FLABEL, V...) _MENU_ITEM_N_f_F(TYPE, N, f, true, FLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_N_f(TYPE, N, f, LABEL, V...) EDIT_ITEM_FAST_N_f_F(TYPE, N, f, true, GET_TEXT_F(LABEL), ##V)
|
||||
#define EDIT_ITEM_FAST_f_F(TYPE, f, FLABEL, V...) _MENU_ITEM_f_F(TYPE, f, true, FLABEL, ##V)
|
||||
#define EDIT_ITEM_FAST_f(TYPE, f, LABEL, V...) EDIT_ITEM_FAST_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define _CONFIRM_ITEM_INNER_F(FLABEL, V...) do { \
|
||||
if (encoderLine == _thisItemNr && ui.use_click()) { \
|
||||
ui.push_current_screen(); \
|
||||
ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \
|
||||
return; \
|
||||
} \
|
||||
if (ui.should_draw()) MenuItem_confirm::draw \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, FLABEL, ##V); \
|
||||
}while(0)
|
||||
|
||||
// Indexed items set a global index value and optional data
|
||||
#define _CONFIRM_ITEM_P(PLABEL, V...) do { \
|
||||
#define _CONFIRM_ITEM_F(FLABEL, V...) do { \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
_CONFIRM_ITEM_INNER_P(PLABEL, ##V); \
|
||||
_CONFIRM_ITEM_INNER_F(FLABEL, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Indexed items set a global index value
|
||||
#define _CONFIRM_ITEM_N_S_P(N, S, V...) do{ \
|
||||
#define _CONFIRM_ITEM_N_S_F(N, S, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
_skipStatic = false; \
|
||||
MenuItemBase::init(N, S); \
|
||||
_CONFIRM_ITEM_INNER_P(TYPE, ##V); \
|
||||
_CONFIRM_ITEM_INNER_F(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Indexed items set a global index value
|
||||
#define _CONFIRM_ITEM_N_P(N, V...) _CONFIRM_ITEM_N_S_P(N, nullptr, V)
|
||||
#define _CONFIRM_ITEM_N_F(N, V...) _CONFIRM_ITEM_N_S_F(N, nullptr, V)
|
||||
|
||||
#define CONFIRM_ITEM_P(PLABEL,A,B,V...) _CONFIRM_ITEM_P(PLABEL, GET_TEXT(A), GET_TEXT(B), ##V)
|
||||
#define CONFIRM_ITEM(LABEL, V...) CONFIRM_ITEM_P(GET_TEXT(LABEL), ##V)
|
||||
#define CONFIRM_ITEM_F(FLABEL,A,B,V...) _CONFIRM_ITEM_F(FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V)
|
||||
#define CONFIRM_ITEM(LABEL, V...) CONFIRM_ITEM_F(GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define YESNO_ITEM_P(PLABEL, V...) CONFIRM_ITEM_P(PLABEL, MSG_YES, MSG_NO, ##V)
|
||||
#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_P(GET_TEXT(LABEL), ##V)
|
||||
#define YESNO_ITEM_F(FLABEL, V...) CONFIRM_ITEM_F(FLABEL, MSG_YES, MSG_NO, ##V)
|
||||
#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_F(GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define CONFIRM_ITEM_N_S_P(N,S,PLABEL,A,B,V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V)
|
||||
#define CONFIRM_ITEM_N_S(N,S,LABEL,V...) CONFIRM_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ##V)
|
||||
#define CONFIRM_ITEM_N_P(N,PLABEL,A,B,V...) _CONFIRM_ITEM_N_P(N, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V)
|
||||
#define CONFIRM_ITEM_N(N,LABEL, V...) CONFIRM_ITEM_N_P(N, GET_TEXT(LABEL), ##V)
|
||||
#define CONFIRM_ITEM_N_S_F(N,S,FLABEL,A,B,V...) _CONFIRM_ITEM_N_S_F(N, S, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V)
|
||||
#define CONFIRM_ITEM_N_S(N,S,LABEL,V...) CONFIRM_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V)
|
||||
#define CONFIRM_ITEM_N_F(N,FLABEL,A,B,V...) _CONFIRM_ITEM_N_F(N, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V)
|
||||
#define CONFIRM_ITEM_N(N,LABEL, V...) CONFIRM_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#define YESNO_ITEM_N_S_P(N,S,PLABEL, V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, MSG_YES, MSG_NO, ##V)
|
||||
#define YESNO_ITEM_N_S(N,S,LABEL, V...) YESNO_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ##V)
|
||||
#define YESNO_ITEM_N_P(N,PLABEL, V...) CONFIRM_ITEM_N_P(N, PLABEL, MSG_YES, MSG_NO, ##V)
|
||||
#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_P(N, GET_TEXT(LABEL), ##V)
|
||||
#define YESNO_ITEM_N_S_F(N,S,FLABEL, V...) _CONFIRM_ITEM_N_S_F(N, S, FLABEL, MSG_YES, MSG_NO, ##V)
|
||||
#define YESNO_ITEM_N_S(N,S,LABEL, V...) YESNO_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V)
|
||||
#define YESNO_ITEM_N_F(N,FLABEL, V...) CONFIRM_ITEM_N_F(N, FLABEL, MSG_YES, MSG_NO, ##V)
|
||||
#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V)
|
||||
|
||||
#if ENABLED(LEVEL_BED_CORNERS)
|
||||
#if ENABLED(LCD_BED_TRAMMING)
|
||||
void _lcd_level_bed_corners();
|
||||
#endif
|
||||
|
||||
@@ -462,6 +540,7 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
|
||||
inline void on_fan_update() {
|
||||
thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
|
||||
TERN_(LASER_SYNCHRONOUS_M106_M107, planner.buffer_sync_block(BLOCK_BIT_SYNC_FANS));
|
||||
}
|
||||
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, POWER_LOSS_RECOVERY)
|
||||
#if BOTH(HAS_MARLINUI_MENU, POWER_LOSS_RECOVERY)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../gcode/queue.h"
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
static void lcd_power_loss_recovery_resume() {
|
||||
ui.return_to_status();
|
||||
queue.inject_P(PSTR("M1000"));
|
||||
queue.inject(F("M1000"));
|
||||
}
|
||||
|
||||
void lcd_power_loss_recovery_cancel() {
|
||||
@@ -54,4 +54,4 @@ void menu_job_recovery() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && POWER_LOSS_RECOVERY
|
||||
#endif // HAS_MARLINUI_MENU && POWER_LOSS_RECOVERY
|
||||
|
@@ -41,14 +41,14 @@ void menu_language() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MAIN);
|
||||
|
||||
MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE )::LANGUAGE, []{ set_lcd_language(0); });
|
||||
MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_2)::LANGUAGE, []{ set_lcd_language(1); });
|
||||
MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(1)), []{ set_lcd_language(0); });
|
||||
MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(2)), []{ set_lcd_language(1); });
|
||||
#if NUM_LANGUAGES > 2
|
||||
MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_3)::LANGUAGE, []{ set_lcd_language(2); });
|
||||
MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(3)), []{ set_lcd_language(2); });
|
||||
#if NUM_LANGUAGES > 3
|
||||
MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_4)::LANGUAGE, []{ set_lcd_language(3); });
|
||||
MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(4)), []{ set_lcd_language(3); });
|
||||
#if NUM_LANGUAGES > 4
|
||||
MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_5)::LANGUAGE, []{ set_lcd_language(4); });
|
||||
MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(5)), []{ set_lcd_language(4); });
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU && EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU)
|
||||
#if HAS_MARLINUI_MENU && EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU)
|
||||
|
||||
#include "menu_item.h"
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_LED_CONTROL);
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
STATIC_ITEM_N(MSG_LED_CHANNEL_N, 1, SS_DEFAULT|SS_INVERT);
|
||||
STATIC_ITEM_N(1, MSG_LED_CHANNEL_N, SS_DEFAULT|SS_INVERT);
|
||||
#endif
|
||||
EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
|
||||
EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
|
||||
@@ -95,7 +95,7 @@
|
||||
EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
|
||||
#endif
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
STATIC_ITEM_N(MSG_LED_CHANNEL_N, 2, SS_DEFAULT|SS_INVERT);
|
||||
STATIC_ITEM_N(2, MSG_LED_CHANNEL_N, SS_DEFAULT|SS_INVERT);
|
||||
EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds2.color.r, 0, 255, leds2.update, true);
|
||||
EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds2.color.g, 0, 255, leds2.update, true);
|
||||
EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds2.color.b, 0, 255, leds2.update, true);
|
||||
@@ -169,4 +169,4 @@ void menu_led() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && LED_CONTROL_MENU
|
||||
#endif // HAS_MARLINUI_MENU && LED_CONTROL_MENU
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/temperature.h"
|
||||
@@ -58,7 +58,7 @@
|
||||
#include "../../feature/password/password.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)
|
||||
#if (ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)) || (ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION))
|
||||
#include "../../feature/host_actions.h"
|
||||
#endif
|
||||
|
||||
@@ -106,8 +106,8 @@ void menu_configuration();
|
||||
|
||||
#if ENABLED(CUSTOM_MENU_MAIN)
|
||||
|
||||
void _lcd_custom_menu_main_gcode(PGM_P const cmd) {
|
||||
queue.inject_P(cmd);
|
||||
void _lcd_custom_menu_main_gcode(FSTR_P const fstr) {
|
||||
queue.inject(fstr);
|
||||
TERN_(CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK, ui.completion_feedback());
|
||||
TERN_(CUSTOM_MENU_MAIN_SCRIPT_RETURN, ui.return_to_status());
|
||||
}
|
||||
@@ -123,15 +123,14 @@ void menu_configuration();
|
||||
#else
|
||||
#define _DONE_SCRIPT ""
|
||||
#endif
|
||||
#define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(PSTR(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N));
|
||||
#define _CUSTOM_ITEM_MAIN_CONFIRM(N) \
|
||||
SUBMENU_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), []{ \
|
||||
MenuItem_confirm::confirm_screen( \
|
||||
GCODE_LAMBDA_MAIN(N), \
|
||||
ui.goto_previous_screen, \
|
||||
PSTR(MAIN_MENU_ITEM_##N##_DESC "?") \
|
||||
); \
|
||||
#define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(F(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_F(F(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N));
|
||||
#define _CUSTOM_ITEM_MAIN_CONFIRM(N) \
|
||||
SUBMENU_F(F(MAIN_MENU_ITEM_##N##_DESC), []{ \
|
||||
MenuItem_confirm::confirm_screen( \
|
||||
GCODE_LAMBDA_MAIN(N), nullptr, \
|
||||
F(MAIN_MENU_ITEM_##N##_DESC "?") \
|
||||
); \
|
||||
})
|
||||
|
||||
#define CUSTOM_ITEM_MAIN(N) do{ \
|
||||
@@ -247,19 +246,26 @@ void menu_main() {
|
||||
|
||||
if (card_detected) {
|
||||
if (!card_open) {
|
||||
#if PIN_EXISTS(SD_DETECT)
|
||||
GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21")); // M21 Change Media
|
||||
#else // - or -
|
||||
GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22")); // M22 Release Media
|
||||
#if HAS_SD_DETECT
|
||||
GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media
|
||||
#else // - or -
|
||||
ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media
|
||||
queue.inject(F("M22"));
|
||||
#if ENABLED(TFT_COLOR_UI)
|
||||
// Menu display issue on item removal with multi language selection menu
|
||||
if (encoderTopLine > 0) encoderTopLine--;
|
||||
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
#endif
|
||||
});
|
||||
#endif
|
||||
SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First)
|
||||
SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First)
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if PIN_EXISTS(SD_DETECT)
|
||||
ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media"
|
||||
#if HAS_SD_DETECT
|
||||
ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media"
|
||||
#else
|
||||
GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21")); // M21 Attach Media
|
||||
GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media
|
||||
#endif
|
||||
}
|
||||
};
|
||||
@@ -273,9 +279,9 @@ void menu_main() {
|
||||
#if MACHINE_CAN_STOP
|
||||
SUBMENU(MSG_STOP_PRINT, []{
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK),
|
||||
ui.abort_print, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_STOP_PRINT), (const char *)nullptr, PSTR("?")
|
||||
GET_TEXT_F(MSG_BUTTON_STOP), GET_TEXT_F(MSG_BACK),
|
||||
ui.abort_print, nullptr,
|
||||
GET_TEXT_F(MSG_STOP_PRINT), (const char *)nullptr, F("?")
|
||||
);
|
||||
});
|
||||
#endif
|
||||
@@ -301,7 +307,7 @@ void menu_main() {
|
||||
ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
|
||||
|
||||
#if ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)
|
||||
ACTION_ITEM(MSG_HOST_START_PRINT, host_action_start);
|
||||
ACTION_ITEM(MSG_HOST_START_PRINT, hostui.start);
|
||||
#endif
|
||||
|
||||
#if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM)
|
||||
@@ -336,7 +342,7 @@ void menu_main() {
|
||||
#if ENABLED(CUSTOM_MENU_MAIN)
|
||||
if (TERN1(CUSTOM_MENU_MAIN_ONLY_IDLE, !busy)) {
|
||||
#ifdef CUSTOM_MENU_MAIN_TITLE
|
||||
SUBMENU_P(PSTR(CUSTOM_MENU_MAIN_TITLE), custom_menus_main);
|
||||
SUBMENU_F(F(CUSTOM_MENU_MAIN_TITLE), custom_menus_main);
|
||||
#else
|
||||
SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_main);
|
||||
#endif
|
||||
@@ -346,8 +352,8 @@ void menu_main() {
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
#if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
YESNO_ITEM(MSG_FILAMENTCHANGE,
|
||||
menu_change_filament, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_FILAMENTCHANGE), (const char *)nullptr, PSTR("?")
|
||||
menu_change_filament, nullptr,
|
||||
GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")
|
||||
);
|
||||
#else
|
||||
SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
|
||||
@@ -370,14 +376,14 @@ void menu_main() {
|
||||
#if ENABLED(PS_OFF_CONFIRM)
|
||||
CONFIRM_ITEM(MSG_SWITCH_PS_OFF,
|
||||
MSG_YES, MSG_NO,
|
||||
ui.poweroff, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?")
|
||||
ui.poweroff, nullptr,
|
||||
GET_TEXT_F(MSG_SWITCH_PS_OFF), (const char *)nullptr, F("?")
|
||||
);
|
||||
#else
|
||||
GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81"));
|
||||
ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff);
|
||||
#endif
|
||||
else
|
||||
GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80"));
|
||||
GCODES_ITEM(MSG_SWITCH_PS_ON, F("M80"));
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP)
|
||||
@@ -392,24 +398,24 @@ void menu_main() {
|
||||
ui.return_to_status();
|
||||
};
|
||||
#if SERVICE_INTERVAL_1 > 0
|
||||
CONFIRM_ITEM_P(PSTR(SERVICE_NAME_1),
|
||||
CONFIRM_ITEM_F(F(SERVICE_NAME_1),
|
||||
MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
|
||||
[]{ _service_reset(1); }, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_1), PSTR("?")
|
||||
[]{ _service_reset(1); }, nullptr,
|
||||
GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_1), F("?")
|
||||
);
|
||||
#endif
|
||||
#if SERVICE_INTERVAL_2 > 0
|
||||
CONFIRM_ITEM_P(PSTR(SERVICE_NAME_2),
|
||||
CONFIRM_ITEM_F(F(SERVICE_NAME_2),
|
||||
MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
|
||||
[]{ _service_reset(2); }, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_2), PSTR("?")
|
||||
[]{ _service_reset(2); }, nullptr,
|
||||
GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_2), F("?")
|
||||
);
|
||||
#endif
|
||||
#if SERVICE_INTERVAL_3 > 0
|
||||
CONFIRM_ITEM_P(PSTR(SERVICE_NAME_3),
|
||||
CONFIRM_ITEM_F(F(SERVICE_NAME_3),
|
||||
MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
|
||||
[]{ _service_reset(3); }, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_3), PSTR("?")
|
||||
[]{ _service_reset(3); }, nullptr,
|
||||
GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_3), F("?")
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
@@ -442,7 +448,17 @@ void menu_main() {
|
||||
SUBMENU(LANGUAGE, menu_language);
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION)
|
||||
SUBMENU(MSG_HOST_SHUTDOWN, []{
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BUTTON_CANCEL),
|
||||
[]{ ui.return_to_status(); hostui.shutdown(); }, nullptr,
|
||||
GET_TEXT_F(MSG_HOST_SHUTDOWN), (const char *)nullptr, F("?")
|
||||
);
|
||||
});
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, SDSUPPORT)
|
||||
#if BOTH(HAS_MARLINUI_MENU, SDSUPPORT)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
@@ -61,10 +61,10 @@ inline void sdcard_start_selected_file() {
|
||||
|
||||
class MenuItem_sdfile : public MenuItem_sdbase {
|
||||
public:
|
||||
static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) {
|
||||
MenuItem_sdbase::draw(sel, row, pstr, theCard, false);
|
||||
static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) {
|
||||
MenuItem_sdbase::draw(sel, row, fstr, theCard, false);
|
||||
}
|
||||
static void action(PGM_P const pstr, CardReader &) {
|
||||
static void action(FSTR_P const fstr, CardReader &) {
|
||||
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
||||
// Save menu state for the selected file
|
||||
sd_encoder_position = ui.encoderPosition;
|
||||
@@ -72,30 +72,30 @@ class MenuItem_sdfile : public MenuItem_sdbase {
|
||||
sd_items = screen_items;
|
||||
#endif
|
||||
#if ENABLED(SD_MENU_CONFIRM_START)
|
||||
MenuItem_submenu::action(pstr, []{
|
||||
MenuItem_submenu::action(fstr, []{
|
||||
char * const longest = card.longest_filename();
|
||||
char buffer[strlen(longest) + 2];
|
||||
buffer[0] = ' ';
|
||||
strcpy(buffer + 1, longest);
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL),
|
||||
sdcard_start_selected_file, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_START_PRINT), buffer, PSTR("?")
|
||||
GET_TEXT_F(MSG_BUTTON_PRINT), GET_TEXT_F(MSG_BUTTON_CANCEL),
|
||||
sdcard_start_selected_file, nullptr,
|
||||
GET_TEXT_F(MSG_START_PRINT), buffer, F("?")
|
||||
);
|
||||
});
|
||||
#else
|
||||
sdcard_start_selected_file();
|
||||
UNUSED(pstr);
|
||||
UNUSED(fstr);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
class MenuItem_sdfolder : public MenuItem_sdbase {
|
||||
public:
|
||||
static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) {
|
||||
MenuItem_sdbase::draw(sel, row, pstr, theCard, true);
|
||||
static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) {
|
||||
MenuItem_sdbase::draw(sel, row, fstr, theCard, true);
|
||||
}
|
||||
static void action(PGM_P const, CardReader &theCard) {
|
||||
static void action(FSTR_P const, CardReader &theCard) {
|
||||
card.cd(theCard.filename);
|
||||
encoderTopLine = 0;
|
||||
ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM);
|
||||
@@ -119,15 +119,15 @@ void menu_media_filelist() {
|
||||
#if ENABLED(MULTI_VOLUME)
|
||||
ACTION_ITEM(MSG_BACK, []{ ui.goto_screen(menu_media); });
|
||||
#else
|
||||
BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK));
|
||||
BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK));
|
||||
#endif
|
||||
if (card.flag.workDirIsRoot) {
|
||||
#if !PIN_EXISTS(SD_DETECT)
|
||||
#if !HAS_SD_DETECT
|
||||
ACTION_ITEM(MSG_REFRESH, []{ encoderTopLine = 0; card.mount(); });
|
||||
#endif
|
||||
}
|
||||
else if (card.isMounted())
|
||||
ACTION_ITEM_P(PSTR(LCD_STR_FOLDER " .."), lcd_sd_updir);
|
||||
ACTION_ITEM_F(F(LCD_STR_FOLDER " .."), lcd_sd_updir);
|
||||
|
||||
if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) {
|
||||
if (_menuLineNr == _thisItemNr) {
|
||||
@@ -146,7 +146,7 @@ void menu_media_filelist() {
|
||||
#if ENABLED(MULTI_VOLUME)
|
||||
void menu_media_select() {
|
||||
START_MENU();
|
||||
BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK));
|
||||
BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK));
|
||||
#if ENABLED(VOLUME_SD_ONBOARD)
|
||||
ACTION_ITEM(MSG_SD_CARD, []{ card.changeMedia(&card.media_driver_sdcard); card.mount(); ui.goto_screen(menu_media_filelist); });
|
||||
#endif
|
||||
@@ -161,4 +161,4 @@ void menu_media() {
|
||||
TERN(MULTI_VOLUME, menu_media_select, menu_media_filelist)();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && SDSUPPORT
|
||||
#endif // HAS_MARLINUI_MENU && SDSUPPORT
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, MIXING_EXTRUDER)
|
||||
#if BOTH(HAS_MARLINUI_MENU, MIXING_EXTRUDER)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "menu_addon.h"
|
||||
@@ -57,7 +57,7 @@
|
||||
if (ui.should_draw()) {
|
||||
char tmp[16];
|
||||
SETCURSOR(1, (LCD_HEIGHT - 1) / 2);
|
||||
lcd_put_u8str_P(isend ? GET_TEXT(MSG_END_Z) : GET_TEXT(MSG_START_Z));
|
||||
lcd_put_u8str(isend ? GET_TEXT_F(MSG_END_Z) : GET_TEXT_F(MSG_START_Z));
|
||||
sprintf_P(tmp, PSTR("%4d.%d mm"), int(zvar), int(zvar * 10) % 10);
|
||||
SETCURSOR_RJ(9, (LCD_HEIGHT - 1) / 2);
|
||||
lcd_put_u8str(tmp);
|
||||
@@ -89,15 +89,15 @@
|
||||
|
||||
char tmp[18];
|
||||
|
||||
PGM_P const slabel = GET_TEXT(MSG_START_Z);
|
||||
SUBMENU_P(slabel, []{ _lcd_mixer_gradient_z_edit(false); });
|
||||
FSTR_P const slabel = GET_TEXT_F(MSG_START_Z);
|
||||
SUBMENU_F(slabel, []{ _lcd_mixer_gradient_z_edit(false); });
|
||||
MENU_ITEM_ADDON_START_RJ(11);
|
||||
sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10);
|
||||
lcd_put_u8str(tmp);
|
||||
MENU_ITEM_ADDON_END();
|
||||
|
||||
PGM_P const elabel = GET_TEXT(MSG_END_Z);
|
||||
SUBMENU_P(elabel, []{ _lcd_mixer_gradient_z_edit(true); });
|
||||
FSTR_P const elabel = GET_TEXT_F(MSG_END_Z);
|
||||
SUBMENU_F(elabel, []{ _lcd_mixer_gradient_z_edit(true); });
|
||||
MENU_ITEM_ADDON_START_RJ(11);
|
||||
sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10);
|
||||
lcd_put_u8str(tmp);
|
||||
@@ -114,7 +114,7 @@ static uint8_t v_index;
|
||||
void _lcd_draw_mix(const uint8_t y) {
|
||||
char tmp[20]; // "100%_100%"
|
||||
sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1]));
|
||||
SETCURSOR(2, y); lcd_put_u8str_P(GET_TEXT(MSG_MIX));
|
||||
SETCURSOR(2, y); lcd_put_u8str(GET_TEXT_F(MSG_MIX));
|
||||
SETCURSOR_RJ(10, y); lcd_put_u8str(tmp);
|
||||
}
|
||||
#endif
|
||||
@@ -253,11 +253,11 @@ void menu_mixer() {
|
||||
MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
|
||||
[]{
|
||||
mixer.reset_vtools();
|
||||
LCD_MESSAGEPGM(MSG_VTOOLS_RESET);
|
||||
LCD_MESSAGE(MSG_VTOOLS_RESET);
|
||||
ui.return_to_status();
|
||||
},
|
||||
nullptr,
|
||||
GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?")
|
||||
GET_TEXT_F(MSG_RESET_VTOOLS), (const char *)nullptr, F("?")
|
||||
);
|
||||
|
||||
#if ENABLED(GRADIENT_MIX)
|
||||
@@ -275,4 +275,4 @@ void menu_mixer() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && MIXING_EXTRUDER
|
||||
#endif // HAS_MARLINUI_MENU && MIXING_EXTRUDER
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, MMU2_MENUS)
|
||||
#if BOTH(HAS_MARLINUI_MENU, MMU2_MENUS)
|
||||
|
||||
#include "../../MarlinCore.h"
|
||||
#include "../../feature/mmu/mmu2.h"
|
||||
@@ -36,19 +36,19 @@
|
||||
inline void action_mmu2_load_filament_to_nozzle(const uint8_t tool) {
|
||||
ui.reset_status();
|
||||
ui.return_to_status();
|
||||
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(tool + 1));
|
||||
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(tool + 1));
|
||||
if (mmu2.load_filament_to_nozzle(tool)) ui.reset_status();
|
||||
ui.return_to_status();
|
||||
}
|
||||
|
||||
void _mmu2_load_filament(uint8_t index) {
|
||||
ui.return_to_status();
|
||||
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
|
||||
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
|
||||
mmu2.load_filament(index);
|
||||
ui.reset_status();
|
||||
}
|
||||
void action_mmu2_load_all() {
|
||||
LOOP_L_N(i, EXTRUDERS) _mmu2_load_filament(i);
|
||||
EXTRUDER_LOOP() _mmu2_load_filament(e);
|
||||
ui.return_to_status();
|
||||
}
|
||||
|
||||
@@ -56,14 +56,14 @@ void menu_mmu2_load_filament() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MMU2_MENU);
|
||||
ACTION_ITEM(MSG_MMU2_ALL, action_mmu2_load_all);
|
||||
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); });
|
||||
EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); });
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
void menu_mmu2_load_to_nozzle() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MMU2_MENU);
|
||||
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); });
|
||||
EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); });
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -74,14 +74,14 @@ void menu_mmu2_load_to_nozzle() {
|
||||
void _mmu2_eject_filament(uint8_t index) {
|
||||
ui.reset_status();
|
||||
ui.return_to_status();
|
||||
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_EJECTING_FILAMENT), int(index + 1));
|
||||
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_EJECTING_FILAMENT), int(index + 1));
|
||||
if (mmu2.eject_filament(index, true)) ui.reset_status();
|
||||
}
|
||||
|
||||
void action_mmu2_unload_filament() {
|
||||
ui.reset_status();
|
||||
ui.return_to_status();
|
||||
LCD_MESSAGEPGM(MSG_MMU2_UNLOADING_FILAMENT);
|
||||
LCD_MESSAGE(MSG_MMU2_UNLOADING_FILAMENT);
|
||||
idle();
|
||||
if (mmu2.unload()) ui.reset_status();
|
||||
}
|
||||
@@ -89,7 +89,7 @@ void action_mmu2_unload_filament() {
|
||||
void menu_mmu2_eject_filament() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MMU2_MENU);
|
||||
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); });
|
||||
EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); });
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void menu_mmu2_choose_filament() {
|
||||
#if LCD_HEIGHT > 2
|
||||
STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT);
|
||||
#endif
|
||||
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); });
|
||||
EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); });
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -167,4 +167,4 @@ uint8_t mmu2_choose_filament() {
|
||||
return feeder_index;
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && MMU2_MENUS
|
||||
#endif // HAS_MARLINUI_MENU && MMU2_MENUS
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#define LARGE_AREA_TEST ((X_BED_SIZE) >= 1000 || (Y_BED_SIZE) >= 1000 || (Z_MAX_POS) >= 1000)
|
||||
|
||||
@@ -35,29 +35,22 @@
|
||||
|
||||
#include "../../module/motion.h"
|
||||
#include "../../gcode/parser.h" // for inch support
|
||||
#include "../../module/temperature.h"
|
||||
|
||||
#if ENABLED(DELTA)
|
||||
#include "../../module/delta.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||
#include "../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
#if HAS_LEVELING
|
||||
#include "../../module/planner.h"
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(MANUAL_E_MOVES_RELATIVE)
|
||||
float manual_move_e_origin = 0;
|
||||
#endif
|
||||
|
||||
//
|
||||
// "Motion" > "Move Axis" submenu
|
||||
//
|
||||
|
||||
static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) {
|
||||
void lcd_move_axis(const AxisEnum axis) {
|
||||
if (ui.use_click()) return ui.goto_previous_screen_no_defer();
|
||||
if (ui.encoderPosition && !ui.manual_move.processing) {
|
||||
// Get motion limit from software endstops, if any
|
||||
@@ -81,31 +74,16 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) {
|
||||
}
|
||||
ui.encoderPosition = 0;
|
||||
if (ui.should_draw()) {
|
||||
MenuEditItemBase::itemIndex = axis;
|
||||
const float pos = ui.manual_move.axis_value(axis);
|
||||
if (parser.using_inch_units()) {
|
||||
const float imp_pos = LINEAR_UNIT(pos);
|
||||
MenuEditItemBase::draw_edit_screen(name, ftostr63(imp_pos));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ftostr63(imp_pos));
|
||||
}
|
||||
else
|
||||
MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
|
||||
}
|
||||
}
|
||||
void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
|
||||
#if HAS_Y_AXIS
|
||||
void lcd_move_y() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Y), Y_AXIS); }
|
||||
#endif
|
||||
#if HAS_Z_AXIS
|
||||
void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
void lcd_move_i() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_I), I_AXIS); }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
void lcd_move_j() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_J), J_AXIS); }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
void lcd_move_k() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_K), K_AXIS); }
|
||||
#endif
|
||||
|
||||
#if E_MANUAL
|
||||
|
||||
@@ -123,10 +101,10 @@ void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
|
||||
if (ui.should_draw()) {
|
||||
TERN_(MULTI_E_MANUAL, MenuItemBase::init(eindex));
|
||||
MenuEditItemBase::draw_edit_screen(
|
||||
GET_TEXT(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
|
||||
GET_TEXT_F(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
|
||||
ftostr41sign(current_position.e
|
||||
PLUS_TERN0(IS_KINEMATIC, ui.manual_move.offset)
|
||||
MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin)
|
||||
MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, ui.manual_move.e_origin)
|
||||
)
|
||||
);
|
||||
} // should_draw
|
||||
@@ -134,6 +112,15 @@ void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
|
||||
|
||||
#endif // E_MANUAL
|
||||
|
||||
#if EITHER(PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION)
|
||||
|
||||
void _goto_manual_move_z(const_float_t scale) {
|
||||
ui.manual_move.menu_scale = scale;
|
||||
ui.goto_screen([]{ lcd_move_axis(Z_AXIS); });
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// "Motion" > "Move Xmm" > "Move XYZ" submenu
|
||||
//
|
||||
@@ -142,26 +129,22 @@ void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
|
||||
#define FINE_MANUAL_MOVE 0.025
|
||||
#endif
|
||||
|
||||
screenFunc_t _manual_move_func_ptr;
|
||||
|
||||
void _goto_manual_move(const_float_t scale) {
|
||||
ui.defer_status_screen();
|
||||
ui.manual_move.menu_scale = scale;
|
||||
ui.goto_screen(_manual_move_func_ptr);
|
||||
ui.goto_screen(ui.manual_move.screen_ptr);
|
||||
thermalManager.set_menu_cold_override(true);
|
||||
}
|
||||
|
||||
void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=active_extruder) {
|
||||
_manual_move_func_ptr = func;
|
||||
ui.manual_move.screen_ptr = func;
|
||||
START_MENU();
|
||||
if (LCD_HEIGHT >= 4) {
|
||||
switch (axis) {
|
||||
case X_AXIS: STATIC_ITEM(MSG_MOVE_X, SS_DEFAULT|SS_INVERT); break;
|
||||
case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, SS_DEFAULT|SS_INVERT); break;
|
||||
case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, SS_DEFAULT|SS_INVERT); break;
|
||||
default:
|
||||
TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e);
|
||||
STATIC_ITEM(MSG_MOVE_E, SS_DEFAULT|SS_INVERT);
|
||||
break;
|
||||
if (axis < NUM_AXES)
|
||||
STATIC_ITEM_N(axis, MSG_MOVE_N, SS_DEFAULT|SS_INVERT);
|
||||
else {
|
||||
TERN_(MANUAL_E_MOVES_RELATIVE, ui.manual_move.e_origin = current_position.e);
|
||||
STATIC_ITEM_N(eindex, MSG_MOVE_EN, SS_DEFAULT|SS_INVERT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,22 +160,8 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
|
||||
SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); });
|
||||
SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); });
|
||||
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); });
|
||||
if (axis == Z_AXIS && (FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) {
|
||||
// Determine digits needed right of decimal
|
||||
constexpr uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 :
|
||||
!UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2;
|
||||
PGM_P const label = GET_TEXT(MSG_MOVE_N_MM);
|
||||
char tmp[strlen_P(label) + 10 + 1], numstr[10];
|
||||
sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
|
||||
#if DISABLED(HAS_GRAPHICAL_TFT)
|
||||
SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
|
||||
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
|
||||
lcd_put_u8str(tmp);
|
||||
MENU_ITEM_ADDON_END();
|
||||
#else
|
||||
SUBMENU_P(tmp, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
|
||||
#endif
|
||||
}
|
||||
if (axis == Z_AXIS && (FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f)
|
||||
SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
|
||||
}
|
||||
END_MENU();
|
||||
}
|
||||
@@ -204,23 +173,20 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
|
||||
}
|
||||
|
||||
inline void _menu_move_distance_e_maybe() {
|
||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||
const bool too_cold = thermalManager.tooColdToExtrude(active_extruder);
|
||||
if (too_cold) {
|
||||
ui.goto_screen([]{
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK),
|
||||
_goto_menu_move_distance_e, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!")
|
||||
);
|
||||
});
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
_goto_menu_move_distance_e();
|
||||
if (thermalManager.tooColdToExtrude(active_extruder)) {
|
||||
ui.goto_screen([]{
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BACK),
|
||||
_goto_menu_move_distance_e, nullptr,
|
||||
GET_TEXT_F(MSG_HOTEND_TOO_COLD), (const char *)nullptr, F("!")
|
||||
);
|
||||
});
|
||||
}
|
||||
else
|
||||
_goto_menu_move_distance_e();
|
||||
}
|
||||
|
||||
#endif // E_MANUAL
|
||||
#endif
|
||||
|
||||
void menu_move() {
|
||||
START_MENU();
|
||||
@@ -230,76 +196,69 @@ void menu_move() {
|
||||
EDIT_ITEM(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstop._enabled);
|
||||
#endif
|
||||
|
||||
// Move submenu for each axis
|
||||
if (NONE(IS_KINEMATIC, NO_MOTION_BEFORE_HOMING) || all_axes_homed()) {
|
||||
if (TERN1(DELTA, current_position.z <= delta_clip_start_height)) {
|
||||
SUBMENU(MSG_MOVE_X, []{ _menu_move_distance(X_AXIS, lcd_move_x); });
|
||||
SUBMENU_N(X_AXIS, MSG_MOVE_N, []{ _menu_move_distance(X_AXIS, []{ lcd_move_axis(X_AXIS); }); });
|
||||
#if HAS_Y_AXIS
|
||||
SUBMENU(MSG_MOVE_Y, []{ _menu_move_distance(Y_AXIS, lcd_move_y); });
|
||||
SUBMENU_N(Y_AXIS, MSG_MOVE_N, []{ _menu_move_distance(Y_AXIS, []{ lcd_move_axis(Y_AXIS); }); });
|
||||
#endif
|
||||
}
|
||||
#if ENABLED(DELTA)
|
||||
else
|
||||
else {
|
||||
#if ENABLED(DELTA)
|
||||
ACTION_ITEM(MSG_FREE_XY, []{ line_to_z(delta_clip_start_height); ui.synchronize(); });
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
#if HAS_Z_AXIS
|
||||
SUBMENU(MSG_MOVE_Z, []{ _menu_move_distance(Z_AXIS, lcd_move_z); });
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
SUBMENU(MSG_MOVE_I, []{ _menu_move_distance(I_AXIS, lcd_move_i); });
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
SUBMENU(MSG_MOVE_J, []{ _menu_move_distance(J_AXIS, lcd_move_j); });
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
SUBMENU(MSG_MOVE_K, []{ _menu_move_distance(K_AXIS, lcd_move_k); });
|
||||
#define _AXIS_MOVE(N) SUBMENU_N(N, MSG_MOVE_N, []{ _menu_move_distance(AxisEnum(N), []{ lcd_move_axis(AxisEnum(N)); }); });
|
||||
REPEAT_S(2, NUM_AXES, _AXIS_MOVE);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
|
||||
GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
|
||||
|
||||
#if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, MAGNETIC_SWITCHING_TOOLHEAD)
|
||||
|
||||
#if EXTRUDERS >= 4
|
||||
switch (active_extruder) {
|
||||
case 0: GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); break;
|
||||
case 1: GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); break;
|
||||
case 2: GCODES_ITEM_N(3, MSG_SELECT_E, PSTR("T3")); break;
|
||||
case 3: GCODES_ITEM_N(2, MSG_SELECT_E, PSTR("T2")); break;
|
||||
case 0: GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); break;
|
||||
case 1: GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); break;
|
||||
case 2: GCODES_ITEM_N(3, MSG_SELECT_E, F("T3")); break;
|
||||
case 3: GCODES_ITEM_N(2, MSG_SELECT_E, F("T2")); break;
|
||||
#if EXTRUDERS == 6
|
||||
case 4: GCODES_ITEM_N(5, MSG_SELECT_E, PSTR("T5")); break;
|
||||
case 5: GCODES_ITEM_N(4, MSG_SELECT_E, PSTR("T4")); break;
|
||||
case 4: GCODES_ITEM_N(5, MSG_SELECT_E, F("T5")); break;
|
||||
case 5: GCODES_ITEM_N(4, MSG_SELECT_E, F("T4")); break;
|
||||
#endif
|
||||
}
|
||||
#elif EXTRUDERS == 3
|
||||
if (active_extruder < 2) {
|
||||
if (active_extruder)
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, F("T0"));
|
||||
else
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, F("T1"));
|
||||
}
|
||||
#else
|
||||
if (active_extruder)
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, F("T0"));
|
||||
else
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, F("T1"));
|
||||
#endif
|
||||
|
||||
#elif ENABLED(DUAL_X_CARRIAGE)
|
||||
|
||||
if (active_extruder)
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, F("T0"));
|
||||
else
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, F("T1"));
|
||||
|
||||
#endif
|
||||
|
||||
#if E_MANUAL
|
||||
|
||||
// The current extruder
|
||||
SUBMENU(MSG_MOVE_E, []{ _menu_move_distance_e_maybe(); });
|
||||
SUBMENU(MSG_MOVE_E, _menu_move_distance_e_maybe);
|
||||
|
||||
#define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(MenuItemBase::itemIndex); }, MenuItemBase::itemIndex); });
|
||||
#define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(N); }, N); });
|
||||
|
||||
#if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
|
||||
|
||||
@@ -310,8 +269,8 @@ void menu_move() {
|
||||
|
||||
#elif MULTI_E_MANUAL
|
||||
|
||||
// Independent extruders with one E-stepper per hotend
|
||||
LOOP_L_N(n, E_MANUAL) SUBMENU_MOVE_E(n);
|
||||
// Independent extruders with one E stepper per hotend
|
||||
REPEAT(E_MANUAL, SUBMENU_MOVE_E);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -320,6 +279,8 @@ void menu_move() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#define _HOME_ITEM(N) GCODES_ITEM_N(N##_AXIS, MSG_AUTO_HOME_A, F("G28" STR_##N));
|
||||
|
||||
#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
|
||||
//
|
||||
// "Motion" > "Homing" submenu
|
||||
@@ -328,23 +289,8 @@ void menu_move() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MOTION);
|
||||
|
||||
GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
|
||||
GCODES_ITEM(MSG_AUTO_HOME_X, PSTR("G28X"));
|
||||
#if HAS_Y_AXIS
|
||||
GCODES_ITEM(MSG_AUTO_HOME_Y, PSTR("G28Y"));
|
||||
#endif
|
||||
#if HAS_Z_AXIS
|
||||
GCODES_ITEM(MSG_AUTO_HOME_Z, PSTR("G28Z"));
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
GCODES_ITEM(MSG_AUTO_HOME_I, PSTR("G28" AXIS4_STR));
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
GCODES_ITEM(MSG_AUTO_HOME_J, PSTR("G28" AXIS5_STR));
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
GCODES_ITEM(MSG_AUTO_HOME_K, PSTR("G28" AXIS6_STR));
|
||||
#endif
|
||||
GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
|
||||
MAIN_AXIS_MAP(_HOME_ITEM);
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
@@ -380,24 +326,9 @@ void menu_motion() {
|
||||
#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
|
||||
SUBMENU(MSG_HOMING, menu_home);
|
||||
#else
|
||||
GCODES_ITEM(MSG_AUTO_HOME, G28_STR);
|
||||
GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
|
||||
#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
|
||||
GCODES_ITEM(MSG_AUTO_HOME_X, PSTR("G28X"));
|
||||
#if HAS_Y_AXIS
|
||||
GCODES_ITEM(MSG_AUTO_HOME_Y, PSTR("G28Y"));
|
||||
#endif
|
||||
#if HAS_Z_AXIS
|
||||
GCODES_ITEM(MSG_AUTO_HOME_Z, PSTR("G28Z"));
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
GCODES_ITEM(MSG_AUTO_HOME_I, PSTR("G28" AXIS4_STR));
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
GCODES_ITEM(MSG_AUTO_HOME_J, PSTR("G28" AXIS5_STR));
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
GCODES_ITEM(MSG_AUTO_HOME_K, PSTR("G28" AXIS6_STR));
|
||||
#endif
|
||||
MAIN_AXIS_MAP(_HOME_ITEM);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -405,14 +336,22 @@ void menu_motion() {
|
||||
// Auto-calibration
|
||||
//
|
||||
#if ENABLED(CALIBRATION_GCODE)
|
||||
GCODES_ITEM(MSG_AUTO_CALIBRATE, PSTR("G425"));
|
||||
GCODES_ITEM(MSG_AUTO_CALIBRATE, F("G425"));
|
||||
#endif
|
||||
|
||||
//
|
||||
// Auto Z-Align
|
||||
//
|
||||
#if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
|
||||
GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34"));
|
||||
GCODES_ITEM(MSG_AUTO_Z_ALIGN, F("G34"));
|
||||
#endif
|
||||
|
||||
//
|
||||
// Probe Deploy/Stow
|
||||
//
|
||||
#if ENABLED(PROBE_DEPLOY_STOW_MENU)
|
||||
GCODES_ITEM(MSG_MANUAL_DEPLOY, F("M401"));
|
||||
GCODES_ITEM(MSG_MANUAL_STOW, F("M402"));
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -437,7 +376,7 @@ void menu_motion() {
|
||||
#elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)
|
||||
|
||||
#if DISABLED(PROBE_MANUALLY)
|
||||
GCODES_ITEM(MSG_LEVEL_BED, PSTR("G29N"));
|
||||
GCODES_ITEM(MSG_LEVEL_BED, F("G29N"));
|
||||
#endif
|
||||
|
||||
if (all_axes_homed() && leveling_is_valid()) {
|
||||
@@ -452,20 +391,20 @@ void menu_motion() {
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING)
|
||||
#if ENABLED(LCD_BED_TRAMMING) && DISABLED(LCD_BED_LEVELING)
|
||||
SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners);
|
||||
#endif
|
||||
|
||||
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
|
||||
GCODES_ITEM(MSG_M48_TEST, PSTR("G28O\nM48 P10"));
|
||||
GCODES_ITEM(MSG_M48_TEST, F("G28O\nM48 P10"));
|
||||
#endif
|
||||
|
||||
//
|
||||
// Disable Steppers
|
||||
//
|
||||
GCODES_ITEM(MSG_DISABLE_STEPPERS, PSTR("M84"));
|
||||
GCODES_ITEM(MSG_DISABLE_STEPPERS, F("M84"));
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, PASSWORD_FEATURE)
|
||||
#if BOTH(HAS_MARLINUI_MENU, PASSWORD_FEATURE)
|
||||
|
||||
#include "../../feature/password/password.h"
|
||||
|
||||
@@ -49,22 +49,22 @@ void Password::menu_password_entry() {
|
||||
START_MENU();
|
||||
|
||||
// "Login" or "New Code"
|
||||
STATIC_ITEM_P(authenticating ? GET_TEXT(MSG_LOGIN_REQUIRED) : GET_TEXT(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT);
|
||||
STATIC_ITEM_F(authenticating ? GET_TEXT_F(MSG_LOGIN_REQUIRED) : GET_TEXT_F(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT);
|
||||
|
||||
STATIC_ITEM_P(NUL_STR, SS_CENTER, string);
|
||||
STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, string);
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
STATIC_ITEM_P(NUL_STR, SS_CENTER, "");
|
||||
STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, "");
|
||||
#endif
|
||||
|
||||
// Make the digit edit item look like a sub-menu
|
||||
PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT);
|
||||
EDIT_ITEM_P(uint8, label, &editable.uint8, 0, 9, digit_entered);
|
||||
MENU_ITEM_ADDON_START(utf8_strlen_P(label) + 1);
|
||||
lcd_put_wchar(' ');
|
||||
lcd_put_wchar('1' + digit_no);
|
||||
FSTR_P const label = GET_TEXT_F(MSG_ENTER_DIGIT);
|
||||
EDIT_ITEM_F(uint8, label, &editable.uint8, 0, 9, digit_entered);
|
||||
MENU_ITEM_ADDON_START(utf8_strlen(label) + 1);
|
||||
lcd_put_lchar(' ');
|
||||
lcd_put_lchar('1' + digit_no);
|
||||
SETCURSOR_X(LCD_WIDTH - 2);
|
||||
lcd_put_wchar('>');
|
||||
lcd_put_lchar('>');
|
||||
MENU_ITEM_ADDON_END();
|
||||
|
||||
ACTION_ITEM(MSG_START_OVER, start_over);
|
||||
@@ -184,4 +184,4 @@ void Password::menu_password() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && PASSWORD_FEATURE
|
||||
#endif // HAS_MARLINUI_MENU && PASSWORD_FEATURE
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU && HAS_POWER_MONITOR
|
||||
#if HAS_MARLINUI_MENU && HAS_POWER_MONITOR
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../feature/power_monitor.h"
|
||||
@@ -59,4 +59,4 @@ void menu_power_monitor() {
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && HAS_POWER_MONITOR
|
||||
#endif // HAS_MARLINUI_MENU && HAS_POWER_MONITOR
|
||||
|
@@ -39,23 +39,13 @@
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#endif
|
||||
|
||||
void _goto_manual_move_z(const_float_t);
|
||||
|
||||
// Global storage
|
||||
float z_offset_backup, calculated_z_offset, z_offset_ref;
|
||||
|
||||
#if HAS_LEVELING
|
||||
bool leveling_was_active;
|
||||
#endif
|
||||
|
||||
inline void z_clearance_move() {
|
||||
do_z_clearance(
|
||||
#ifdef Z_AFTER_HOMING
|
||||
Z_AFTER_HOMING
|
||||
#elif defined(Z_HOMING_HEIGHT)
|
||||
Z_HOMING_HEIGHT
|
||||
#else
|
||||
10
|
||||
#endif
|
||||
);
|
||||
do_z_clearance(Z_POST_CLEARANCE);
|
||||
}
|
||||
|
||||
void set_offset_and_go_back(const_float_t z) {
|
||||
@@ -65,11 +55,6 @@ void set_offset_and_go_back(const_float_t z) {
|
||||
ui.goto_previous_screen_no_defer();
|
||||
}
|
||||
|
||||
void _goto_manual_move_z(const_float_t scale) {
|
||||
ui.manual_move.menu_scale = scale;
|
||||
ui.goto_screen(lcd_move_z);
|
||||
}
|
||||
|
||||
void probe_offset_wizard_menu() {
|
||||
START_MENU();
|
||||
calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
|
||||
@@ -77,27 +62,14 @@ void probe_offset_wizard_menu() {
|
||||
if (LCD_HEIGHT >= 4)
|
||||
STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT);
|
||||
|
||||
STATIC_ITEM_P(PSTR("Z="), SS_CENTER, ftostr42_52(current_position.z));
|
||||
STATIC_ITEM_F(F("Z"), SS_CENTER, ftostr42_52(current_position.z));
|
||||
STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset));
|
||||
|
||||
SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); });
|
||||
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); });
|
||||
|
||||
if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) {
|
||||
char tmp[20], numstr[10];
|
||||
// Determine digits needed right of decimal
|
||||
const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 :
|
||||
!UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2;
|
||||
sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
|
||||
#if DISABLED(HAS_GRAPHICAL_TFT)
|
||||
SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
|
||||
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
|
||||
lcd_put_u8str(tmp);
|
||||
MENU_ITEM_ADDON_END();
|
||||
#else
|
||||
SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
|
||||
#endif
|
||||
}
|
||||
if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f)
|
||||
SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
|
||||
|
||||
ACTION_ITEM(MSG_BUTTON_DONE, []{
|
||||
set_offset_and_go_back(calculated_z_offset);
|
||||
@@ -111,7 +83,7 @@ void probe_offset_wizard_menu() {
|
||||
// If wizard-homing was done by probe with PROBE_OFFSET_WIZARD_START_Z
|
||||
#if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z)
|
||||
set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction
|
||||
queue.inject_P(PSTR("G28Z"));
|
||||
queue.inject(F("G28Z"));
|
||||
#else // Otherwise do a Z clearance move like after Homing
|
||||
z_clearance_move();
|
||||
#endif
|
||||
@@ -122,7 +94,7 @@ void probe_offset_wizard_menu() {
|
||||
|
||||
void prepare_for_probe_offset_wizard() {
|
||||
#if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE
|
||||
if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING));
|
||||
if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT_F(MSG_PROBE_WIZARD_PROBING));
|
||||
|
||||
if (ui.wait_for_move) return;
|
||||
|
||||
@@ -148,7 +120,7 @@ void prepare_for_probe_offset_wizard() {
|
||||
ui.wait_for_move = true;
|
||||
current_position += probe.offset_xy;
|
||||
line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE));
|
||||
ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING));
|
||||
ui.synchronize(GET_TEXT_F(MSG_PROBE_WIZARD_MOVING));
|
||||
ui.wait_for_move = false;
|
||||
|
||||
SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement
|
||||
|
@@ -26,14 +26,14 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_LCD_MENU && HAS_CUTTER
|
||||
#if HAS_MARLINUI_MENU && HAS_CUTTER
|
||||
|
||||
#include "menu_item.h"
|
||||
|
||||
#include "../../feature/spindle_laser.h"
|
||||
|
||||
void menu_spindle_laser() {
|
||||
bool is_enabled = cutter.enabled() && cutter.isReady;
|
||||
bool is_enabled = cutter.enabled();
|
||||
#if ENABLED(SPINDLE_CHANGE_DIR)
|
||||
bool is_rev = cutter.is_reverse();
|
||||
#endif
|
||||
@@ -48,8 +48,14 @@
|
||||
cutter.mpower_min(), cutter.mpower_max(), cutter.update_from_mpower);
|
||||
#endif
|
||||
|
||||
editable.state = is_enabled;
|
||||
EDIT_ITEM(bool, MSG_CUTTER(TOGGLE), &is_enabled, []{ if (editable.state) cutter.disable(); else cutter.enable_same_dir(); });
|
||||
editable.state = is_enabled; // State before toggle
|
||||
EDIT_ITEM(bool, MSG_CUTTER(TOGGLE), &is_enabled, []{
|
||||
#if ENABLED(SPINDLE_FEATURE)
|
||||
if (editable.state) cutter.disable(); else cutter.enable_same_dir();
|
||||
#else
|
||||
cutter.menu_set_enabled(!editable.state);
|
||||
#endif
|
||||
});
|
||||
|
||||
#if ENABLED(AIR_EVACUATION)
|
||||
bool evac_state = cutter.air_evac_state();
|
||||
@@ -64,7 +70,7 @@
|
||||
#if ENABLED(SPINDLE_CHANGE_DIR)
|
||||
if (!is_enabled) {
|
||||
editable.state = is_rev;
|
||||
ACTION_ITEM_P(is_rev ? GET_TEXT(MSG_CUTTER(REVERSE)) : GET_TEXT(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); });
|
||||
ACTION_ITEM_F(is_rev ? GET_TEXT_F(MSG_CUTTER(REVERSE)) : GET_TEXT_F(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); });
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -72,13 +78,11 @@
|
||||
// Setup and fire a test pulse using the current PWM power level for for a duration of test_pulse_min to test_pulse_max ms.
|
||||
EDIT_ITEM_FAST(CUTTER_MENU_PULSE_TYPE, MSG_LASER_PULSE_MS, &cutter.testPulse, LASER_TEST_PULSE_MIN, LASER_TEST_PULSE_MAX);
|
||||
ACTION_ITEM(MSG_LASER_FIRE_PULSE, cutter.test_fire_pulse);
|
||||
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY
|
||||
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 80000, cutter.refresh_frequency);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOTH(MARLIN_DEV_MODE, HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY)
|
||||
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 80000, cutter.refresh_frequency);
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && HAS_CUTTER
|
||||
#endif // HAS_MARLINUI_MENU && HAS_CUTTER
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_LCD_MENU && HAS_TEMPERATURE
|
||||
#if HAS_MARLINUI_MENU && HAS_TEMPERATURE
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/temperature.h"
|
||||
@@ -47,29 +47,29 @@
|
||||
// "Temperature" submenu items
|
||||
//
|
||||
|
||||
void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb) {
|
||||
UNUSED(e); UNUSED(indh); UNUSED(indb);
|
||||
#if HAS_HOTEND
|
||||
if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0)
|
||||
setTargetHotend(_MIN(thermalManager.hotend_max_target(e), ui.material_preset[indh].hotend_temp), e);
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp);
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
if (indh >= 0) {
|
||||
const uint8_t fan_index = active_extruder < (FAN_COUNT) ? active_extruder : 0;
|
||||
if (true
|
||||
#if REDUNDANT_PART_COOLING_FAN
|
||||
&& fan_index != REDUNDANT_PART_COOLING_FAN
|
||||
#endif
|
||||
) set_fan_speed(fan_index, ui.material_preset[indh].fan_speed);
|
||||
}
|
||||
#endif
|
||||
ui.return_to_status();
|
||||
}
|
||||
#if HAS_PREHEAT
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb) {
|
||||
UNUSED(e); UNUSED(indh); UNUSED(indb);
|
||||
#if HAS_HOTEND
|
||||
if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0)
|
||||
setTargetHotend(_MIN(thermalManager.hotend_max_target(e), ui.material_preset[indh].hotend_temp), e);
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp);
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
if (indh >= 0) {
|
||||
const uint8_t fan_index = active_extruder < (FAN_COUNT) ? active_extruder : 0;
|
||||
if (true
|
||||
#if REDUNDANT_PART_COOLING_FAN
|
||||
&& fan_index != REDUNDANT_PART_COOLING_FAN
|
||||
#endif
|
||||
) set_fan_speed(fan_index, ui.material_preset[indh].fan_speed);
|
||||
}
|
||||
#endif
|
||||
ui.return_to_status();
|
||||
}
|
||||
|
||||
#if HAS_TEMP_HOTEND
|
||||
inline void _preheat_end(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); }
|
||||
@@ -88,14 +88,14 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i
|
||||
|
||||
// Indexed "Preheat ABC" and "Heat Bed" items
|
||||
#define PREHEAT_ITEMS(M,E) do{ \
|
||||
ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_both(M, MenuItemBase::itemIndex); }); \
|
||||
ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(M, MenuItemBase::itemIndex); }); \
|
||||
ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_both(M, MenuItemBase::itemIndex); }); \
|
||||
ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(M, MenuItemBase::itemIndex); }); \
|
||||
}while(0)
|
||||
|
||||
#elif HAS_MULTI_HOTEND
|
||||
|
||||
// No heated bed, so just indexed "Preheat ABC" items
|
||||
#define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); })
|
||||
#define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); })
|
||||
|
||||
#endif
|
||||
|
||||
@@ -112,24 +112,25 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i
|
||||
#if HOTENDS == 1
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_both(editable.int8, 0); });
|
||||
ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_END, do_preheat_end_m);
|
||||
ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_both(editable.int8, 0); });
|
||||
ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_END, do_preheat_end_m);
|
||||
#else
|
||||
ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m);
|
||||
ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m);
|
||||
#endif
|
||||
|
||||
#elif HAS_MULTI_HOTEND
|
||||
|
||||
HOTEND_LOOP() PREHEAT_ITEMS(editable.int8, e);
|
||||
ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_ALL, []() {
|
||||
HOTEND_LOOP() thermalManager.setTargetHotend(ui.material_preset[editable.int8].hotend_temp, e);
|
||||
ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_ALL, []() {
|
||||
const celsius_t t = ui.material_preset[editable.int8].hotend_temp;
|
||||
HOTEND_LOOP() thermalManager.setTargetHotend(t, e);
|
||||
TERN(HAS_HEATED_BED, _preheat_bed(editable.int8), ui.return_to_status());
|
||||
});
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); });
|
||||
ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); });
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
@@ -137,13 +138,12 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i
|
||||
|
||||
#endif // HAS_MULTI_HOTEND || HAS_HEATED_BED
|
||||
|
||||
#endif // PREHEAT_COUNT
|
||||
#endif // HAS_PREHEAT
|
||||
|
||||
#if HAS_TEMP_HOTEND || HAS_HEATED_BED
|
||||
|
||||
void lcd_cooldown() {
|
||||
thermalManager.zero_fan_speeds();
|
||||
thermalManager.disable_all_heaters();
|
||||
thermalManager.cooldown();
|
||||
ui.return_to_status();
|
||||
}
|
||||
|
||||
@@ -262,16 +262,16 @@ void menu_temperature() {
|
||||
|
||||
#endif // HAS_FAN
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
//
|
||||
// Preheat for all Materials
|
||||
//
|
||||
LOOP_L_N(m, PREHEAT_COUNT) {
|
||||
editable.int8 = m;
|
||||
#if HOTENDS > 1 || HAS_HEATED_BED
|
||||
SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m);
|
||||
#if HAS_MULTI_HOTEND || HAS_HEATED_BED
|
||||
SUBMENU_f(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m);
|
||||
#elif HAS_HOTEND
|
||||
ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m);
|
||||
ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -295,10 +295,10 @@ void menu_temperature() {
|
||||
|
||||
LOOP_L_N(m, PREHEAT_COUNT) {
|
||||
editable.int8 = m;
|
||||
#if HOTENDS > 1 || HAS_HEATED_BED
|
||||
SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m);
|
||||
#if HAS_MULTI_HOTEND || HAS_HEATED_BED
|
||||
SUBMENU_f(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m);
|
||||
#else
|
||||
ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m);
|
||||
ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -307,4 +307,4 @@ void menu_temperature() {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // HAS_LCD_MENU && HAS_TEMPERATURE
|
||||
#endif // HAS_MARLINUI_MENU && HAS_TEMPERATURE
|
||||
|
@@ -26,25 +26,25 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU && HAS_TRINAMIC_CONFIG
|
||||
#if HAS_MARLINUI_MENU && HAS_TRINAMIC_CONFIG
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/stepper/indirection.h"
|
||||
#include "../../feature/tmc_util.h"
|
||||
|
||||
#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_P(uint16_4, PSTR(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); })
|
||||
#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_F(uint16_4, F(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); })
|
||||
|
||||
void menu_tmc_current() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_TMC_DRIVERS);
|
||||
#if AXIS_IS_TMC(X)
|
||||
TMC_EDIT_STORED_I_RMS(X, STR_X);
|
||||
TMC_EDIT_STORED_I_RMS(X, STR_A);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Y)
|
||||
TMC_EDIT_STORED_I_RMS(Y, STR_Y);
|
||||
TMC_EDIT_STORED_I_RMS(Y, STR_B);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z)
|
||||
TMC_EDIT_STORED_I_RMS(Z, STR_Z);
|
||||
TMC_EDIT_STORED_I_RMS(Z, STR_C);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(X2)
|
||||
TMC_EDIT_STORED_I_RMS(X2, STR_X2);
|
||||
@@ -62,35 +62,35 @@ void menu_tmc_current() {
|
||||
TMC_EDIT_STORED_I_RMS(Z4, STR_Z4);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E0)
|
||||
TMC_EDIT_STORED_I_RMS(E0, LCD_STR_E0);
|
||||
TMC_EDIT_STORED_I_RMS(E0, STR_E0);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E1)
|
||||
TMC_EDIT_STORED_I_RMS(E1, LCD_STR_E1);
|
||||
TMC_EDIT_STORED_I_RMS(E1, STR_E1);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E2)
|
||||
TMC_EDIT_STORED_I_RMS(E2, LCD_STR_E2);
|
||||
TMC_EDIT_STORED_I_RMS(E2, STR_E2);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E3)
|
||||
TMC_EDIT_STORED_I_RMS(E3, LCD_STR_E3);
|
||||
TMC_EDIT_STORED_I_RMS(E3, STR_E3);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E4)
|
||||
TMC_EDIT_STORED_I_RMS(E4, LCD_STR_E4);
|
||||
TMC_EDIT_STORED_I_RMS(E4, STR_E4);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E5)
|
||||
TMC_EDIT_STORED_I_RMS(E5, LCD_STR_E5);
|
||||
TMC_EDIT_STORED_I_RMS(E5, STR_E5);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E6)
|
||||
TMC_EDIT_STORED_I_RMS(E6, LCD_STR_E6);
|
||||
TMC_EDIT_STORED_I_RMS(E6, STR_E6);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E7)
|
||||
TMC_EDIT_STORED_I_RMS(E7, LCD_STR_E7);
|
||||
TMC_EDIT_STORED_I_RMS(E7, STR_E7);
|
||||
#endif
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#if ENABLED(HYBRID_THRESHOLD)
|
||||
|
||||
#define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_P(uint8, PSTR(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); });
|
||||
#define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint8, F(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); });
|
||||
|
||||
void menu_tmc_hybrid_thrs() {
|
||||
START_MENU();
|
||||
@@ -103,14 +103,14 @@ void menu_tmc_current() {
|
||||
TERN_(Z2_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(Z2, STR_Z2));
|
||||
TERN_(Z3_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(Z3, STR_Z3));
|
||||
TERN_(Z4_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(Z4, STR_Z4));
|
||||
TERN_(E0_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E0, LCD_STR_E0));
|
||||
TERN_(E1_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E1, LCD_STR_E1));
|
||||
TERN_(E2_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E2, LCD_STR_E2));
|
||||
TERN_(E3_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E3, LCD_STR_E3));
|
||||
TERN_(E4_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E4, LCD_STR_E4));
|
||||
TERN_(E5_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E5, LCD_STR_E5));
|
||||
TERN_(E6_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E6, LCD_STR_E6));
|
||||
TERN_(E7_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E7, LCD_STR_E7));
|
||||
TERN_(E0_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E0, STR_E0));
|
||||
TERN_(E1_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E1, STR_E1));
|
||||
TERN_(E2_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E2, STR_E2));
|
||||
TERN_(E3_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E3, STR_E3));
|
||||
TERN_(E4_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E4, STR_E4));
|
||||
TERN_(E5_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E5, STR_E5));
|
||||
TERN_(E6_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E6, STR_E6));
|
||||
TERN_(E7_HAS_STEALTHCHOP, TMC_EDIT_STORED_HYBRID_THRS(E7, STR_E7));
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ void menu_tmc_current() {
|
||||
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
|
||||
#define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); });
|
||||
#define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_F(int4, F(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); });
|
||||
|
||||
void menu_tmc_homing_thrs() {
|
||||
START_MENU();
|
||||
@@ -134,6 +134,9 @@ void menu_tmc_current() {
|
||||
TERN_( I_SENSORLESS, TMC_EDIT_STORED_SGT(I));
|
||||
TERN_( J_SENSORLESS, TMC_EDIT_STORED_SGT(J));
|
||||
TERN_( K_SENSORLESS, TMC_EDIT_STORED_SGT(K));
|
||||
TERN_( U_SENSORLESS, TMC_EDIT_STORED_SGT(U));
|
||||
TERN_( V_SENSORLESS, TMC_EDIT_STORED_SGT(V));
|
||||
TERN_( W_SENSORLESS, TMC_EDIT_STORED_SGT(W));
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -141,7 +144,7 @@ void menu_tmc_current() {
|
||||
|
||||
#if HAS_STEALTHCHOP
|
||||
|
||||
#define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_P(bool, PSTR(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); })
|
||||
#define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_F(bool, F(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); })
|
||||
|
||||
void menu_tmc_step_mode() {
|
||||
START_MENU();
|
||||
@@ -155,14 +158,14 @@ void menu_tmc_current() {
|
||||
TERN_(Z2_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(Z2, STR_Z2));
|
||||
TERN_(Z3_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(Z3, STR_Z3));
|
||||
TERN_(Z4_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(Z4, STR_Z4));
|
||||
TERN_(E0_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E0, LCD_STR_E0));
|
||||
TERN_(E1_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E1, LCD_STR_E1));
|
||||
TERN_(E2_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E2, LCD_STR_E2));
|
||||
TERN_(E3_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E3, LCD_STR_E3));
|
||||
TERN_(E4_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E4, LCD_STR_E4));
|
||||
TERN_(E5_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E5, LCD_STR_E5));
|
||||
TERN_(E6_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E6, LCD_STR_E6));
|
||||
TERN_(E7_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E7, LCD_STR_E7));
|
||||
TERN_(E0_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E0, STR_E0));
|
||||
TERN_(E1_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E1, STR_E1));
|
||||
TERN_(E2_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E2, STR_E2));
|
||||
TERN_(E3_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E3, STR_E3));
|
||||
TERN_(E4_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E4, STR_E4));
|
||||
TERN_(E5_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E5, STR_E5));
|
||||
TERN_(E6_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E6, STR_E6));
|
||||
TERN_(E7_HAS_STEALTHCHOP, TMC_EDIT_STEP_MODE(E7, STR_E7));
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION)
|
||||
#if BOTH(HAS_MARLINUI_MENU, TOUCH_SCREEN_CALIBRATION)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../marlinui.h"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, ASSISTED_TRAMMING_WIZARD)
|
||||
#if BOTH(HAS_MARLINUI_MENU, ASSISTED_TRAMMING_WIZARD)
|
||||
|
||||
#include "menu_item.h"
|
||||
|
||||
@@ -36,11 +36,15 @@
|
||||
#include "../../module/probe.h"
|
||||
#include "../../gcode/queue.h"
|
||||
|
||||
#if ENABLED(BLTOUCH)
|
||||
#include "../../feature/bltouch.h"
|
||||
#endif
|
||||
|
||||
//#define DEBUG_OUT 1
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
static float z_measured[G35_PROBE_COUNT];
|
||||
static bool z_isvalid[G35_PROBE_COUNT];
|
||||
static Flags<G35_PROBE_COUNT> z_isvalid;
|
||||
static uint8_t tram_index = 0;
|
||||
static int8_t reference_index; // = 0
|
||||
|
||||
@@ -51,13 +55,16 @@ static int8_t reference_index; // = 0
|
||||
static bool probe_single_point() {
|
||||
do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
|
||||
// Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
|
||||
const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true);
|
||||
const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN0(BLTOUCH, bltouch.high_speed_mode) ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
|
||||
z_measured[tram_index] = z_probed_height;
|
||||
if (reference_index < 0) reference_index = tram_index;
|
||||
move_to_tramming_wait_pos();
|
||||
|
||||
DEBUG_ECHOLNPGM("probe_single_point(", tram_index, ") = ", z_probed_height, "mm");
|
||||
return (z_isvalid[tram_index] = !isnan(z_probed_height));
|
||||
|
||||
const bool v = !isnan(z_probed_height);
|
||||
z_isvalid.set(tram_index, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static void _menu_single_probe() {
|
||||
@@ -66,7 +73,7 @@ static void _menu_single_probe() {
|
||||
STATIC_ITEM(MSG_BED_TRAMMING, SS_LEFT);
|
||||
STATIC_ITEM(MSG_LAST_VALUE_SP, SS_LEFT, z_isvalid[tram_index] ? ftostr42_52(z_measured[reference_index] - z_measured[tram_index]) : "---");
|
||||
ACTION_ITEM(MSG_UBL_BC_INSERT2, []{ if (probe_single_point()) ui.refresh(); });
|
||||
ACTION_ITEM(MSG_BUTTON_DONE, []{ ui.goto_previous_screen(); });
|
||||
ACTION_ITEM(MSG_BUTTON_DONE, ui.goto_previous_screen);
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -76,7 +83,7 @@ static void tramming_wizard_menu() {
|
||||
|
||||
// Draw a menu item for each tramming point
|
||||
for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++)
|
||||
SUBMENU_P((char*)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
|
||||
SUBMENU_F(FPSTR(pgm_read_ptr(&tramming_point_name[tram_index])), _menu_single_probe);
|
||||
|
||||
ACTION_ITEM(MSG_BUTTON_DONE, []{
|
||||
probe.stow(); // Stow before exiting Tramming Wizard
|
||||
@@ -91,12 +98,12 @@ void goto_tramming_wizard() {
|
||||
ui.defer_status_screen();
|
||||
|
||||
// Initialize measured point flags
|
||||
ZERO(z_isvalid);
|
||||
z_isvalid.reset();
|
||||
reference_index = -1;
|
||||
|
||||
// Inject G28, wait for homing to complete,
|
||||
set_all_unhomed();
|
||||
queue.inject_P(TERN(CAN_SET_LEVELING_AFTER_G28, PSTR("G28L0"), G28_STR));
|
||||
queue.inject(TERN(CAN_SET_LEVELING_AFTER_G28, F("G28L0"), FPSTR(G28_STR)));
|
||||
|
||||
ui.goto_screen([]{
|
||||
_lcd_draw_homing();
|
||||
@@ -105,4 +112,4 @@ void goto_tramming_wizard() {
|
||||
});
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && ASSISTED_TRAMMING_WIZARD
|
||||
#endif // HAS_MARLINUI_MENU && ASSISTED_TRAMMING_WIZARD
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/motion.h"
|
||||
@@ -50,7 +50,9 @@
|
||||
#include "../dogm/marlinui_DOGM.h"
|
||||
#endif
|
||||
|
||||
void _lcd_babystep(const AxisEnum axis, PGM_P const msg) {
|
||||
// TODO: Replace fmsg with MSG_BABYSTEP_N and index substitution
|
||||
|
||||
void _lcd_babystep(const AxisEnum axis, FSTR_P const fmsg) {
|
||||
if (ui.use_click()) return ui.goto_previous_screen_no_defer();
|
||||
if (ui.encoderPosition) {
|
||||
const int16_t steps = int16_t(ui.encoderPosition) * (
|
||||
@@ -66,20 +68,20 @@
|
||||
}
|
||||
if (ui.should_draw()) {
|
||||
const float mps = planner.mm_per_step[axis];
|
||||
MenuEditItemBase::draw_edit_screen(msg, BABYSTEP_TO_STR(mps * babystep.accum));
|
||||
MenuEditItemBase::draw_edit_screen(fmsg, BABYSTEP_TO_STR(mps * babystep.accum));
|
||||
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||
const bool in_view = TERN1(HAS_MARLINUI_U8GLIB, PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1));
|
||||
if (in_view) {
|
||||
TERN_(HAS_MARLINUI_U8GLIB, ui.set_font(FONT_MENU));
|
||||
#if ENABLED(TFT_COLOR_UI)
|
||||
lcd_moveto(4, 3);
|
||||
lcd_put_u8str_P(GET_TEXT(MSG_BABYSTEP_TOTAL));
|
||||
lcd_put_wchar(':');
|
||||
lcd_put_u8str(GET_TEXT_F(MSG_BABYSTEP_TOTAL));
|
||||
lcd_put_lchar(':');
|
||||
lcd_moveto(10, 3);
|
||||
#else
|
||||
lcd_moveto(0, TERN(HAS_MARLINUI_U8GLIB, LCD_PIXEL_HEIGHT - MENU_FONT_DESCENT, LCD_HEIGHT - 1));
|
||||
lcd_put_u8str_P(GET_TEXT(MSG_BABYSTEP_TOTAL));
|
||||
lcd_put_wchar(':');
|
||||
lcd_put_u8str(GET_TEXT_F(MSG_BABYSTEP_TOTAL));
|
||||
lcd_put_lchar(':');
|
||||
#endif
|
||||
lcd_put_u8str(BABYSTEP_TO_STR(mps * babystep.axis_total[BS_TOTAL_IND(axis)]));
|
||||
}
|
||||
@@ -94,12 +96,12 @@
|
||||
}
|
||||
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT(MSG_BABYSTEP_X)); }
|
||||
void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT(MSG_BABYSTEP_Y)); }
|
||||
void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT_F(MSG_BABYSTEP_X)); }
|
||||
void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT_F(MSG_BABYSTEP_Y)); }
|
||||
#endif
|
||||
|
||||
#if DISABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT(MSG_BABYSTEP_Z)); }
|
||||
void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT_F(MSG_BABYSTEP_Z)); }
|
||||
void lcd_babystep_z() { _lcd_babystep_go(_lcd_babystep_z); }
|
||||
#endif
|
||||
|
||||
@@ -118,7 +120,7 @@ void menu_tune() {
|
||||
// Manual bed leveling, Bed Z:
|
||||
//
|
||||
#if BOTH(MESH_BED_LEVELING, LCD_BED_LEVELING)
|
||||
EDIT_ITEM(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
|
||||
EDIT_ITEM(float43, MSG_BED_Z, &bedlevel.z_offset, -1, 1);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -199,8 +201,8 @@ void menu_tune() {
|
||||
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); });
|
||||
// Flow En:
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_N(int3, n, MSG_FLOW_N, &planner.flow_percentage[n], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_N(int3, e, MSG_FLOW_N, &planner.flow_percentage[e], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -211,8 +213,8 @@ void menu_tune() {
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10);
|
||||
#elif HAS_MULTI_EXTRUDER
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10);
|
||||
EXTRUDER_LOOP()
|
||||
EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -223,17 +225,17 @@ void menu_tune() {
|
||||
//
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
SUBMENU(MSG_BABYSTEP_X, []{ _lcd_babystep_go(_lcd_babystep_x); });
|
||||
SUBMENU(MSG_BABYSTEP_Y, []{ _lcd_babystep_go(_lcd_babystep_y); });
|
||||
SUBMENU_N(X_AXIS, MSG_BABYSTEP_N, []{ _lcd_babystep_go(_lcd_babystep_x); });
|
||||
SUBMENU_N(Y_AXIS, MSG_BABYSTEP_N, []{ _lcd_babystep_go(_lcd_babystep_y); });
|
||||
#endif
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
||||
#else
|
||||
SUBMENU(MSG_BABYSTEP_Z, lcd_babystep_z);
|
||||
SUBMENU_N(Z_AXIS, MSG_BABYSTEP_N, lcd_babystep_z);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL)
|
||||
#if BOTH(HAS_MARLINUI_MENU, AUTO_BED_LEVELING_UBL)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../gcode/gcode.h"
|
||||
@@ -58,7 +58,7 @@ inline float rounded_mesh_value() {
|
||||
|
||||
/**
|
||||
* This screen displays the temporary mesh value and updates it based on encoder
|
||||
* movement. While this screen is active ubl.fine_tune_mesh sits in a loop getting
|
||||
* movement. While this screen is active bedlevel.fine_tune_mesh sits in a loop getting
|
||||
* the current value via ubl_mesh_value, moves the Z axis, and updates the mesh
|
||||
* value until the encoder button is pressed.
|
||||
*
|
||||
@@ -67,39 +67,39 @@ inline float rounded_mesh_value() {
|
||||
* - Draw the graphical overlay, if enabled.
|
||||
* - Update the 'refresh' state according to the display type
|
||||
*/
|
||||
void _lcd_mesh_fine_tune(PGM_P const msg) {
|
||||
void _lcd_mesh_fine_tune(FSTR_P const fmsg) {
|
||||
constexpr float mesh_edit_step = 1.0f / 200.0f;
|
||||
ui.defer_status_screen();
|
||||
if (ubl.encoder_diff) {
|
||||
if (bedlevel.encoder_diff) {
|
||||
mesh_edit_accumulator += TERN(IS_TFTGLCD_PANEL,
|
||||
ubl.encoder_diff * mesh_edit_step / ENCODER_PULSES_PER_STEP,
|
||||
ubl.encoder_diff > 0 ? mesh_edit_step : -mesh_edit_step
|
||||
bedlevel.encoder_diff * mesh_edit_step / ENCODER_PULSES_PER_STEP,
|
||||
bedlevel.encoder_diff > 0 ? mesh_edit_step : -mesh_edit_step
|
||||
);
|
||||
ubl.encoder_diff = 0;
|
||||
bedlevel.encoder_diff = 0;
|
||||
IF_DISABLED(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
|
||||
}
|
||||
TERN_(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
|
||||
|
||||
if (ui.should_draw()) {
|
||||
const float rounded_f = rounded_mesh_value();
|
||||
MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f));
|
||||
TERN_(MESH_EDIT_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(rounded_f));
|
||||
MenuEditItemBase::draw_edit_screen(fmsg, ftostr43sign(rounded_f));
|
||||
TERN_(MESH_EDIT_GFX_OVERLAY, ui.zoffset_overlay(rounded_f));
|
||||
TERN_(HAS_GRAPHICAL_TFT, ui.refresh(LCDVIEW_NONE));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Init mesh editing and go to the fine tuning screen (ubl.fine_tune_mesh)
|
||||
// Init mesh editing and go to the fine tuning screen (bedlevel.fine_tune_mesh)
|
||||
// To capture encoder events UBL will also call ui.capture and ui.release.
|
||||
//
|
||||
void MarlinUI::ubl_mesh_edit_start(const_float_t initial) {
|
||||
TERN_(HAS_GRAPHICAL_TFT, clear_lcd());
|
||||
mesh_edit_accumulator = initial;
|
||||
goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDIT_Z)); });
|
||||
goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT_F(MSG_MESH_EDIT_Z)); });
|
||||
}
|
||||
|
||||
//
|
||||
// Get the mesh value within a Z adjustment loop (ubl.fine_tune_mesh)
|
||||
// Get the mesh value within a Z adjustment loop (bedlevel.fine_tune_mesh)
|
||||
//
|
||||
float MarlinUI::ubl_mesh_value() { return rounded_mesh_value(); }
|
||||
|
||||
@@ -176,8 +176,8 @@ void _menu_ubl_height_adjust() {
|
||||
void _lcd_ubl_edit_mesh() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_TOOLS);
|
||||
GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29P4RT"));
|
||||
GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29P4T"));
|
||||
GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, F("G29P4RT"));
|
||||
GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, F("G29P4T"));
|
||||
SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust);
|
||||
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
|
||||
END_MENU();
|
||||
@@ -208,29 +208,16 @@ void _lcd_ubl_edit_mesh() {
|
||||
void _lcd_ubl_validate_mesh() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_TOOLS);
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
#if HAS_HEATED_BED
|
||||
#define VALIDATE_MESH_GCODE_ITEM(M) \
|
||||
GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M)))
|
||||
GCODES_ITEM_N_f(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPI" STRINGIFY(M)));
|
||||
#else
|
||||
#define VALIDATE_MESH_GCODE_ITEM(M) \
|
||||
GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M)))
|
||||
GCODES_ITEM_N_f(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPB0I" STRINGIFY(M)));
|
||||
#endif
|
||||
|
||||
VALIDATE_MESH_GCODE_ITEM(0);
|
||||
#if PREHEAT_COUNT > 1
|
||||
VALIDATE_MESH_GCODE_ITEM(1);
|
||||
#if PREHEAT_COUNT > 2
|
||||
VALIDATE_MESH_GCODE_ITEM(2);
|
||||
#if PREHEAT_COUNT > 3
|
||||
VALIDATE_MESH_GCODE_ITEM(3);
|
||||
#if PREHEAT_COUNT > 4
|
||||
VALIDATE_MESH_GCODE_ITEM(4);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif // PREHEAT_COUNT
|
||||
REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM)
|
||||
#endif
|
||||
ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh);
|
||||
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
|
||||
END_MENU();
|
||||
@@ -268,7 +255,7 @@ void _lcd_ubl_grid_level() {
|
||||
void _lcd_ubl_mesh_leveling() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_TOOLS);
|
||||
GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29J0"));
|
||||
GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, F("G29J0"));
|
||||
SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level);
|
||||
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
|
||||
END_MENU();
|
||||
@@ -297,14 +284,14 @@ void _menu_ubl_fillin() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_BUILD_MESH_MENU);
|
||||
EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd);
|
||||
GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29P3T0"));
|
||||
GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29P2BT0"));
|
||||
GCODES_ITEM(MSG_UBL_SMART_FILLIN, F("G29P3T0"));
|
||||
GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, F("G29P2BT0"));
|
||||
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
void _lcd_ubl_invalidate() {
|
||||
ubl.invalidate();
|
||||
bedlevel.invalidate();
|
||||
SERIAL_ECHOLNPGM("Mesh invalidated.");
|
||||
}
|
||||
|
||||
@@ -324,14 +311,14 @@ void _lcd_ubl_invalidate() {
|
||||
void _lcd_ubl_build_mesh() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_TOOLS);
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
#if HAS_HEATED_BED
|
||||
#define PREHEAT_BED_GCODE(M) "M190I" STRINGIFY(M) "\n"
|
||||
#else
|
||||
#define PREHEAT_BED_GCODE(M) ""
|
||||
#endif
|
||||
#define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_S(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \
|
||||
PSTR( \
|
||||
#define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_f(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \
|
||||
F( \
|
||||
"G28\n" \
|
||||
PREHEAT_BED_GCODE(M) \
|
||||
"M109I" STRINGIFY(M) "\n" \
|
||||
@@ -352,14 +339,14 @@ void _lcd_ubl_build_mesh() {
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif // PREHEAT_COUNT
|
||||
#endif // HAS_PREHEAT
|
||||
|
||||
SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh);
|
||||
GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G29NP1"));
|
||||
GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, F("G29NP1"));
|
||||
SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin);
|
||||
GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29P1C"));
|
||||
GCODES_ITEM(MSG_UBL_CONTINUE_MESH, F("G29P1C"));
|
||||
ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate);
|
||||
GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29I"));
|
||||
GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, F("G29I"));
|
||||
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
|
||||
END_MENU();
|
||||
}
|
||||
@@ -367,14 +354,14 @@ void _lcd_ubl_build_mesh() {
|
||||
/**
|
||||
* UBL Load / Save Mesh Commands
|
||||
*/
|
||||
inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) {
|
||||
inline void _lcd_ubl_load_save_cmd(const char loadsave, FSTR_P const fmsg) {
|
||||
char ubl_lcd_gcode[40];
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("G29%c%i\nM117 "), loadsave, ubl_storage_slot);
|
||||
sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], msg, ubl_storage_slot);
|
||||
sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], FTOP(fmsg), ubl_storage_slot);
|
||||
gcode.process_subcommands_now(ubl_lcd_gcode);
|
||||
}
|
||||
void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT(MSG_MESH_LOADED)); }
|
||||
void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT(MSG_MESH_SAVED)); }
|
||||
void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT_F(MSG_MESH_LOADED)); }
|
||||
void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT_F(MSG_MESH_SAVED)); }
|
||||
|
||||
/**
|
||||
* UBL Mesh Storage submenu
|
||||
@@ -403,8 +390,8 @@ void _lcd_ubl_storage_mesh() {
|
||||
*/
|
||||
void _lcd_ubl_map_edit_cmd() {
|
||||
char ubl_lcd_gcode[50], str[10], str2[10];
|
||||
dtostrf(ubl.mesh_index_to_xpos(x_plot), 0, 2, str);
|
||||
dtostrf(ubl.mesh_index_to_ypos(y_plot), 0, 2, str2);
|
||||
dtostrf(bedlevel.get_mesh_x(x_plot), 0, 2, str);
|
||||
dtostrf(bedlevel.get_mesh_y(y_plot), 0, 2, str2);
|
||||
snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29P4X%sY%sR%i"), str, str2, int(n_edit_pts));
|
||||
queue.inject(ubl_lcd_gcode);
|
||||
}
|
||||
@@ -413,7 +400,7 @@ void _lcd_ubl_map_edit_cmd() {
|
||||
* UBL LCD Map Movement
|
||||
*/
|
||||
void ubl_map_move_to_xy() {
|
||||
const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) };
|
||||
const xy_pos_t xy = { bedlevel.get_mesh_x(x_plot), bedlevel.get_mesh_y(y_plot) };
|
||||
|
||||
// Some printers have unreachable areas in the mesh. Skip the move if unreachable.
|
||||
if (!position_is_reachable(xy)) return;
|
||||
@@ -472,7 +459,7 @@ void ubl_map_screen() {
|
||||
|
||||
// Validate if needed
|
||||
#if IS_KINEMATIC
|
||||
const xy_pos_t xy = { ubl.mesh_index_to_xpos(x), ubl.mesh_index_to_ypos(y) };
|
||||
const xy_pos_t xy = { bedlevel.get_mesh_x(x), bedlevel.get_mesh_y(y) };
|
||||
if (position_is_reachable(xy)) break; // Found a valid point
|
||||
ui.encoderPosition += step_dir; // Test the next point
|
||||
#endif
|
||||
@@ -513,7 +500,7 @@ void _ubl_map_screen_homing() {
|
||||
ui.defer_status_screen();
|
||||
_lcd_draw_homing();
|
||||
if (all_axes_homed()) {
|
||||
ubl.lcd_map_control = true; // Return to the map screen after editing Z
|
||||
bedlevel.lcd_map_control = true; // Return to the map screen after editing Z
|
||||
ui.goto_screen(ubl_map_screen, grid_index(x_plot, y_plot)); // Pre-set the encoder value
|
||||
ui.manual_move.menu_scale = 0; // Immediate move
|
||||
ubl_map_move_to_xy(); // Move to current mesh point
|
||||
@@ -544,9 +531,9 @@ void _ubl_goto_map_screen() {
|
||||
void _lcd_ubl_output_map() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_LEVEL_BED);
|
||||
GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29T0"));
|
||||
GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29T1"));
|
||||
GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29S-1"));
|
||||
GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, F("G29T0"));
|
||||
GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, F("G29T1"));
|
||||
GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, F("G29S-1"));
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
@@ -563,7 +550,7 @@ void _menu_ubl_tools() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_LEVEL_BED);
|
||||
SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh);
|
||||
GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29I999\nG29P2BT0"));
|
||||
GCODES_ITEM(MSG_UBL_MANUAL_MESH, F("G29I999\nG29P2BT0"));
|
||||
#if ENABLED(G26_MESH_VALIDATION)
|
||||
SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
|
||||
#endif
|
||||
@@ -589,12 +576,12 @@ void _menu_ubl_tools() {
|
||||
void _lcd_ubl_step_by_step() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_UBL_LEVEL_BED);
|
||||
GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G29NP1"));
|
||||
GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29P3T0"));
|
||||
GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, F("G29NP1"));
|
||||
GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, F("G29P3T0"));
|
||||
SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
|
||||
GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29P4RT"));
|
||||
GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, F("G29P4RT"));
|
||||
SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
|
||||
GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29P4RT"));
|
||||
GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, F("G29P4RT"));
|
||||
ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd);
|
||||
END_MENU();
|
||||
}
|
||||
@@ -663,9 +650,9 @@ void _lcd_ubl_level_bed() {
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MOTION);
|
||||
if (planner.leveling_active)
|
||||
GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29D"));
|
||||
GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, F("G29D"));
|
||||
else
|
||||
GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29A"));
|
||||
GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, F("G29A"));
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
editable.decimal = planner.z_fade_height;
|
||||
EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); });
|
||||
@@ -680,8 +667,8 @@ void _lcd_ubl_level_bed() {
|
||||
SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh);
|
||||
SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map);
|
||||
SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools);
|
||||
GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29W"));
|
||||
GCODES_ITEM(MSG_UBL_INFO_UBL, F("G29W"));
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && AUTO_BED_LEVELING_UBL
|
||||
#endif // HAS_MARLINUI_MENU && AUTO_BED_LEVELING_UBL
|
||||
|
213
Marlin/src/lcd/menu/menu_x_twist.cpp
Normal file
213
Marlin/src/lcd/menu/menu_x_twist.cpp
Normal file
@@ -0,0 +1,213 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "menu_addon.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#include "../../feature/x_twist.h"
|
||||
#include "../../module/motion.h"
|
||||
#include "../../gcode/queue.h"
|
||||
#include "../../module/probe.h"
|
||||
|
||||
#ifndef XATC_Y_POSITION
|
||||
#define XATC_Y_POSITION ((probe.max_y() - probe.min_y())/2)
|
||||
#endif
|
||||
|
||||
void _goto_manual_move_z(const_float_t);
|
||||
|
||||
float measured_z, z_offset;
|
||||
|
||||
//
|
||||
// Step 9: X Axis Twist Compensation Wizard is finished.
|
||||
//
|
||||
void xatc_wizard_done() {
|
||||
if (!ui.wait_for_move) {
|
||||
xatc.print_points();
|
||||
set_bed_leveling_enabled(leveling_was_active);
|
||||
SET_SOFT_ENDSTOP_LOOSE(false);
|
||||
ui.goto_screen(menu_advanced_settings);
|
||||
}
|
||||
if (ui.should_draw())
|
||||
MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_XATC_DONE));
|
||||
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
}
|
||||
|
||||
void xatc_wizard_goto_next_point();
|
||||
|
||||
//
|
||||
// Step 8: Ask the user if he wants to update the z-offset of the probe
|
||||
//
|
||||
void xatc_wizard_update_z_offset() {
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO)
|
||||
, []{
|
||||
probe.offset.z = z_offset;
|
||||
ui.goto_screen(xatc_wizard_done);
|
||||
}
|
||||
, xatc_wizard_done
|
||||
, GET_TEXT_F(MSG_XATC_UPDATE_Z_OFFSET)
|
||||
, ftostr42_52(z_offset), F("?")
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Step 7: Set the Z-offset for this point and go to the next one.
|
||||
//
|
||||
void xatc_wizard_set_offset_and_go_to_next_point() {
|
||||
// Set Z-offset at probed point
|
||||
xatc.z_offset[manual_probe_index++] = probe.offset.z + current_position.z - measured_z;
|
||||
// Go to next point
|
||||
ui.goto_screen(xatc_wizard_goto_next_point);
|
||||
}
|
||||
|
||||
//
|
||||
// Step 6: Wizard Menu. Move the nozzle down until it touches the bed.
|
||||
//
|
||||
void xatc_wizard_menu() {
|
||||
START_MENU();
|
||||
float calculated_z_offset = probe.offset.z + current_position.z - measured_z;
|
||||
|
||||
if (LCD_HEIGHT >= 4)
|
||||
STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT);
|
||||
|
||||
STATIC_ITEM_F(F("Z="), SS_CENTER, ftostr42_52(current_position.z));
|
||||
STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset));
|
||||
|
||||
SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); });
|
||||
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); });
|
||||
|
||||
if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f)
|
||||
SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
|
||||
|
||||
ACTION_ITEM(MSG_BUTTON_DONE, xatc_wizard_set_offset_and_go_to_next_point);
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
//
|
||||
// Step 5: Display "Next point: 1 / 9" while waiting for move to finish
|
||||
//
|
||||
void xatc_wizard_moving() {
|
||||
if (ui.should_draw()) {
|
||||
char msg[10];
|
||||
sprintf_P(msg, PSTR("%i / %u"), manual_probe_index + 1, XATC_MAX_POINTS);
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg);
|
||||
}
|
||||
ui.refresh(LCDVIEW_CALL_NO_REDRAW);
|
||||
if (!ui.wait_for_move) ui.goto_screen(xatc_wizard_menu);
|
||||
}
|
||||
|
||||
//
|
||||
// Step 4: Initiate a move to the next point
|
||||
//
|
||||
void xatc_wizard_goto_next_point() {
|
||||
if (manual_probe_index < XATC_MAX_POINTS) {
|
||||
|
||||
const float x = xatc.start + manual_probe_index * xatc.spacing;
|
||||
|
||||
// Avoid probing outside the round or hexagonal area
|
||||
if (!TERN0(IS_KINEMATIC, !probe.can_reach(x, XATC_Y_POSITION))) {
|
||||
ui.wait_for_move = true;
|
||||
ui.goto_screen(xatc_wizard_moving);
|
||||
|
||||
// Deploy certain probes before starting probing
|
||||
TERN_(BLTOUCH, do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE));
|
||||
|
||||
xatc.set_enabled(false);
|
||||
measured_z = probe.probe_at_point(x, XATC_Y_POSITION, PROBE_PT_STOW);
|
||||
xatc.set_enabled(true);
|
||||
current_position += probe.offset_xy;
|
||||
current_position.z = (XATC_START_Z) - probe.offset.z + measured_z;
|
||||
line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE));
|
||||
ui.wait_for_move = false;
|
||||
}
|
||||
else
|
||||
manual_probe_index++; // Go to next point
|
||||
}
|
||||
else {
|
||||
// Compute the z-offset by averaging the values found with this wizard
|
||||
z_offset = 0;
|
||||
LOOP_L_N(i, XATC_MAX_POINTS) z_offset += xatc.z_offset[i];
|
||||
z_offset /= XATC_MAX_POINTS;
|
||||
|
||||
// Subtract the average from the values found with this wizard.
|
||||
// This way they are indipendent from the z-offset
|
||||
LOOP_L_N(i, XATC_MAX_POINTS) xatc.z_offset[i] -= z_offset;
|
||||
|
||||
ui.goto_screen(xatc_wizard_update_z_offset);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Step 3: Display "Click to Begin", wait for click
|
||||
// Move to the first probe position
|
||||
//
|
||||
void xatc_wizard_homing_done() {
|
||||
if (ui.should_draw()) {
|
||||
MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING));
|
||||
|
||||
// Color UI needs a control to detect a touch
|
||||
#if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT)
|
||||
touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ui.use_click()) {
|
||||
xatc.reset();
|
||||
|
||||
SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement
|
||||
|
||||
ui.goto_screen(xatc_wizard_goto_next_point);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Step 2: Display "Homing XYZ" - Wait for homing to finish
|
||||
//
|
||||
void xatc_wizard_homing() {
|
||||
_lcd_draw_homing();
|
||||
if (all_axes_homed())
|
||||
ui.goto_screen(xatc_wizard_homing_done);
|
||||
}
|
||||
|
||||
//
|
||||
// Step 1: Prepare for the wizard...
|
||||
//
|
||||
void xatc_wizard_continue() {
|
||||
// Store Bed-Leveling-State and disable
|
||||
#if HAS_LEVELING
|
||||
leveling_was_active = planner.leveling_active;
|
||||
set_bed_leveling_enabled(false);
|
||||
#endif
|
||||
|
||||
// Home all axes
|
||||
ui.defer_status_screen();
|
||||
set_all_unhomed();
|
||||
ui.goto_screen(xatc_wizard_homing);
|
||||
queue.inject_P(G28_STR);
|
||||
}
|
||||
|
||||
#endif // X_AXIS_TWIST_COMPENSATION
|
Reference in New Issue
Block a user