Prusa MINI Firmware overview
screen_printing.cpp File Reference
#include "dbg.h"
#include "gui.h"
#include "config.h"
#include "window_header.h"
#include "status_footer.h"
#include "marlin_client.h"
#include "filament.h"
#include "screen_printing.h"
#include "marlin_server.h"
#include "ffconf.h"
#include "../Marlin/src/libs/duration_t.h"
#include "../Marlin/src/gcode/lcd/M73_PE.h"

Classes

struct  screen_printing_data_t
 
struct  pduration_t
 

Macros

#define COLOR_VALUE_VALID   COLOR_WHITE
 
#define COLOR_VALUE_INVALID   COLOR_WHITE
 
#define BUTTON_TUNE   0
 
#define BUTTON_PAUSE   1
 
#define BUTTON_STOP   2
 
#define POPUP_MSG_DUR_MS   5000
 
#define HEATING_DIFFERENCE   1
 
#define pw   ((screen_printing_data_t *)screen->pdata)
 

Enumerations

enum  printing_state_t {
  P_INITIAL, P_PRINTING, P_PAUSING, P_PAUSED,
  P_RESUMING, P_REHEATING, P_REHEATING_DONE, P_MBL_FAILED,
  P_PRINTED
}
 
enum  item_id_t {
  iid_settings, iid_pause, iid_pausing, iid_stop,
  iid_resume, iid_resuming, iid_reheating, iid_reprint,
  iid_home, iid_count
}
 

Functions

void reset_print_state (void)
 
void screen_printing_init (screen_t *screen)
 
void screen_printing_done (screen_t *screen)
 
void screen_printing_draw (screen_t *screen)
 
int screen_printing_event (screen_t *screen, window_t *window, uint8_t event, void *param)
 
void screen_printing_timer (screen_t *screen, uint32_t seconds)
 
void screen_printing_update_progress (screen_t *screen)
 
void screen_printing_pause_print (screen_t *screen)
 
void screen_printing_resume_print (screen_t *screen)
 
void screen_printing_reprint (screen_t *screen)
 
void screen_printing_printed (screen_t *screen)
 
void screen_mesh_err_stop_print (screen_t *screen)
 
void change_print_state (screen_t *screen, printing_state_t state)
 
static void screen_printing_update_remaining_time_progress (screen_t *screen)
 
static void open_popup_message (screen_t *screen)
 
static void close_popup_message (screen_t *screen)
 
void screen_printing_disable_tune_button (screen_t *screen)
 
void screen_printing_enable_tune_button (screen_t *screen)
 
void _state_loop (screen_t *screen)
 
void set_icon_and_label (item_id_t id_to_set, int16_t btn_id, int16_t lbl_id)
 
void enable_button (window_icon_t *p_button)
 
void disable_button (window_icon_t *p_button)
 
void set_pause_icon_and_label (screen_t *screen)
 
void set_tune_icon_and_label (screen_t *screen)
 
void set_stop_icon_and_label (screen_t *screen)
 

Variables

screen_tpscreen_home
 
screen_tpscreen_menu_tune
 
const uint16_t printing_icons [iid_count]
 
const char * printing_labels [iid_count]
 
static printing_state_t state__readonly__use_change_print_state
 
screen_t screen_printing
 
const screen_tpscreen_printing = &screen_printing
 
char screen_printing_file_name [_MAX_LFN+1] = { '\0' }
 
char screen_printing_file_path [_MAX_LFN+2] = { '\0' }
 

Macro Definition Documentation

◆ COLOR_VALUE_VALID

#define COLOR_VALUE_VALID   COLOR_WHITE

◆ COLOR_VALUE_INVALID

#define COLOR_VALUE_INVALID   COLOR_WHITE

◆ BUTTON_TUNE

#define BUTTON_TUNE   0

◆ BUTTON_PAUSE

#define BUTTON_PAUSE   1

◆ BUTTON_STOP

#define BUTTON_STOP   2

◆ POPUP_MSG_DUR_MS

#define POPUP_MSG_DUR_MS   5000

◆ HEATING_DIFFERENCE

#define HEATING_DIFFERENCE   1

◆ pw

#define pw   ((screen_printing_data_t *)screen->pdata)

Enumeration Type Documentation

◆ printing_state_t

