Adafruit Library
ws_display_ui_helper.h
Go to the documentation of this file.
1 
16 #ifndef WS_DISPLAY_UI_HELPER_H
17 #define WS_DISPLAY_UI_HELPER_H
18 
19 #include "Wippersnapper.h"
20 #include "ws_display_driver.h"
21 #include "ws_display_tooltips.h"
22 #include <lvgl.h>
23 
24 /**********************
25  * MACROS
26  **********************/
27 #define MAX_CONSOLE_TEXT_LEN 430
28 /* External fonts and symbols */
29 #define SYMBOL_CODE "\xEF\x87\x89"
30 #define SYMBOL_WIFI "\xEF\x87\xAB"
31 #define SYMBOL_TURTLE30PX "\xEF\x9C\xA6"
32 #define SYMBOL_CLOUD "\xEF\x83\x82"
33 #define SYMBOL_ERROR_TRIANGLE \
34  "\xEF\x81\xB1"
35 
36 /**********************
37  * IMAGE DECLARE
38  **********************/
39 LV_FONT_DECLARE(errorTriangle);
40 LV_FONT_DECLARE(file);
41 LV_FONT_DECLARE(wifi_30px);
42 LV_FONT_DECLARE(cloud_30px);
43 LV_FONT_DECLARE(turtle_30px);
44 LV_FONT_DECLARE(turtle_16);
45 
53 };
54 
55 class ws_display_driver;
56 
57 /**************************************************************************/
62 /**************************************************************************/
64 public:
65  /**************************************************************************/
71  /**************************************************************************/
72  ws_display_ui_helper(ws_display_driver *drv) { _dispDriver = drv; };
74 
75  void set_bg_black();
76  void show_scr_load();
77  void clear_scr_load();
78  void build_scr_monitor();
79  void add_text_to_terminal(const char *text);
81  void set_label_status(const char *text); // callback ui help?
82  void remove_tip_timer();
83  void show_scr_error(const char *lblError, const char *lblDesc);
84  bool getLoadingState();
85 
86 private:
87  ws_display_driver *_dispDriver = nullptr;
88  void addToTerminal(const char *txt_in);
89  bool _loadingState = false;
90 };
91 #endif // WS_DISPLAY_UI_HELPER_H
void set_label_status(const char *text)
Sets the text of the status label on the loading screen.
Definition: ws_display_ui_helper.cpp:95
Turtle icon.
Definition: ws_display_ui_helper.h:51
loadBarIcons
Icon names for use with set_load_bar_icon_complete()
Definition: ws_display_ui_helper.h:47
Checkmark icon.
Definition: ws_display_ui_helper.h:52
File icon.
Definition: ws_display_ui_helper.h:48
void clear_scr_load()
Deletes all objects/styles off the load screen and frees their resources.
Definition: ws_display_ui_helper.cpp:257
void show_scr_error(const char *lblError, const char *lblDesc)
Build and display an error screen.
Definition: ws_display_ui_helper.cpp:287
Display driver for LVGL and LVGL_Glue in WipperSnapper.
Definition: ws_display_driver.h:33
WiFi icon.
Definition: ws_display_ui_helper.h:49
void set_bg_black()
Sets the screen&#39;s background to a black color.
Definition: ws_display_ui_helper.cpp:118
Helps build and manage the LVGL objects and screens for the application code.
Definition: ws_display_ui_helper.h:63
void build_scr_monitor()
Build and display the monitor screen.
Definition: ws_display_ui_helper.cpp:337
ws_display_ui_helper(ws_display_driver *drv)
Constructor for the ws_display_ui_helper class.
Definition: ws_display_ui_helper.h:72
void remove_tip_timer()
Pauses and deletes the loading tip callback timer.
Definition: ws_display_ui_helper.cpp:108
LV_FONT_DECLARE(errorTriangle)
Error triangle icon.
Cloud icon.
Definition: ws_display_ui_helper.h:50
bool getLoadingState()
Returns the loading screen&#39;s state.
Definition: ws_display_ui_helper.cpp:170
void set_load_bar_icon_complete(loadBarIcons iconType)
Sets the color of an icon on the loading screen to green.
Definition: ws_display_ui_helper.cpp:131
void add_text_to_terminal(const char *text)
Add text on the terminal label and displays it.
Definition: ws_display_ui_helper.cpp:405
void show_scr_load()
Builds and displays the loading screen.
Definition: ws_display_ui_helper.cpp:177