More "zero extruders" changes (#15213)

This commit is contained in:
Scott Lahteine
2019-09-10 02:20:49 -05:00
committed by GitHub
parent 54abf3aeba
commit 584c86bed1
27 changed files with 1068 additions and 841 deletions

View File

@ -866,7 +866,11 @@ void MarlinUI::draw_status_screen() {
char c;
uint16_t per;
#if HAS_FAN0
if (blink || thermalManager.fan_speed_scaler[0] < 128) {
if (true
#if EXTRUDERS
&& (blink || thermalManager.fan_speed_scaler[0] < 128)
#endif
) {
uint16_t spd = thermalManager.fan_speed[0];
if (blink) c = 'F';
#if ENABLED(ADAPTIVE_FAN_SLOWING)
@ -877,8 +881,10 @@ void MarlinUI::draw_status_screen() {
else
#endif
{
c = 'E';
per = planner.flow_percentage[0];
#if EXTRUDERS
c = 'E';
per = planner.flow_percentage[0];
#endif
}
lcd_put_wchar(c);
lcd_put_u8str(i16tostr3(per));

View File

@ -69,10 +69,28 @@
//
#if HAS_HEATED_BED && HOTENDS <= 4
#if HOTENDS == 1
#if HOTENDS == 0
#define STATUS_HEATERS_WIDTH 96
const unsigned char status_heaters_bmp[] PROGMEM = {
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000
};
#elif HOTENDS == 1
#define STATUS_HEATERS_WIDTH 96
#define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10)
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
@ -92,7 +110,6 @@
#elif HOTENDS == 2
#define STATUS_HEATERS_WIDTH 96
#define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10)
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
@ -112,7 +129,6 @@
#elif HOTENDS == 3
#define STATUS_HEATERS_WIDTH 96
#define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10)
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000,
@ -132,7 +148,6 @@
#else // HOTENDS > 3
#define STATUS_HEATERS_WIDTH 120
#define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10)
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000,
@ -151,9 +166,15 @@
#endif // HOTENDS
#define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10)
#else // !HAS_HEATED_BED || HOTENDS > 3
#if HOTENDS == 1
#if HOTENDS == 0
#define STATUS_HEATERS_WIDTH 0
#elif HOTENDS == 1
#define STATUS_HEATERS_WIDTH 12
@ -229,7 +250,7 @@
B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000
};
#elif HOTENDS > 4
#else // HOTENDS > 4
#define STATUS_HEATERS_WIDTH 108
@ -304,105 +325,101 @@
#endif
#else
#elif HOTENDS >= 2
#if HOTENDS >= 2
#ifdef STATUS_HOTEND_ANIM
#ifdef STATUS_HOTEND_ANIM
const unsigned char status_hotend1_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111110,B11110000,
B00111100,B11110000,
B00011010,B11100000,
B00011110,B11100000,
B00111110,B11110000,
B00111110,B11110000,
B00111110,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend1_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111110,B11110000,
B00111100,B11110000,
B00011010,B11100000,
B00011110,B11100000,
B00111110,B11110000,
B00111110,B11110000,
B00111110,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend1_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100001,B00010000,
B00100011,B00010000,
B00010101,B00100000,
B00010001,B00100000,
B00100001,B00010000,
B00100001,B00010000,
B00110001,B00110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend1_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100001,B00010000,
B00100011,B00010000,
B00010101,B00100000,
B00010001,B00100000,
B00100001,B00010000,
B00100001,B00010000,
B00110001,B00110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111100,B11110000,
B00111011,B01110000,
B00011111,B01100000,
B00011110,B11100000,
B00111101,B11110000,
B00111011,B11110000,
B00111000,B01110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111100,B11110000,
B00111011,B01110000,
B00011111,B01100000,
B00011110,B11100000,
B00111101,B11110000,
B00111011,B11110000,
B00111000,B01110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100011,B00010000,
B00100100,B10010000,
B00010000,B10100000,
B00010001,B00100000,
B00100010,B00010000,
B00100100,B00010000,
B00110111,B10110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100011,B00010000,
B00100100,B10010000,
B00010000,B10100000,
B00010001,B00100000,
B00100010,B00010000,
B00100100,B00010000,
B00110111,B10110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
#else
#else
const unsigned char status_hotend1_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111110,B11110000,
B00111100,B11110000,
B00111010,B11110000,
B00011110,B11100000,
B00011110,B11100000,
B00111110,B11110000,
B00111110,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend1_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111110,B11110000,
B00111100,B11110000,
B00111010,B11110000,
B00011110,B11100000,
B00011110,B11100000,
B00111110,B11110000,
B00111110,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111100,B11110000,
B00111011,B01110000,
B00111111,B01110000,
B00011110,B11100000,
B00011101,B11100000,
B00111011,B11110000,
B00111000,B01110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#endif
const unsigned char status_hotend2_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111100,B11110000,
B00111011,B01110000,
B00111111,B01110000,
B00011110,B11100000,
B00011101,B11100000,
B00111011,B11110000,
B00111000,B01110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#endif
@ -573,6 +590,8 @@
#endif
#else
#define STATUS_HEATERS_HEIGHT 20
#endif
#endif
@ -1431,6 +1450,10 @@
"Status heaters bitmap (status_heaters_bmp) dimensions don't match data."
);
#else // HOTENDS == 0
//#error "Incomplete status header"
#endif
//

View File

@ -93,7 +93,10 @@
#define CHAMBER_ALT() false
#endif
#define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE)))
#if HOTENDS
#define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE)))
#endif
#define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1)
#if ENABLED(MARLIN_DEV_MODE)
@ -127,6 +130,11 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin
const bool isHeat = IFBED(BED_ALT(), HOTEND_ALT(heater));
#endif
#ifndef STATUS_HOTEND_TEXT_X
#define STATUS_HOTEND_TEXT_X(N) 0
#define STATUS_HEATERS_Y 0
#endif
const uint8_t tx = IFBED(STATUS_BED_TEXT_X, STATUS_HOTEND_TEXT_X(heater));
#if ENABLED(MARLIN_DEV_MODE)
@ -424,8 +432,10 @@ void MarlinUI::draw_status_screen() {
//
if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) {
// Extruders
for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e)
_draw_heater_status((heater_ind_t)e, blink);
#if HOTENDS
for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e)
_draw_heater_status((heater_ind_t)e, blink);
#endif
// Heated bed
#if DO_DRAW_BED && DISABLED(STATUS_COMBINE_HEATERS) || (HAS_HEATED_BED && ENABLED(STATUS_COMBINE_HEATERS) && HOTENDS <= 4)

View File

@ -497,21 +497,25 @@ void DGUSScreenVariableHandler::HandleTemperatureChanged(DGUS_VP_Variable &var,
}
void DGUSScreenVariableHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t newvalue = swap16(*(uint16_t*)val_ptr);
uint8_t target_extruder;
switch (var.VP) {
default: return;
#if (HOTENDS >= 1)
case VP_Flowrate_E1: target_extruder = 0; break;
#endif
#if (HOTENDS >= 2)
case VP_Flowrate_E2: target_extruder = 1; break;
#endif
}
#if EXTRUDERS
uint16_t newvalue = swap16(*(uint16_t*)val_ptr);
uint8_t target_extruder;
switch (var.VP) {
default: return;
#if (HOTENDS >= 1)
case VP_Flowrate_E1: target_extruder = 0; break;
#endif
#if (HOTENDS >= 2)
case VP_Flowrate_E2: target_extruder = 1; break;
#endif
}
planner.flow_percentage[target_extruder] = newvalue;
planner.refresh_e_factor(target_extruder);
ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
planner.flow_percentage[target_extruder] = newvalue;
planner.refresh_e_factor(target_extruder);
ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
#else
UNUSED(var); UNUSED(val_ptr);
#endif
}
void DGUSScreenVariableHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) {

View File

@ -168,7 +168,7 @@ namespace ExtUI {
}
void enableHeater(const extruder_t extruder) {
#if HEATER_IDLE_HANDLER
#if HOTENDS && HEATER_IDLE_HANDLER
thermalManager.reset_heater_idle_timer(extruder - E0);
#endif
}
@ -184,14 +184,18 @@ namespace ExtUI {
#if HAS_HEATED_CHAMBER
case CHAMBER: return; // Chamber has no idle timer
#endif
default: thermalManager.reset_heater_idle_timer(heater - H0);
default:
#if HOTENDS
thermalManager.reset_heater_idle_timer(heater - H0);
#endif
break;
}
#endif
}
bool isHeaterIdle(const extruder_t extruder) {
return false
#if HEATER_IDLE_HANDLER
#if HOTENDS && HEATER_IDLE_HANDLER
|| thermalManager.hotend_idle[extruder - E0].timed_out
#endif
;
@ -206,7 +210,12 @@ namespace ExtUI {
#if HAS_HEATED_CHAMBER
case CHAMBER: return false; // Chamber has no idle timer
#endif
default: return thermalManager.hotend_idle[heater - H0].timed_out;
default:
#if HOTENDS
return thermalManager.hotend_idle[heater - H0].timed_out;
#else
return false;
#endif
}
#else
return false;
@ -841,22 +850,28 @@ namespace ExtUI {
}
void setTargetTemp_celsius(float value, const heater_t heater) {
constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
const int16_t e = heater - H0;
enableHeater(heater);
#if HAS_HEATED_BED
if (heater == BED)
thermalManager.setTargetBed(clamp(value, 0, BED_MAXTEMP - 10));
else
#endif
thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
{
#if HOTENDS
static constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
const int16_t e = heater - H0;
thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
#endif
}
}
void setTargetTemp_celsius(float value, const extruder_t extruder) {
constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
const int16_t e = extruder - E0;
enableHeater(extruder);
thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
#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);
const int16_t e = extruder - E0;
enableHeater(extruder);
thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
#endif
}
void setTargetFan_percent(const float value, const fan_t fan) {

View File

@ -30,7 +30,9 @@
extern int8_t encoderLine, encoderTopLine, screen_items;
extern bool screen_changed;
constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
#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);
#endif
void scroll_screen(const uint8_t limit, const bool is_menu);
bool printer_busy();

View File

@ -43,7 +43,7 @@
#include "../../module/temperature.h"
#endif
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM
#include "../../feature/runout.h"
float lcd_runout_distance_mm;
#endif
@ -178,7 +178,7 @@ void menu_backlash();
#if EXTRUDERS == 1
MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength);
#else // EXTRUDERS > 1
#elif EXTRUDERS > 1
#define EDIT_FIL_UNLOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E##N, &fc_settings[N-1].unload_length, 0, extrude_maxlength)
MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);
EDIT_FIL_UNLOAD(1);
@ -199,7 +199,7 @@ void menu_backlash();
#if EXTRUDERS == 1
MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength);
#else // EXTRUDERS > 1
#elif EXTRUDERS > 1
#define EDIT_FIL_LOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E##N, &fc_settings[N-1].load_length, 0, extrude_maxlength)
MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength);
EDIT_FIL_LOAD(1);
@ -219,7 +219,7 @@ void menu_backlash();
#endif // EXTRUDERS > 1
#endif
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM
MENU_ITEM_EDIT_CALLBACK(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{
runout.set_runout_distance(lcd_runout_distance_mm);
});
@ -620,7 +620,7 @@ void menu_backlash();
#endif // !SLIM_LCD_MENUS
void menu_advanced_settings() {
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM
lcd_runout_distance_mm = runout.runout_distance();
#endif
START_MENU();

View File

@ -158,80 +158,85 @@ static void _lcd_move_xyz(PGM_P name, AxisEnum axis) {
void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); }
void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); }
void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); }
static void _lcd_move_e(
#if E_MANUAL > 1
const int8_t eindex=-1
#endif
) {
if (ui.use_click()) return ui.goto_previous_screen_no_defer();
if (ui.encoderPosition) {
if (!ui.processing_manual_move) {
const float diff = float(int16_t(ui.encoderPosition)) * move_menu_scale;
#if IS_KINEMATIC
manual_move_offset += diff;
#else
current_position[E_AXIS] += diff;
#endif
manual_move_to_current(E_AXIS
#if E_MANUAL > 1
, eindex
#if E_MANUAL
static void _lcd_move_e(
#if E_MANUAL > 1
const int8_t eindex=-1
#endif
) {
if (ui.use_click()) return ui.goto_previous_screen_no_defer();
if (ui.encoderPosition) {
if (!ui.processing_manual_move) {
const float diff = float(int16_t(ui.encoderPosition)) * move_menu_scale;
#if IS_KINEMATIC
manual_move_offset += diff;
#else
current_position[E_AXIS] += diff;
#endif
);
ui.refresh(LCDVIEW_REDRAW_NOW);
}
ui.encoderPosition = 0;
}
if (ui.should_draw()) {
PGM_P pos_label;
#if E_MANUAL == 1
pos_label = PSTR(MSG_MOVE_E);
#else
switch (eindex) {
default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
#if E_MANUAL > 2
case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
#if E_MANUAL > 3
case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
#if E_MANUAL > 4
case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break;
#if E_MANUAL > 5
case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break;
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
manual_move_to_current(E_AXIS
#if E_MANUAL > 1
, eindex
#endif
);
ui.refresh(LCDVIEW_REDRAW_NOW);
}
#endif // E_MANUAL > 1
ui.encoderPosition = 0;
}
if (ui.should_draw()) {
PGM_P pos_label;
#if E_MANUAL == 1
pos_label = PSTR(MSG_MOVE_E);
#else
switch (eindex) {
default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
#if E_MANUAL > 2
case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
#if E_MANUAL > 3
case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
#if E_MANUAL > 4
case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break;
#if E_MANUAL > 5
case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break;
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
}
#endif // E_MANUAL > 1
draw_edit_screen(pos_label, ftostr41sign(current_position[E_AXIS]
#if IS_KINEMATIC
+ manual_move_offset
#endif
#if ENABLED(MANUAL_E_MOVES_RELATIVE)
- manual_move_e_origin
#endif
));
draw_edit_screen(pos_label, ftostr41sign(current_position[E_AXIS]
#if IS_KINEMATIC
+ manual_move_offset
#endif
#if ENABLED(MANUAL_E_MOVES_RELATIVE)
- manual_move_e_origin
#endif
));
}
}
}
inline void lcd_move_e() { _lcd_move_e(); }
#if E_MANUAL > 1
inline void lcd_move_e0() { _lcd_move_e(0); }
inline void lcd_move_e1() { _lcd_move_e(1); }
#if E_MANUAL > 2
inline void lcd_move_e2() { _lcd_move_e(2); }
#if E_MANUAL > 3
inline void lcd_move_e3() { _lcd_move_e(3); }
#if E_MANUAL > 4
inline void lcd_move_e4() { _lcd_move_e(4); }
#if E_MANUAL > 5
inline void lcd_move_e5() { _lcd_move_e(5); }
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
#endif // E_MANUAL > 1
inline void lcd_move_e() { _lcd_move_e(); }
#if E_MANUAL > 1
inline void lcd_move_e0() { _lcd_move_e(0); }
inline void lcd_move_e1() { _lcd_move_e(1); }
#if E_MANUAL > 2
inline void lcd_move_e2() { _lcd_move_e(2); }
#if E_MANUAL > 3
inline void lcd_move_e3() { _lcd_move_e(3); }
#if E_MANUAL > 4
inline void lcd_move_e4() { _lcd_move_e(4); }
#if E_MANUAL > 5
inline void lcd_move_e5() { _lcd_move_e(5); }
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
#endif // E_MANUAL > 1
#endif // E_MANUAL
//
// "Motion" > "Move Xmm" > "Move XYZ" submenu
@ -295,23 +300,26 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
void lcd_move_get_x_amount() { _menu_move_distance(X_AXIS, lcd_move_x); }
void lcd_move_get_y_amount() { _menu_move_distance(Y_AXIS, lcd_move_y); }
void lcd_move_get_z_amount() { _menu_move_distance(Z_AXIS, lcd_move_z); }
void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); }
#if E_MANUAL > 1
void lcd_move_get_e0_amount() { _menu_move_distance(E_AXIS, lcd_move_e0, 0); }
void lcd_move_get_e1_amount() { _menu_move_distance(E_AXIS, lcd_move_e1, 1); }
#if E_MANUAL > 2
void lcd_move_get_e2_amount() { _menu_move_distance(E_AXIS, lcd_move_e2, 2); }
#if E_MANUAL > 3
void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); }
#if E_MANUAL > 4
void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); }
#if E_MANUAL > 5
void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); }
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
#endif // E_MANUAL > 1
#if E_MANUAL
void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); }
#if E_MANUAL > 1
void lcd_move_get_e0_amount() { _menu_move_distance(E_AXIS, lcd_move_e0, 0); }
void lcd_move_get_e1_amount() { _menu_move_distance(E_AXIS, lcd_move_e1, 1); }
#if E_MANUAL > 2
void lcd_move_get_e2_amount() { _menu_move_distance(E_AXIS, lcd_move_e2, 2); }
#if E_MANUAL > 3
void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); }
#if E_MANUAL > 4
void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); }
#if E_MANUAL > 5
void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); }
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
#endif // E_MANUAL > 1
#endif // E_MANUAL
#if ENABLED(DELTA)
void lcd_lower_z_to_clip_height() {
@ -396,39 +404,43 @@ void menu_move() {
#endif
#if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
#if E_MANUAL
#if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
// Only the current...
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
// ...and the non-switching
#if E_MANUAL == 5
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
#elif E_MANUAL == 3
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
#endif
#else
// Independent extruders with one E-stepper per hotend
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
#if E_MANUAL > 1
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount);
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount);
#if E_MANUAL > 2
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
#if E_MANUAL > 3
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount);
#if E_MANUAL > 4
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
#if E_MANUAL > 5
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount);
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
#endif // E_MANUAL > 1
// Only the current...
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
// ...and the non-switching
#if E_MANUAL == 5
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
#elif E_MANUAL == 3
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
#endif
#else
// Independent extruders with one E-stepper per hotend
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
#if E_MANUAL > 1
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount);
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount);
#if E_MANUAL > 2
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
#if E_MANUAL > 3
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount);
#if E_MANUAL > 4
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
#if E_MANUAL > 5
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount);
#endif // E_MANUAL > 5
#endif // E_MANUAL > 4
#endif // E_MANUAL > 3
#endif // E_MANUAL > 2
#endif // E_MANUAL > 1
#endif
#endif // E_MANUAL
END_MENU();
}

