Minor LCD cleanup, improvement
This commit is contained in:
parent
520c0ab96b
commit
f445bc26e5
9 changed files with 74 additions and 86 deletions
|
@ -826,7 +826,7 @@
|
||||||
static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); }
|
static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); }
|
||||||
|
|
||||||
float unified_bed_leveling::measure_business_card_thickness(float in_height) {
|
float unified_bed_leveling::measure_business_card_thickness(float in_height) {
|
||||||
TERN_(HAS_LCD_MENU, ui.capture());
|
ui.capture();
|
||||||
save_ubl_active_state_and_disable(); // Disable bed level correction for probing
|
save_ubl_active_state_and_disable(); // Disable bed level correction for probing
|
||||||
|
|
||||||
do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
|
do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
|
||||||
|
@ -857,15 +857,13 @@
|
||||||
SERIAL_ECHOLNPGM("mm thick.");
|
SERIAL_ECHOLNPGM("mm thick.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.release();
|
|
||||||
|
|
||||||
restore_ubl_active_state_and_leave();
|
restore_ubl_active_state_and_leave();
|
||||||
|
|
||||||
return thickness;
|
return thickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
|
void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
|
||||||
TERN_(HAS_LCD_MENU, ui.capture());
|
ui.capture();
|
||||||
|
|
||||||
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
|
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
|
||||||
do_blocking_move_to_xy_z(current_position, z_clearance);
|
do_blocking_move_to_xy_z(current_position, z_clearance);
|
||||||
|
@ -893,7 +891,7 @@
|
||||||
do_blocking_move_to_z(z_clearance);
|
do_blocking_move_to_z(z_clearance);
|
||||||
|
|
||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
TERN_(HAS_LCD_MENU, ui.capture());
|
ui.capture();
|
||||||
|
|
||||||
if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing
|
if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing
|
||||||
|
|
||||||
|
@ -907,7 +905,6 @@
|
||||||
if (click_and_hold()) {
|
if (click_and_hold()) {
|
||||||
SERIAL_ECHOLNPGM("\nMesh only partially populated.");
|
SERIAL_ECHOLNPGM("\nMesh only partially populated.");
|
||||||
do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
|
do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
|
||||||
ui.release();
|
|
||||||
return restore_ubl_active_state_and_leave();
|
return restore_ubl_active_state_and_leave();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -958,7 +955,7 @@
|
||||||
save_ubl_active_state_and_disable();
|
save_ubl_active_state_and_disable();
|
||||||
|
|
||||||
LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
|
LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
|
||||||
TERN_(HAS_LCD_MENU, ui.capture()); // Take over control of the LCD encoder
|
ui.capture(); // Take over control of the LCD encoder
|
||||||
|
|
||||||
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance
|
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance
|
||||||
|
|
||||||
|
@ -1016,8 +1013,6 @@
|
||||||
|
|
||||||
} while (lpos.x >= 0 && --g29_repetition_cnt > 0);
|
} while (lpos.x >= 0 && --g29_repetition_cnt > 0);
|
||||||
|
|
||||||
ui.release();
|
|
||||||
|
|
||||||
if (do_ubl_mesh_map) display_map(g29_map_type);
|
if (do_ubl_mesh_map) display_map(g29_map_type);
|
||||||
restore_ubl_active_state_and_leave();
|
restore_ubl_active_state_and_leave();
|
||||||
|
|
||||||
|
@ -1168,6 +1163,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
void unified_bed_leveling::restore_ubl_active_state_and_leave() {
|
void unified_bed_leveling::restore_ubl_active_state_and_leave() {
|
||||||
|
TERN_(HAS_LCD_MENU, ui.release());
|
||||||
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
||||||
if (--ubl_state_recursion_chk) {
|
if (--ubl_state_recursion_chk) {
|
||||||
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
|
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
|
||||||
|
|
|
@ -824,13 +824,9 @@ void MarlinUI::draw_status_screen() {
|
||||||
|
|
||||||
#else // !HAS_DUAL_MIXING
|
#else // !HAS_DUAL_MIXING
|
||||||
|
|
||||||
if (TERN1(LCD_SHOW_E_TOTAL, !printingIsActive())) {
|
const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive() || marlin_state == MF_SD_COMPLETE);
|
||||||
const xy_pos_t lpos = current_position.asLogical();
|
|
||||||
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
|
if (show_e_total) {
|
||||||
lcd_put_wchar(' ');
|
|
||||||
_draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#if ENABLED(LCD_SHOW_E_TOTAL)
|
#if ENABLED(LCD_SHOW_E_TOTAL)
|
||||||
char tmp[20];
|
char tmp[20];
|
||||||
const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
|
const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
|
||||||
|
@ -838,6 +834,12 @@ void MarlinUI::draw_status_screen() {
|
||||||
lcd_put_u8str(tmp);
|
lcd_put_u8str(tmp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const xy_pos_t lpos = current_position.asLogical();
|
||||||
|
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
|
||||||
|
lcd_put_wchar(' ');
|
||||||
|
_draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // !HAS_DUAL_MIXING
|
#endif // !HAS_DUAL_MIXING
|
||||||
|
|
||||||
|
|
|
@ -414,7 +414,7 @@ void MarlinUI::draw_status_screen() {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const bool showxy = TERN1(LCD_SHOW_E_TOTAL, !printingIsActive());
|
const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive() || marlin_state == MF_SD_COMPLETE);
|
||||||
|
|
||||||
// At the first page, generate new display values
|
// At the first page, generate new display values
|
||||||
if (first_page) {
|
if (first_page) {
|
||||||
|
@ -434,16 +434,16 @@ void MarlinUI::draw_status_screen() {
|
||||||
const xyz_pos_t lpos = current_position.asLogical();
|
const xyz_pos_t lpos = current_position.asLogical();
|
||||||
strcpy(zstring, ftostr52sp(lpos.z));
|
strcpy(zstring, ftostr52sp(lpos.z));
|
||||||
|
|
||||||
if (showxy) {
|
if (show_e_total) {
|
||||||
strcpy(xstring, ftostr4sign(lpos.x));
|
|
||||||
strcpy(ystring, ftostr4sign(lpos.y));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#if ENABLED(LCD_SHOW_E_TOTAL)
|
#if ENABLED(LCD_SHOW_E_TOTAL)
|
||||||
const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
|
const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
|
||||||
sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm
|
sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
strcpy(xstring, ftostr4sign(lpos.x));
|
||||||
|
strcpy(ystring, ftostr4sign(lpos.y));
|
||||||
|
}
|
||||||
|
|
||||||
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
||||||
strcpy(wstring, ftostr12ns(filwidth.measured_mm));
|
strcpy(wstring, ftostr12ns(filwidth.measured_mm));
|
||||||
|
@ -772,14 +772,14 @@ void MarlinUI::draw_status_screen() {
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (showxy) {
|
if (show_e_total) {
|
||||||
_draw_axis_value(X_AXIS, xstring, blink);
|
|
||||||
_draw_axis_value(Y_AXIS, ystring, blink);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_draw_axis_value(E_AXIS, xstring, true);
|
_draw_axis_value(E_AXIS, xstring, true);
|
||||||
lcd_put_u8str_P(PSTR(" "));
|
lcd_put_u8str_P(PSTR(" "));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
_draw_axis_value(X_AXIS, xstring, blink);
|
||||||
|
_draw_axis_value(Y_AXIS, ystring, blink);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -318,7 +318,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
|
|
||||||
#endif // ADVANCED_PAUSE_FEATURE
|
#endif // ADVANCED_PAUSE_FEATURE
|
||||||
|
|
||||||
// Set the colors for a menu item based on whether it is selected
|
// Mark a menu item and set font color if selected.
|
||||||
|
// Return 'false' if the item is not on screen.
|
||||||
static bool mark_as_selected(const uint8_t row, const bool sel) {
|
static bool mark_as_selected(const uint8_t row, const bool sel) {
|
||||||
row_y1 = row * (MENU_FONT_HEIGHT) + 1;
|
row_y1 = row * (MENU_FONT_HEIGHT) + 1;
|
||||||
row_y2 = row_y1 + MENU_FONT_HEIGHT - 1;
|
row_y2 = row_y1 + MENU_FONT_HEIGHT - 1;
|
||||||
|
@ -330,15 +331,13 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH);
|
u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH);
|
||||||
u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
|
u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
|
||||||
#else
|
#else
|
||||||
u8g.setColorIndex(1); // black on white
|
u8g.setColorIndex(1); // solid outline
|
||||||
u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, MENU_FONT_HEIGHT - 1);
|
u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, MENU_FONT_HEIGHT - 1);
|
||||||
u8g.setColorIndex(0); // white on black
|
u8g.setColorIndex(0); // inverted text
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if DISABLED(MENU_HOLLOW_FRAME)
|
#if DISABLED(MENU_HOLLOW_FRAME)
|
||||||
else {
|
else u8g.setColorIndex(1); // solid text
|
||||||
u8g.setColorIndex(1); // unmarked text is black on white
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!PAGE_CONTAINS(row_y1, row_y2)) return false;
|
if (!PAGE_CONTAINS(row_y1, row_y2)) return false;
|
||||||
|
@ -352,13 +351,15 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
|
|
||||||
if (mark_as_selected(row, style & SS_INVERT)) {
|
if (mark_as_selected(row, style & SS_INVERT)) {
|
||||||
|
|
||||||
u8g_uint_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
|
pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
|
||||||
|
|
||||||
if ((style & SS_CENTER) && !valstr) {
|
if ((style & SS_CENTER) && !valstr)
|
||||||
int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2;
|
for (int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; pad > 0; --pad) {
|
||||||
while (--pad >= 0) { lcd_put_wchar(' '); n--; }
|
lcd_put_wchar(' ');
|
||||||
|
n -= MENU_FONT_WIDTH;
|
||||||
}
|
}
|
||||||
n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH) * (MENU_FONT_WIDTH);
|
|
||||||
|
n = lcd_put_u8str_ind_P(pstr, itemIndex, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
|
||||||
if (valstr) n -= lcd_put_u8str_max(valstr, n);
|
if (valstr) n -= lcd_put_u8str_max(valstr, n);
|
||||||
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
||||||
}
|
}
|
||||||
|
@ -367,7 +368,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
// Draw a generic menu item
|
// Draw a generic menu item
|
||||||
void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) {
|
void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) {
|
||||||
if (mark_as_selected(row, sel)) {
|
if (mark_as_selected(row, sel)) {
|
||||||
u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2) * (MENU_FONT_WIDTH);
|
pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 1) * (MENU_FONT_WIDTH);
|
||||||
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
||||||
lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
|
lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
|
||||||
lcd_put_wchar(' ');
|
lcd_put_wchar(' ');
|
||||||
|
@ -380,7 +381,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)),
|
const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)),
|
||||||
pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), data) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)data));
|
pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), data) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)data));
|
||||||
|
|
||||||
u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH);
|
pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH);
|
||||||
if (vallen) {
|
if (vallen) {
|
||||||
lcd_put_wchar(':');
|
lcd_put_wchar(':');
|
||||||
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
||||||
|
@ -440,8 +441,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) {
|
inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) {
|
||||||
const u8g_uint_t len = utf8_strlen_P(pstr), bw = len * (MENU_FONT_WIDTH),
|
const u8g_uint_t len = utf8_strlen_P(pstr),
|
||||||
bx = x * (MENU_FONT_WIDTH), by = (y + 1) * (MENU_FONT_HEIGHT);
|
by = (y + 1) * (MENU_FONT_HEIGHT);
|
||||||
|
const pixel_len_t bw = len * (MENU_FONT_WIDTH), bx = x * (MENU_FONT_WIDTH);
|
||||||
if (inv) {
|
if (inv) {
|
||||||
u8g.setColorIndex(1);
|
u8g.setColorIndex(1);
|
||||||
u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1);
|
u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1);
|
||||||
|
@ -463,8 +465,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
if (mark_as_selected(row, sel)) {
|
if (mark_as_selected(row, sel)) {
|
||||||
if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]);
|
if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]);
|
||||||
constexpr uint8_t maxlen = LCD_WIDTH - 1;
|
constexpr uint8_t maxlen = LCD_WIDTH - 1;
|
||||||
const u8g_uint_t pixw = maxlen * (MENU_FONT_WIDTH);
|
const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH);
|
||||||
u8g_uint_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw);
|
pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw);
|
||||||
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,14 +46,9 @@
|
||||||
#include "../../feature/bedlevel/bedlevel.h"
|
#include "../../feature/bedlevel/bedlevel.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern millis_t manual_move_start_time;
|
|
||||||
extern int8_t manual_move_axis;
|
|
||||||
#if ENABLED(MANUAL_E_MOVES_RELATIVE)
|
#if ENABLED(MANUAL_E_MOVES_RELATIVE)
|
||||||
float manual_move_e_origin = 0;
|
float manual_move_e_origin = 0;
|
||||||
#endif
|
#endif
|
||||||
#if IS_KINEMATIC
|
|
||||||
extern float manual_move_offset;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tell ui.update() to start a move to current_position" after a short delay.
|
// Tell ui.update() to start a move to current_position" after a short delay.
|
||||||
|
@ -66,8 +61,8 @@ inline void manual_move_to_current(AxisEnum axis
|
||||||
#if MULTI_MANUAL
|
#if MULTI_MANUAL
|
||||||
if (axis == E_AXIS) ui.manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
|
if (axis == E_AXIS) ui.manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
|
||||||
#endif
|
#endif
|
||||||
manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
|
ui.manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
|
||||||
manual_move_axis = (int8_t)axis;
|
ui.manual_move_axis = (int8_t)axis;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -112,11 +107,11 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) {
|
||||||
// Get the new position
|
// Get the new position
|
||||||
const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
|
const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
|
||||||
#if IS_KINEMATIC
|
#if IS_KINEMATIC
|
||||||
manual_move_offset += diff;
|
ui.manual_move_offset += diff;
|
||||||
if (int32_t(ui.encoderPosition) < 0)
|
if (int32_t(ui.encoderPosition) < 0)
|
||||||
NOLESS(manual_move_offset, min - current_position[axis]);
|
NOLESS(ui.manual_move_offset, min - current_position[axis]);
|
||||||
else
|
else
|
||||||
NOMORE(manual_move_offset, max - current_position[axis]);
|
NOMORE(ui.manual_move_offset, max - current_position[axis]);
|
||||||
#else
|
#else
|
||||||
current_position[axis] += diff;
|
current_position[axis] += diff;
|
||||||
if (int32_t(ui.encoderPosition) < 0)
|
if (int32_t(ui.encoderPosition) < 0)
|
||||||
|
@ -130,11 +125,10 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) {
|
||||||
}
|
}
|
||||||
ui.encoderPosition = 0;
|
ui.encoderPosition = 0;
|
||||||
if (ui.should_draw()) {
|
if (ui.should_draw()) {
|
||||||
const float pos = NATIVE_TO_LOGICAL(ui.processing_manual_move ? destination[axis] : current_position[axis]
|
const float pos = NATIVE_TO_LOGICAL(
|
||||||
#if IS_KINEMATIC
|
ui.processing_manual_move ? destination[axis] : current_position[axis] + TERN0(IS_KINEMATIC, ui.manual_move_offset),
|
||||||
+ manual_move_offset
|
axis
|
||||||
#endif
|
);
|
||||||
, axis);
|
|
||||||
MenuEditItemBase::draw_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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +143,7 @@ void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
|
||||||
if (ui.encoderPosition) {
|
if (ui.encoderPosition) {
|
||||||
if (!ui.processing_manual_move) {
|
if (!ui.processing_manual_move) {
|
||||||
const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
|
const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
|
||||||
TERN(IS_KINEMATIC, manual_move_offset, current_position.e) += diff;
|
TERN(IS_KINEMATIC, ui.manual_move_offset, current_position.e) += diff;
|
||||||
manual_move_to_current(E_AXIS
|
manual_move_to_current(E_AXIS
|
||||||
#if MULTI_MANUAL
|
#if MULTI_MANUAL
|
||||||
, eindex
|
, eindex
|
||||||
|
@ -166,7 +160,7 @@ void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
|
||||||
MenuEditItemBase::draw_edit_screen(
|
MenuEditItemBase::draw_edit_screen(
|
||||||
GET_TEXT(TERN(MULTI_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
|
GET_TEXT(TERN(MULTI_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
|
||||||
ftostr41sign(current_position.e
|
ftostr41sign(current_position.e
|
||||||
+ TERN0(IS_KINEMATIC, manual_move_offset)
|
+ TERN0(IS_KINEMATIC, ui.manual_move_offset)
|
||||||
- TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin)
|
- TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "../../gcode/gcode.h"
|
#include "../../gcode/gcode.h"
|
||||||
#include "../../gcode/queue.h"
|
#include "../../gcode/queue.h"
|
||||||
|
#include "../../module/motion.h"
|
||||||
#include "../../module/planner.h"
|
#include "../../module/planner.h"
|
||||||
#include "../../module/configuration_store.h"
|
#include "../../module/configuration_store.h"
|
||||||
#include "../../feature/bedlevel/bedlevel.h"
|
#include "../../feature/bedlevel/bedlevel.h"
|
||||||
|
@ -356,24 +357,16 @@ void _lcd_ubl_build_mesh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UBL Load Mesh Command
|
* UBL Load / Save Mesh Commands
|
||||||
*/
|
*/
|
||||||
void _lcd_ubl_load_mesh_cmd() {
|
inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) {
|
||||||
char ubl_lcd_gcode[40];
|
char ubl_lcd_gcode[40];
|
||||||
sprintf_P(ubl_lcd_gcode, PSTR("G29 L%i\nM117 "), ubl_storage_slot);
|
sprintf_P(ubl_lcd_gcode, PSTR("G29 %c%i\nM117 "), loadsave, ubl_storage_slot);
|
||||||
sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], GET_TEXT(MSG_MESH_LOADED), ubl_storage_slot);
|
sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], msg, ubl_storage_slot);
|
||||||
gcode.process_subcommands_now(ubl_lcd_gcode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UBL Save Mesh Command
|
|
||||||
*/
|
|
||||||
void _lcd_ubl_save_mesh_cmd() {
|
|
||||||
char ubl_lcd_gcode[40];
|
|
||||||
sprintf_P(ubl_lcd_gcode, PSTR("G29 S%i\nM117 "), ubl_storage_slot);
|
|
||||||
sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], GET_TEXT(MSG_MESH_SAVED), ubl_storage_slot);
|
|
||||||
gcode.process_subcommands_now(ubl_lcd_gcode);
|
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)); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UBL Mesh Storage submenu
|
* UBL Mesh Storage submenu
|
||||||
|
@ -444,9 +437,6 @@ void ubl_map_move_to_xy() {
|
||||||
/**
|
/**
|
||||||
* UBL LCD "radar" map
|
* UBL LCD "radar" map
|
||||||
*/
|
*/
|
||||||
void set_current_from_steppers_for_axis(const AxisEnum axis);
|
|
||||||
void sync_plan_position();
|
|
||||||
|
|
||||||
void _lcd_ubl_output_map_lcd() {
|
void _lcd_ubl_output_map_lcd() {
|
||||||
|
|
||||||
static int16_t step_scaler = 0;
|
static int16_t step_scaler = 0;
|
||||||
|
|
|
@ -637,12 +637,12 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
|
||||||
|
|
||||||
#if HAS_LCD_MENU
|
#if HAS_LCD_MENU
|
||||||
|
|
||||||
int8_t manual_move_axis = (int8_t)NO_AXIS;
|
int8_t MarlinUI::manual_move_axis = (int8_t)NO_AXIS;
|
||||||
millis_t manual_move_start_time = 0;
|
millis_t MarlinUI::manual_move_start_time = 0;
|
||||||
|
|
||||||
#if IS_KINEMATIC
|
#if IS_KINEMATIC
|
||||||
bool MarlinUI::processing_manual_move = false;
|
bool MarlinUI::processing_manual_move = false;
|
||||||
float manual_move_offset = 0;
|
float MarlinUI::manual_move_offset = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MULTI_MANUAL
|
#if MULTI_MANUAL
|
||||||
|
@ -905,8 +905,8 @@ void MarlinUI::update() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// then we want to use 1/2 of the time only.
|
// Then we want to use only 50% of the time
|
||||||
uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
|
const uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
|
||||||
|
|
||||||
if ((should_draw() || drawing_screen) && (!bbr2 || bbr2 > max_display_update_time)) {
|
if ((should_draw() || drawing_screen) && (!bbr2 || bbr2 > max_display_update_time)) {
|
||||||
|
|
||||||
|
|
|
@ -494,7 +494,11 @@ public:
|
||||||
static void enable_encoder_multiplier(const bool onoff);
|
static void enable_encoder_multiplier(const bool onoff);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int8_t manual_move_axis;
|
||||||
|
static millis_t manual_move_start_time;
|
||||||
|
|
||||||
#if IS_KINEMATIC
|
#if IS_KINEMATIC
|
||||||
|
static float manual_move_offset;
|
||||||
static bool processing_manual_move;
|
static bool processing_manual_move;
|
||||||
#else
|
#else
|
||||||
static constexpr bool processing_manual_move = false;
|
static constexpr bool processing_manual_move = false;
|
||||||
|
|
|
@ -2039,7 +2039,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||||
const uint8_t moves_queued = nonbusy_movesplanned();
|
const uint8_t moves_queued = nonbusy_movesplanned();
|
||||||
|
|
||||||
// Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
|
// Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
|
||||||
#if EITHER(SLOWDOWN, ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT)
|
#if EITHER(SLOWDOWN, HAS_SPI_LCD) || defined(XY_FREQUENCY_LIMIT)
|
||||||
// Segment time im micro seconds
|
// Segment time im micro seconds
|
||||||
int32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
|
int32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
|
||||||
#endif
|
#endif
|
||||||
|
|
Reference in a new issue