C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
rtos_widget.h
Go to the documentation of this file.
1
11#pragma once
12#include <vector>
13#include <string>
14
15#include "pico/stdlib.h"
16
18#include "sw/widget/canvas.h"
20
21#include "FreeRTOS.h"
22#include "task.h"
23#include "queue.h"
24#include "semphr.h"
25
26class rtos_Model;
27
31{
32protected:
35
37 std::vector<rtos_Widget *> rtos_widgets;
38
39public:
46
49
51 TaskHandle_t task_handle;
52
56 rtos_Widget(rtos_Model *actual_displayed_model,
58
63 void set_display_device(rtos_DisplayDevice *_new_display_device);
67 void update_widget_anchor(uint8_t x, uint8_t y);
68
71 void add_widget(rtos_Widget *_sub_widget);
72
77 virtual void draw() = 0;
79 virtual void get_value_of_interest() = 0;
80};
81
82
86{
87private:
88public:
96 rtos_GraphicWidget(rtos_Model *actual_displayed_model,
98 CanvasFormat canvas_format,
101 virtual ~rtos_GraphicWidget();
102};
103
106{
107private:
108public:
117 rtos_TextWidget(rtos_Model *actual_displayed_model,
119 CanvasFormat canvas_format,
121
130 rtos_TextWidget(rtos_Model *actual_displayed_model,
132 CanvasFormat canvas_format,
133 size_t frame_width, size_t frame_height,
135 virtual ~rtos_TextWidget();
136};
137
140{
141protected:
148
149public:
151 char *text_buffer = nullptr;
155 rtos_PrintWidget(rtos_Model *actual_displayed_model,
156 rtos_TerminalConsole *terminal_console);
157 virtual ~rtos_PrintWidget();
158};
CanvasFormat
the format of the canvas
Definition canvas.h:61
A class that implements basic graphic drawing primitives for widgets.
Definition widget_primitives.h:44
A class dedicated to text drawing within a widget.
Definition widget_primitives.h:169
The RTOS display device is the base class for all display devices that are managed by a dedicated dis...
Definition display_device.h:126
rtos_GraphicWidget(rtos_Model *actual_displayed_model, struct_ConfigGraphicWidget graph_cfg, CanvasFormat canvas_format, rtos_DisplayDevice *display_device)
Constructor of the RTOS graphic widget.
Definition rtos_widget.cpp:39
virtual ~rtos_GraphicWidget()
Destructor of the RTOS graphic widget.
Definition rtos_widget.cpp:51
GraphicDrawer * drawer
the graphic drawer associated to the widget
Definition rtos_widget.h:90
RTOS wrapper for Model class.
Definition rtos_ui_core.h:29
rtos_PrintWidget(rtos_Model *actual_displayed_model, rtos_TerminalConsole *terminal_console)
Definition rtos_widget.cpp:84
size_t text_buffer_size
the number of characters
Definition rtos_widget.h:147
char * text_buffer
the effective character buffer
Definition rtos_widget.h:151
size_t number_of_line
the number of line
Definition rtos_widget.h:145
size_t number_of_column
the size, in number of character of a line
Definition rtos_widget.h:143
The RTOS terminal console is the class for all text display devices that are managed by a dedicated d...
Definition display_device.h:161
rtos_TextWidget(rtos_Model *actual_displayed_model, struct_ConfigTextWidget text_cfg, CanvasFormat canvas_format, rtos_DisplayDevice *display_device)
Construct a new Text Widget object.
Definition rtos_widget.cpp:56
TextWriter * writer
the text writer associated to the widget
Definition rtos_widget.h:110
rtos_Widget(rtos_Model *actual_displayed_model, rtos_DisplayDevice *display_device=nullptr)
constructor for RTOS widget
Definition rtos_widget.cpp:5
void set_display_device(rtos_DisplayDevice *_new_display_device)
Set the display screen object.
Definition rtos_widget.cpp:22
virtual void get_value_of_interest()=0
A pure virtual method that results in the transfer of the displayed values of the displayed model to ...
virtual void draw()=0
a pure virtual member that is called to effectively draw the widget.
rtos_Model * actual_rtos_displayed_model
a pointer to the Model actually displayed by the widget
Definition rtos_widget.h:34
TaskHandle_t task_handle
FreeRTOS task handle associated to the widget.
Definition rtos_widget.h:51
~rtos_Widget()
destructor for RTOS widget
Definition rtos_widget.cpp:18
rtos_DisplayDevice * display_device
the display device where the attached to the frame buffer
Definition rtos_widget.h:41
uint8_t widget_anchor_y
location in y of the widget within the hosting framebuffer
Definition rtos_widget.h:45
void update_widget_anchor(uint8_t x, uint8_t y)
Modify the anchor of the widget on the display screen.
Definition rtos_widget.cpp:28
std::vector< rtos_Widget * > rtos_widgets
A rtos_widget can be composed by several rtos_widgets.
Definition rtos_widget.h:37
uint8_t widget_anchor_x
location in x of the widget within the hosting framebuffer
Definition rtos_widget.h:43
struct_WidgetDataToGateKeeper widget_data_to_gatekeeper
data structure used to queue widget data to send to the display task
Definition rtos_widget.h:48
void add_widget(rtos_Widget *_sub_widget)
add sub_widget to the current widget
Definition rtos_widget.cpp:34
data structure used to configure graphic framebuffer
Definition canvas.h:81
the data structure used to configure textual widget
Definition canvas.h:100
data structure used to queue widget data to send to the display task
Definition display_device.h:46
Basic drawing primitives for widgets.