🐛 Fix misc. UI issues (#25252)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
ellensp 2023-01-22 15:08:37 +13:00 committed by GitHub
parent f2b8942adc
commit b7c23631c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 52 additions and 43 deletions

View file

@ -232,7 +232,7 @@ void GcodeSuite::M115() {
const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
wmin = cmin.asLogical(), wmax = cmax.asLogical();
SERIAL_ECHOLNPGM(
SERIAL_ECHOPGM(
"area:{"
"full:{"
"min:{"
@ -249,6 +249,8 @@ void GcodeSuite::M115() {
),
"}" // max
"}," // full
);
SERIAL_ECHOLNPGM(
"work:{"
"min:{"
LIST_N(DOUBLE(NUM_AXES),

View file

@ -656,6 +656,10 @@
#define HAS_MEDIA_SUBCALLS 1
#endif
#if ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
#define HAS_EXTRA_PROGRESS 1
#endif
#if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
#define HAS_PRINT_PROGRESS_PERMYRIAD 1
#endif

View file

@ -944,7 +944,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled."
#endif
#if HAS_LCDPRINT && LCD_HEIGHT < 4 && ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
#if HAS_LCDPRINT && HAS_EXTRA_PROGRESS && LCD_HEIGHT < 4
#error "Displays with fewer than 4 rows of text can't show progress values."
#endif

View file

@ -444,7 +444,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
}
// Prepare strings for progress display
#if HAS_PRINT_PROGRESS
#if HAS_EXTRA_PROGRESS
static MarlinUI::progress_t progress = 0;
static char bufferc[13];

View file

@ -705,7 +705,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
void ST7920_Lite_Status_Screen::drawRemain() {
const duration_t remaint = TERN0(SET_REMAINING_TIME, ui.get_remaining_time());
if (printJobOngoing() && remaint.value) {
draw_progress_string( PPOS, prepare_time_string(remaint, 'R'));
draw_progress_string(PPOS, prepare_time_string(remaint, 'R'));
}
}
#endif
@ -714,7 +714,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
void ST7920_Lite_Status_Screen::drawInter() {
const duration_t interactt = ui.interaction_time;
if (printingIsActive() && interactt.value) {
draw_progress_string( PPOS, prepare_time_string(interactt, 'C'));
draw_progress_string(PPOS, prepare_time_string(interactt, 'C'));
}
}
#endif
@ -723,7 +723,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
void ST7920_Lite_Status_Screen::drawElapsed() {
if (printJobOngoing()) {
const duration_t elapsedt = print_job_timer.duration();
draw_progress_string( PPOS, prepare_time_string(elapsedt, 'E'));
draw_progress_string(PPOS, prepare_time_string(elapsedt, 'E'));
}
}
#endif

View file

@ -1743,9 +1743,11 @@ void MarlinUI::init() {
);
}
#if LCD_WITH_BLINK && DISABLED(HAS_GRAPHICAL_TFT)
typedef void (*PrintProgress_t)();
void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings
#if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS
// Renew and redraw all enabled progress strings
void MarlinUI::rotate_progress() {
typedef void (*PrintProgress_t)();
const PrintProgress_t progFunc[] = {
OPTITEM(SHOW_PROGRESS_PERCENT, drawPercent)
OPTITEM(SHOW_ELAPSED_TIME, drawElapsed)
@ -1760,7 +1762,8 @@ void MarlinUI::init() {
(*progFunc[i])();
}
}
#endif
#endif // LCD_WITH_BLINK && HAS_EXTRA_PROGRESS
#endif // HAS_PRINT_PROGRESS

View file

@ -334,7 +334,7 @@ public:
FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); }
#endif
static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); }
#if LCD_WITH_BLINK
#if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS
#if ENABLED(SHOW_PROGRESS_PERCENT)
static void drawPercent();
#endif
@ -348,6 +348,8 @@ public:
static void drawInter();
#endif
static void rotate_progress();
#else
static void rotate_progress() {}
#endif
#else
static constexpr uint8_t get_progress_percent() { return 0; }

View file