Enumerator
P_INITIAL 
P_PRINTING 
P_PAUSING 
P_PAUSED 
P_RESUMING 
P_REHEATING 
P_REHEATING_DONE 
P_MBL_FAILED 
P_PRINTED 
42  {
43  P_INITIAL,
44  P_PRINTING,
45  P_PAUSING,
46  P_PAUSED,
47  P_RESUMING,
51  P_PRINTED

◆ item_id_t

enum item_id_t
Enumerator
iid_settings 
iid_pause 
iid_pausing 
iid_stop 
iid_resume 
iid_resuming 
iid_reheating 
iid_reprint 
iid_home 
iid_count 
54  {
56  iid_pause,
58  iid_stop,
59  iid_resume,
63  iid_home,
64  iid_count
65 } item_id_t;

Function Documentation

◆ reset_print_state()

void reset_print_state ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_init()

void screen_printing_init ( screen_t screen)
196  {
198  int16_t id;
199 
200  strcpy(pw->text_time, "0m");
201  strcpy(pw->text_filament, "999m");
202 
203  int16_t root = window_create_ptr(WINDOW_CLS_FRAME, -1,
204  rect_ui16(0, 0, 0, 0),
205  &(pw->root));
206 
208  rect_ui16(0, 0, 240, 31), &(pw->header));
210  p_window_header_set_text(&(pw->header), "PRINTING");
211 
213  rect_ui16(10, 33, 220, 29),
214  &(pw->w_filename));
215  pw->w_filename.font = resource_font(IDR_FNT_BIG);
216  window_set_padding(id, padding_ui8(0, 0, 0, 0));
219 
221  rect_ui16(10, 70, 220, 50),
222  &(pw->w_progress));
223  pw->w_progress.color_progress = COLOR_ORANGE;
224  pw->w_progress.font = resource_font(IDR_FNT_BIG);
225  pw->w_progress.height_progress = 14;
226 
228  rect_ui16(130, 128, 101, 20),
229  &(pw->w_etime_label));
230  pw->w_etime_label.font = resource_font(IDR_FNT_SMALL);
232  window_set_padding(id, padding_ui8(0, 2, 0, 2));
233  window_set_text(id, "Remaining Time");
234 
236  rect_ui16(130, 148, 101, 20),
237  &(pw->w_etime_value));
238  pw->w_etime_value.font = resource_font(IDR_FNT_SMALL);
240  window_set_padding(id, padding_ui8(0, 2, 0, 2));
241  window_set_text(id, pw->text_etime);
242 
244  rect_ui16(10, 128, 101, 20),
245  &(pw->w_time_label));
246  pw->w_time_label.font = resource_font(IDR_FNT_SMALL);
248  window_set_padding(id, padding_ui8(0, 2, 0, 2));
249  window_set_text(id, "Printing Time");
250 
252  rect_ui16(10, 148, 101, 20),
253  &(pw->w_time_value));
254  pw->w_time_value.font = resource_font(IDR_FNT_SMALL);
256  window_set_padding(id, padding_ui8(0, 2, 0, 2));
257  window_set_text(id, pw->text_time);
258 
260  rect_ui16(10, 75, 230, 95),
261  &(pw->w_message));
262  pw->w_time_value.font = resource_font(IDR_FNT_SMALL);
264  window_set_padding(id, padding_ui8(0, 2, 0, 2));
265  window_set_text(id, "No messages");
266  window_hide(id);
267  pw->message_flag = 0;
268 
269  for (uint8_t col = 0; col < 3; col++) {
270  id = window_create_ptr(
271  WINDOW_CLS_ICON, root,
272  rect_ui16(8 + (15 + 64) * col, 185, 64, 64),
273  &(pw->w_buttons[col]));
275  window_set_tag(id, col + 1);
276  window_enable(id);
277 
278  id = window_create_ptr(
279  WINDOW_CLS_TEXT, root,
280  rect_ui16(80 * col, 196 + 48 + 8, 80, 22),
281  &(pw->w_labels[col]));
282  pw->w_labels[col].font = resource_font(IDR_FNT_SMALL);
283  window_set_padding(id, padding_ui8(0, 0, 0, 0));
285  }
286 
287  //todo it is static, because menu tune is not dialog
288  //change_print_state(screen, P_INITIAL);
290 
291  status_footer_init(&(pw->footer), root);
292  screen_printing_timer(screen, 1000); // first fast value s update
294 }
Here is the call graph for this function:

◆ screen_printing_done()

void screen_printing_done ( screen_t screen)
296  {
297  window_destroy(pw->root.win.id);
298 }
Here is the call graph for this function:

◆ screen_printing_draw()

void screen_printing_draw ( screen_t screen)
300  {
301 }

◆ screen_printing_event()

