Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added info_subtitle_text for basic print status after prints are cancelled or complete #3313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/gui/dialogs/print_progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PrintProgress::PrintProgress(window_t *parent)
, estime_label(this, Rect16(22, 260, 140, 16), is_multiline::no)
, estime_value(this, Rect16(22, 280, 200, 22), is_multiline::no)
, info_text(this, Rect16(22, 265, 300, 30), is_multiline::no)
, info_subtitle_text(this, Rect16(22, 295, 300, 30), is_multiline::no)
, input_shaper_text(this, Rect16(Width() - 200, Height() - 20, 195, 16), is_multiline::no)
, progress_bar(this, Rect16(Width() - (Width() - GuiDefaults::ProgressThumbnailRect.Width()), 0, Width() - GuiDefaults::ProgressThumbnailRect.Width(), GuiDefaults::ProgressThumbnailRect.Height()))
, progress_num(this, Rect16(Width() - 145, GuiDefaults::ProgressThumbnailRect.Height() + 5, 130, Height() - GuiDefaults::ProgressThumbnailRect.Height() - 25))
Expand All @@ -39,6 +40,11 @@ PrintProgress::PrintProgress(window_t *parent)
info_text.SetText(_(finish_print_text));
info_text.Hide();

info_subtitle_text.set_font(resource_font(IDR_FNT_SMALL));
info_subtitle_text.SetPadding({ 0, 0, 0, 0 });
info_subtitle_text.SetAlignment(Align_t::LeftCenter());
info_subtitle_text.Hide();

input_shaper_text.set_font(resource_font(IDR_FNT_SMALL));
input_shaper_text.SetAlignment(Align_t::RightTop());
input_shaper_text.SetText(_(input_shaper_alpha_text));
Expand Down Expand Up @@ -90,13 +96,17 @@ void PrintProgress::UpdateTexts() {
estime_value.Hide();
info_text.SetText(_(stop_print_text));
info_text.Show();
PrintProgress::updateEsTime();
info_subtitle_text.Show();
mode = ProgressMode_t::END_PREVIEW;
break;
case ProgressMode_t::FINISHED_INIT:
estime_label.Hide();
estime_value.Hide();
info_text.SetText(_(finish_print_text));
info_text.Show();
PrintProgress::updateEsTime();
info_subtitle_text.Show();
thumbnail.redrawWhole(); // thumbnaill will be invalidated by hiding estime_label above, we need to force it to redraw entirely
thumbnail.Invalidate();
mode = ProgressMode_t::END_PREVIEW;
Expand All @@ -122,7 +132,7 @@ void PrintProgress::updateLoop(visibility_changed_t visibility_changed) {
}

void PrintProgress::updateEsTime() {
PT_t time_format = print_time.update_loop(time_end_format, &estime_value); // cannot return init
PT_t time_format = print_time.update_loop(time_end_format, &estime_value, &info_subtitle_text); // cannot return init

if (time_format != time_end_format) {
switch (time_format) {
Expand Down
1 change: 1 addition & 0 deletions src/gui/dialogs/print_progress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PrintProgress : public AddSuperWindow<DialogTimed> {
window_text_t estime_label;
window_text_t estime_value;
window_text_t info_text;
window_text_t info_subtitle_text;
window_text_t input_shaper_text;
WindowPrintVerticalProgress progress_bar;
WindowNumbPrintProgress progress_num;
Expand Down
3 changes: 1 addition & 2 deletions src/gui/print_time_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ PT_t PrintTime::update_loop(PT_t screen_format, window_text_t *out_print_end, [[
out_print_end->Invalidate();
last_time_to_end = time_to_end;

#if defined(USE_ST7789)
if (out_print_dur) {
const time_t rawtime = (time_t)marlin_vars()->print_duration;
if (rawtime != last_print_duration) {
out_print_dur->SetTextColor(generate_duration(rawtime));
out_print_dur->SetText(string_view_utf8::MakeRAM((const uint8_t *)text_time_dur.data()));
}
}
#endif // USE_ST7789

return time_end_format;
}

Expand Down