Prusa MINI Firmware overview
window_dlg_wait.h File Reference
#include "window.h"

Go to the source code of this file.

Classes

struct  _window_dlg_wait_t
 
struct  _window_class_dlg_wait_t
 

Typedefs

typedef struct _window_dlg_wait_t window_dlg_wait_t
 
typedef struct _window_class_dlg_wait_t window_class_dlg_wait_t
 

Functions

int gui_dlg_wait (int8_t(*callback)())
 
int8_t gui_marlin_busy_callback (void)
 

Variables

int16_t WINDOW_CLS_DLG_WAIT
 
const window_class_dlg_wait_t window_class_dlg_wait
 

Typedef Documentation

◆ window_dlg_wait_t

◆ window_class_dlg_wait_t

Function Documentation

◆ gui_dlg_wait()

int gui_dlg_wait ( int8_t(*)()  callback)
139  { //callback
140 
141  window_dlg_wait_t dlg;
142 
143  int16_t id_capture = window_capture();
145  window_1 = (window_t *)&dlg;
146  gui_reset_jogwheel();
147  gui_invalidate();
148  window_set_capture(id);
149 
150  dlg.progress = (*callback)();
151  dlg.flags |= DLG_W8_FRAME_FLG; //draw gray frame
152  dlg.flags |= DLG_W8_HOUR_REDRW; //redraw hourglass icon
153 
154  dlg.timer = HAL_GetTick();
155  uint32_t tmp = DLG_W8_ANI_FLG;
156  uint8_t tmp_timer, last_time = 0;
157 
158  if (dlg.progress < 0) {
159  while ((*callback)()) {
160  tmp_timer = ((HAL_GetTick() - dlg.timer) / (1000 / DLG_W8_FPS));
161  if (tmp_timer != last_time && tmp_timer < 5) {
162  if (tmp <= 0x0080) {
163  dlg.flags |= tmp; //redraw sand animation
164  dlg.flags |= DLG_W8_HOUR_REDRW;
165  gui_invalidate();
166  }
167  if (tmp < 0x0080)
168  tmp <<= 1;
169  }
170  if (tmp_timer >= 5) {
171  dlg.flags |= DLG_W8_HOUR_ROT; //redraw next phase of hourglass animation ADD ICON 0x0200
172  dlg.timer = HAL_GetTick();
173  tmp = DLG_W8_ANI_FLG;
174  tmp_timer = last_time = 0;
175  gui_invalidate();
176  }
177  last_time = tmp_timer;
178  gui_loop();
179  }
180  } else {
181 
182  while (dlg.progress < 100) {
183  int8_t tmp_progress = (*callback)();
184  if (dlg.progress != tmp_progress) {
185  dlg.progress = tmp_progress;
186  dlg.flags |= DLG_W8_PROGRESS;
187  }
188  tmp_timer = ((HAL_GetTick() - dlg.timer) / (1000 / DLG_W8_FPS));
189  if (tmp_timer != last_time && tmp_timer < 5) {
190  if (tmp <= 0x0080) {
191  dlg.flags |= tmp; //redraw sand animation and progressbar
192  dlg.flags |= DLG_W8_HOUR_REDRW;
193  gui_invalidate();
194  }
195  if (tmp < 0x0080)
196  tmp <<= 1;
197  }
198  if (tmp_timer >= 5) {
199  dlg.flags |= DLG_W8_HOUR_ROT; //redraw next phase of hourglass animation ADD ICON 0x0200
200  dlg.timer = HAL_GetTick();
201  tmp = DLG_W8_ANI_FLG;
202  tmp_timer = last_time = 0;
203  gui_invalidate();
204  }
205  last_time = tmp_timer;
206  gui_loop();
207  }
208  }
209 
210  window_destroy(id);
211  window_set_capture(id_capture);
213  return 0;
214 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gui_marlin_busy_callback()

int8_t gui_marlin_busy_callback ( void  )
216  {
217  if (marlin_motion() || marlin_busy())
218  return -1;
219  else
220  return 0;
221 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ WINDOW_CLS_DLG_WAIT

int16_t WINDOW_CLS_DLG_WAIT

◆ window_class_dlg_wait

const window_class_dlg_wait_t window_class_dlg_wait
DLG_W8_HOUR_ROT
#define DLG_W8_HOUR_ROT
Definition: window_dlg_wait.c:22
window_capture
int16_t window_capture(void)
Definition: window.c:169
DLG_W8_FRAME_FLG
#define DLG_W8_FRAME_FLG
Definition: window_dlg_wait.c:20
_window_dlg_wait_t::flags
uint16_t flags
Definition: window_dlg_wait.h:29
window_invalidate
void window_invalidate(int16_t id)
Definition: window.c:304
window_destroy
void window_destroy(int16_t id)
Definition: window.c:132
_gui_defaults_t::msg_box_sz
rect_ui16_t msg_box_sz
Definition: guitypes.h:114
DLG_W8_FPS
#define DLG_W8_FPS
Definition: window_dlg_wait.c:23
DLG_W8_HOUR_REDRW
#define DLG_W8_HOUR_REDRW
Definition: window_dlg_wait.c:18
WINDOW_CLS_DLG_WAIT
int16_t WINDOW_CLS_DLG_WAIT
Definition: window_dlg_wait.c:25
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
window_1
window_t * window_1
Definition: window.c:14
gui_invalidate
void gui_invalidate(void)
Definition: gui.c:66
marlin_motion
int marlin_motion(void)
Definition: marlin_client.c:182
_window_t
Definition: window.h:76
marlin_busy
int marlin_busy(void)
Definition: marlin_client.c:152
window_set_capture
void window_set_capture(int16_t id)
Definition: window.c:500
DLG_W8_PROGRESS
#define DLG_W8_PROGRESS
Definition: window_dlg_wait.c:21
_window_dlg_wait_t::progress
int8_t progress
Definition: window_dlg_wait.h:28
_window_dlg_wait_t::timer
uint32_t timer
Definition: window_dlg_wait.h:27
uint8_t
const uint8_t[]
Definition: 404_html.c:3
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_W8_ANI_FLG
#define DLG_W8_ANI_FLG
Definition: window_dlg_wait.c:19
gui_defaults
gui_defaults_t gui_defaults
Definition: gui.c:20
_window_dlg_wait_t
Definition: window_dlg_wait.h:20