View File

@ -48,7 +48,9 @@ uint8_t MarlinUI::preheat_fan_speed[2];
//
void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const uint8_t fan) {
if (temph > 0) thermalManager.setTargetHotend(_MIN(heater_maxtemp[endnum] - 15, temph), endnum);
#if HOTENDS
if (temph > 0) thermalManager.setTargetHotend(_MIN(heater_maxtemp[endnum] - 15, temph), endnum);
#endif
#if HAS_HEATED_BED
if (tempb >= 0) thermalManager.setTargetBed(tempb);
#else
@ -165,12 +167,16 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
#if HAS_TEMP_HOTEND || HAS_HEATED_BED
void lcd_preheat_m1_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); }
void lcd_preheat_m2_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); }
#if HOTENDS
void lcd_preheat_m1_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); }
void lcd_preheat_m2_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); }
#endif
#if HAS_HEATED_BED
void lcd_preheat_m1_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); }
void lcd_preheat_m2_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); }
#if HOTENDS
void lcd_preheat_m1_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); }
void lcd_preheat_m2_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); }
#endif
void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); }
void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); }
#endif
@ -313,7 +319,7 @@ void menu_temperature() {
//
#if HOTENDS == 1
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0);
#else // HOTENDS > 1
#elif HOTENDS > 1
#define EDIT_TARGET(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N)
EDIT_TARGET(0);
EDIT_TARGET(1);

View File

@ -144,7 +144,7 @@ void menu_tune() {
//
#if HOTENDS == 1
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0);
#else // HOTENDS > 1
#elif HOTENDS > 1
#define EDIT_NOZZLE(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N)
EDIT_NOZZLE(0);
EDIT_NOZZLE(1);