Prusa MINI Firmware overview
|
#include "window_dlg_statemachine.h"
#include "display_helper.h"
#include "gui.h"
#include "dbg.h"
#include "menu_vars.h"
#include "stm32f4xx_hal.h"
#include <limits.h>
#include "button_draw.h"
|
static uint32_t | _phase_time_total (int phase, const _cl_dlg *_ths) |
|
static void | clr_logs () |
|
static void | is_part_log (int part_progress) |
|
static void | progress_changed_log (int progress) |
|
static void | phase_changed_log (int phase, int base_progress) |
|
static void | print_log () |
|
void | set_repaint_btn_flg (window_dlg_statemachine_t *window) |
|
int | is_repaint_btn_flg (window_dlg_statemachine_t *window) |
|
void | window_dlg_statemachine_init (window_dlg_statemachine_t *window) |
|
rect_ui16_t | _get_dlg_statemachine_button_size (window_dlg_statemachine_t *window) |
|
void | window_dlg_statemachine_draw_1bt (window_dlg_statemachine_t *window) |
|
void | window_dlg_statemachine_draw_0bt (window_dlg_statemachine_t *window) |
|
void | _window_dlg_statemachine_draw_frame (window_dlg_statemachine_t *window) |
|
void | progress_draw (rect_ui16_t win_rect, font_t *font, color_t color_back, color_t color_text, padding_ui8_t padding, uint8_t progress) |
|
void | progress_clr (rect_ui16_t win_rect, font_t *font, color_t color_back) |
|
void | window_dlg_statemachine_draw_progress_tot (window_dlg_statemachine_t *window) |
|
void | window_dlg_statemachine_draw_progress_part (window_dlg_statemachine_t *window) |
|
void | window_dlg_statemachine_draw_progress_none (window_dlg_statemachine_t *window) |
|
void | _window_dlg_statemachine_draw_phase_text (window_dlg_statemachine_t *window) |
|
void | window_dlg_statemachine_draw (window_dlg_statemachine_t *window) |
|
void | window_dlg_statemachine_event (window_dlg_statemachine_t *window, uint8_t event, void *param) |
|
void | window_dlg_statemachine_event_1bt (window_dlg_statemachine_t *window, uint8_t event, void *param) |
|
dlg_result_t | _gui_dlg (const _cl_dlg *_ths, void *p_additional_vars, int32_t ttl) |
|
◆ DBG_LOAD_PROGRESS
#define DBG_LOAD_PROGRESS 0 |
◆ DLG_FRAME_ENA
◆ DLG_SHI_MOD
◆ DLG_SHI_CHG
◆ DLG_DRA_FR
#define DLG_DRA_FR 0x0000 |
◆ DLG_BTN_CH
#define DLG_BTN_CH 0x1000 |
◆ DLG_TXT_CH
#define DLG_TXT_CH 0x2000 |
◆ DLG_PRO_CH
#define DLG_PRO_CH 0x4000 |
◆ DLG_PPR_CH
#define DLG_PPR_CH 0x8000 |
◆ DLG_PRX_CH
◆ DLG_PHA_CH
◆ DLG_MSK_MOD
#define DLG_MSK_MOD 0x0003 |
◆ DLG_MSK_CHG
◆ _phase_time_total()
static uint32_t _phase_time_total |
( |
int |
phase, |
|
|
const _cl_dlg * |
_ths |
|
) |
| |
|
static |
◆ clr_logs()
◆ is_part_log()
static void is_part_log |
( |
int |
part_progress | ) |
|
|
static |
◆ progress_changed_log()
static void progress_changed_log |
( |
int |
progress | ) |
|
|
static |
◆ phase_changed_log()
static void phase_changed_log |
( |
int |
phase, |
|
|
int |
base_progress |
|
) |
| |
|
static |
◆ print_log()
static void print_log |
( |
| ) |
|
|
static |
◆ set_repaint_btn_flg()
◆ is_repaint_btn_flg()
◆ window_dlg_statemachine_init()
◆ _get_dlg_statemachine_button_size()
80 rc_btn.
y += (rc_btn.
h - 40);
◆ window_dlg_statemachine_draw_1bt()
◆ window_dlg_statemachine_draw_0bt()
◆ _window_dlg_statemachine_draw_frame()
◆ progress_draw()
116 uint16_t w = rc_pro.
w;
117 rc_pro.
w = w * progress / 100;
119 rc_pro.
x += rc_pro.
w;
120 rc_pro.
w = w - rc_pro.
w;
122 rc_pro.
y += rc_pro.
h;
123 rc_pro.
w = win_rect.
w - 120;
124 rc_pro.
x = win_rect.
x + 60;
126 sprintf(text,
"%d%%", progress);
◆ progress_clr()
137 rc_pro.
y += rc_pro.
h;
138 rc_pro.
w = win_rect.
w - 120;
139 rc_pro.
x = win_rect.
x + 60;
◆ window_dlg_statemachine_draw_progress_tot()
◆ window_dlg_statemachine_draw_progress_part()
◆ window_dlg_statemachine_draw_progress_none()
◆ _window_dlg_statemachine_draw_phase_text()
164 for (nl = 0; s[nl]; s[nl] ==
'\n' ? nl++ : *s++)
167 rc_sta.
y += (30 + 46);
◆ window_dlg_statemachine_draw()
◆ window_dlg_statemachine_event()
231 if (event_cb !=
NULL)
232 event_cb(window, event, param);
◆ window_dlg_statemachine_event_1bt()
◆ _gui_dlg()
261 memset(&dlg, 0,
sizeof(dlg));
266 gui_reset_jogwheel();
287 if ((uint32_t)(
HAL_GetTick() - start_tick) >= (uint32_t)ttl) {
317 if (part_progress > 100)
319 if (part_progress < 0)
◆ WINDOW_CLS_DLG_LOADUNLOAD
int16_t WINDOW_CLS_DLG_LOADUNLOAD = 0 |
◆ window_1
◆ window_class_dlg_statemachine
const dlg_cb_t on_timeout
Definition: window_dlg_statemachine.h:83
static void phase_changed_log(int phase, int base_progress)
Definition: window_dlg_statemachine.c:461
void() window_draw_t(void *window)
Definition: window.h:57
const _cl_dlg * _ths
Definition: window_dlg_statemachine.h:97
const _dlg_state * p_states
Definition: window_dlg_statemachine.h:79
#define BT_ENABLED
Definition: window_dlg_statemachine.h:15
int16_t WINDOW_CLS_DLG_LOADUNLOAD
Definition: window_dlg_statemachine.c:37
void progress_draw(rect_ui16_t win_rect, font_t *font, color_t color_back, color_t color_text, padding_ui8_t padding, uint8_t progress)
Definition: window_dlg_statemachine.c:108
int16_t window_capture(void)
Definition: window.c:169
uint16_t y
Definition: guitypes.h:71
uint8_t h
Definition: guitypes.h:78
color_t color_back
Definition: window_dlg_statemachine.h:89
uint16_t h
Definition: display.h:26
uint16_t w
Definition: guitypes.h:72
#define DLG_BT_FLG
Definition: window_dlg_statemachine.h:19
void _window_dlg_statemachine_draw_phase_text(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:160
uint8_t flags
Definition: window_dlg_statemachine.h:38
#define DLG_PRX_CH
Definition: window_dlg_statemachine.c:31
window_draw_dlg_cb_t * progress_draw
Definition: window_dlg_statemachine.h:70
color_t color_text
Definition: guitypes.h:108
#define BT_AUTOEXIT
Definition: window_dlg_statemachine.h:17
const dlg_loop_cb_t on_loop
Definition: window_dlg_statemachine.h:82
#define DLG_PPR_CH
Definition: window_dlg_statemachine.c:30
#define ALIGN_CENTER
Definition: guitypes.h:19
void window_invalidate(int16_t id)
Definition: window.c:304
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
void progress_clr(rect_ui16_t win_rect, font_t *font, color_t color_back)
Definition: window_dlg_statemachine.c:130
dlg_state_func state_fnc
Definition: window_dlg_statemachine.h:73
font_t * font
Definition: guitypes.h:110
const char * text
Definition: window_dlg_statemachine.h:71
void window_destroy(int16_t id)
Definition: window.c:132
uint8_t last_text_h
Definition: window_dlg_statemachine.h:95
#define WINDOW_CLS_USER
Definition: window.h:21
#define DLG_BTN_CH
Definition: window_dlg_statemachine.c:27
rect_ui16_t msg_box_sz
Definition: guitypes.h:114
void window_dlg_statemachine_init(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:57
static void print_log()
Definition: window_dlg_statemachine.c:463
int8_t phase
Definition: window_dlg_statemachine.h:39
void _window_dlg_statemachine_draw_frame(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:100
#define NULL
Definition: usbd_def.h:53
color_t color_text
Definition: window_dlg_statemachine.h:90
Definition: window_dlg_statemachine.h:87
display_fill_rect_t * fill_rect
Definition: display.h:33
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
_dlg_vars vars
Definition: window_dlg_statemachine.h:98
uint32_t f_invalid
Definition: window.h:87
padding_ui8_t padding
Definition: guitypes.h:112
#define COLOR_GRAY
Definition: guitypes.h:50
static void is_part_log(int part_progress)
Definition: window_dlg_statemachine.c:457
uint32_t time_total
Definition: window_dlg_statemachine.h:47
void() window_event_dlg_cb_t(window_dlg_statemachine_t *window, uint8_t event, void *param)
Definition: window_dlg_statemachine.h:30
void gui_invalidate(void)
Definition: gui.c:66
Definition: window_dlg_statemachine.h:52
font_t * font_title
Definition: window_dlg_statemachine.h:92
#define COLOR_ORANGE
Definition: guitypes.h:57
window_t win
Definition: window_dlg_statemachine.h:88
static int rect_empty_ui16(rect_ui16_t rc)
Definition: guitypes.h:177
const dlg_cb_t on_done
Definition: window_dlg_statemachine.h:84
void window_dlg_statemachine_event(window_dlg_statemachine_t *window, uint8_t event, void *param)
Definition: window_dlg_statemachine.c:228
uint8_t base_progress
Definition: window_dlg_statemachine.h:44
color_t color_back
Definition: guitypes.h:107
if(size<=((png_alloc_size_t) -1) - ob)
Definition: pngwrite.c:2176
static uint32_t _phase_time_total(int phase, const _cl_dlg *_ths)
Definition: window_dlg_statemachine.c:375
void() window_event_t(void *window, uint8_t event, void *param)
Definition: window.h:58
Definition: guitypes.h:69
void render_text_align(rect_ui16_t rc, const char *text, font_t *font, color_t clr0, color_t clr1, padding_ui8_t padding, uint16_t flags)
Definition: display_helper.c:6
int8_t prev_phase
Definition: window_dlg_statemachine.h:40
uint32_t time
Definition: window_dlg_statemachine.h:69
const uint8_t[]
Definition: 404_html.c:3
static void progress_changed_log(int progress)
Definition: window_dlg_statemachine.c:459
Definition: dlg_result.h:10
Definition: window_dlg_statemachine.h:36
display_t * display
Definition: display.c:6
uint16_t h
Definition: guitypes.h:73
uint8_t part_progress
Definition: window_dlg_statemachine.h:43
rect_ui16_t rect
Definition: window.h:101
const char * title
Definition: window_dlg_statemachine.h:78
const _dlg_button_t * p_button
Definition: window_dlg_statemachine.h:72
void window_dlg_statemachine_draw(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:187
uint32_t f_visible
Definition: window.h:85
#define WINDOW_EVENT_CLICK
Definition: window.h:46
font_t * font
Definition: window_dlg_statemachine.h:91
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
#define DLG_TXT_CH
Definition: window_dlg_statemachine.c:28
#define DLG_PRO_CH
Definition: window_dlg_statemachine.c:29
uint16_t x
Definition: guitypes.h:70
padding_ui8_t padding
Definition: window_dlg_statemachine.h:93
uint16_t w
Definition: display.h:25
int
Definition: createSpeedLookupTable.py:15
uint8_t prev_part_progress
Definition: window_dlg_statemachine.h:45
font_t * font_big
Definition: guitypes.h:111
void() window_init_t(void *window)
Definition: window.h:55
gui_defaults_t gui_defaults
Definition: gui.c:20
#define WINDOW_EVENT_BTN_DN
Definition: window.h:38
const size_t count
Definition: window_dlg_statemachine.h:80
uint8_t progress
Definition: window_dlg_statemachine.h:41
window_t * window_1
Definition: window.c:14
rect_ui16_t _get_dlg_statemachine_button_size(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:78
#define DLG_PHA_CH
Definition: window_dlg_statemachine.c:32
uint32_t tick_part_start
Definition: window_dlg_statemachine.h:46
#define DLG_DRA_FR
Definition: window_dlg_statemachine.c:25
uint32_t flg
Definition: window.h:81
display_draw_line_t * draw_line
Definition: display.h:31
static void clr_logs()
Definition: window_dlg_statemachine.c:455
const dlg_cb_t on_load
Definition: window_dlg_statemachine.h:81
#define WINDOW_FLG_ENABLED
Definition: window.h:25
uint16_t flags
Definition: window_dlg_statemachine.h:94
uint8_t prev_progress
Definition: window_dlg_statemachine.h:42
static point_ui16_t point_ui16(uint16_t x, uint16_t y)
Definition: guitypes.h:154
struct _window_dlg_statemachine_t window_dlg_statemachine_t
Definition: window_dlg_statemachine.h:9