@ -377,7 +377,7 @@ void menu_backlash();
#if ENABLED(MPC_INCLUDE_FAN)
#define MPC_EDIT_ITEMS(N) \
MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \
MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].mpc; \
_MPC_EDIT_ITEMS(N); \
EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \
thermalManager.temp_hotend[MenuItemBase::itemIndex].applyFanAdjustment(editable.decimal); \

View file

@ -675,12 +675,10 @@ static void drawAxisValue(const AxisEnum axis) {
static void moveAxis(const AxisEnum axis, const int8_t direction) {
quick_feedback();
#if ENABLED(PREVENT_COLD_EXTRUSION)
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
drawMessage(F("Too cold"));
return;
}
#endif
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
drawMessage(F("Too cold"));
return;
}
const float diff = motionAxisState.currentStepSize * direction;

View file

@ -768,12 +768,10 @@ static void drawAxisValue(const AxisEnum axis) {
static void moveAxis(const AxisEnum axis, const int8_t direction) {
quick_feedback();
#if ENABLED(PREVENT_COLD_EXTRUSION)
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
drawMessage(F("Too cold"));
return;
}
#endif
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
drawMessage(F("Too cold"));
return;
}
const float diff = motionAxisState.currentStepSize * direction;

View file

@ -656,12 +656,10 @@ static void drawAxisValue(const AxisEnum axis) {
static void moveAxis(const AxisEnum axis, const int8_t direction) {
quick_feedback();
#if ENABLED(PREVENT_COLD_EXTRUSION)
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
drawMessage(F("Too cold"));
return;
}
#endif
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
drawMessage(F("Too cold"));
return;
}
const float diff = motionAxisState.currentStepSize * direction;

View file

@ -58,6 +58,11 @@
#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X)
#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y)
// TFT_ROTATION is user configurable
#ifndef TFT_ROTATION
#define TFT_ROTATION TFT_NO_ROTATION
#endif
// TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION
#define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION))

View file

@ -1418,12 +1418,8 @@ void prepare_line_to_destination() {
#if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE)
if (!DEBUGGING(DRYRUN) && destination.e != current_position.e) {
bool ignore_e = false;
#if ENABLED(PREVENT_COLD_EXTRUSION)
ignore_e = thermalManager.tooColdToExtrude(active_extruder);
if (ignore_e) SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP);
#endif
bool ignore_e = thermalManager.tooColdToExtrude(active_extruder);
if (ignore_e) SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP);
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
const float e_delta = ABS(destination.e - current_position.e) * planner.e_factor[active_extruder];

View file

@ -517,6 +517,9 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
#if ENABLED(PREVENT_COLD_EXTRUSION)
bool Temperature::allow_cold_extrude = false;
celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP;
#else
constexpr bool Temperature::allow_cold_extrude;
constexpr celsius_t Temperature::extrude_min_temp;
#endif
#if HAS_ADC_BUTTONS

View file

@ -643,6 +643,8 @@ class Temperature {
static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); }
static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); }
#else
static constexpr bool allow_cold_extrude = true;
static constexpr celsius_t extrude_min_temp = 0;
static bool tooColdToExtrude(const uint8_t) { return false; }
static bool targetTooColdToExtrude(const uint8_t) { return false; }
#endif

View file

@ -929,7 +929,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
* Returns FALSE if able to move.
*/
bool too_cold(uint8_t toolID){
if (TERN0(PREVENT_COLD_EXTRUSION, !DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID))) {
if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID)) {
SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD);
return true;
}
@ -1429,12 +1429,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
bool extruder_migration() {
#if ENABLED(PREVENT_COLD_EXTRUSION)
if (thermalManager.targetTooColdToExtrude(active_extruder)) {
DEBUG_ECHOLNPGM("Migration Source Too Cold");
return false;
}
#endif
if (thermalManager.targetTooColdToExtrude(active_extruder)) {
DEBUG_ECHOLNPGM("Migration Source Too Cold");
return false;
}
// No auto-migration or specified target?
if (!migration.target && active_extruder >= migration.last) {