Prusa MINI Firmware overview
window_dlg_statemachine.c File Reference
#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"

Macros

#define DBG_LOAD_PROGRESS   0
 
#define DLG_FRAME_ENA   0
 
#define DLG_SHI_MOD   4
 
#define DLG_SHI_CHG   14
 
#define DLG_DRA_FR   0x0000
 
#define DLG_BTN_CH   0x1000
 
#define DLG_TXT_CH   0x2000
 
#define DLG_PRO_CH   0x4000
 
#define DLG_PPR_CH   0x8000
 
#define DLG_PRX_CH   (DLG_PRO_CH | DLG_PPR_CH)
 
#define DLG_PHA_CH   (DLG_PRX_CH | DLG_BTN_CH | DLG_TXT_CH)
 
#define DLG_MSK_MOD   0x0003
 
#define DLG_MSK_CHG   DLG_PHA_CH
 

Functions

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)
 

Variables

int16_t WINDOW_CLS_DLG_LOADUNLOAD = 0
 
window_twindow_1
 
const window_class_dlg_statemachine_t window_class_dlg_statemachine
 

Macro Definition Documentation

◆ DBG_LOAD_PROGRESS

#define DBG_LOAD_PROGRESS   0

◆ DLG_FRAME_ENA

#define DLG_FRAME_ENA   0

◆ DLG_SHI_MOD

#define DLG_SHI_MOD   4

◆ DLG_SHI_CHG

#define DLG_SHI_CHG   14

◆ 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

#define DLG_PRX_CH   (DLG_PRO_CH | DLG_PPR_CH)

◆ DLG_PHA_CH

#define DLG_PHA_CH   (DLG_PRX_CH | DLG_BTN_CH | DLG_TXT_CH)

◆ DLG_MSK_MOD

#define DLG_MSK_MOD   0x0003

◆ DLG_MSK_CHG

#define DLG_MSK_CHG   DLG_PHA_CH

Function Documentation

◆ _phase_time_total()

static uint32_t _phase_time_total ( int  phase,
const _cl_dlg _ths 
)
static
375  {
376  uint32_t time = 0;
377  while (phase >= 0)
378  time += _ths->p_states[phase--].time;
379  return time;
380 }
Here is the caller graph for this function:

◆ clr_logs()

static void clr_logs ( )
static
455 {}
Here is the caller graph for this function:

◆ is_part_log()

static void is_part_log ( int  part_progress)
static
457 {}
Here is the caller graph for this function:

◆ progress_changed_log()

static void progress_changed_log ( int  progress)
static
459 {}
Here is the caller graph for this function:

◆ phase_changed_log()

static void phase_changed_log ( int  phase,
int  base_progress 
)
static
461 {}
Here is the caller graph for this function:

◆ print_log()

static void print_log ( )
static
463 {}
Here is the caller graph for this function:

◆ set_repaint_btn_flg()

void set_repaint_btn_flg ( window_dlg_statemachine_t window)
49  {
50  window->flags |= DLG_BTN_CH;
51 }
Here is the caller graph for this function:

◆ is_repaint_btn_flg()

int is_repaint_btn_flg ( window_dlg_statemachine_t window)
53  {
54  return window->flags | DLG_BTN_CH;
55 }

◆ window_dlg_statemachine_init()

void window_dlg_statemachine_init ( window_dlg_statemachine_t window)
57  {
58  if (rect_empty_ui16(window->win.rect)) //use display rect if current rect is empty
59  window->win.rect = rect_ui16(0, 0, display->w, display->h);
60  window->win.flg |= WINDOW_FLG_ENABLED; //enabled by default
63  window->font = gui_defaults.font;
65  window->padding = gui_defaults.padding;
66  window->vars.phase = 0;
67  window->vars.prev_phase = -1;
68  window->vars.progress = 0;
69  window->vars.prev_progress = 0;
70  window->vars.part_progress = 0;
71  window->vars.base_progress = 0;
72  window->flags = 0;
73 
74  window->vars.tick_part_start = HAL_GetTick();
75  window->vars.time_total = _phase_time_total(window->_ths->count - 1, window->_ths);
76 }
Here is the call graph for this function:

◆ _get_dlg_statemachine_button_size()

rect_ui16_t _get_dlg_statemachine_button_size ( window_dlg_statemachine_t window)
78  {
79  rect_ui16_t rc_btn = window->win.rect;
80  rc_btn.y += (rc_btn.h - 40); // 30pixels for button (+ 10 space for grey frame)
81  rc_btn.h = 30;
82  rc_btn.x += 6;
83  rc_btn.w -= 12;
84  return rc_btn;
85 }
Here is the caller graph for this function:

◆ window_dlg_statemachine_draw_1bt()

void window_dlg_statemachine_draw_1bt ( window_dlg_statemachine_t window)
87  {
89  const char *label = window->_ths->p_states[window->vars.phase].p_button->labels[0];
90  int enabled = window->_ths->p_states[window->vars.phase].p_button->flags & BT_ENABLED ? 1 : 0;
91  button_draw(rc_btn, label, window->font_title, enabled);
92 }
Here is the call graph for this function:

◆ window_dlg_statemachine_draw_0bt()

void window_dlg_statemachine_draw_0bt ( window_dlg_statemachine_t window)
94  {
96 
97  display->fill_rect(rc_btn, window->color_back);
98 }
Here is the call graph for this function:

◆ _window_dlg_statemachine_draw_frame()

