Prusa MINI Firmware overview
|
#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"
|
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
} |
|
◆ COLOR_VALUE_VALID
◆ COLOR_VALUE_INVALID
◆ BUTTON_TUNE
◆ BUTTON_PAUSE
◆ BUTTON_STOP
◆ POPUP_MSG_DUR_MS
#define POPUP_MSG_DUR_MS 5000 |
◆ HEATING_DIFFERENCE
#define HEATING_DIFFERENCE 1 |
◆ pw
◆ printing_state_t
Enumerator |
---|
P_INITIAL | |
P_PRINTING | |
P_PAUSING | |
P_PAUSED | |
P_RESUMING | |
P_REHEATING | |
P_REHEATING_DONE | |
P_MBL_FAILED | |
P_PRINTED | |
◆ item_id_t
Enumerator |
---|
iid_settings | |
iid_pause | |
iid_pausing | |
iid_stop | |
iid_resume | |
iid_resuming | |
iid_reheating | |
iid_reprint | |
iid_home | |
iid_count | |
◆ reset_print_state()
◆ screen_printing_init()
200 strcpy(
pw->text_time,
"0m");
201 strcpy(
pw->text_filament,
"999m");
225 pw->w_progress.height_progress = 14;
229 &(
pw->w_etime_label));
237 &(
pw->w_etime_value));
245 &(
pw->w_time_label));
253 &(
pw->w_time_value));
267 pw->message_flag = 0;
269 for (
uint8_t col = 0; col < 3; col++) {
272 rect_ui16(8 + (15 + 64) * col, 185, 64, 64),
273 &(
pw->w_buttons[col]));
280 rect_ui16(80 * col, 196 + 48 + 8, 80, 22),
281 &(
pw->w_labels[col]));
◆ screen_printing_done()
◆ screen_printing_draw()
◆ screen_printing_event()
376 switch (((
int)param) - 1) {
412 }
else if (gui_msgbox(
"Are you sure to stop this printing?",
◆ screen_printing_timer()
void screen_printing_timer |
( |
screen_t * |
screen, |
|
|
uint32_t |
seconds |
|
) |
| |
429 if ((mseconds -
pw->last_timer_repaint) >= 1000) {
431 pw->last_timer_repaint = mseconds;
◆ screen_printing_update_progress()
533 e_time.to_string(
pw->text_time);
◆ screen_printing_pause_print()
◆ screen_printing_resume_print()
◆ screen_printing_reprint()
◆ screen_printing_printed()
◆ screen_mesh_err_stop_print()
◆ change_print_state()
699 _dbg(
"printstate %d entered", (
int)st);
◆ screen_printing_update_remaining_time_progress()
static void screen_printing_update_remaining_time_progress |
( |
screen_t * |
screen | ) |
|
|
static |
502 _dbg(
"progress: %d", nPercent);
◆ open_popup_message()
314 pw->message_flag = 1;
◆ close_popup_message()
327 pw->message_flag = 0;
◆ screen_printing_disable_tune_button()
void screen_printing_disable_tune_button |
( |
screen_t * |
screen | ) |
|
◆ screen_printing_enable_tune_button()
void screen_printing_enable_tune_button |
( |
screen_t * |
screen | ) |
|
◆ _state_loop()
473 if (p_vars->sd_printing) {
◆ set_icon_and_label()
void set_icon_and_label |
( |
item_id_t |
id_to_set, |
|
|
int16_t |
btn_id, |
|
|
int16_t |
lbl_id |
|
) |
| |
◆ enable_button()
◆ disable_button()
◆ set_pause_icon_and_label()
624 int16_t btn_id = p_button->
win.
id;
◆ set_tune_icon_and_label()
662 int16_t btn_id = p_button->
win.
id;
◆ set_stop_icon_and_label()
683 int16_t btn_id = p_button->
win.
id;
◆ pscreen_home
◆ pscreen_menu_tune
◆ printing_icons
◆ printing_labels
Initial value:= {
"Tune",
"Pause",
"Pausing...",
"Stop",
"Resume",
"Resuming...",
"Heating...",
"Reprint",
"Home",
}
◆ state__readonly__use_change_print_state
◆ screen_printing
◆ pscreen_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' } |
void window_set_alignment(int16_t id, uint8_t alignment)
Definition: window.c:561
void set_tune_icon_and_label(screen_t *screen)
Definition: screen_printing.cpp:660
#define IDR_PNG_status_icon_printing
Definition: resource.h:26
void screen_printing_disable_tune_button(screen_t *screen)
Definition: screen_printing.cpp:434
Definition: screen_printing.cpp:62
void screen_printing_init(screen_t *screen)
Definition: screen_printing.cpp:196
#define IDR_PNG_menu_icon_settings
Definition: resource.h:33
void screen_printing_timer(screen_t *screen, uint32_t seconds)
Definition: screen_printing.cpp:428
#define pw
Definition: screen_printing.cpp:167
static void open_popup_message(screen_t *screen)
Definition: screen_printing.cpp:303
void window_set_padding(int16_t id, padding_ui8_t padding)
Definition: window.c:549
Definition: marlin_server.h:26
uint32_t f_enabled
Definition: window.h:86
printing_state_t
Definition: screen_printing.cpp:42
static printing_state_t state__readonly__use_change_print_state
Definition: screen_printing.cpp:130
#define IDR_PNG_menu_icon_resume
Definition: resource.h:37
#define COLOR_VALUE_INVALID
Definition: screen_printing.cpp:29
void marlin_park_head(void)
Definition: marlin_client.c:499
#define IDR_PNG_menu_icon_stop
Definition: resource.h:36
void window_set_color_back(int16_t id, color_t clr)
Definition: window.c:431
void screen_printing_update_progress(screen_t *screen)
Definition: screen_printing.cpp:506
void screen_printing_printed(screen_t *screen)
Definition: screen_printing.cpp:569
void screen_mesh_err_stop_print(screen_t *screen)
Definition: screen_printing.cpp:583
void marlin_print_pause(void)
Definition: marlin_client.c:483
Definition: screen_printing.cpp:50
void marlin_print_resume(void)
Definition: marlin_client.c:491
char screen_printing_file_path[_MAX_LFN+2]
Definition: screen_printing.cpp:165
void screen_printing_reprint(screen_t *screen)
Definition: screen_printing.cpp:557
#define ALIGN_CENTER
Definition: guitypes.h:19
void window_invalidate(int16_t id)
Definition: window.c:304
Definition: screen_printing.cpp:47
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
Definition: screen_printing.cpp:58
void screen_printing_draw(screen_t *screen)
Definition: screen_printing.cpp:300
#define BUTTON_PAUSE
Definition: screen_printing.cpp:32
void window_destroy(int16_t id)
Definition: window.c:132
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
Definition: screen_printing.cpp:63
char screen_printing_file_name[_MAX_LFN+1]
Definition: screen_printing.cpp:164
#define MSGBOX_ICO_WARNING
Definition: window_msgbox.h:35
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
uint8_t count
Definition: marlin_server.h:29
void screen_printing_pause_print(screen_t *screen)
Definition: screen_printing.cpp:546
#define MARLIN_CMD_M600
Definition: marlin_events.h:57
void screen_printing_done(screen_t *screen)
Definition: screen_printing.cpp:296
Definition: window_icon.h:11
Definition: screen_printing.cpp:45
Definition: screen_printing.cpp:43
void screen_open(int16_t screen_id)
Definition: screen.c:62
void enable_button(window_icon_t *p_button)
Definition: screen_printing.cpp:608
#define MSGBOX_DEF_BUTTON1
Definition: window_msgbox.h:55
ClValidityValueSec oTime2End
Definition: M73_PE.h:39
#define ALIGN_LEFT_BOTTOM
Definition: guitypes.h:22
void set_pause_icon_and_label(screen_t *screen)
Definition: screen_printing.cpp:622
uint32_t f_disabled
Definition: window.h:91
void window_show(int16_t id)
Definition: window.c:529
Definition: screen_printing.cpp:55
int marlin_error_clr(uint8_t err_id)
Definition: marlin_client.c:324
#define strcpy_P(dest, src)
Definition: pgmspace.h:56
Definition: screen_printing.cpp:60
#define ALIGN_LEFT_TOP
Definition: guitypes.h:20
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
int16_t id
Definition: window.h:79
void screen_close(void)
Definition: screen.c:80
Definition: screen_printing.cpp:51
#define COLOR_GRAY
Definition: guitypes.h:50
#define MARLIN_ERR_ProbingFailed
Definition: marlin_errors.h:9
char msg_data[MSG_STACK_SIZE][MSG_MAX_LENGTH]
Definition: marlin_server.h:28
Definition: screen_printing.cpp:64
static void close_popup_message(screen_t *screen)
Definition: screen_printing.cpp:317
#define POPUP_MSG_DUR_MS
Definition: screen_printing.cpp:35
const uint16_t printing_icons[iid_count]
Definition: screen_printing.cpp:69
#define ALIGN_RIGHT_BOTTOM
Definition: guitypes.h:25
window_t win
Definition: window_icon.h:12
#define PSTR(str)
Definition: pgmspace.h:31
void set_stop_icon_and_label(screen_t *screen)
Definition: screen_printing.cpp:681
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
void set_icon_and_label(item_id_t id_to_set, int16_t btn_id, int16_t lbl_id)
Definition: screen_printing.cpp:600
int marlin_motion(void)
Definition: marlin_client.c:182
#define COLOR_ORANGE
Definition: guitypes.h:57
#define WINDOW_CLS_PROGRESS
Definition: window.h:20
Definition: screen_printing.cpp:169
marlin_vars_t * marlin_vars(void)
Definition: marlin_client.c:361
int marlin_reheating(void)
Definition: marlin_client.c:553
#define MSGBOX_RES_YES
Definition: window_msgbox.h:44
int screen_printing_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_printing.cpp:330
#define WINDOW_CLS_FRAME
Definition: window.h:9
void disable_button(window_icon_t *p_button)
Definition: screen_printing.cpp:615
void window_set_value(int16_t id, float value)
Definition: window.c:363
float target_nozzle
Definition: marlin_vars.h:85
Definition: screen_printing.cpp:57
void window_set_focus(int16_t id)
Definition: window.c:480
#define COLOR_VALUE_VALID
Definition: screen_printing.cpp:27
#define BUTTON_STOP
Definition: screen_printing.cpp:33
Definition: screen_printing.cpp:56
Definition: screen_printing.cpp:46
int window_is_focused(int16_t id)
Definition: window.c:267
void window_set_tag(int16_t id, uint8_t tag)
Definition: window.c:329
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
uint16_t window_get_icon_id(int16_t id)
Definition: window.c:671
Definition: screen_printing.cpp:44
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
const uint8_t[]
Definition: 404_html.c:3
void mInit(void)
Definition: M73_PE.cpp:73
#define IDR_FNT_BIG
Definition: resource.h:11
#define _dbg(...)
Definition: dbg.h:50
static void screen_printing_update_remaining_time_progress(screen_t *screen)
Definition: screen_printing.cpp:483
Definition: screen_printing.cpp:61
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
void window_hide(int16_t id)
Definition: window.c:539
#define WINDOW_CLS_ICON
Definition: window.h:12
ClProgressData oProgressData
Definition: M73_PE.cpp:15
void mFormatSeconds(char *sStr, uint16_t nFeedrate)
Definition: M73_PE.cpp:54
bool mIsActual(uint32_t nNow)
Definition: M73_PE.cpp:36
Definition: screen_printing.cpp:59
#define WINDOW_CLS_TEXT
Definition: window.h:10
uint32_t marlin_command(void)
Definition: marlin_client.c:159
#define MARLIN_VAR_SD_PRINT
Definition: marlin_vars.h:29
uint16_t print_speed
Definition: marlin_vars.h:89
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
#define WINDOW_EVENT_CLICK
Definition: window.h:46
const char * printing_labels[iid_count]
Definition: screen_printing.cpp:81
screen_t * pscreen_menu_tune
Definition: screen_menu_tune.cpp:203
#define MSGBOX_BTN_YESNO
Definition: window_msgbox.h:24
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
#define IDR_PNG_menu_icon_home
Definition: resource.h:38
void window_enable(int16_t id)
Definition: window.c:517
uint8_t sd_percent_done
Definition: marlin_vars.h:94
#define IDR_FNT_SMALL
Definition: resource.h:9
void _state_loop(screen_t *screen)
Definition: screen_printing.cpp:454
void screen_printing_resume_print(screen_t *screen)
Definition: screen_printing.cpp:552
int16_t id
Definition: screen.h:19
void change_print_state(screen_t *screen, printing_state_t state)
Definition: screen_printing.cpp:698
uint32_t mGetValue(void)
Definition: M73_PE.cpp:31
#define WINDOW_EVENT_MESSAGE
Definition: window.h:51
#define BUTTON_TUNE
Definition: screen_printing.cpp:31
item_id_t
Definition: screen_printing.cpp:54
void screen_printing_enable_tune_button(screen_t *screen)
Definition: screen_printing.cpp:446
int marlin_error(uint8_t err_id)
Definition: marlin_client.c:304
void marlin_print_abort(void)
Definition: marlin_client.c:475
#define MARLIN_EVT_MediaRemoved
Definition: marlin_events.h:13
Definition: screen_printing.cpp:49
Definition: screen_printing.cpp:96
#define IDR_PNG_menu_icon_pause
Definition: resource.h:35
ClValidityValue oPercentDone
Definition: M73_PE.h:38
#define IDR_PNG_menu_icon_reprint
Definition: resource.h:31
uint16_t marlin_set_print_speed(uint16_t val)
Definition: marlin_client.c:417
char * window_get_text(int16_t id)
Definition: window.c:352
float target_bed
Definition: marlin_vars.h:86
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
Definition: screen_printing.cpp:48
#define MARLIN_EVT_UserConfirmRequired
Definition: marlin_events.h:19