int screen_printing_event ( screen_t screen,
window_t window,
uint8_t  event,
void param 
)
330  {
331  if (event == WINDOW_EVENT_MESSAGE && msg_stack.count > 0) {
332  open_popup_message(screen);
333  return 0;
334  }
335 
336  if (pw->message_flag != 0 && HAL_GetTick() - pw->message_timer >= POPUP_MSG_DUR_MS) {
337  close_popup_message(screen);
338  }
339 
345 
346  if (gui_msgbox("Bed leveling failed. Try again?", MSGBOX_BTN_YESNO) == MSGBOX_RES_YES) {
347  screen_printing_reprint(screen);
349  } else {
350  marlin_gcode("M104 S0");
351  marlin_gcode("M140 S0");
352  screen_close();
353  }
354  }
355  }
356 
357  if (p_window_header_event_clr(&(pw->header), MARLIN_EVT_MediaRemoved)) { // close screen when media removed
359  screen_close();
360  return 1;
361  }
363  }
364  window_header_events(&(pw->header));
365 
366  screen_printing_timer(screen, (HAL_GetTick() / 50) * 50);
367 
368  if (status_footer_event(&(pw->footer), window, event, param)) {
369  return 1;
370  }
371 
372  if (event != WINDOW_EVENT_CLICK) {
373  return 0;
374  }
375 
376  switch (((int)param) - 1) {
377  case BUTTON_TUNE:
379  case P_PRINTING:
380  case P_PAUSED:
382  break;
383  default:
384  break;
385  }
386  return 1;
387  break;
388  case BUTTON_PAUSE: {
389  //todo it is static, because menu tune is not dialog
390  //switch(pw->state__readonly__use_change_print_state)
392  case P_PRINTING:
394  break;
395  case P_PAUSED:
397  break;
398  case P_PRINTED:
399  screen_printing_reprint(screen);
400  break;
401  default:
402  break;
403  }
404  break;
405  }
406  case BUTTON_STOP:
407  //todo it is static, because menu tune is not dialog
408  //if(pw->state__readonly__use_change_print_state == P_PRINTED)
410  screen_close();
411  return 1;
412  } else if (gui_msgbox("Are you sure to stop this printing?",
414  == MSGBOX_RES_YES) {
416  while (marlin_vars()->sd_printing) {
417  gui_loop();
418  }
420  screen_close();
421  return 1;
422  }
423  break;
424  }
425  return 0;
426 }
Here is the call graph for this function:

◆ screen_printing_timer()

void screen_printing_timer ( screen_t screen,
uint32_t  seconds 
)
428  {
429  if ((mseconds - pw->last_timer_repaint) >= 1000) {
431  pw->last_timer_repaint = mseconds;
432  }
433 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_update_progress()

void screen_printing_update_progress ( screen_t screen)
506  {
507  if (marlin_reheating()) {
508  //todo it is static, because menu tune is not dialog
509  //if (pw->state__readonly__use_change_print_state != P_REHEATING)
511  change_print_state(screen, P_REHEATING); //state change is not checked inside
512  } else {
513  //todo it is static, because menu tune is not dialog
514  //switch(pw->state__readonly__use_change_print_state)
516  case P_REHEATING:
519  break;
520 
521  case P_PAUSING:
523  change_print_state(screen, P_PAUSED);
524  } //no break, need to do default
525  default:
526  _state_loop(screen);
527  }
528  }
529 
530  //const pduration_t e_time(ExtUI::getProgress_seconds_elapsed());
531 
532  const pduration_t e_time(marlin_vars()->print_duration);
533  e_time.to_string(pw->text_time);
534  window_set_text(pw->w_time_value.win.id, pw->text_time);
535  //_dbg("#.. progress / p :: %d t0: %d ?: %d\r",oProgressData.oPercentDirectControl.mGetValue(),oProgressData.oPercentDirectControl.nTime,oProgressData.oPercentDirectControl.mIsActual(print_job_timer.duration()));
536  //_dbg("#.. progress / P :: %d t0: %d ?: %d\r",oProgressData.oPercentDone.mGetValue(),oProgressData.oPercentDone.nTime,oProgressData.oPercentDone.mIsActual(print_job_timer.duration()));
537  //_dbg("#.. progress / R :: %d t0: %d ?: %d\r",oProgressData.oTime2End.mGetValue(),oProgressData.oTime2End.nTime,oProgressData.oTime2End.mIsActual(print_job_timer.duration()));
538  //_dbg("#.. progress / T :: %d t0: %d ?: %d\r",oProgressData.oTime2Pause.mGetValue(),oProgressData.oTime2Pause.nTime,oProgressData.oTime2Pause.mIsActual(print_job_timer.duration()));
539 
540  /*
541  sprintf(pw->text_filament, "1.2m");
542  window_set_text(pw->w_filament_value.win.id, pw->text_filament);
543  */
544 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_pause_print()

void screen_printing_pause_print ( screen_t screen)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_resume_print()

