Reduced string storage using tokens (#15593)
This commit is contained in:
@ -64,15 +64,17 @@ typedef struct {
|
||||
} menuPosition;
|
||||
menuPosition screen_history[6];
|
||||
uint8_t screen_history_depth = 0;
|
||||
bool screen_changed;
|
||||
|
||||
// Value Editing
|
||||
chimera_t editable;
|
||||
PGM_P MenuEditItemBase::editLabel;
|
||||
void* MenuEditItemBase::editValue;
|
||||
int32_t MenuEditItemBase::minEditValue, MenuEditItemBase::maxEditValue;
|
||||
uint8_t MenuItemBase::itemIndex; // Index number for draw and action
|
||||
chimera_t editable; // Value Editing
|
||||
|
||||
// Menu Edit Items
|
||||
PGM_P MenuEditItemBase::editLabel;
|
||||
void* MenuEditItemBase::editValue;
|
||||
int32_t MenuEditItemBase::minEditValue,
|
||||
MenuEditItemBase::maxEditValue;
|
||||
screenFunc_t MenuEditItemBase::callbackFunc;
|
||||
bool MenuEditItemBase::liveEdit;
|
||||
bool MenuEditItemBase::liveEdit;
|
||||
|
||||
// Prevent recursion into screen handlers
|
||||
bool no_reentry = false;
|
||||
@ -121,17 +123,15 @@ void MenuItem_gcode::action(PGM_P const, PGM_P const pgcode) { queue.inject_P(pg
|
||||
/**
|
||||
* Functions for editing single values
|
||||
*
|
||||
* The "DEFINE_MENU_EDIT_ITEM" macro generates the functions needed to edit a numerical value.
|
||||
* 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:
|
||||
*
|
||||
* DECLARE_MENU_EDIT_TYPE(int16_t, int3, i16tostr3, 1)
|
||||
* DEFINE_MENU_EDIT_ITEM_TYPE(int16_t, int3, i16tostr3, 1)
|
||||
*
|
||||
* For example, DEFINE_MENU_EDIT_ITEM(int3) expands into these functions:
|
||||
* For example, DEFINE_MENU_EDIT_ITEM(int3) expands into:
|
||||
*
|
||||
* bool MenuItem_int3::_edit();
|
||||
* void MenuItem_int3::edit(); // edit int16_t (interactively)
|
||||
* void MenuItem_int3::action(PGM_P const pstr, int16_t * const ptr, const int32_t minValue, const int32_t maxValue, const screenFunc_t callback = null, const bool live = false);
|
||||
* 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)
|
||||
@ -143,14 +143,14 @@ void MenuItem_gcode::action(PGM_P const, PGM_P const pgcode) { queue.inject_P(pg
|
||||
* MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::draw(encoderLine == _thisItemNr, _lcdLineNr, plabel, &feedrate_percentage, 10, 999)
|
||||
*/
|
||||
void MenuEditItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) {
|
||||
void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) {
|
||||
#if ENABLED(TOUCH_BUTTONS)
|
||||
ui.repeat_delay = BUTTON_DELAY_EDIT;
|
||||
#endif
|
||||
if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0;
|
||||
if (int32_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue;
|
||||
if (ui.should_draw())
|
||||
edit_screen(editLabel, strfunc(ui.encoderPosition + minEditValue));
|
||||
draw_edit_screen(strfunc(ui.encoderPosition + minEditValue));
|
||||
if (ui.lcd_clicked || (liveEdit && ui.should_draw())) {
|
||||
if (editValue != nullptr) loadfunc(editValue, ui.encoderPosition + minEditValue);
|
||||
if (callbackFunc && (liveEdit || ui.lcd_clicked)) (*callbackFunc)();
|
||||
@ -158,7 +158,17 @@ void MenuEditItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) {
|
||||
}
|
||||
}
|
||||
|
||||
void MenuEditItemBase::init(PGM_P const el, void * const ev, const int32_t minv, const int32_t maxv, const uint16_t ep, const screenFunc_t cs, const screenFunc_t cb, const bool le) {
|
||||
void MenuEditItemBase::goto_edit_screen(
|
||||
PGM_P const el, // Edit label
|
||||
void * const ev, // Edit value pointer
|
||||
const int32_t minv, // Encoder minimum
|
||||
const int32_t maxv, // Encoder maximum
|
||||
const uint16_t ep, // Initial encoder value
|
||||
const screenFunc_t cs, // MenuItem_type::draw_edit_screen => MenuEditItemBase::edit()
|
||||
const screenFunc_t cb, // Callback after edit
|
||||
const bool le // Flag to call cb() during editing
|
||||
) {
|
||||
ui.screen_changed = true;
|
||||
ui.save_previous_screen();
|
||||
ui.refresh();
|
||||
editLabel = el;
|
||||
@ -171,6 +181,7 @@ void MenuEditItemBase::init(PGM_P const el, void * const ev, const int32_t minv,
|
||||
liveEdit = le;
|
||||
}
|
||||
|
||||
// TODO: Remove these but test build size with and without
|
||||
#define DEFINE_MENU_EDIT_ITEM(NAME) template class TMenuEditItem<MenuEditItemInfo_##NAME>
|
||||
|
||||
DEFINE_MENU_EDIT_ITEM(percent); // 100% right-justified
|
||||
@ -193,8 +204,8 @@ DEFINE_MENU_EDIT_ITEM(float52sign); // +123.45
|
||||
DEFINE_MENU_EDIT_ITEM(long5); // 12345 right-justified
|
||||
DEFINE_MENU_EDIT_ITEM(long5_25); // 12345 right-justified (25 increment)
|
||||
|
||||
void MenuItem_bool::action(PGM_P pstr, bool *ptr, screenFunc_t callback) {
|
||||
UNUSED(pstr); *ptr ^= true; ui.refresh();
|
||||
void MenuItem_bool::action(PGM_P const, bool * const ptr, screenFunc_t callback) {
|
||||
*ptr ^= true; ui.refresh();
|
||||
if (callback) (*callback)();
|
||||
}
|
||||
|
||||
@ -344,7 +355,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0;
|
||||
if (ui.first_page) {
|
||||
encoderLine = ui.encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM);
|
||||
screen_changed = false;
|
||||
ui.screen_changed = false;
|
||||
}
|
||||
if (screen_items > 0 && encoderLine >= screen_items - limit) {
|
||||
encoderLine = _MAX(0, screen_items - limit);
|
||||
@ -418,10 +429,10 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
if (ui.should_draw()) {
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
if (!do_probe)
|
||||
MenuEditItemBase::edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr43sign(hotend_offset[active_extruder].z));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr43sign(hotend_offset[active_extruder].z));
|
||||
else
|
||||
#endif
|
||||
MenuEditItemBase::edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), ftostr43sign(probe_offset.z));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), ftostr43sign(probe_offset.z));
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
|
||||
if (do_probe) _lcd_zoffset_overlay_gfx(probe_offset.z);
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "limits.h"
|
||||
|
||||
extern int8_t encoderLine, encoderTopLine, screen_items;
|
||||
extern bool screen_changed;
|
||||
|
||||
#if HOTENDS
|
||||
constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP);
|
||||
@ -52,24 +51,32 @@ typedef void (*selectFunc_t)();
|
||||
///////////// Base Menu Items //////////////
|
||||
////////////////////////////////////////////
|
||||
|
||||
class MenuItem_static {
|
||||
public:
|
||||
static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const valstr=nullptr);
|
||||
};
|
||||
|
||||
class MenuItemBase {
|
||||
public:
|
||||
// An index to interject in the item label and for
|
||||
// use by the action
|
||||
static uint8_t itemIndex;
|
||||
|
||||
// Store the index of the item ahead of use by indexed items
|
||||
FORCE_INLINE static void init(const uint8_t ind) { itemIndex = ind; }
|
||||
|
||||
// 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);
|
||||
|
||||
// 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) {
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
// CONFIRM_ITEM(PLABEL,Y,N,FY,FN,V...), YESNO_ITEM(PLABEL,FY,FN,V...)
|
||||
class MenuItem_confirm : MenuItemBase {
|
||||
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 valstr=nullptr);
|
||||
};
|
||||
|
||||
// CONFIRM_ITEM(LABEL,Y,N,FY,FN,V...),
|
||||
// YESNO_ITEM(LABEL,FY,FN,V...)
|
||||
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]);
|
||||
@ -104,16 +111,17 @@ class MenuItem_confirm : MenuItemBase {
|
||||
}
|
||||
};
|
||||
|
||||
// BACK_ITEM(PLABEL)
|
||||
// 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]);
|
||||
}
|
||||
static inline void action(PGM_P const=nullptr) { ui.go_back(); }
|
||||
// Back Item action goes back one step in history
|
||||
FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); }
|
||||
};
|
||||
|
||||
// SUBMENU(PLABEL, screen_handler)
|
||||
// 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, ...) {
|
||||
@ -122,21 +130,29 @@ class MenuItem_submenu : public MenuItemBase {
|
||||
static inline void action(PGM_P const, const screenFunc_t func) { ui.save_previous_screen(); ui.goto_screen(func); }
|
||||
};
|
||||
|
||||
// GCODE_ITEM(PLABEL, gcode)
|
||||
class MenuItem_gcode : public MenuItemBase {
|
||||
// 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, '>', ' ');
|
||||
}
|
||||
};
|
||||
|
||||
// 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, '>', ' ');
|
||||
}
|
||||
static void action(PGM_P const, const char * const pgcode);
|
||||
static inline void action(PGM_P const pstr, const uint8_t, const char * const pgcode) { action(pstr, pgcode); }
|
||||
};
|
||||
|
||||
// ACTION_ITEM(PLABEL, function)
|
||||
class MenuItem_function : public MenuItemBase {
|
||||
// ACTION_ITEM(LABEL, FUNC)
|
||||
class MenuItem_function : public MenuItem_button {
|
||||
public:
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', ' ');
|
||||
}
|
||||
//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)(); };
|
||||
};
|
||||
|
||||
@ -144,6 +160,7 @@ class MenuItem_function : public MenuItemBase {
|
||||
class CardReader;
|
||||
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);
|
||||
};
|
||||
#endif
|
||||
@ -165,9 +182,13 @@ typedef union {
|
||||
} chimera_t;
|
||||
extern chimera_t editable;
|
||||
|
||||
// Edit items use long integer encoder units
|
||||
// Base class for Menu Edit Items
|
||||
class MenuEditItemBase : public MenuItemBase {
|
||||
private:
|
||||
// These values are statically constructed by init() via action()
|
||||
// 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 void *editValue;
|
||||
static int32_t minEditValue, maxEditValue; // Encoder value range
|
||||
@ -176,21 +197,31 @@ class MenuEditItemBase : public MenuItemBase {
|
||||
protected:
|
||||
typedef const char* (*strfunc_t)(const int32_t);
|
||||
typedef void (*loadfunc_t)(void *, const int32_t);
|
||||
static void init(PGM_P const el, void * const ev, const int32_t minv, const int32_t maxv, const uint16_t ep, const screenFunc_t cs, const screenFunc_t cb, const bool le);
|
||||
static void edit(strfunc_t, loadfunc_t);
|
||||
static void goto_edit_screen(
|
||||
PGM_P const el, // Edit label
|
||||
void * const ev, // Edit value pointer
|
||||
const int32_t minv, // Encoder minimum
|
||||
const int32_t maxv, // Encoder maximum
|
||||
const uint16_t ep, // Initial encoder value
|
||||
const screenFunc_t cs, // MenuItem_type::draw_edit_screen => MenuEditItemBase::edit()
|
||||
const screenFunc_t cb, // Callback after edit
|
||||
const bool le // Flag to call cb() during editing
|
||||
);
|
||||
static void edit_screen(strfunc_t, loadfunc_t); // Edit value handler
|
||||
public:
|
||||
// Implemented for HD44780 and DOGM
|
||||
// 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 data, const bool pgm);
|
||||
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { draw(sel, row, pstr, data, false); }
|
||||
FORCE_INLINE static void draw_P(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { draw(sel, row, pstr, data, true); }
|
||||
static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm=false);
|
||||
|
||||
// Implemented for HD44780 and DOGM
|
||||
// This low-level method is good to draw from anywhere
|
||||
static void edit_screen(PGM_P const pstr, const char* const value=nullptr);
|
||||
static void draw_edit_screen(PGM_P const pstr, 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); }
|
||||
};
|
||||
|
||||
// Template for specific Menu Edit Item Types
|
||||
template<typename NAME>
|
||||
class TMenuEditItem : MenuEditItemBase {
|
||||
private:
|
||||
@ -206,6 +237,8 @@ class TMenuEditItem : MenuEditItemBase {
|
||||
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()));
|
||||
}
|
||||
// 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
|
||||
type_t * const ptr, // Value pointer
|
||||
@ -217,9 +250,9 @@ 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);
|
||||
init(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, edit, callback, live);
|
||||
goto_edit_screen(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv,
|
||||
edit_screen, callback, live);
|
||||
}
|
||||
static void edit() { MenuEditItemBase::edit(to_string, load); }
|
||||
};
|
||||
|
||||
// Provide a set of Edit Item Types which encompass a primitive
|
||||
@ -256,15 +289,12 @@ DEFINE_MENU_EDIT_ITEM_TYPE(uint32_t, long5_25, ftostr5rj, 0.04f ); //
|
||||
|
||||
class MenuItem_bool : public MenuEditItemBase {
|
||||
public:
|
||||
//#define DRAW_BOOL_SETTING(sel, row, pstr, data) draw_menu_item_edit_P(sel, row, pstr, (*(data))?GET_TEXT(MSG_LCD_ON):GET_TEXT(MSG_LCD_OFF))
|
||||
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);
|
||||
}
|
||||
//#define draw_menu_item_bool(sel, row, pstr, data, ...) DRAW_BOOL_SETTING(sel, row, pstr, data)
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, bool * const data, ...) {
|
||||
draw(sel, row, pstr, *data);
|
||||
}
|
||||
//#define draw_menu_item_accessor_bool(sel, row, pstr, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, 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());
|
||||
}
|
||||
@ -283,8 +313,10 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
* _menuLineNr is the menu item to draw and process
|
||||
* _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM
|
||||
*/
|
||||
#define SCREEN_OR_MENU_LOOP() \
|
||||
#define SCREEN_OR_MENU_LOOP(IS_MENU) \
|
||||
scroll_screen(IS_MENU ? 1 : LCD_HEIGHT, IS_MENU); \
|
||||
int8_t _menuLineNr = encoderTopLine, _thisItemNr; \
|
||||
bool _skipStatic = IS_MENU; \
|
||||
for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \
|
||||
_thisItemNr = 0
|
||||
|
||||
@ -295,20 +327,11 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
* START_MENU Opening code for a screen with menu items.
|
||||
* Scroll as-needed to keep the selected line in view.
|
||||
*/
|
||||
#define START_SCREEN() \
|
||||
scroll_screen(LCD_HEIGHT, false); \
|
||||
bool _skipStatic = false; \
|
||||
SCREEN_OR_MENU_LOOP()
|
||||
|
||||
#define START_MENU() \
|
||||
scroll_screen(1, true); \
|
||||
bool _skipStatic = true; \
|
||||
SCREEN_OR_MENU_LOOP()
|
||||
|
||||
#define END_SCREEN() \
|
||||
} \
|
||||
screen_items = _thisItemNr
|
||||
|
||||
#define START_SCREEN() SCREEN_OR_MENU_LOOP(false)
|
||||
#define START_MENU() SCREEN_OR_MENU_LOOP(true)
|
||||
#define NEXT_ITEM() (++_thisItemNr)
|
||||
#define SKIP_ITEM() NEXT_ITEM()
|
||||
#define END_SCREEN() } screen_items = _thisItemNr
|
||||
#define END_MENU() END_SCREEN(); UNUSED(_skipStatic)
|
||||
|
||||
#if ENABLED(ENCODER_RATE_MULTIPLIER)
|
||||
@ -328,90 +351,151 @@ class MenuItem_bool : public MenuEditItemBase {
|
||||
*
|
||||
* Examples:
|
||||
* BACK_ITEM(MSG_WATCH)
|
||||
* MENU_ITEM(back, MSG_WATCH)
|
||||
* MenuItem_back::draw(sel, row, GET_TEXT(MSG_WATCH))
|
||||
* MenuItem_back::action()
|
||||
* MenuItem_back::action(plabel, ...)
|
||||
* MenuItem_back::draw(sel, row, plabel, ...)
|
||||
*
|
||||
* ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause)
|
||||
* MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause)
|
||||
* MenuItem_function::draw(sel, row, GET_TEXT(MSG_PAUSE_PRINT), lcd_sdcard_pause)
|
||||
* MenuItem_function::action(GET_TEXT(MSG_PAUSE_PRINT), lcd_sdcard_pause)
|
||||
* MenuItem_function::action(plabel, lcd_sdcard_pause)
|
||||
* MenuItem_function::draw(sel, row, plabel, lcd_sdcard_pause)
|
||||
*
|
||||
* EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::draw(sel, row, GET_TEXT(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::action(GET_TEXT(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
*
|
||||
* MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999)
|
||||
* MenuItem_int3::draw(sel, row, plabel, &feedrate_percentage, 10, 999)
|
||||
*/
|
||||
#define _MENU_ITEM_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \
|
||||
_skipStatic = false; \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
PGM_P const plabel = PLABEL; \
|
||||
if (encoderLine == _thisItemNr && ui.use_click()) { \
|
||||
_MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \
|
||||
MenuItem_##TYPE::action(plabel, ##V); \
|
||||
if (screen_changed) return; \
|
||||
} \
|
||||
if (ui.should_draw()) \
|
||||
MenuItem_##TYPE::draw \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \
|
||||
} \
|
||||
++_thisItemNr; \
|
||||
|
||||
#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \
|
||||
PGM_P const plabel = PLABEL; \
|
||||
if (encoderLine == _thisItemNr && ui.use_click()) { \
|
||||
_MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \
|
||||
MenuItem_##TYPE::action(plabel, ##V); \
|
||||
if (ui.screen_changed) return; \
|
||||
} \
|
||||
if (ui.should_draw()) \
|
||||
MenuItem_##TYPE::draw \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \
|
||||
}while(0)
|
||||
|
||||
// Used to print static text with no visible cursor.
|
||||
// Parameters: label [, bool center [, bool invert [, char *value] ] ]
|
||||
#define STATIC_ITEM_P(PLABEL, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
if (_skipStatic && encoderLine <= _thisItemNr) { \
|
||||
ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
|
||||
++encoderLine; \
|
||||
} \
|
||||
if (ui.should_draw()) \
|
||||
MenuItem_static::draw(_lcdLineNr, PLABEL, ##V); \
|
||||
} \
|
||||
++_thisItemNr; \
|
||||
#define _MENU_ITEM_P(TYPE, V...) do { \
|
||||
_skipStatic = false; \
|
||||
if (_menuLineNr == _thisItemNr) \
|
||||
_MENU_INNER_P(TYPE, ##V); \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Indexed items set a global index value
|
||||
#define _MENU_ITEM_N_P(TYPE, N, V...) do{ \
|
||||
_skipStatic = false; \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
MenuItemBase::init(N); \
|
||||
_MENU_INNER_P(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// STATIC_ITEM draws a styled string with no highlight.
|
||||
// Parameters: label [, style [, char *value] ]
|
||||
|
||||
#define STATIC_ITEM_INNER_P(PLABEL, V...) do{ \
|
||||
if (_skipStatic && encoderLine <= _thisItemNr) { \
|
||||
ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
|
||||
++encoderLine; \
|
||||
} \
|
||||
if (ui.should_draw()) \
|
||||
MenuItem_static::draw(_lcdLineNr, PLABEL, ##V); \
|
||||
} while(0)
|
||||
|
||||
#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_P(GET_TEXT(LABEL), ##V)
|
||||
#define STATIC_ITEM_P(PLABEL, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) \
|
||||
STATIC_ITEM_INNER_P(PLABEL, ##V); \
|
||||
NEXT_ITEM(); \
|
||||
} while(0)
|
||||
|
||||
#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)
|
||||
#define STATIC_ITEM_N_P(PLABEL, N, V...) do{ \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
MenuItemBase::init(N); \
|
||||
STATIC_ITEM_INNER_P(PLABEL, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
#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 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), ##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 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)
|
||||
|
||||
#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 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 GCODES_ITEM_P(PLABEL, GCODES) MENU_ITEM_P(gcode, PLABEL, GCODES)
|
||||
#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_P(GET_TEXT(LABEL), GCODES)
|
||||
#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
|
||||
|
||||
#define SUBMENU_P(PLABEL, DEST) MENU_ITEM_P(submenu, PLABEL, DEST)
|
||||
#define SUBMENU(LABEL, DEST) SUBMENU_P(GET_TEXT(LABEL), DEST)
|
||||
#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 BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
|
||||
#define SKIP_ITEM() (_thisItemNr++)
|
||||
#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 _CONFIRM_ITEM_P(PLABEL, V...) do { \
|
||||
_skipStatic = false; \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
if (encoderLine == _thisItemNr && ui.use_click()) { \
|
||||
ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \
|
||||
return; \
|
||||
} \
|
||||
if (ui.should_draw()) MenuItem_confirm::draw \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \
|
||||
} \
|
||||
++_thisItemNr; \
|
||||
#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_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 SUBMENU_P(PLABEL, DEST) MENU_ITEM_P(submenu, PLABEL, DEST)
|
||||
#define SUBMENU(LABEL, DEST) SUBMENU_P(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 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_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_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_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 _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \
|
||||
if (encoderLine == _thisItemNr && ui.use_click()) { \
|
||||
ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \
|
||||
return; \
|
||||
} \
|
||||
if (ui.should_draw()) MenuItem_confirm::draw \
|
||||
(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \
|
||||
}while(0)
|
||||
|
||||
#define _CONFIRM_ITEM_P(PLABEL, V...) do { \
|
||||
_skipStatic = false; \
|
||||
if (_menuLineNr == _thisItemNr) \
|
||||
_CONFIRM_ITEM_INNER_P(PLABEL, ##V); \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
// Indexed items set a global index value
|
||||
#define _CONFIRM_ITEM_N_P(N, V...) do{ \
|
||||
_skipStatic = false; \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
MenuItemBase::init(N); \
|
||||
_CONFIRM_ITEM_INNER_P(TYPE, ##V); \
|
||||
} \
|
||||
NEXT_ITEM(); \
|
||||
}while(0)
|
||||
|
||||
#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 YESNO_ITEM_P(PLABEL, V...) _CONFIRM_ITEM_P(PLABEL, ##V)
|
||||
#define YESNO_ITEM(LABEL, V...) _CONFIRM_ITEM_P(GET_TEXT(LABEL), ##V)
|
||||
#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_P(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 YESNO_ITEM_N_P(N,PLABEL, V...) _CONFIRM_ITEM_N_P(N, PLABEL, ##V)
|
||||
#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_P(N, GET_TEXT(LABEL), ##V)
|
||||
|
||||
////////////////////////////////////////////
|
||||
/////////////// Menu Screens ///////////////
|
||||
|
@ -65,7 +65,7 @@ void menu_cancelobject();
|
||||
LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i);
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
#define EDIT_DAC_PERCENT(A) EDIT_ITEM(uint8, MSG_##A " " MSG_DAC_PERCENT, &driverPercent[_AXIS(A)], 0, 100, []{ dac_current_set_percents(driverPercent); })
|
||||
#define EDIT_DAC_PERCENT(A) EDIT_ITEM_P(uint8, PSTR(MSG_##A " " MSG_DAC_PERCENT), &driverPercent[_AXIS(A)], 0, 100, []{ dac_current_set_percents(driverPercent); })
|
||||
EDIT_DAC_PERCENT(X);
|
||||
EDIT_DAC_PERCENT(Y);
|
||||
EDIT_DAC_PERCENT(Z);
|
||||
@ -114,22 +114,10 @@ void menu_cancelobject();
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
|
||||
#elif EXTRUDERS > 1
|
||||
#define EDIT_ADVANCE_K(N) EDIT_ITEM(float52, MSG_ADVANCE_K_E##N, &planner.extruder_advance_K[N], 0, 999)
|
||||
EDIT_ADVANCE_K(0);
|
||||
EDIT_ADVANCE_K(1);
|
||||
#if EXTRUDERS > 2
|
||||
EDIT_ADVANCE_K(2);
|
||||
#if EXTRUDERS > 3
|
||||
EDIT_ADVANCE_K(3);
|
||||
#if EXTRUDERS > 4
|
||||
EDIT_ADVANCE_K(4);
|
||||
#if EXTRUDERS > 5
|
||||
EDIT_ADVANCE_K(5);
|
||||
#endif // EXTRUDERS > 5
|
||||
#endif // EXTRUDERS > 4
|
||||
#endif // EXTRUDERS > 3
|
||||
#endif // EXTRUDERS > 2
|
||||
#endif // EXTRUDERS > 1
|
||||
#define EDIT_ADVANCE_K(N) EDIT_ITEM_N(float52, N, MSG_ADVANCE_K_E, &planner.extruder_advance_K[N], 0, 999)
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++)
|
||||
EDIT_ADVANCE_K(n);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if DISABLED(NO_VOLUMETRICS)
|
||||
@ -138,24 +126,11 @@ void menu_cancelobject();
|
||||
if (parser.volumetric_enabled) {
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
|
||||
#else // EXTRUDERS > 1
|
||||
#define EDIT_FIL_DIAM(N) EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM_E##N, &planner.filament_size[N], 1.5f, 3.25f, planner.calculate_volumetric_multipliers)
|
||||
#elif EXTRUDERS > 1
|
||||
#define EDIT_FIL_DIAM(N) EDIT_ITEM_FAST_N(float43, N, MSG_FILAMENT_DIAM_E, &planner.filament_size[N], 1.5f, 3.25f, planner.calculate_volumetric_multipliers)
|
||||
EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
|
||||
EDIT_FIL_DIAM(0);
|
||||
EDIT_FIL_DIAM(1);
|
||||
#if EXTRUDERS > 2
|
||||
EDIT_FIL_DIAM(2);
|
||||
#if EXTRUDERS > 3
|
||||
EDIT_FIL_DIAM(3);
|
||||
#if EXTRUDERS > 4
|
||||
EDIT_FIL_DIAM(4);
|
||||
#if EXTRUDERS > 5
|
||||
EDIT_FIL_DIAM(5);
|
||||
#endif // EXTRUDERS > 5
|
||||
#endif // EXTRUDERS > 4
|
||||
#endif // EXTRUDERS > 3
|
||||
#endif // EXTRUDERS > 2
|
||||
#endif // EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_DIAM(n);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -171,44 +146,18 @@ void menu_cancelobject();
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength);
|
||||
#elif EXTRUDERS > 1
|
||||
#define EDIT_FIL_UNLOAD(N) EDIT_ITEM_FAST(float3, MSG_FILAMENTUNLOAD_E##N, &fc_settings[N].unload_length, 0, extrude_maxlength)
|
||||
#define EDIT_FIL_UNLOAD(N) EDIT_ITEM_FAST_N(float3, N, MSG_FILAMENTUNLOAD_E, &fc_settings[N].unload_length, 0, extrude_maxlength)
|
||||
EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);
|
||||
EDIT_FIL_UNLOAD(0);
|
||||
EDIT_FIL_UNLOAD(1);
|
||||
#if EXTRUDERS > 2
|
||||
EDIT_FIL_UNLOAD(2);
|
||||
#if EXTRUDERS > 3
|
||||
EDIT_FIL_UNLOAD(3);
|
||||
#if EXTRUDERS > 4
|
||||
EDIT_FIL_UNLOAD(4);
|
||||
#if EXTRUDERS > 5
|
||||
EDIT_FIL_UNLOAD(5);
|
||||
#endif // EXTRUDERS > 5
|
||||
#endif // EXTRUDERS > 4
|
||||
#endif // EXTRUDERS > 3
|
||||
#endif // EXTRUDERS > 2
|
||||
#endif // EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_UNLOAD(n);
|
||||
#endif
|
||||
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength);
|
||||
#elif EXTRUDERS > 1
|
||||
#define EDIT_FIL_LOAD(N) EDIT_ITEM_FAST(float3, MSG_FILAMENTLOAD_E##N, &fc_settings[N].load_length, 0, extrude_maxlength)
|
||||
#define EDIT_FIL_LOAD(N) EDIT_ITEM_FAST_N(float3, N, MSG_FILAMENTLOAD_E, &fc_settings[N].load_length, 0, extrude_maxlength)
|
||||
EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength);
|
||||
EDIT_FIL_LOAD(0);
|
||||
EDIT_FIL_LOAD(1);
|
||||
#if EXTRUDERS > 2
|
||||
EDIT_FIL_LOAD(2);
|
||||
#if EXTRUDERS > 3
|
||||
EDIT_FIL_LOAD(3);
|
||||
#if EXTRUDERS > 4
|
||||
EDIT_FIL_LOAD(4);
|
||||
#if EXTRUDERS > 5
|
||||
EDIT_FIL_LOAD(5);
|
||||
#endif // EXTRUDERS > 5
|
||||
#endif // EXTRUDERS > 4
|
||||
#endif // EXTRUDERS > 3
|
||||
#endif // EXTRUDERS > 2
|
||||
#endif // EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_LOAD(n);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM
|
||||
@ -339,26 +288,18 @@ void menu_cancelobject();
|
||||
// PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5
|
||||
//
|
||||
|
||||
#if EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
|
||||
#if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
#define PID_LABEL(MSG,N) MSG##_E##N
|
||||
#else
|
||||
#define PID_LABEL(MSG,N) MSG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_EDIT_MENU)
|
||||
#define _PID_BASE_MENU_ITEMS(N) \
|
||||
raw_Ki = unscalePID_i(PID_PARAM(Ki, N)); \
|
||||
raw_Kd = unscalePID_d(PID_PARAM(Kd, N)); \
|
||||
EDIT_ITEM(float52sign, PID_LABEL(MSG_PID_P,N), &PID_PARAM(Kp, N), 1, 9990); \
|
||||
EDIT_ITEM(float52sign, PID_LABEL(MSG_PID_I,N), &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM(float52sign, PID_LABEL(MSG_PID_D,N), &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
EDIT_ITEM_N(float52sign, N, MSG_PID_P_E, &PID_PARAM(Kp, N), 1, 9990); \
|
||||
EDIT_ITEM_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM_N(float52sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
#define _PID_EDIT_MENU_ITEMS(N) \
|
||||
_PID_BASE_MENU_ITEMS(N); \
|
||||
EDIT_ITEM(float3, PID_LABEL(MSG_PID_C,N), &PID_PARAM(Kc, N), 1, 9990)
|
||||
EDIT_ITEM(float3, MSG_PID_C_E, N, &PID_PARAM(Kc, N), 1, 9990)
|
||||
#else
|
||||
#define _PID_EDIT_MENU_ITEMS(N) _PID_BASE_MENU_ITEMS(N)
|
||||
#endif
|
||||
@ -372,7 +313,7 @@ void menu_cancelobject();
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define PID_EDIT_MENU_ITEMS(N) \
|
||||
_PID_EDIT_MENU_ITEMS(N); \
|
||||
EDIT_ITEM_FAST(int3, PID_LABEL(MSG_AUTOTUNE_PID,N), &autotune_temp[N], 150, heater_maxtemp[N] - 15, []{ _lcd_autotune(N); })
|
||||
EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, heater_maxtemp[N] - 15, []{ _lcd_autotune(MenuItemBase::itemIndex); })
|
||||
#else
|
||||
#define PID_EDIT_MENU_ITEMS(N) _PID_EDIT_MENU_ITEMS(N)
|
||||
#endif
|
||||
@ -437,22 +378,9 @@ void menu_cancelobject();
|
||||
EDIT_VMAX(C);
|
||||
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
#define EDIT_VMAX_E(N) EDIT_ITEM_FAST(float3, MSG_VMAX_E##N, &planner.settings.max_feedrate_mm_s[E_AXIS_N(N)], 1, max_fr_edit_scaled.e)
|
||||
#define EDIT_VMAX_E(N) EDIT_ITEM_FAST_N(float3, N, MSG_VMAX_EN, &planner.settings.max_feedrate_mm_s[E_AXIS_N(N)], 1, max_fr_edit_scaled.e)
|
||||
EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e);
|
||||
EDIT_VMAX_E(0);
|
||||
EDIT_VMAX_E(1);
|
||||
#if E_STEPPERS > 2
|
||||
EDIT_VMAX_E(2);
|
||||
#if E_STEPPERS > 3
|
||||
EDIT_VMAX_E(3);
|
||||
#if E_STEPPERS > 4
|
||||
EDIT_VMAX_E(4);
|
||||
#if E_STEPPERS > 5
|
||||
EDIT_VMAX_E(5);
|
||||
#endif // E_STEPPERS > 5
|
||||
#endif // E_STEPPERS > 4
|
||||
#endif // E_STEPPERS > 3
|
||||
#endif // E_STEPPERS > 2
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_VMAX_E(n);
|
||||
#elif E_STEPPERS
|
||||
EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, max_fr_edit_scaled.e);
|
||||
#endif
|
||||
@ -504,22 +432,9 @@ void menu_cancelobject();
|
||||
EDIT_AMAX(C, 10);
|
||||
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
#define EDIT_AMAX_E(N) EDIT_ITEM_FAST(long5_25, MSG_AMAX_E##N, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(N)], 100, max_accel_edit_scaled.e, []{ _reset_e_acceleration_rate(N); })
|
||||
#define EDIT_AMAX_E(N) 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, []{ _reset_e_acceleration_rate(MenuItemBase::itemIndex); })
|
||||
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_AMAX_E(0);
|
||||
EDIT_AMAX_E(1);
|
||||
#if E_STEPPERS > 2
|
||||
EDIT_AMAX_E(2);
|
||||
#if E_STEPPERS > 3
|
||||
EDIT_AMAX_E(3);
|
||||
#if E_STEPPERS > 4
|
||||
EDIT_AMAX_E(4);
|
||||
#if E_STEPPERS > 5
|
||||
EDIT_AMAX_E(5);
|
||||
#endif // E_STEPPERS > 5
|
||||
#endif // E_STEPPERS > 4
|
||||
#endif // E_STEPPERS > 3
|
||||
#endif // E_STEPPERS > 2
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_AMAX_E(n);
|
||||
#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(); });
|
||||
#endif
|
||||
@ -576,22 +491,9 @@ void menu_cancelobject();
|
||||
EDIT_QSTEPS(C);
|
||||
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
#define EDIT_ESTEPS(N) EDIT_ITEM_FAST(float51, MSG_E##N##_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(N)], 5, 9999, []{ _planner_refresh_e_positioning(N); })
|
||||
#define EDIT_ESTEPS(N) EDIT_ITEM_FAST_N(float51, N, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(N)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); })
|
||||
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, []{ planner.refresh_positioning(); });
|
||||
EDIT_ESTEPS(0);
|
||||
EDIT_ESTEPS(1);
|
||||
#if E_STEPPERS > 2
|
||||
EDIT_ESTEPS(2);
|
||||
#if E_STEPPERS > 3
|
||||
EDIT_ESTEPS(3);
|
||||
#if E_STEPPERS > 4
|
||||
EDIT_ESTEPS(4);
|
||||
#if E_STEPPERS > 5
|
||||
EDIT_ESTEPS(5);
|
||||
#endif // E_STEPPERS > 5
|
||||
#endif // E_STEPPERS > 4
|
||||
#endif // E_STEPPERS > 3
|
||||
#endif // E_STEPPERS > 2
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_ESTEPS(n);
|
||||
#elif E_STEPPERS
|
||||
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
|
||||
#endif
|
||||
@ -661,22 +563,9 @@ void menu_advanced_settings() {
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
|
||||
#elif EXTRUDERS > 1
|
||||
#define EDIT_ADVANCE_K(N) EDIT_ITEM(float52, MSG_ADVANCE_K_E##N, &planner.extruder_advance_K[N], 0, 999)
|
||||
EDIT_ADVANCE_K(0);
|
||||
EDIT_ADVANCE_K(1);
|
||||
#if EXTRUDERS > 2
|
||||
EDIT_ADVANCE_K(2);
|
||||
#if EXTRUDERS > 3
|
||||
EDIT_ADVANCE_K(3);
|
||||
#if EXTRUDERS > 4
|
||||
EDIT_ADVANCE_K(4);
|
||||
#if EXTRUDERS > 5
|
||||
EDIT_ADVANCE_K(5);
|
||||
#endif // EXTRUDERS > 5
|
||||
#endif // EXTRUDERS > 4
|
||||
#endif // EXTRUDERS > 3
|
||||
#endif // EXTRUDERS > 2
|
||||
#endif // EXTRUDERS > 1
|
||||
#define EDIT_ADVANCE_K(N) EDIT_ITEM_N(float52, N, MSG_ADVANCE_K_E, &planner.extruder_advance_K[N], 0, 999)
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_ADVANCE_K(n);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// M540 S - Abort on endstop hit when SD printing
|
||||
|
@ -132,7 +132,7 @@
|
||||
//
|
||||
if (ui.should_draw()) {
|
||||
const float v = current_position.z;
|
||||
MenuEditItemBase::edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+'));
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
if (ui.should_draw()) {
|
||||
char msg[10];
|
||||
sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points);
|
||||
MenuEditItemBase::edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg);
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg);
|
||||
}
|
||||
ui.refresh(LCDVIEW_CALL_NO_REDRAW);
|
||||
if (!ui.wait_for_bl_move) ui.goto_screen(_lcd_level_bed_get_z);
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "../../feature/cancel_object.h"
|
||||
|
||||
static void lcd_cancel_object_confirm() {
|
||||
const int8_t v = editable.int8;
|
||||
const int8_t v = MenuItemBase::itemIndex;
|
||||
const char item_num[] = {
|
||||
' ',
|
||||
char((v > 9) ? '0' + (v / 10) : ' '),
|
||||
@ -43,7 +43,7 @@ static void lcd_cancel_object_confirm() {
|
||||
};
|
||||
MenuItem_confirm::confirm_screen(
|
||||
[]{
|
||||
cancelable.cancel_object(editable.int8 - 1);
|
||||
cancelable.cancel_object(MenuItemBase::itemIndex - 1);
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback();
|
||||
#endif
|
||||
@ -63,13 +63,8 @@ void menu_cancelobject() {
|
||||
for (int8_t i = -1; i < cancelable.object_count; i++) {
|
||||
if (i == a) continue;
|
||||
int8_t j = i < 0 ? a : i;
|
||||
if (!cancelable.is_canceled(j)) {
|
||||
editable.int8 = j + 1;
|
||||
SUBMENU(MSG_CANCEL_OBJECT, lcd_cancel_object_confirm);
|
||||
MENU_ITEM_ADDON_START(LCD_WIDTH - 2 - (j >= 9));
|
||||
lcd_put_int(editable.int8);
|
||||
MENU_ITEM_ADDON_END();
|
||||
}
|
||||
if (!cancelable.is_canceled(j))
|
||||
SUBMENU_N(j, MSG_CANCEL_OBJECT_N, lcd_cancel_object_confirm);
|
||||
if (i < 0) SKIP_ITEM();
|
||||
}
|
||||
|
||||
|
@ -107,155 +107,86 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
||||
|
||||
// Change filament
|
||||
#if E_STEPPERS == 1
|
||||
PGM_P const msg0 = GET_TEXT(MSG_FILAMENTCHANGE);
|
||||
PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE);
|
||||
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
||||
SUBMENU_P(msg0, []{ _menu_temp_filament_op(PauseMode(editable.int8), 0); });
|
||||
SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
|
||||
else
|
||||
GCODES_ITEM_P(msg0, PSTR("M600 B0"));
|
||||
GCODES_ITEM_P(msg, PSTR("M600 B0"));
|
||||
#else
|
||||
PGM_P const msg0 = GET_TEXT(MSG_FILAMENTCHANGE_E0);
|
||||
PGM_P const msg1 = GET_TEXT(MSG_FILAMENTCHANGE_E1);
|
||||
if (thermalManager.targetTooColdToExtrude(0))
|
||||
SUBMENU_P(msg0, []{ _menu_temp_filament_op(PauseMode(editable.int8), 0); });
|
||||
else
|
||||
GCODES_ITEM_P(msg0, PSTR("M600 B0 T0"));
|
||||
if (thermalManager.targetTooColdToExtrude(1))
|
||||
SUBMENU_P(msg1, []{ _menu_temp_filament_op(PauseMode(editable.int8), 1); });
|
||||
else
|
||||
GCODES_ITEM_P(msg1, PSTR("M600 B0 T1"));
|
||||
#if E_STEPPERS > 2
|
||||
PGM_P const msg2 = GET_TEXT(MSG_FILAMENTCHANGE_E2);
|
||||
if (thermalManager.targetTooColdToExtrude(2))
|
||||
SUBMENU_P(msg2, []{ _menu_temp_filament_op(PauseMode(editable.int8), 2); });
|
||||
else
|
||||
GCODES_ITEM_P(msg2, PSTR("M600 B0 T2"));
|
||||
#if E_STEPPERS > 3
|
||||
PGM_P const msg3 = GET_TEXT(MSG_FILAMENTCHANGE_E3);
|
||||
if (thermalManager.targetTooColdToExtrude(3))
|
||||
SUBMENU_P(msg3, []{ _menu_temp_filament_op(PauseMode(editable.int8), 3); });
|
||||
else
|
||||
GCODES_ITEM_P(msg3, PSTR("M600 B0 T3"));
|
||||
#if E_STEPPERS > 4
|
||||
PGM_P const msg4 = GET_TEXT(MSG_FILAMENTCHANGE_E4);
|
||||
if (thermalManager.targetTooColdToExtrude(4))
|
||||
SUBMENU_P(msg4, []{ _menu_temp_filament_op(PauseMode(editable.int8), 4); });
|
||||
else
|
||||
GCODES_ITEM_P(msg4, PSTR("M600 B0 T4"));
|
||||
#if E_STEPPERS > 5
|
||||
PGM_P const msg5 = GET_TEXT(MSG_FILAMENTCHANGE_E5);
|
||||
if (thermalManager.targetTooColdToExtrude(5))
|
||||
SUBMENU_P(msg5, []{ _menu_temp_filament_op(PauseMode(editable.int8), 5); });
|
||||
else
|
||||
GCODES_ITEM_P(msg5, PSTR("M600 B0 T5"));
|
||||
#endif // E_STEPPERS > 5
|
||||
#endif // E_STEPPERS > 4
|
||||
#endif // E_STEPPERS > 3
|
||||
#endif // E_STEPPERS > 2
|
||||
#endif // E_STEPPERS == 1
|
||||
PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E);
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
ACTION_ITEM_N_P(s, msg, []{
|
||||
char cmd[12];
|
||||
sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex));
|
||||
lcd_enqueue_one_now(cmd);
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
if (!printer_busy()) {
|
||||
// Load filament
|
||||
#if E_STEPPERS == 1
|
||||
PGM_P const msg0 = GET_TEXT(MSG_FILAMENTLOAD);
|
||||
PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD);
|
||||
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
||||
SUBMENU_P(msg0, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
|
||||
SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
|
||||
else
|
||||
GCODES_ITEM_P(msg0, PSTR("M701"));
|
||||
GCODES_ITEM_P(msg_load, PSTR("M701"));
|
||||
#else
|
||||
PGM_P const msg0 = GET_TEXT(MSG_FILAMENTLOAD_E0);
|
||||
PGM_P const msg1 = GET_TEXT(MSG_FILAMENTLOAD_E1);
|
||||
if (thermalManager.targetTooColdToExtrude(0))
|
||||
SUBMENU_P(msg0, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); });
|
||||
else
|
||||
GCODES_ITEM_P(msg0, PSTR("M701 T0"));
|
||||
if (thermalManager.targetTooColdToExtrude(1))
|
||||
SUBMENU_P(msg1, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 1); });
|
||||
else
|
||||
GCODES_ITEM_P(msg1, PSTR("M701 T1"));
|
||||
#if E_STEPPERS > 2
|
||||
PGM_P const msg2 = GET_TEXT(MSG_FILAMENTLOAD_E2);
|
||||
if (thermalManager.targetTooColdToExtrude(2))
|
||||
SUBMENU_P(msg2, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 2); });
|
||||
else
|
||||
GCODES_ITEM_P(msg2, PSTR("M701 T2"));
|
||||
#if E_STEPPERS > 3
|
||||
PGM_P const msg3 = GET_TEXT(MSG_FILAMENTLOAD_E3);
|
||||
if (thermalManager.targetTooColdToExtrude(3))
|
||||
SUBMENU_P(msg3, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 3); });
|
||||
else
|
||||
GCODES_ITEM_P(msg3, PSTR("M701 T3"));
|
||||
#if E_STEPPERS > 4
|
||||
PGM_P const msg4 = GET_TEXT(MSG_FILAMENTLOAD_E4);
|
||||
if (thermalManager.targetTooColdToExtrude(4))
|
||||
SUBMENU_P(msg4, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 4); });
|
||||
else
|
||||
GCODES_ITEM_P(msg4, PSTR("M701 T4"));
|
||||
#if E_STEPPERS > 5
|
||||
PGM_P const msg5 = GET_TEXT(MSG_FILAMENTLOAD_E5);
|
||||
if (thermalManager.targetTooColdToExtrude(5))
|
||||
SUBMENU_P(msg5, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 5); });
|
||||
else
|
||||
GCODES_ITEM_P(msg5, PSTR("M701 T5"));
|
||||
#endif // E_STEPPERS > 5
|
||||
#endif // E_STEPPERS > 4
|
||||
#endif // E_STEPPERS > 3
|
||||
#endif // E_STEPPERS > 2
|
||||
#endif // E_STEPPERS == 1
|
||||
PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E);
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
ACTION_ITEM_N_P(s, msg_load, []{
|
||||
char cmd[12];
|
||||
sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex));
|
||||
lcd_enqueue_one_now(cmd);
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Unload filament
|
||||
#if E_STEPPERS == 1
|
||||
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD, PSTR("M702"));
|
||||
PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD);
|
||||
if (thermalManager.targetTooColdToExtrude(active_extruder))
|
||||
SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
|
||||
GCODES_ITEM_P(msg_unload, PSTR("M702"));
|
||||
#else
|
||||
#if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
|
||||
if (JOIN_N(E_STEPPERS, &&,
|
||||
thermalManager.targetHotEnoughToExtrude(0),
|
||||
thermalManager.targetHotEnoughToExtrude(1),
|
||||
thermalManager.targetHotEnoughToExtrude(2),
|
||||
thermalManager.targetHotEnoughToExtrude(3),
|
||||
thermalManager.targetHotEnoughToExtrude(4),
|
||||
thermalManager.targetHotEnoughToExtrude(5))
|
||||
) GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702"));
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); });
|
||||
#endif
|
||||
if (thermalManager.targetHotEnoughToExtrude(0))
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_E0, PSTR("M702 T0"));
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_E0, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); });
|
||||
if (thermalManager.targetHotEnoughToExtrude(1))
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_E1, PSTR("M702 T1"));
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_E1, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 1); });
|
||||
#if E_STEPPERS > 2
|
||||
if (thermalManager.targetHotEnoughToExtrude(2))
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_E2, PSTR("M702 T2"));
|
||||
{
|
||||
bool too_cold = false;
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
if (thermalManager.targetTooColdToExtrude(s)) {
|
||||
too_cold = true; break;
|
||||
}
|
||||
}
|
||||
if (!too_cold)
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702"));
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_E2, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 2); });
|
||||
#if E_STEPPERS > 3
|
||||
if (thermalManager.targetHotEnoughToExtrude(3))
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_E3, PSTR("M702 T3"));
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_E3, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 3); });
|
||||
#if E_STEPPERS > 4
|
||||
if (thermalManager.targetHotEnoughToExtrude(4))
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_E4, PSTR("M702 T4"));
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_E4, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 4); });
|
||||
#if E_STEPPERS > 5
|
||||
if (thermalManager.targetHotEnoughToExtrude(5))
|
||||
GCODES_ITEM(MSG_FILAMENTUNLOAD_E5, PSTR("M702 T5"));
|
||||
else
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_E5, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 5); });
|
||||
#endif // E_STEPPERS > 5
|
||||
#endif // E_STEPPERS > 4
|
||||
#endif // E_STEPPERS > 3
|
||||
#endif // E_STEPPERS > 2
|
||||
#endif // E_STEPPERS == 1
|
||||
}
|
||||
SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); });
|
||||
}
|
||||
#endif
|
||||
PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E);
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
ACTION_ITEM_N_P(s, msg_unload, []{
|
||||
char cmd[12];
|
||||
sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex));
|
||||
lcd_enqueue_one_now(cmd);
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} // !printer_busy
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
|
@ -34,7 +34,7 @@
|
||||
void lcd_sd_updir() {
|
||||
ui.encoderPosition = card.cdup() ? ENCODER_STEPS_PER_MENU_ITEM : 0;
|
||||
encoderTopLine = 0;
|
||||
screen_changed = true;
|
||||
ui.screen_changed = true;
|
||||
ui.refresh();
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ void lcd_sd_updir() {
|
||||
// safe_delay(50);
|
||||
// ui.synchronize();
|
||||
// ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
// ui.drawing_screen = screen_changed = true;
|
||||
// ui.drawing_screen = ui.screen_changed = true;
|
||||
//#endif
|
||||
|
||||
goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items);
|
||||
@ -112,7 +112,7 @@ class MenuItem_sdfolder : public MenuItem_sdbase {
|
||||
card.cd(theCard.filename);
|
||||
encoderTopLine = 0;
|
||||
ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM);
|
||||
screen_changed = true;
|
||||
ui.screen_changed = true;
|
||||
#if HAS_GRAPHICAL_LCD
|
||||
ui.drawing_screen = false;
|
||||
#endif
|
||||
|
@ -156,34 +156,9 @@ void _lcd_mixer_select_vtool() {
|
||||
|
||||
void lcd_mixer_mix_edit() {
|
||||
|
||||
#if CHANNEL_MIX_EDITING
|
||||
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MIXER);
|
||||
|
||||
#define EDIT_COLOR(N) EDIT_ITEM_FAST(float52, MSG_MIX_COMPONENT_##N, &mixer.collector[N-1], 0, 10);
|
||||
|
||||
EDIT_COLOR(1);
|
||||
EDIT_COLOR(2);
|
||||
#if MIXING_STEPPERS > 2
|
||||
EDIT_COLOR(3);
|
||||
#if MIXING_STEPPERS > 3
|
||||
EDIT_COLOR(4);
|
||||
#if MIXING_STEPPERS > 4
|
||||
EDIT_COLOR(5);
|
||||
#if MIXING_STEPPERS > 5
|
||||
EDIT_COLOR(6);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ACTION_ITEM(MSG_CYCLE_MIX, _lcd_mixer_cycle_mix);
|
||||
ACTION_ITEM(MSG_COMMIT_VTOOL, _lcd_mixer_commit_vtool);
|
||||
END_MENU();
|
||||
|
||||
#elif DUAL_MIXING_EXTRUDER
|
||||
#if DUAL_MIXING_EXTRUDER && !CHANNEL_MIX_EDITING
|
||||
|
||||
// Adjust 2-channel mix from the encoder
|
||||
if (ui.encoderPosition != 0) {
|
||||
mixer.mix[0] += int32_t(ui.encoderPosition);
|
||||
ui.encoderPosition = 0;
|
||||
@ -193,6 +168,7 @@ void lcd_mixer_mix_edit() {
|
||||
}
|
||||
_lcd_draw_mix((LCD_HEIGHT - 1) / 2);
|
||||
|
||||
// Click to commit the change
|
||||
if (ui.lcd_clicked) {
|
||||
mixer.update_vtool_from_mix();
|
||||
ui.goto_previous_screen();
|
||||
@ -202,6 +178,17 @@ void lcd_mixer_mix_edit() {
|
||||
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MIXER);
|
||||
|
||||
#if CHANNEL_MIX_EDITING
|
||||
|
||||
for (uint8_t n = 1; n <= MIXING_STEPPERS; n++)
|
||||
EDIT_ITEM_FAST_N(float52, n, MSG_MIX_COMPONENT_N, &mixer.collector[n-1], 0, 10);
|
||||
|
||||
ACTION_ITEM(MSG_CYCLE_MIX, _lcd_mixer_cycle_mix);
|
||||
ACTION_ITEM(MSG_COMMIT_VTOOL, _lcd_mixer_commit_vtool);
|
||||
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
|
||||
#endif
|
||||
|
@ -74,7 +74,7 @@ inline void manual_move_to_current(AxisEnum axis
|
||||
// "Motion" > "Move Axis" submenu
|
||||
//
|
||||
|
||||
static void _lcd_move_xyz(PGM_P name, AxisEnum axis) {
|
||||
static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) {
|
||||
if (ui.use_click()) return ui.goto_previous_screen_no_defer();
|
||||
if (ui.encoderPosition && !ui.processing_manual_move) {
|
||||
|
||||
@ -147,7 +147,7 @@ static void _lcd_move_xyz(PGM_P name, AxisEnum axis) {
|
||||
+ manual_move_offset
|
||||
#endif
|
||||
, axis);
|
||||
MenuEditItemBase::edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos));
|
||||
MenuEditItemBase::draw_edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos));
|
||||
}
|
||||
}
|
||||
void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
|
||||
@ -180,35 +180,27 @@ void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
|
||||
ui.encoderPosition = 0;
|
||||
}
|
||||
if (ui.should_draw()) {
|
||||
PGM_P pos_label = GET_TEXT(MSG_MOVE_E);
|
||||
#if E_MANUAL > 1
|
||||
switch (eindex) {
|
||||
default: pos_label = GET_TEXT(MSG_MOVE_E0); break;
|
||||
case 1: pos_label = GET_TEXT(MSG_MOVE_E1); break;
|
||||
#if E_MANUAL > 2
|
||||
case 2: pos_label = GET_TEXT(MSG_MOVE_E2); break;
|
||||
#if E_MANUAL > 3
|
||||
case 3: pos_label = GET_TEXT(MSG_MOVE_E3); break;
|
||||
#if E_MANUAL > 4
|
||||
case 4: pos_label = GET_TEXT(MSG_MOVE_E4); break;
|
||||
#if E_MANUAL > 5
|
||||
case 5: pos_label = GET_TEXT(MSG_MOVE_E5); break;
|
||||
#endif // E_MANUAL > 5
|
||||
#endif // E_MANUAL > 4
|
||||
#endif // E_MANUAL > 3
|
||||
#endif // E_MANUAL > 2
|
||||
}
|
||||
#endif // E_MANUAL > 1
|
||||
|
||||
MenuEditItemBase::edit_screen(pos_label, ftostr41sign(current_position.e
|
||||
#if IS_KINEMATIC
|
||||
+ manual_move_offset
|
||||
#endif
|
||||
#if ENABLED(MANUAL_E_MOVES_RELATIVE)
|
||||
- manual_move_e_origin
|
||||
#endif
|
||||
));
|
||||
}
|
||||
MenuItemBase::init(eindex);
|
||||
#endif
|
||||
MenuEditItemBase::draw_edit_screen(
|
||||
GET_TEXT(
|
||||
#if E_MANUAL > 1
|
||||
MSG_MOVE_EN
|
||||
#else
|
||||
MSG_MOVE_E
|
||||
#endif
|
||||
),
|
||||
ftostr41sign(current_position.e
|
||||
#if IS_KINEMATIC
|
||||
+ manual_move_offset
|
||||
#endif
|
||||
#if ENABLED(MANUAL_E_MOVES_RELATIVE)
|
||||
- manual_move_e_origin
|
||||
#endif
|
||||
)
|
||||
);
|
||||
} // should_draw
|
||||
}
|
||||
|
||||
#endif // E_MANUAL
|
||||
@ -310,35 +302,35 @@ void menu_move() {
|
||||
|
||||
#if EXTRUDERS >= 4
|
||||
switch (active_extruder) {
|
||||
case 0: GCODES_ITEM(MSG_SELECT_E1, PSTR("T1")); break;
|
||||
case 1: GCODES_ITEM(MSG_SELECT_E0, PSTR("T0")); break;
|
||||
case 2: GCODES_ITEM(MSG_SELECT_E3, PSTR("T3")); break;
|
||||
case 3: GCODES_ITEM(MSG_SELECT_E2, PSTR("T2")); break;
|
||||
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;
|
||||
#if EXTRUDERS == 6
|
||||
case 4: GCODES_ITEM(MSG_SELECT_E5, PSTR("T5")); break;
|
||||
case 5: GCODES_ITEM(MSG_SELECT_E4, PSTR("T4")); break;
|
||||
case 4: GCODES_ITEM_N(5, MSG_SELECT_E, PSTR("T5")); break;
|
||||
case 5: GCODES_ITEM_N(4, MSG_SELECT_E, PSTR("T4")); break;
|
||||
#endif
|
||||
}
|
||||
#elif EXTRUDERS == 3
|
||||
if (active_extruder < 2) {
|
||||
if (active_extruder)
|
||||
GCODES_ITEM(MSG_SELECT_E0, PSTR("T0"));
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
|
||||
else
|
||||
GCODES_ITEM(MSG_SELECT_E1, PSTR("T1"));
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
|
||||
}
|
||||
#else
|
||||
if (active_extruder)
|
||||
GCODES_ITEM(MSG_SELECT_E0, PSTR("T0"));
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
|
||||
else
|
||||
GCODES_ITEM(MSG_SELECT_E1, PSTR("T1"));
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
|
||||
#endif
|
||||
|
||||
#elif ENABLED(DUAL_X_CARRIAGE)
|
||||
|
||||
if (active_extruder)
|
||||
GCODES_ITEM(MSG_SELECT_E0, PSTR("T0"));
|
||||
GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0"));
|
||||
else
|
||||
GCODES_ITEM(MSG_SELECT_E1, PSTR("T1"));
|
||||
GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1"));
|
||||
|
||||
#endif
|
||||
|
||||
@ -347,7 +339,7 @@ void menu_move() {
|
||||
// The current extruder
|
||||
SUBMENU(MSG_MOVE_E, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(); }, -1); });
|
||||
|
||||
#define SUBMENU_MOVE_E(N) SUBMENU(MSG_MOVE_E##N, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(N); }, N); });
|
||||
#define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(MenuItemBase::itemIndex); }, MenuItemBase::itemIndex); });
|
||||
|
||||
#if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
|
||||
|
||||
@ -358,25 +350,10 @@ void menu_move() {
|
||||
SUBMENU_MOVE_E(2);
|
||||
#endif
|
||||
|
||||
#else
|
||||
#elif E_MANUAL > 1
|
||||
|
||||
// Independent extruders with one E-stepper per hotend
|
||||
#if E_MANUAL > 1
|
||||
SUBMENU_MOVE_E(0);
|
||||
SUBMENU_MOVE_E(1);
|
||||
#if E_MANUAL > 2
|
||||
SUBMENU_MOVE_E(2);
|
||||
#if E_MANUAL > 3
|
||||
SUBMENU_MOVE_E(3);
|
||||
#if E_MANUAL > 4
|
||||
SUBMENU_MOVE_E(4);
|
||||
#if E_MANUAL > 5
|
||||
SUBMENU_MOVE_E(5);
|
||||
#endif // E_MANUAL > 5
|
||||
#endif // E_MANUAL > 4
|
||||
#endif // E_MANUAL > 3
|
||||
#endif // E_MANUAL > 2
|
||||
#endif // E_MANUAL > 1
|
||||
for (uint8_t n = 0; n < E_MANUAL; n++) SUBMENU_MOVE_E(n);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -87,14 +87,14 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
|
||||
#if HAS_TEMP_HOTEND || HAS_HEATED_BED
|
||||
|
||||
#define _PREHEAT_ITEMS(M,N) do{ \
|
||||
ACTION_ITEM(MSG_PREHEAT_##M##_H##N, []{ _preheat_both(M-1, N); }); \
|
||||
ACTION_ITEM(MSG_PREHEAT_##M##_END_E##N, []{ _preheat_end(M-1, N); }); \
|
||||
ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_both(M-1, MenuItemBase::itemIndex); }); \
|
||||
ACTION_ITEM_N(N, MSG_PREHEAT_##M##_END_E, []{ _preheat_end(M-1, MenuItemBase::itemIndex); }); \
|
||||
}while(0)
|
||||
#if HAS_HEATED_BED
|
||||
#define PREHEAT_ITEMS(M,N) _PREHEAT_ITEMS(M,N)
|
||||
#else
|
||||
#define PREHEAT_ITEMS(M,N) \
|
||||
ACTION_ITEM(MSG_PREHEAT_##M##_H##N, []{ _preheat_end(M-1, N); })
|
||||
ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_end(M-1, MenuItemBase::itemIndex); })
|
||||
#endif
|
||||
|
||||
void menu_preheat_m1() {
|
||||
@ -111,19 +111,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
|
||||
#if HAS_HEATED_BED
|
||||
_PREHEAT_ITEMS(1,0);
|
||||
#endif
|
||||
PREHEAT_ITEMS(1,1);
|
||||
#if HOTENDS > 2
|
||||
PREHEAT_ITEMS(1,2);
|
||||
#if HOTENDS > 3
|
||||
PREHEAT_ITEMS(1,3);
|
||||
#if HOTENDS > 4
|
||||
PREHEAT_ITEMS(1,4);
|
||||
#if HOTENDS > 5
|
||||
PREHEAT_ITEMS(1,5);
|
||||
#endif // HOTENDS > 5
|
||||
#endif // HOTENDS > 4
|
||||
#endif // HOTENDS > 3
|
||||
#endif // HOTENDS > 2
|
||||
for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(1,n);
|
||||
ACTION_ITEM(MSG_PREHEAT_1_ALL, []() {
|
||||
#if HAS_HEATED_BED
|
||||
_preheat_bed(0);
|
||||
@ -151,19 +139,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
|
||||
#if HAS_HEATED_BED
|
||||
_PREHEAT_ITEMS(2,0);
|
||||
#endif
|
||||
PREHEAT_ITEMS(2,1);
|
||||
#if HOTENDS > 2
|
||||
PREHEAT_ITEMS(2,2);
|
||||
#if HOTENDS > 3
|
||||
PREHEAT_ITEMS(2,3);
|
||||
#if HOTENDS > 4
|
||||
PREHEAT_ITEMS(2,4);
|
||||
#if HOTENDS > 5
|
||||
PREHEAT_ITEMS(2,5);
|
||||
#endif // HOTENDS > 5
|
||||
#endif // HOTENDS > 4
|
||||
#endif // HOTENDS > 3
|
||||
#endif // HOTENDS > 2
|
||||
for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(2,n);
|
||||
ACTION_ITEM(MSG_PREHEAT_2_ALL, []() {
|
||||
#if HAS_HEATED_BED
|
||||
_preheat_bed(1);
|
||||
@ -196,22 +172,9 @@ void menu_temperature() {
|
||||
#if HOTENDS == 1
|
||||
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(0); });
|
||||
#elif HOTENDS > 1
|
||||
#define EDIT_TARGET(N) EDIT_ITEM_FAST(int3, MSG_NOZZLE_##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(N); })
|
||||
EDIT_TARGET(0);
|
||||
EDIT_TARGET(1);
|
||||
#if HOTENDS > 2
|
||||
EDIT_TARGET(2);
|
||||
#if HOTENDS > 3
|
||||
EDIT_TARGET(3);
|
||||
#if HOTENDS > 4
|
||||
EDIT_TARGET(4);
|
||||
#if HOTENDS > 5
|
||||
EDIT_TARGET(5);
|
||||
#endif // HOTENDS > 5
|
||||
#endif // HOTENDS > 4
|
||||
#endif // HOTENDS > 3
|
||||
#endif // HOTENDS > 2
|
||||
#endif // HOTENDS > 1
|
||||
#define EDIT_TARGET(N) EDIT_ITEM_FAST_N(int3, N, MSG_NOZZLE_N, &thermalManager.temp_hotend[N].target, 0, heater_maxtemp[N] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); })
|
||||
HOTEND_LOOP() EDIT_TARGET(e);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SINGLENOZZLE)
|
||||
EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15);
|
||||
@ -237,23 +200,23 @@ void menu_temperature() {
|
||||
#if FAN_COUNT > 0
|
||||
#if HAS_FAN0
|
||||
editable.uint8 = thermalManager.fan_speed[0];
|
||||
EDIT_ITEM_FAST(percent, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN1
|
||||
editable.uint8 = thermalManager.fan_speed[1];
|
||||
EDIT_ITEM_FAST(percent, MSG_FAN_SPEED_2, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_EXTRA_FAN_SPEED_2, &thermalManager.new_fan_speed[1], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN2
|
||||
editable.uint8 = thermalManager.fan_speed[2];
|
||||
EDIT_ITEM_FAST(percent, MSG_FAN_SPEED_3, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_EXTRA_FAN_SPEED_3, &thermalManager.new_fan_speed[2], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#endif // FAN_COUNT > 0
|
||||
|
@ -65,7 +65,7 @@
|
||||
}
|
||||
if (ui.should_draw()) {
|
||||
const float spm = planner.steps_to_mm[axis];
|
||||
MenuEditItemBase::edit_screen(msg, ftostr54sign(spm * babystep.accum));
|
||||
MenuEditItemBase::draw_edit_screen(msg, ftostr54sign(spm * babystep.accum));
|
||||
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||
const bool in_view = (true
|
||||
#if HAS_GRAPHICAL_LCD
|
||||
@ -128,22 +128,9 @@ void menu_tune() {
|
||||
#if HOTENDS == 1
|
||||
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(0); });
|
||||
#elif HOTENDS > 1
|
||||
#define EDIT_NOZZLE(N) EDIT_ITEM_FAST(int3, MSG_NOZZLE_##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(N); })
|
||||
EDIT_NOZZLE(0);
|
||||
EDIT_NOZZLE(1);
|
||||
#if HOTENDS > 2
|
||||
EDIT_NOZZLE(2);
|
||||
#if HOTENDS > 3
|
||||
EDIT_NOZZLE(3);
|
||||
#if HOTENDS > 4
|
||||
EDIT_NOZZLE(4);
|
||||
#if HOTENDS > 5
|
||||
EDIT_NOZZLE(5);
|
||||
#endif // HOTENDS > 5
|
||||
#endif // HOTENDS > 4
|
||||
#endif // HOTENDS > 3
|
||||
#endif // HOTENDS > 2
|
||||
#endif // HOTENDS > 1
|
||||
#define EDIT_NOZZLE(N) EDIT_ITEM_FAST_N(int3, N, MSG_NOZZLE_N, &thermalManager.temp_hotend[N].target, 0, heater_maxtemp[N] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); })
|
||||
HOTEND_LOOP() EDIT_NOZZLE(e);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SINGLENOZZLE)
|
||||
EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15);
|
||||
@ -162,23 +149,23 @@ void menu_tune() {
|
||||
#if FAN_COUNT > 0
|
||||
#if HAS_FAN0
|
||||
editable.uint8 = thermalManager.fan_speed[0];
|
||||
EDIT_ITEM_FAST(percent, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN1
|
||||
editable.uint8 = thermalManager.fan_speed[1];
|
||||
EDIT_ITEM_FAST(percent, MSG_FAN_SPEED_2, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_EXTRA_FAN_SPEED_2, &thermalManager.new_fan_speed[1], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN2
|
||||
editable.uint8 = thermalManager.fan_speed[2];
|
||||
EDIT_ITEM_FAST(percent, MSG_FAN_SPEED_3, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_EXTRA_FAN_SPEED_3, &thermalManager.new_fan_speed[2], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#endif // FAN_COUNT > 0
|
||||
@ -191,22 +178,9 @@ void menu_tune() {
|
||||
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, []{ planner.refresh_e_factor(0); });
|
||||
#elif EXTRUDERS
|
||||
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); });
|
||||
#define EDIT_FLOW(N) EDIT_ITEM(int3, MSG_FLOW_##N, &planner.flow_percentage[N], 10, 999, []{ planner.refresh_e_factor(N); })
|
||||
EDIT_FLOW(0);
|
||||
EDIT_FLOW(1);
|
||||
#if EXTRUDERS > 2
|
||||
EDIT_FLOW(2);
|
||||
#if EXTRUDERS > 3
|
||||
EDIT_FLOW(3);
|
||||
#if EXTRUDERS > 4
|
||||
EDIT_FLOW(4);
|
||||
#if EXTRUDERS > 5
|
||||
EDIT_FLOW(5);
|
||||
#endif // EXTRUDERS > 5
|
||||
#endif // EXTRUDERS > 4
|
||||
#endif // EXTRUDERS > 3
|
||||
#endif // EXTRUDERS > 2
|
||||
#endif // EXTRUDERS
|
||||
#define EDIT_FLOW(N) EDIT_ITEM_N(int3, N, MSG_FLOW_N, &planner.flow_percentage[N], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); })
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FLOW(n);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Babystep X:
|
||||
|
@ -65,7 +65,7 @@ static void _lcd_mesh_fine_tune(PGM_P msg) {
|
||||
}
|
||||
|
||||
if (ui.should_draw()) {
|
||||
MenuEditItemBase::edit_screen(msg, ftostr43sign(mesh_edit_value));
|
||||
MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(mesh_edit_value));
|
||||
#if ENABLED(MESH_EDIT_GFX_OVERLAY)
|
||||
_lcd_zoffset_overlay_gfx(mesh_edit_value);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user