![]() |
RumPi Linux Client 1.0
A wxWidgets desktop dashboard that visualizes a RumPi robot's live sensor data as a condition-reactive scene
|
Collects small, general-purpose helpers shared across the client UI. More...
#include <ClientUtilities.h>
Static Public Member Functions | |
| static unsigned char | AlphaByte (double alpha) |
| Converts a 0.0 - 1.0 opacity to a wxColour alpha byte, clamped so an out-of-range value never overflows. More... | |
| static wxString | FormatReading (float value, const char *utf8Unit, int decimals=1) |
| Formats a numeric sensor reading with its unit, or "N/A" for the NaN "no reading / sensor absent" sentinel. More... | |
Collects small, general-purpose helpers shared across the client UI.
Helpers that only make sense for one class (e.g. the scene's Co2DotColour) stay local to that class - only genuinely reusable functions belong here.
|
static |
Converts a 0.0 - 1.0 opacity to a wxColour alpha byte, clamped so an out-of-range value never overflows.
Output: 127
| [in] | alpha | The opacity, from 0.0 (transparent) to 1.0 (opaque). |
|
static |
Formats a numeric sensor reading with its unit, or "N/A" for the NaN "no reading / sensor absent" sentinel.
utf8Unit is a UTF-8 literal (degree/micro/cubic glyphs), so keep source files saved as UTF-8.
Output: 21.5 °C
| [in] | value | The reading to format (NaN means no reading / sensor absent). |
| [in] | utf8Unit | The unit string, as a UTF-8 literal. |
| [in] | decimals | The number of decimal places to show. |