void screen_printing_resume_print ( screen_t screen)
552  {
555 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_reprint()

void screen_printing_reprint ( screen_t screen)
557  {
559  marlin_gcode("M24");
561  window_set_text(pw->w_etime_label.win.id, PSTR("Remaining Time")); // !!! "screen_printing_init()" is not invoked !!!
562 
565 
566  p_window_header_set_text(&(pw->header), "PRINTING");
567 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_printed()

void screen_printing_printed ( screen_t screen)
569  {
571  change_print_state(screen, P_PRINTED);
572  window_set_value(pw->w_progress.win.id, 100);
573 
574  p_window_header_set_text(&(pw->header), "PRINT DONE"); // beware! this must not hit the ethernet icon, so keep it short
575 
576  pw->w_progress.color_text = COLOR_VALUE_VALID;
577  window_set_text(pw->w_etime_label.win.id, PSTR(""));
578  window_set_text(pw->w_etime_value.win.id, PSTR(""));
579 
580  //screen_printing_disable_tune_button(screen);
581 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_mesh_err_stop_print()

void screen_mesh_err_stop_print ( screen_t screen)
583  {
584  double target_nozzle = marlin_vars()->target_nozzle;
585  double target_bed = marlin_vars()->target_bed;
587  while (marlin_vars()->sd_printing) {
588  gui_loop();
589  }
590  //marlin_park_head();
591  marlin_gcode_printf("M104 S%F", target_nozzle);
592  marlin_gcode_printf("M140 S%F", target_bed);
593  marlin_gcode("G0 Z30"); //Z 30mm
594  marlin_gcode("M84"); //Disable steppers
595  while (marlin_vars()->pqueue) {
596  gui_loop();
597  }
598 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ change_print_state()

void change_print_state ( screen_t screen,
printing_state_t  state 
)
698  {
699  _dbg("printstate %d entered", (int)st);
700  //todo it is static, because menu tune is not dialog
701  //pw->state__readonly__use_change_print_state = st;
703  set_pause_icon_and_label(screen);
704  set_tune_icon_and_label(screen);
705  set_stop_icon_and_label(screen);
706 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_update_remaining_time_progress()

static void screen_printing_update_remaining_time_progress ( screen_t screen)
static
483  {
484  uint8_t nPercent;
485  if (oProgressData.oPercentDone.mIsActual(marlin_vars()->print_duration)) {
487  oProgressData.oTime2End.mFormatSeconds(pw->text_etime, marlin_vars()->print_speed);
488  pw->w_etime_value.color_text = ((marlin_vars()->print_speed == 100) ? COLOR_VALUE_VALID : COLOR_VALUE_INVALID);
489  pw->w_progress.color_text = COLOR_VALUE_VALID;
490  //_dbg(".progress: %d\r",nPercent);
491  } else {
492  nPercent = marlin_vars()->sd_percent_done;
493  strcpy_P(pw->text_etime, PSTR("N/A"));
494  pw->w_etime_value.color_text = COLOR_VALUE_VALID;
495  pw->w_progress.color_text = COLOR_VALUE_INVALID;
496  //_dbg(".progress: %d ???\r",nPercent);
497  }
498  window_set_value(pw->w_progress.win.id, nPercent);
499  window_set_text(pw->w_etime_value.win.id, pw->text_etime);
500 
501  //-// _dbg("progress: %d", ExtUI::getProgress_percent());
502  _dbg("progress: %d", nPercent);
503  //_dbg("##% FeedRate %d",feedrate_percentage);
504 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_popup_message()

static void open_popup_message ( screen_t screen)
static
303  {
304  window_hide(pw->w_etime_label.win.id);
305  window_hide(pw->w_etime_value.win.id);
306  window_hide(pw->w_progress.win.id);
307  window_hide(pw->w_time_label.win.id);
308  window_hide(pw->w_time_value.win.id);
309 
310  window_set_text(pw->w_message.win.id, msg_stack.msg_data[0]);
311 
312  window_show(pw->w_message.win.id);
313  pw->message_timer = HAL_GetTick();
314  pw->message_flag = 1;
315 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_popup_message()

static void close_popup_message ( screen_t screen)
static
317  {
318  window_show(pw->w_etime_label.win.id);
319  window_show(pw->w_etime_value.win.id);
320  window_show(pw->w_progress.win.id);
321  window_show(pw->w_time_label.win.id);
322  window_show(pw->w_time_value.win.id);
323 
324  window_set_text(pw->w_message.win.id, "");
325 
326  window_hide(pw->w_message.win.id);
327  pw->message_flag = 0;
328 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_disable_tune_button()

void screen_printing_disable_tune_button ( screen_t screen)
434  {
435  window_icon_t *p_button = &pw->w_buttons[BUTTON_TUNE];
436  p_button->win.f_disabled = 1;
437  p_button->win.f_enabled = 0; // cant't be focused
438 
439  // move to reprint when tune is focused
440  if (window_is_focused(p_button->win.id)) {
441  window_set_focus(pw->w_buttons[BUTTON_PAUSE].win.id);
442  }
443  window_invalidate(p_button->win.id);
444 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_printing_enable_tune_button()

void screen_printing_enable_tune_button ( screen_t screen)
446  {
447  window_icon_t *p_button = &pw->w_buttons[BUTTON_TUNE];
448 
449  p_button->win.f_disabled = 0;
450  p_button->win.f_enabled = 1; // can be focused
451  window_invalidate(p_button->win.id);
452 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _state_loop()

void _state_loop ( screen_t screen)
454  {
455  //todo it is static, because menu tune is not dialog
456  //switch (pw->state__readonly__use_change_print_state)
457 
460  case P_PRINTING:
461  if ((!p_vars->sd_printing) && (marlin_command() != MARLIN_CMD_M600) && // prevent false trigering durring M600 TODO: better solution
462  !marlin_motion()) // wait for motors idle
463  screen_printing_printed(screen);
464  else
466  break;
467  case P_INITIAL:
468  case P_PAUSED:
469  case P_RESUMING:
470  case P_PRINTED:
471  case P_REHEATING_DONE:
472  //case P_MBL_FAILED:
473  if (p_vars->sd_printing) {
475  }
476  break;
477  case P_MBL_FAILED:
478  default:
479  break;
480  }
481 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_icon_and_label()

void set_icon_and_label ( item_id_t  id_to_set,
int16_t  btn_id,
int16_t  lbl_id 
)
600  {
601  if (window_get_icon_id(btn_id) != printing_icons[id_to_set])
602  window_set_icon_id(btn_id, printing_icons[id_to_set]);
603  //compare pointers to text, compare texts would take too long
604  if (window_get_text(lbl_id) != printing_labels[id_to_set])
605  window_set_text(lbl_id, printing_labels[id_to_set]);
606 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_button()

void enable_button ( window_icon_t p_button)
608  {
609  if (p_button->win.f_disabled) {
610  p_button->win.f_disabled = 0;
611  window_invalidate(p_button->win.id);
612  }
613 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disable_button()

void disable_button ( window_icon_t p_button)
615  {
616  if (!p_button->win.f_disabled) {
617  p_button->win.f_disabled = 1;
618  window_invalidate(p_button->win.id);
619  }
620 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_pause_icon_and_label()

void set_pause_icon_and_label ( screen_t screen)
622  {
623  window_icon_t *p_button = &pw->w_buttons[BUTTON_PAUSE];
624  int16_t btn_id = p_button->win.id;
625  int16_t lbl_id = pw->w_labels[BUTTON_PAUSE].win.id;
626 
627  //todo it is static, because menu tune is not dialog
628  //switch (pw->state__readonly__use_change_print_state)
630  case P_INITIAL:
631  case P_PRINTING:
632  case P_MBL_FAILED:
633  enable_button(p_button);
634  set_icon_and_label(iid_pause, btn_id, lbl_id);
635  break;
636  case P_PAUSING:
637  disable_button(p_button);
638  set_icon_and_label(iid_pausing, btn_id, lbl_id);
639  break;
640  case P_PAUSED:
641  enable_button(p_button);
642  set_icon_and_label(iid_resume, btn_id, lbl_id);
643  break;
644  case P_RESUMING:
645  disable_button(p_button);
646  set_icon_and_label(iid_resuming, btn_id, lbl_id);
647  break;
648  case P_REHEATING:
649  case P_REHEATING_DONE:
650  disable_button(p_button);
651  set_icon_and_label(iid_reheating, btn_id, lbl_id);
652  break;
653  case P_PRINTED:
654  enable_button(p_button);
655  set_icon_and_label(iid_reprint, btn_id, lbl_id);
656  break;
657  }
658 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_tune_icon_and_label()

void set_tune_icon_and_label ( screen_t screen)
660  {
661  window_icon_t *p_button = &pw->w_buttons[BUTTON_TUNE];
662  int16_t btn_id = p_button->win.id;
663  int16_t lbl_id = pw->w_labels[BUTTON_TUNE].win.id;
664 
665  //must be before switch
666  set_icon_and_label(iid_settings, btn_id, lbl_id);
667 
668  //todo it is static, because menu tune is not dialog
669  //switch (pw->state__readonly__use_change_print_state)
671  case P_PRINTING:
672  case P_PAUSED:
674  break;
675  default:
677  break;
678  }
679 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_stop_icon_and_label()

void set_stop_icon_and_label ( screen_t screen)
681  {
682  window_icon_t *p_button = &pw->w_buttons[BUTTON_STOP];
683  int16_t btn_id = p_button->win.id;
684  int16_t lbl_id = pw->w_labels[BUTTON_STOP].win.id;
685 
686  //todo it is static, because menu tune is not dialog
687  //switch (pw->state__readonly__use_change_print_state)
689  case P_PRINTED:
690  set_icon_and_label(iid_home, btn_id, lbl_id);
691  break;
692  default:
693  set_icon_and_label(iid_stop, btn_id, lbl_id);
694  break;
695  }
696 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ pscreen_home

screen_t* pscreen_home

◆ pscreen_menu_tune

screen_t* pscreen_menu_tune

◆ printing_icons

◆ printing_labels

const char* printing_labels[iid_count]
Initial value:
= {
"Tune",
"Pause",
"Pausing...",
"Stop",
"Resume",
"Resuming...",
"Heating...",
"Reprint",
"Home",
}

◆ state__readonly__use_change_print_state

printing_state_t state__readonly__use_change_print_state
static

◆ screen_printing

◆ pscreen_printing

const screen_t* pscreen_printing = &screen_printing

◆ screen_printing_file_name

char screen_printing_file_name[_MAX_LFN+1] = { '\0' }

◆ screen_printing_file_path

char screen_printing_file_path[_MAX_LFN+2] = { '\0' }
window_set_alignment
void window_set_alignment(int16_t id, uint8_t alignment)
Definition: window.c:561
set_tune_icon_and_label
void set_tune_icon_and_label(screen_t *screen)
Definition: screen_printing.cpp:660
IDR_PNG_status_icon_printing
#define IDR_PNG_status_icon_printing
Definition: resource.h:26
screen_printing_disable_tune_button
void screen_printing_disable_tune_button(screen_t *screen)
Definition: screen_printing.cpp:434
iid_reprint
Definition: screen_printing.cpp:62
screen_printing_init
void screen_printing_init(screen_t *screen)
Definition: screen_printing.cpp:196
IDR_PNG_menu_icon_settings
#define IDR_PNG_menu_icon_settings
Definition: resource.h:33
screen_printing_timer
void screen_printing_timer(screen_t *screen, uint32_t seconds)
Definition: screen_printing.cpp:428
pw
#define pw
Definition: screen_printing.cpp:167
open_popup_message
static void open_popup_message(screen_t *screen)
Definition: screen_printing.cpp:303
window_set_padding
void window_set_padding(int16_t id, padding_ui8_t padding)
Definition: window.c:549
msg_stack
Definition: marlin_server.h:26
_window_t::f_enabled
uint32_t f_enabled
Definition: window.h:86
printing_state_t
printing_state_t
Definition: screen_printing.cpp:42
state__readonly__use_change_print_state
static printing_state_t state__readonly__use_change_print_state
Definition: screen_printing.cpp:130
IDR_PNG_menu_icon_resume
#define IDR_PNG_menu_icon_resume
Definition: resource.h:37
COLOR_VALUE_INVALID
#define COLOR_VALUE_INVALID
Definition: screen_printing.cpp:29
marlin_park_head
void marlin_park_head(void)
Definition: marlin_client.c:499
IDR_PNG_menu_icon_stop
#define IDR_PNG_menu_icon_stop
Definition: resource.h:36
window_set_color_back
void window_set_color_back(int16_t id, color_t clr)
Definition: window.c:431
screen_printing_update_progress
void screen_printing_update_progress(screen_t *screen)
Definition: screen_printing.cpp:506
window_header_events
#define window_header_events(window)
Definition: window_header.h:72
screen_printing_printed
void screen_printing_printed(screen_t *screen)
Definition: screen_printing.cpp:569
screen_mesh_err_stop_print
void screen_mesh_err_stop_print(screen_t *screen)
Definition: screen_printing.cpp:583
marlin_print_pause
void marlin_print_pause(void)
Definition: marlin_client.c:483
P_MBL_FAILED
Definition: screen_printing.cpp:50
marlin_print_resume
void marlin_print_resume(void)
Definition: marlin_client.c:491
screen_printing_file_path
char screen_printing_file_path[_MAX_LFN+2]
Definition: screen_printing.cpp:165
screen_printing_reprint
void screen_printing_reprint(screen_t *screen)
Definition: screen_printing.cpp:557
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
window_invalidate
void window_invalidate(int16_t id)
Definition: window.c:304
P_RESUMING
Definition: screen_printing.cpp:47
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
iid_stop
Definition: screen_printing.cpp:58
screen_printing_draw
void screen_printing_draw(screen_t *screen)
Definition: screen_printing.cpp:300
BUTTON_PAUSE
#define BUTTON_PAUSE
Definition: screen_printing.cpp:32
window_destroy
void window_destroy(int16_t id)
Definition: window.c:132
padding_ui8
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
iid_home
Definition: screen_printing.cpp:63
screen_printing_file_name
char screen_printing_file_name[_MAX_LFN+1]
Definition: screen_printing.cpp:164
MSGBOX_ICO_WARNING
#define MSGBOX_ICO_WARNING
Definition: window_msgbox.h:35
window_set_icon_id
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
msg_stack::count
uint8_t count
Definition: marlin_server.h:29
screen_printing_pause_print
void screen_printing_pause_print(screen_t *screen)
Definition: screen_printing.cpp:546
MARLIN_CMD_M600
#define MARLIN_CMD_M600
Definition: marlin_events.h:57
screen_printing_done
void screen_printing_done(screen_t *screen)
Definition: screen_printing.cpp:296
_window_icon_t
Definition: window_icon.h:11
P_PAUSING
Definition: screen_printing.cpp:45
P_INITIAL
Definition: screen_printing.cpp:43
screen_open
void screen_open(int16_t screen_id)
Definition: screen.c:62
enable_button
void enable_button(window_icon_t *p_button)
Definition: screen_printing.cpp:608
MSGBOX_DEF_BUTTON1
#define MSGBOX_DEF_BUTTON1
Definition: window_msgbox.h:55
ClProgressData::oTime2End
ClValidityValueSec oTime2End
Definition: M73_PE.h:39
ALIGN_LEFT_BOTTOM
#define ALIGN_LEFT_BOTTOM
Definition: guitypes.h:22
set_pause_icon_and_label
void set_pause_icon_and_label(screen_t *screen)
Definition: screen_printing.cpp:622
_window_t::f_disabled
uint32_t f_disabled
Definition: window.h:91
window_show
void window_show(int16_t id)
Definition: window.c:529
iid_settings
Definition: screen_printing.cpp:55
marlin_error_clr
int marlin_error_clr(uint8_t err_id)
Definition: marlin_client.c:324
strcpy_P
#define strcpy_P(dest, src)
Definition: pgmspace.h:56
iid_resuming
Definition: screen_printing.cpp:60
ALIGN_LEFT_TOP
#define ALIGN_LEFT_TOP
Definition: guitypes.h:20
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
_window_t::id
int16_t id
Definition: window.h:79
screen_close
void screen_close(void)
Definition: screen.c:80
P_PRINTED
Definition: screen_printing.cpp:51
COLOR_GRAY
#define COLOR_GRAY
Definition: guitypes.h:50
MARLIN_ERR_ProbingFailed
#define MARLIN_ERR_ProbingFailed
Definition: marlin_errors.h:9
msg_stack::msg_data
char msg_data[MSG_STACK_SIZE][MSG_MAX_LENGTH]
Definition: marlin_server.h:28
iid_count
Definition: screen_printing.cpp:64
close_popup_message
static void close_popup_message(screen_t *screen)
Definition: screen_printing.cpp:317
POPUP_MSG_DUR_MS
#define POPUP_MSG_DUR_MS
Definition: screen_printing.cpp:35
printing_icons
const uint16_t printing_icons[iid_count]
Definition: screen_printing.cpp:69
ALIGN_RIGHT_BOTTOM
#define ALIGN_RIGHT_BOTTOM
Definition: guitypes.h:25
_window_icon_t::win
window_t win
Definition: window_icon.h:12
PSTR
#define PSTR(str)
Definition: pgmspace.h:31
set_stop_icon_and_label
void set_stop_icon_and_label(screen_t *screen)
Definition: screen_printing.cpp:681
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
set_icon_and_label
void set_icon_and_label(item_id_t id_to_set, int16_t btn_id, int16_t lbl_id)
Definition: screen_printing.cpp:600
marlin_motion
int marlin_motion(void)
Definition: marlin_client.c:182
COLOR_ORANGE
#define COLOR_ORANGE
Definition: guitypes.h:57
WINDOW_CLS_PROGRESS
#define WINDOW_CLS_PROGRESS
Definition: window.h:20
pduration_t
Definition: screen_printing.cpp:169
marlin_vars
marlin_vars_t * marlin_vars(void)
Definition: marlin_client.c:361
marlin_reheating
int marlin_reheating(void)
Definition: marlin_client.c:553
MSGBOX_RES_YES
#define MSGBOX_RES_YES
Definition: window_msgbox.h:44
screen_printing_event
int screen_printing_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_printing.cpp:330
WINDOW_CLS_FRAME
#define WINDOW_CLS_FRAME
Definition: window.h:9
disable_button
void disable_button(window_icon_t *p_button)
Definition: screen_printing.cpp:615
window_set_value
void window_set_value(int16_t id, float value)
Definition: window.c:363
_marlin_vars_t::target_nozzle
float target_nozzle
Definition: marlin_vars.h:85
iid_pausing
Definition: screen_printing.cpp:57
window_set_focus
void window_set_focus(int16_t id)
Definition: window.c:480
COLOR_VALUE_VALID
#define COLOR_VALUE_VALID
Definition: screen_printing.cpp:27
BUTTON_STOP
#define BUTTON_STOP
Definition: screen_printing.cpp:33
iid_pause
Definition: screen_printing.cpp:56
P_PAUSED
Definition: screen_printing.cpp:46
window_is_focused
int window_is_focused(int16_t id)
Definition: window.c:267
window_set_tag
void window_set_tag(int16_t id, uint8_t tag)
Definition: window.c:329
marlin_gcode
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
window_get_icon_id
uint16_t window_get_icon_id(int16_t id)
Definition: window.c:671
P_PRINTING
Definition: screen_printing.cpp:44
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
uint8_t
const uint8_t[]
Definition: 404_html.c:3
ClProgressData::mInit
void mInit(void)
Definition: M73_PE.cpp:73
IDR_FNT_BIG
#define IDR_FNT_BIG
Definition: resource.h:11
_dbg
#define _dbg(...)
Definition: dbg.h:50
screen_printing_update_remaining_time_progress
static void screen_printing_update_remaining_time_progress(screen_t *screen)
Definition: screen_printing.cpp:483
iid_reheating
Definition: screen_printing.cpp:61
MARLIN_VAR_MSK
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
window_hide
void window_hide(int16_t id)
Definition: window.c:539
WINDOW_CLS_ICON
#define WINDOW_CLS_ICON
Definition: window.h:12
oProgressData
ClProgressData oProgressData
Definition: M73_PE.cpp:15
ClValidityValueSec::mFormatSeconds
void mFormatSeconds(char *sStr, uint16_t nFeedrate)
Definition: M73_PE.cpp:54
ClValidityValue::mIsActual
bool mIsActual(uint32_t nNow)
Definition: M73_PE.cpp:36
iid_resume
Definition: screen_printing.cpp:59
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
marlin_command
uint32_t marlin_command(void)
Definition: marlin_client.c:159
MARLIN_VAR_SD_PRINT
#define MARLIN_VAR_SD_PRINT
Definition: marlin_vars.h:29
_marlin_vars_t::print_speed
uint16_t print_speed
Definition: marlin_vars.h:89
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
printing_labels
const char * printing_labels[iid_count]
Definition: screen_printing.cpp:81
pscreen_menu_tune
screen_t * pscreen_menu_tune
Definition: screen_menu_tune.cpp:203
MSGBOX_BTN_YESNO
#define MSGBOX_BTN_YESNO
Definition: window_msgbox.h:24
window_create_ptr
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
IDR_PNG_menu_icon_home
#define IDR_PNG_menu_icon_home
Definition: resource.h:38
window_enable
void window_enable(int16_t id)
Definition: window.c:517
_marlin_vars_t::sd_percent_done
uint8_t sd_percent_done
Definition: marlin_vars.h:94
IDR_FNT_SMALL
#define IDR_FNT_SMALL
Definition: resource.h:9
_state_loop
void _state_loop(screen_t *screen)
Definition: screen_printing.cpp:454
screen_printing_resume_print
void screen_printing_resume_print(screen_t *screen)
Definition: screen_printing.cpp:552
_screen_t::id
int16_t id
Definition: screen.h:19
change_print_state
void change_print_state(screen_t *screen, printing_state_t state)
Definition: screen_printing.cpp:698
ClValidityValue::mGetValue
uint32_t mGetValue(void)
Definition: M73_PE.cpp:31
WINDOW_EVENT_MESSAGE
#define WINDOW_EVENT_MESSAGE
Definition: window.h:51
BUTTON_TUNE
#define BUTTON_TUNE
Definition: screen_printing.cpp:31
item_id_t
item_id_t
Definition: screen_printing.cpp:54
WINDOW_CLS_HEADER
int16_t WINDOW_CLS_HEADER
Definition: window_header.c:24
screen_printing_enable_tune_button
void screen_printing_enable_tune_button(screen_t *screen)
Definition: screen_printing.cpp:446
marlin_error
int marlin_error(uint8_t err_id)
Definition: marlin_client.c:304
marlin_print_abort
void marlin_print_abort(void)
Definition: marlin_client.c:475
MARLIN_EVT_MediaRemoved
#define MARLIN_EVT_MediaRemoved
Definition: marlin_events.h:13
P_REHEATING_DONE
Definition: screen_printing.cpp:49
screen_printing_data_t
Definition: screen_printing.cpp:96
IDR_PNG_menu_icon_pause
#define IDR_PNG_menu_icon_pause
Definition: resource.h:35
ClProgressData::oPercentDone
ClValidityValue oPercentDone
Definition: M73_PE.h:38
IDR_PNG_menu_icon_reprint
#define IDR_PNG_menu_icon_reprint
Definition: resource.h:31
p_window_header_event_clr
int p_window_header_event_clr(window_header_t *window, uint8_t evt_id)
Definition: window_header.c:157
marlin_set_print_speed
uint16_t marlin_set_print_speed(uint16_t val)
Definition: marlin_client.c:417
window_get_text
char * window_get_text(int16_t id)
Definition: window.c:352
_marlin_vars_t::target_bed
float target_bed
Definition: marlin_vars.h:86
p_window_header_set_icon
void p_window_header_set_icon(window_header_t *window, uint16_t id_res)
Definition: window_header.c:121
marlin_gcode_printf
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
p_window_header_set_text
void p_window_header_set_text(window_header_t *window, const char *text)
Definition: window_header.c:152
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
P_REHEATING
Definition: screen_printing.cpp:48
MARLIN_EVT_UserConfirmRequired
#define MARLIN_EVT_UserConfirmRequired
Definition: marlin_events.h:19