FluxSand 1.0
FluxSand - Interactive Digital Hourglass
|
LED Matrix GUI Controller with Dual Orientation Support and Sand Animation Physics. More...
#include <comp_gui.hpp>
Public Types | |
enum class | Orientation { Landscape , Portrait } |
enum class | RegionID { SCREEN_0_LANDSCAPE , SCREEN_1_LANDSCAPE , SCREEN_0_PORTRAIT , SCREEN_1_PORTRAIT } |
Public Member Functions | |
CompGuiX (Max7219< 8 > &display, Orientation ori=Orientation::Portrait) | |
Construct with MAX7219 display reference. | |
void | SetOrientation (Orientation ori) |
Update display orientation. | |
void | Draw (RegionID region, int value) |
Draw 2-digit number in specified region. | |
void | Clear () |
Clear display buffer. | |
void | SetGravityDegree (float gravity_angle) |
Set gravity direction for sand physics. | |
void | SandEnable () |
Enable sand simulation. | |
void | SandDisable () |
Disable sand simulation. | |
void | ThreadFun () |
Animation thread entry point. | |
void | SetLight (uint8_t light) |
Set display brightness (0-15) | |
void | RenderTimeLandscape (uint8_t hour, uint8_t minute) |
Render HH:MM in landscape orientation. | |
void | RenderTimeLandscapeMS (uint8_t minutes, uint8_t seconds) |
Render MM:SS with blinking colon. | |
void | RenderTimePortrait (uint8_t hour, uint8_t minute) |
Render HH:MM in portrait orientation. | |
void | RenderTimePortraitMS (uint8_t minutes, uint8_t seconds) |
Render MM:SS with dynamic colon. | |
void | RenderHumidity (uint8_t humidity) |
void | RenderTemperature (uint8_t temperature) |
void | RenderHourglass (SandGrid *up, SandGrid *down) |
void | Reset () |
Reset sand simulation. | |
void | RunUnitTest () |
Data Fields | |
bool | sand_enable_ = false |
Sand animation toggle. | |
SandGrid | grid_up_ |
SandGrid | grid_down_ |
Sand particle containers. | |
float | gravity_deg_ = 0.0f |
Gravity direction (degrees) | |
Private Member Functions | |
void | DrawDigit (int leftX, int topY, const std::array< std::string, 7 > &bitmap, RegionID region) |
Render digit using 5x7 bitmap. | |
void | PlotRotated45 (int lx, int ly, RegionID region, bool on) |
Coordinate transformation for 45° rotated displays. | |
Private Attributes | |
Max7219< 8 > & | display_ |
LED matrix driver. | |
Orientation | orientation_ |
Current orientation. | |
bool | reset_ = false |
Reset flag. | |
std::thread | thread_ |
Animation thread. | |
Static Private Attributes | |
static constexpr std::array< std::array< std::string, 7 >, 10 > | FONT |
static constexpr std::array< std::pair< int, int >, 4 > | REGION_OFFSETSS |
LED Matrix GUI Controller with Dual Orientation Support and Sand Animation Physics.
Definition at line 15 of file comp_gui.hpp.
|
strong |
Definition at line 18 of file comp_gui.hpp.
|
strong |
Definition at line 21 of file comp_gui.hpp.
|
inlineexplicit |
Construct with MAX7219 display reference.
display | Reference to 8x8 LED matrix driver |
ori | Initial display orientation |
Definition at line 33 of file comp_gui.hpp.
|
inline |
|
inline |
Draw 2-digit number in specified region.
region | Target display region |
value | Number to display (0-99) |
Definition at line 47 of file comp_gui.hpp.
|
inlineprivate |
Render digit using 5x7 bitmap.
leftX | Leftmost X coordinate |
topY | Top Y coordinate |
bitmap | Font glyph data |
region | Target display region |
Definition at line 154 of file comp_gui.hpp.
|
inlineprivate |
Coordinate transformation for 45° rotated displays.
lx | Logical X coordinate |
ly | Logical Y coordinate |
region | Target display region |
on | Pixel state (true = on) |
Definition at line 172 of file comp_gui.hpp.
Definition at line 363 of file comp_gui.hpp.
|
inline |
Definition at line 293 of file comp_gui.hpp.
|
inline |
Definition at line 328 of file comp_gui.hpp.
|
inline |
Render HH:MM in landscape orientation.
Definition at line 207 of file comp_gui.hpp.
|
inline |
Render MM:SS with blinking colon.
Definition at line 219 of file comp_gui.hpp.
|
inline |
Render HH:MM in portrait orientation.
Definition at line 233 of file comp_gui.hpp.
|
inline |
Render MM:SS with dynamic colon.
Definition at line 263 of file comp_gui.hpp.
|
inline |
|
inline |
Definition at line 393 of file comp_gui.hpp.
|
inline |
|
inline |
|
inline |
Set gravity direction for sand physics.
gravity_angle | Input angle in radians |
Definition at line 63 of file comp_gui.hpp.
|
inline |
Set display brightness (0-15)
Definition at line 204 of file comp_gui.hpp.
|
inline |
|
inline |
Animation thread entry point.
Definition at line 80 of file comp_gui.hpp.
|
private |
LED matrix driver.
Definition at line 120 of file comp_gui.hpp.
|
staticconstexprprivate |
Definition at line 126 of file comp_gui.hpp.
float CompGuiX::gravity_deg_ = 0.0f |
Gravity direction (degrees)
Definition at line 71 of file comp_gui.hpp.
SandGrid CompGuiX::grid_down_ |
Sand particle containers.
Definition at line 70 of file comp_gui.hpp.
SandGrid CompGuiX::grid_up_ |
Definition at line 70 of file comp_gui.hpp.
|
private |
Current orientation.
Definition at line 121 of file comp_gui.hpp.
|
staticconstexprprivate |
Definition at line 140 of file comp_gui.hpp.
|
private |
Reset flag.
Definition at line 122 of file comp_gui.hpp.
bool CompGuiX::sand_enable_ = false |
Sand animation toggle.
Definition at line 69 of file comp_gui.hpp.
|
private |
Animation thread.
Definition at line 123 of file comp_gui.hpp.