Prusa MINI Firmware overview
wizard_ui.h File Reference
#include "gui.h"
#include "wizard_types.h"

Go to the source code of this file.

Macros

#define WIZARD_MARGIN_LEFT   6
 
#define WIZARD_MARGIN_RIGHT   6
 
#define WIZARD_X_SPACE   (240 - (WIZARD_MARGIN_LEFT + WIZARD_MARGIN_RIGHT))
 
#define MSGBOX_BTN_NEXT   MSGBOX_BTN_MAX + 1
 
#define MSGBOX_BTN_DONE   MSGBOX_BTN_MAX + 2
 

Enumerations

enum  _WIZ_TIMER_t { _WIZ_TIMER, _WIZ_TIMER_AUTOPASS, _WIZ_TIMER_AUTOFAIL }
 

Functions

int wizard_timer (uint32_t *p_timer, uint32_t delay_ms, _TEST_STATE_t *pstate, _WIZ_TIMER_t type)
 
void wizard_update_test_icon (int16_t win_id, uint8_t state)
 
uint16_t wizard_get_test_icon_resource (uint8_t state)
 
int wizard_msgbox_ex (const char *text, uint16_t flags, uint16_t id_icon, rect_ui16_t rc)
 
int wizard_msgbox (const char *text, uint16_t flags, uint16_t id_icon)
 
int wizard_msgbox1 (const char *text, uint16_t flags, uint16_t id_icon)
 
int wizard_msgbox_btns (const char *text, uint16_t flags, uint16_t id_icon, const char **buttons)
 
void wizard_init (float t_noz, float t_bed)
 
void wizard_init_disable_PID (float t_noz, float t_bed)
 

Macro Definition Documentation

◆ WIZARD_MARGIN_LEFT

#define WIZARD_MARGIN_LEFT   6

◆ WIZARD_MARGIN_RIGHT

#define WIZARD_MARGIN_RIGHT   6

◆ WIZARD_X_SPACE

#define WIZARD_X_SPACE   (240 - (WIZARD_MARGIN_LEFT + WIZARD_MARGIN_RIGHT))

◆ MSGBOX_BTN_NEXT

#define MSGBOX_BTN_NEXT   MSGBOX_BTN_MAX + 1

◆ MSGBOX_BTN_DONE

#define MSGBOX_BTN_DONE   MSGBOX_BTN_MAX + 2

Enumeration Type Documentation

◆ _WIZ_TIMER_t

Enumerator
_WIZ_TIMER 
_WIZ_TIMER_AUTOPASS 
_WIZ_TIMER_AUTOFAIL 

Function Documentation

◆ wizard_timer()