void _window_dlg_statemachine_draw_frame ( window_dlg_statemachine_t window)
100  {
101  rect_ui16_t rc = window->win.rect;
102  display->draw_line(point_ui16(rc.x, rc.y), point_ui16(239, rc.y), COLOR_GRAY);
103  display->draw_line(point_ui16(rc.x, rc.y), point_ui16(rc.x, 320 - 67), COLOR_GRAY);
104  display->draw_line(point_ui16(239, rc.y), point_ui16(239, 320 - 67), COLOR_GRAY);
105  display->draw_line(point_ui16(rc.x, 320 - 67), point_ui16(239, 320 - 67), COLOR_GRAY);
106 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ progress_draw()

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 
)
109  {
110  rect_ui16_t rc_pro = win_rect; //must copy it
111  char text[16];
112  rc_pro.x += 10;
113  rc_pro.w -= 20;
114  rc_pro.h = 16;
115  rc_pro.y += 30;
116  uint16_t w = rc_pro.w;
117  rc_pro.w = w * progress / 100;
118  display->fill_rect(rc_pro, COLOR_ORANGE);
119  rc_pro.x += rc_pro.w;
120  rc_pro.w = w - rc_pro.w;
121  display->fill_rect(rc_pro, COLOR_GRAY);
122  rc_pro.y += rc_pro.h;
123  rc_pro.w = win_rect.w - 120;
124  rc_pro.x = win_rect.x + 60;
125  rc_pro.h = 30;
126  sprintf(text, "%d%%", progress);
127  render_text_align(rc_pro, text, font, color_back, color_text, padding, ALIGN_CENTER);
128 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ progress_clr()

void progress_clr ( rect_ui16_t  win_rect,
font_t font,
color_t  color_back 
)
130  {
131  rect_ui16_t rc_pro = win_rect; //must copy it
132  rc_pro.x += 10;
133  rc_pro.w -= 20;
134  rc_pro.h = 16;
135  rc_pro.y += 30;
136  display->fill_rect(rc_pro, color_back);
137  rc_pro.y += rc_pro.h;
138  rc_pro.w = win_rect.w - 120;
139  rc_pro.x = win_rect.x + 60;
140  rc_pro.h = 30;
141  display->fill_rect(rc_pro, color_back);
142 }
Here is the caller graph for this function:

◆ window_dlg_statemachine_draw_progress_tot()

void window_dlg_statemachine_draw_progress_tot ( window_dlg_statemachine_t window)
144  {
145  if (window->flags & DLG_PRO_CH)
146  progress_draw(window->win.rect, window->font_title, window->color_back,
147  window->color_text, window->padding, window->vars.progress);
148 }
Here is the call graph for this function:

◆ window_dlg_statemachine_draw_progress_part()

void window_dlg_statemachine_draw_progress_part ( window_dlg_statemachine_t window)
150  {
151  if (window->flags & DLG_PPR_CH)
152  progress_draw(window->win.rect, window->font_title, window->color_back,
153  window->color_text, window->padding, window->vars.part_progress);
154 }
Here is the call graph for this function:

◆ window_dlg_statemachine_draw_progress_none()

void window_dlg_statemachine_draw_progress_none ( window_dlg_statemachine_t window)
156  {
157  progress_clr(window->win.rect, window->font_title, window->color_back);
158 }
Here is the call graph for this function:

◆ _window_dlg_statemachine_draw_phase_text()

void _window_dlg_statemachine_draw_phase_text ( window_dlg_statemachine_t window)
160  {
161  rect_ui16_t rc_sta = window->win.rect;
162  size_t nl; //number of new lines
163  const char *s = window->_ths->p_states[window->vars.phase].text;
164  for (nl = 0; s[nl]; s[nl] == '\n' ? nl++ : *s++)
165  ; //count '\n' in s
166  rc_sta.h = 30 + window->font_title->h * nl;
167  rc_sta.y += (30 + 46);
168  rc_sta.x += 2;
169  rc_sta.w -= 4;
170 
171  //erase remains of previous text if it was longer
172  //prerelease hack todo text window just should be CENTER_TOP aligned and bigger
173  int h_diff = window->last_text_h - rc_sta.h;
174  if (h_diff > 0) {
175  rect_ui16_t rc = rc_sta;
176  rc.h = window->last_text_h - rc_sta.h;
177  rc.y += rc_sta.h;
178  display->fill_rect(rc, window->color_back);
179  }
180 
181  window->last_text_h = rc_sta.h;
182 
183  render_text_align(rc_sta, window->_ths->p_states[window->vars.phase].text, window->font_title,
184  window->color_back, window->color_text, window->padding, ALIGN_CENTER);
185 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ window_dlg_statemachine_draw()

void window_dlg_statemachine_draw ( window_dlg_statemachine_t window)
187  {
188  if ((window->win.f_visible) && ((size_t)(window->vars.phase) < window->_ths->count)) {
189  rect_ui16_t rc = window->win.rect;
190 
191  if (window->win.f_invalid) {
192  display->fill_rect(rc, window->color_back);
193  rect_ui16_t rc_tit = rc;
194  rc_tit.h = 30; // 30pixels for title
195  // TODO: - icon
196  // rc_tit.w -= 30;
197  // rc_tit.x += 30;
198  //title
199  render_text_align(rc_tit, window->_ths->title, window->font_title,
200  window->color_back, window->color_text, window->padding, ALIGN_CENTER);
201 
202  window->win.f_invalid = 0;
203  window->flags |= DLG_DRA_FR | DLG_PHA_CH | DLG_PPR_CH;
204  }
205  //DLG_PHA_CH == DLG_TXT_CH | DLG_BTN_CH
206  if (window->flags & DLG_TXT_CH) //text changed
207  {
209  window->flags &= ~DLG_TXT_CH;
210  }
211  if (window->flags & DLG_BTN_CH) //button changed
212  {
213  window->_ths->p_states[window->vars.phase].p_button->draw_cb(window);
214  window->flags &= ~DLG_BTN_CH;
215  }
216  if (window->flags & DLG_PRX_CH) //any progress changed
217  {
218  window->_ths->p_states[window->vars.phase].progress_draw(window);
219  window->flags &= ~DLG_PRX_CH;
220  }
221  if (window->flags & DLG_DRA_FR) { //draw frame
223  window->flags &= ~DLG_DRA_FR;
224  }
225  }
226 }
Here is the call graph for this function:

◆ window_dlg_statemachine_event()

void window_dlg_statemachine_event ( window_dlg_statemachine_t window,
uint8_t  event,
void param 
)
229  {
230  window_event_dlg_cb_t *event_cb = window->_ths->p_states[window->vars.phase].p_button->event_cb;
231  if (event_cb != NULL)
232  event_cb(window, event, param);
233 }

◆ window_dlg_statemachine_event_1bt()

void window_dlg_statemachine_event_1bt ( window_dlg_statemachine_t window,
uint8_t  event,
void param 
)
236  {
237  switch (event) {
238  case WINDOW_EVENT_BTN_DN:
239  //case WINDOW_EVENT_BTN_UP:
240  case WINDOW_EVENT_CLICK:
241  window->vars.flags |= DLG_BT_FLG;
242  return;
243  }
244 }

◆ _gui_dlg()

dlg_result_t _gui_dlg ( const _cl_dlg _ths,
void p_additional_vars,
int32_t  ttl 
)
257  {
258  clr_logs();
259 
261  memset(&dlg, 0, sizeof(dlg));
262  dlg._ths = _ths;
263  int16_t id_capture = window_capture();
265  window_1 = (window_t *)&dlg;
266  gui_reset_jogwheel();
267  gui_invalidate();
268  window_set_capture(id);
269 
270  _dlg_vars *const p_vars = &(dlg.vars);
271 
272  uint32_t start_tick = HAL_GetTick();
273 
274  //inicialization cb given in parameter
275  if (_ths->on_load != NULL)
276  _ths->on_load();
277 
278  while ((size_t)(p_vars->phase) < _ths->count) //negative number will force exit
279  {
280  //loop cb given in parameter
281  if (_ths->on_loop != NULL) {
282  if (_ths->on_loop(p_vars, p_additional_vars) == LOOP_RESULT_BREAK)
283  break;
284  }
285 
286  //time to live reached?
287  if ((uint32_t)(HAL_GetTick() - start_tick) >= (uint32_t)ttl) {
288  if (_ths->on_timeout != NULL)
289  _ths->on_timeout();
290  break;
291  }
292 
293  //button auto exit flag must be handled here
294  //state could change phase
295  if (
296  (p_vars->flags & DLG_BT_FLG) && //button clicked
297  (_ths->p_states[p_vars->phase].p_button->flags & BT_AUTOEXIT) //autoexit flag on current button
298  ) {
299  break;
300  }
301 
302  int part_progress = _ths->p_states[p_vars->phase].state_fnc(p_vars, p_additional_vars); //state machine
303 
304  //forced exit
305  //intended to be used as handling user clicked exit button
306  //any state change phase to -1 and force exit
307  if ((size_t)(p_vars->phase) >= _ths->count)
308  break;
309 
310  p_vars->flags &= ~DLG_BT_FLG; //disable button clicked
311 
312  is_part_log(part_progress); //log raw value obtained from state
313 
314  //calculate partial progress (progress of current phase)
315  if (part_progress > p_vars->part_progress)
316  p_vars->part_progress = (uint8_t)part_progress; //progress can only rise
317  if (part_progress > 100)
318  p_vars->part_progress = 100;
319  if (part_progress < 0)
320  p_vars->part_progress = 0;
321 
322  if (p_vars->prev_part_progress != p_vars->part_progress) {
323  dlg.flags |= (p_vars->prev_part_progress != p_vars->part_progress) ? DLG_PPR_CH : 0;
324  }
325 
326  //phase changed
327  if (p_vars->prev_phase != p_vars->phase) {
328  p_vars->part_progress = 0;
329  dlg.flags |= DLG_PHA_CH;
330  gui_invalidate();
331  p_vars->base_progress = 100 * _phase_time_total(p_vars->prev_phase, _ths) / p_vars->time_total;
332  p_vars->prev_phase = p_vars->phase;
333  p_vars->tick_part_start = HAL_GetTick();
334 
335  phase_changed_log(p_vars->phase, p_vars->base_progress);
336  }
337 
338  //calculate "total" progress
339  //p_vars->part_progress MUST remain unscaled
340  //p_vars->base_progress is scaled
341  part_progress = (int)(p_vars->part_progress) * (_ths->p_states[p_vars->phase].time) / p_vars->time_total;
342  p_vars->progress = p_vars->base_progress + part_progress;
343 
344  //in last phase maximum progress is 100
345  //in all other phases maximum progress is 99
346  if ((size_t)(p_vars->phase) == _ths->count - 1) {
347  if (p_vars->progress > 100)
348  p_vars->progress = 100;
349  } else {
350  if (p_vars->progress > 99)
351  p_vars->progress = 99;
352  }
353 
354  //progress changed
355  dlg.flags |= (p_vars->prev_progress != p_vars->progress) ? DLG_PRO_CH : 0;
356 
357  if (dlg.flags & (DLG_PRX_CH)) //any progress changed
358  {
359  gui_invalidate();
361  p_vars->prev_progress = p_vars->progress;
362  }
363 
364  print_log();
365  gui_loop();
366  }
367  if (_ths->on_done != NULL)
368  _ths->on_done();
369  window_destroy(id);
370  window_set_capture(id_capture);
372  return DLG_OK;
373 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ WINDOW_CLS_DLG_LOADUNLOAD

int16_t WINDOW_CLS_DLG_LOADUNLOAD = 0

◆ window_1

window_t* window_1

◆ window_class_dlg_statemachine

_cl_dlg::on_timeout
const dlg_cb_t on_timeout
Definition: window_dlg_statemachine.h:83
phase_changed_log
static void phase_changed_log(int phase, int base_progress)
Definition: window_dlg_statemachine.c:461
window_draw_t
void() window_draw_t(void *window)
Definition: window.h:57
_window_dlg_statemachine_t::_ths
const _cl_dlg * _ths
Definition: window_dlg_statemachine.h:97
_cl_dlg::p_states
const _dlg_state * p_states
Definition: window_dlg_statemachine.h:79
BT_ENABLED
#define BT_ENABLED
Definition: window_dlg_statemachine.h:15
WINDOW_CLS_DLG_LOADUNLOAD
int16_t WINDOW_CLS_DLG_LOADUNLOAD
Definition: window_dlg_statemachine.c:37
progress_draw
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
window_capture
int16_t window_capture(void)
Definition: window.c:169
_rect_ui16_t::y
uint16_t y
Definition: guitypes.h:71
_font_t::h
uint8_t h
Definition: guitypes.h:78
_window_dlg_statemachine_t::color_back
color_t color_back
Definition: window_dlg_statemachine.h:89
_display_t::h
uint16_t h
Definition: display.h:26
_rect_ui16_t::w
uint16_t w
Definition: guitypes.h:72
DLG_BT_FLG
#define DLG_BT_FLG
Definition: window_dlg_statemachine.h:19
_window_dlg_statemachine_draw_phase_text
void _window_dlg_statemachine_draw_phase_text(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:160
_dlg_vars::flags
uint8_t flags
Definition: window_dlg_statemachine.h:38
DLG_PRX_CH
#define DLG_PRX_CH
Definition: window_dlg_statemachine.c:31
_dlg_state::progress_draw
window_draw_dlg_cb_t * progress_draw
Definition: window_dlg_statemachine.h:70
_gui_defaults_t::color_text
color_t color_text
Definition: guitypes.h:108
BT_AUTOEXIT
#define BT_AUTOEXIT
Definition: window_dlg_statemachine.h:17
_cl_dlg::on_loop
const dlg_loop_cb_t on_loop
Definition: window_dlg_statemachine.h:82
DLG_PPR_CH
#define DLG_PPR_CH
Definition: window_dlg_statemachine.c:30
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
window_invalidate
void window_invalidate(int16_t id)
Definition: window.c:304
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
progress_clr
void progress_clr(rect_ui16_t win_rect, font_t *font, color_t color_back)
Definition: window_dlg_statemachine.c:130
_dlg_state::state_fnc
dlg_state_func state_fnc
Definition: window_dlg_statemachine.h:73
_gui_defaults_t::font
font_t * font
Definition: guitypes.h:110
_dlg_state::text
const char * text
Definition: window_dlg_statemachine.h:71
window_destroy
void window_destroy(int16_t id)
Definition: window.c:132
_window_dlg_statemachine_t::last_text_h
uint8_t last_text_h
Definition: window_dlg_statemachine.h:95
WINDOW_CLS_USER
#define WINDOW_CLS_USER
Definition: window.h:21
DLG_BTN_CH
#define DLG_BTN_CH
Definition: window_dlg_statemachine.c:27
_gui_defaults_t::msg_box_sz
rect_ui16_t msg_box_sz
Definition: guitypes.h:114
_dlg_button_t::draw_cb
window_draw_dlg_cb_t * draw_cb
Definition: window_dlg_statemachine.h:63
window_dlg_statemachine_init
void window_dlg_statemachine_init(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:57
print_log
static void print_log()
Definition: window_dlg_statemachine.c:463
_dlg_vars::phase
int8_t phase
Definition: window_dlg_statemachine.h:39
_window_dlg_statemachine_draw_frame
void _window_dlg_statemachine_draw_frame(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:100
NULL
#define NULL
Definition: usbd_def.h:53
_window_dlg_statemachine_t::color_text
color_t color_text
Definition: window_dlg_statemachine.h:90
_window_dlg_statemachine_t
Definition: window_dlg_statemachine.h:87
_display_t::fill_rect
display_fill_rect_t * fill_rect
Definition: display.h:33
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
_window_dlg_statemachine_t::vars
_dlg_vars vars
Definition: window_dlg_statemachine.h:98
_window_t::f_invalid
uint32_t f_invalid
Definition: window.h:87
_gui_defaults_t::padding
padding_ui8_t padding
Definition: guitypes.h:112
COLOR_GRAY
#define COLOR_GRAY
Definition: guitypes.h:50
is_part_log
static void is_part_log(int part_progress)
Definition: window_dlg_statemachine.c:457
_dlg_vars::time_total
uint32_t time_total
Definition: window_dlg_statemachine.h:47
button_draw
void button_draw(rect_ui16_t rc_btn, const char *text, font_t *pf, int is_selected)
Definition: button_draw.c:5
window_event_dlg_cb_t
void() window_event_dlg_cb_t(window_dlg_statemachine_t *window, uint8_t event, void *param)
Definition: window_dlg_statemachine.h:30
gui_invalidate
void gui_invalidate(void)
Definition: gui.c:66
LOOP_RESULT_BREAK
Definition: window_dlg_statemachine.h:52
_window_dlg_statemachine_t::font_title
font_t * font_title
Definition: window_dlg_statemachine.h:92
COLOR_ORANGE
#define COLOR_ORANGE
Definition: guitypes.h:57
_dlg_button_t::event_cb
window_event_dlg_cb_t * event_cb
Definition: window_dlg_statemachine.h:64
_window_dlg_statemachine_t::win
window_t win
Definition: window_dlg_statemachine.h:88
rect_empty_ui16
static int rect_empty_ui16(rect_ui16_t rc)
Definition: guitypes.h:177
_window_t
Definition: window.h:76
_cl_dlg::on_done
const dlg_cb_t on_done
Definition: window_dlg_statemachine.h:84
window_dlg_statemachine_event
void window_dlg_statemachine_event(window_dlg_statemachine_t *window, uint8_t event, void *param)
Definition: window_dlg_statemachine.c:228
_dlg_vars::base_progress
uint8_t base_progress
Definition: window_dlg_statemachine.h:44
_dlg_button_t::flags
uint8_t flags
Definition: window_dlg_statemachine.h:62
_gui_defaults_t::color_back
color_t color_back
Definition: guitypes.h:107
window_set_capture
void window_set_capture(int16_t id)
Definition: window.c:500
if
if(size<=((png_alloc_size_t) -1) - ob)
Definition: pngwrite.c:2176
_phase_time_total
static uint32_t _phase_time_total(int phase, const _cl_dlg *_ths)
Definition: window_dlg_statemachine.c:375
window_event_t
void() window_event_t(void *window, uint8_t event, void *param)
Definition: window.h:58
_rect_ui16_t
Definition: guitypes.h:69
render_text_align
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
_dlg_vars::prev_phase
int8_t prev_phase
Definition: window_dlg_statemachine.h:40
_dlg_state::time
uint32_t time
Definition: window_dlg_statemachine.h:69
uint8_t
const uint8_t[]
Definition: 404_html.c:3
progress_changed_log
static void progress_changed_log(int progress)
Definition: window_dlg_statemachine.c:459
DLG_OK
Definition: dlg_result.h:10
_dlg_vars
Definition: window_dlg_statemachine.h:36
display
display_t * display
Definition: display.c:6
_rect_ui16_t::h
uint16_t h
Definition: guitypes.h:73
_dlg_vars::part_progress
uint8_t part_progress
Definition: window_dlg_statemachine.h:43
_window_t::rect
rect_ui16_t rect
Definition: window.h:101
_cl_dlg::title
const char * title
Definition: window_dlg_statemachine.h:78
_dlg_state::p_button
const _dlg_button_t * p_button
Definition: window_dlg_statemachine.h:72
window_dlg_statemachine_draw
void window_dlg_statemachine_draw(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:187
_window_t::f_visible
uint32_t f_visible
Definition: window.h:85
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
_window_dlg_statemachine_t::font
font_t * font
Definition: window_dlg_statemachine.h:91
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
DLG_TXT_CH
#define DLG_TXT_CH
Definition: window_dlg_statemachine.c:28
DLG_PRO_CH
#define DLG_PRO_CH
Definition: window_dlg_statemachine.c:29
_rect_ui16_t::x
uint16_t x
Definition: guitypes.h:70
_window_dlg_statemachine_t::padding
padding_ui8_t padding
Definition: window_dlg_statemachine.h:93
_display_t::w
uint16_t w
Definition: display.h:25
createSpeedLookupTable.int
int
Definition: createSpeedLookupTable.py:15
_dlg_vars::prev_part_progress
uint8_t prev_part_progress
Definition: window_dlg_statemachine.h:45
_gui_defaults_t::font_big
font_t * font_big
Definition: guitypes.h:111
window_init_t
void() window_init_t(void *window)
Definition: window.h:55
gui_defaults
gui_defaults_t gui_defaults
Definition: gui.c:20
WINDOW_EVENT_BTN_DN
#define WINDOW_EVENT_BTN_DN
Definition: window.h:38
_cl_dlg::count
const size_t count
Definition: window_dlg_statemachine.h:80
_dlg_vars::progress
uint8_t progress
Definition: window_dlg_statemachine.h:41
window_1
window_t * window_1
Definition: window.c:14
_get_dlg_statemachine_button_size
rect_ui16_t _get_dlg_statemachine_button_size(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:78
DLG_PHA_CH
#define DLG_PHA_CH
Definition: window_dlg_statemachine.c:32
_dlg_vars::tick_part_start
uint32_t tick_part_start
Definition: window_dlg_statemachine.h:46
DLG_DRA_FR
#define DLG_DRA_FR
Definition: window_dlg_statemachine.c:25
_dlg_button_t::labels
const char ** labels
Definition: window_dlg_statemachine.h:61
_window_t::flg
uint32_t flg
Definition: window.h:81
_display_t::draw_line
display_draw_line_t * draw_line
Definition: display.h:31
clr_logs
static void clr_logs()
Definition: window_dlg_statemachine.c:455
_cl_dlg::on_load
const dlg_cb_t on_load
Definition: window_dlg_statemachine.h:81
WINDOW_FLG_ENABLED
#define WINDOW_FLG_ENABLED
Definition: window.h:25
_window_dlg_statemachine_t::flags
uint16_t flags
Definition: window_dlg_statemachine.h:94
_dlg_vars::prev_progress
uint8_t prev_progress
Definition: window_dlg_statemachine.h:42
point_ui16
static point_ui16_t point_ui16(uint16_t x, uint16_t y)
Definition: guitypes.h:154
window_dlg_statemachine_t
struct _window_dlg_statemachine_t window_dlg_statemachine_t
Definition: window_dlg_statemachine.h:9