Remaining Time for LIGHTWEIGHT_UI (#18875)
This commit is contained in:
parent
81f5973afc
commit
b15c207d08
|
@ -591,16 +591,17 @@ void ST7920_Lite_Status_Screen::draw_fan_speed(const uint8_t value) {
|
||||||
write_byte('%');
|
write_byte('%');
|
||||||
}
|
}
|
||||||
|
|
||||||
void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed) {
|
void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed, char suffix) {
|
||||||
#if HOTENDS == 1
|
#if HOTENDS == 1
|
||||||
set_ddram_address(DDRAM_LINE_3);
|
set_ddram_address(DDRAM_LINE_3);
|
||||||
#else
|
#else
|
||||||
set_ddram_address(DDRAM_LINE_3 + 5);
|
set_ddram_address(DDRAM_LINE_3 + 5);
|
||||||
#endif
|
#endif
|
||||||
char str[7];
|
char str[7];
|
||||||
str[elapsed.toDigital(str)] = ' ';
|
int str_length = elapsed.toDigital(str);
|
||||||
|
str[str_length++] = suffix;
|
||||||
begin_data();
|
begin_data();
|
||||||
write_str(str, 6);
|
write_str(str, str_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) {
|
void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) {
|
||||||
|
@ -714,6 +715,7 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
|
||||||
if (forceUpdate || indicators_changed()) {
|
if (forceUpdate || indicators_changed()) {
|
||||||
const bool blink = ui.get_blink();
|
const bool blink = ui.get_blink();
|
||||||
const duration_t elapsed = print_job_timer.duration();
|
const duration_t elapsed = print_job_timer.duration();
|
||||||
|
duration_t remaining = TERN0(USE_M73_REMAINING_TIME, ui.get_remaining_time());
|
||||||
const uint16_t feedrate_perc = feedrate_percentage;
|
const uint16_t feedrate_perc = feedrate_percentage;
|
||||||
const int16_t extruder_1_temp = thermalManager.degHotend(0),
|
const int16_t extruder_1_temp = thermalManager.degHotend(0),
|
||||||
extruder_1_target = thermalManager.degTargetHotend(0);
|
extruder_1_target = thermalManager.degTargetHotend(0);
|
||||||
|
@ -738,7 +740,19 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
draw_fan_speed(thermalManager.fanPercent(spd));
|
draw_fan_speed(thermalManager.fanPercent(spd));
|
||||||
draw_print_time(elapsed);
|
|
||||||
|
// Draw elapsed/remaining time
|
||||||
|
const bool show_remaining = ENABLED(SHOW_REMAINING_TIME) && (DISABLED(ROTATE_PROGRESS_DISPLAY) || blink);
|
||||||
|
if (show_remaining && !remaining.second()) {
|
||||||
|
const auto progress = ui.get_progress_percent();
|
||||||
|
if (progress)
|
||||||
|
remaining = elapsed.second() * (100 - progress) / progress;
|
||||||
|
}
|
||||||
|
if (show_remaining && remaining.second())
|
||||||
|
draw_print_time(remaining, 'R');
|
||||||
|
else
|
||||||
|
draw_print_time(elapsed);
|
||||||
|
|
||||||
draw_feedrate_percentage(feedrate_perc);
|
draw_feedrate_percentage(feedrate_perc);
|
||||||
|
|
||||||
// Update the fan and bed animations
|
// Update the fan and bed animations
|
||||||
|
|
|
@ -80,14 +80,14 @@ class ST7920_Lite_Status_Screen {
|
||||||
static void draw_fan_icon(const bool whichIcon);
|
static void draw_fan_icon(const bool whichIcon);
|
||||||
static void draw_heat_icon(const bool whichIcon, const bool heating);
|
static void draw_heat_icon(const bool whichIcon, const bool heating);
|
||||||
static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange);
|
static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange);
|
||||||
static void draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate = false);
|
static void draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate=false);
|
||||||
static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate = false);
|
static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate=false);
|
||||||
static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate = false);
|
static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate=false);
|
||||||
static void draw_fan_speed(const uint8_t value);
|
static void draw_fan_speed(const uint8_t value);
|
||||||
static void draw_print_time(const duration_t &elapsed);
|
static void draw_print_time(const duration_t &elapsed, char suffix=' ');
|
||||||
static void draw_feedrate_percentage(const uint16_t percentage);
|
static void draw_feedrate_percentage(const uint16_t percentage);
|
||||||
static void draw_status_message();
|
static void draw_status_message();
|
||||||
static void draw_position(const xyze_pos_t &pos, bool position_known = true);
|
static void draw_position(const xyze_pos_t &pos, bool position_known=true);
|
||||||
|
|
||||||
static bool indicators_changed();
|
static bool indicators_changed();
|
||||||
static bool position_changed();
|
static bool position_changed();
|
||||||
|
|
Loading…
Reference in a new issue