int wizard_timer ( uint32_t *  p_timer,
uint32_t  delay_ms,
_TEST_STATE_t pstate,
_WIZ_TIMER_t  type 
)
58  {
59  int progress = 0;
60  switch (*pstate) {
61  case _TEST_START:
62  *p_timer = HAL_GetTick();
63  *pstate = _TEST_RUN;
64  break;
65  case _TEST_RUN:
66  progress = 100 * (HAL_GetTick() - *p_timer) / delay_ms;
67  if (progress >= 100) {
68  switch (type) {
69  case _WIZ_TIMER:
70  progress = 99;
71  break;
73  progress = 100;
74  *pstate = _TEST_PASSED;
75  break;
77  progress = 100;
78  *pstate = _TEST_FAILED;
79  break;
80  }
81  }
82  break;
83  case _TEST_PASSED:
84  case _TEST_FAILED:
85  progress = 100;
86  break;
87  }
88  return progress;
89 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wizard_update_test_icon()

void wizard_update_test_icon ( int16_t  win_id,
uint8_t  state 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wizard_get_test_icon_resource()

uint16_t wizard_get_test_icon_resource ( uint8_t  state)
10  {
11  switch (state) {
12  case _TEST_START:
14  case _TEST_RUN:
16  case _TEST_PASSED:
18  case _TEST_FAILED:
20  }
21  return 0;
22 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wizard_msgbox_ex()

int wizard_msgbox_ex ( const char *  text,
uint16_t  flags,
uint16_t  id_icon,
rect_ui16_t  rc 
)
29  {
30  const char *custom_btn = 0;
32  custom_btn = "NEXT";
33  else if ((flags & MSGBOX_MSK_BTN) == MSGBOX_BTN_DONE)
34  custom_btn = "DONE";
35  if (custom_btn) {
37  return gui_msgbox_ex(0, text, flags | MSGBOX_ICO_CUSTOM, rc, id_icon, &custom_btn);
38  }
39  return gui_msgbox_ex(0, text, flags | MSGBOX_ICO_CUSTOM, rc, id_icon, 0);
40 }
Here is the caller graph for this function:

◆ wizard_msgbox()

int wizard_msgbox ( const char *  text,
uint16_t  flags,
uint16_t  id_icon 
)
42  {
43  return wizard_msgbox_ex(text, flags, id_icon,
44  rect_ui16(0, 32, 240, 320 - 96));
45 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wizard_msgbox1()

int wizard_msgbox1 ( const char *  text,
uint16_t  flags,
uint16_t  id_icon 
)
47  {
48  return wizard_msgbox_ex(text, flags, id_icon,
49  rect_ui16(0, 76, 240, 320 - 140));
50 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wizard_msgbox_btns()

int wizard_msgbox_btns ( const char *  text,
uint16_t  flags,
uint16_t  id_icon,
const char **  buttons 
)
52  {
53  return gui_msgbox_ex(0, text, flags | MSGBOX_ICO_CUSTOM,
54  rect_ui16(0, 32, 240, 320 - 96),
55  id_icon, buttons);
56 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wizard_init()

void wizard_init ( float  t_noz,
float  t_bed 
)
111  {
112  /*window_hide(footer_id);*/
114 
115  //Set Hotend Temperature
116  marlin_gcode_printf("M104 S%d", (int)t_noz);
117 
118  //Set Bed Temperature
119  marlin_gcode_printf("M140 S%d", (int)t_bed);
120 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wizard_init_disable_PID()

void wizard_init_disable_PID ( float  t_noz,
float  t_bed 
)
135  {
136  /*window_hide(footer_id);*/
138  _disable_PID();
139 
140  //Set Hotend Temperature
141  marlin_gcode_printf("M104 S%d", (int)t_noz);
142 
143  //Set Bed Temperature
144  marlin_gcode_printf("M140 S%d", (int)t_bed);
145 }
Here is the call graph for this function:
Here is the caller graph for this function:
MSGBOX_MSK_BTN
#define MSGBOX_MSK_BTN
Definition: window_msgbox.h:9
_wizard_init_test
static void _wizard_init_test()
Definition: wizard_ui.c:91
IDR_PNG_wizard_icon_ip1
#define IDR_PNG_wizard_icon_ip1
Definition: resource.h:55
_TEST_FAILED
Definition: wizard_types.h:88
IDR_PNG_wizard_icon_ng
#define IDR_PNG_wizard_icon_ng
Definition: resource.h:53
type
uint8_t type
Definition: UsbCore.h:184
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
state
static volatile fsensor_t state
Definition: filament_sensor.c:23
window_set_icon_id
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
netif::flags
u8_t flags
Definition: netif.h:305
MSGBOX_ICO_CUSTOM
#define MSGBOX_ICO_CUSTOM
Definition: window_msgbox.h:32
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
MSGBOX_BTN_DONE
#define MSGBOX_BTN_DONE
Definition: wizard_ui.h:13
_TEST_RUN
Definition: wizard_types.h:86
IDR_PNG_wizard_icon_ip0
#define IDR_PNG_wizard_icon_ip0
Definition: resource.h:54
_WIZ_TIMER_AUTOFAIL
Definition: wizard_ui.h:21
MSGBOX_BTN_CUSTOM1
#define MSGBOX_BTN_CUSTOM1
Definition: window_msgbox.h:26
IDR_PNG_wizard_icon_na
#define IDR_PNG_wizard_icon_na
Definition: resource.h:51
_WIZ_TIMER_AUTOPASS
Definition: wizard_ui.h:20
_TEST_START
Definition: wizard_types.h:85
_WIZ_TIMER_t
_WIZ_TIMER_t
Definition: wizard_ui.h:18
wizard_get_test_icon_resource
uint16_t wizard_get_test_icon_resource(uint8_t state)
Definition: wizard_ui.c:10
wizard_msgbox_ex
int wizard_msgbox_ex(const char *text, uint16_t flags, uint16_t id_icon, rect_ui16_t rc)
Definition: wizard_ui.c:29
_disable_PID
static void _disable_PID()
Definition: wizard_ui.c:102
IDR_PNG_wizard_icon_ok
#define IDR_PNG_wizard_icon_ok
Definition: resource.h:52
marlin_gcode_printf
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
MSGBOX_BTN_NEXT
#define MSGBOX_BTN_NEXT
Definition: wizard_ui.h:12
_WIZ_TIMER
Definition: wizard_ui.h:19
_TEST_PASSED
Definition: wizard_types.h:87