9#include <RumPi/Data/SelectedSensorReadings.h>
11class wxGraphicsContext;
151 wxBitmapBundle
LoadSceneBundle(
const wxString& folder,
const wxString& baseName,
const char* embeddedSvg)
const;
200 void DrawCelestialBody(wxGraphicsContext* graphicsContext,
int width,
int height);
217 void DrawAtmosphere(wxGraphicsContext* graphicsContext,
int width,
int height);
234 void DrawStreetlights(wxGraphicsContext* graphicsContext,
int width,
int height);
251 void DrawPills(wxGraphicsContext* graphicsContext,
int width,
int height);
266 void OnPaint(wxPaintEvent& event);
296 void OnSize(wxSizeEvent& event);
311 void OnTimer(wxTimerEvent& event);
341 void Update(
const RumPi::SelectedSensorReadings& readings);
The Home tab's stylized, condition-reactive backdrop.
Definition: HomeScenePanel.h:26
wxColour myCo2FreshColour
Indicator colour for the "fresh" CO2 band.
Definition: HomeScenePanel.h:67
void OnPaint(wxPaintEvent &event)
Paint handler: cover-scales and blits the cached base, then composites the celestial body,...
Definition: HomeScenePanel.cpp:480
wxBitmap myFrameBuffer
Definition: HomeScenePanel.h:48
int myBaseCacheHeight
Height the base cache was built at.
Definition: HomeScenePanel.h:44
double myTemperatureTintOpacity
Maximum temperature-tint overlay opacity.
Definition: HomeScenePanel.h:62
wxColour myCo2ElevatedColour
Indicator colour for the "elevated" CO2 band.
Definition: HomeScenePanel.h:68
double myTempWarmAbove
Temperature above which the tint reads "warm".
Definition: HomeScenePanel.h:59
double myCo2ElevatedMax
Upper CO2 bound for the "elevated" band.
Definition: HomeScenePanel.h:58
void CreateDefaultScenesIfMissing(const wxString &folder) const
Seeds the images folder with editable copies of the default day/night SVG art, but only when the fold...
Definition: HomeScenePanel.cpp:313
double myMistOpacity
Maximum mist overlay opacity.
Definition: HomeScenePanel.h:65
wxColour AirQualityDotColour(RumPi::E_AirQualityLevel airQualityLevel) const
Picks the status-dot colour for an air-quality level, collapsing the six levels onto the same good/wa...
Definition: HomeScenePanel.cpp:224
wxString myLocationName
Configured location name.
Definition: HomeScenePanel.h:56
void RenderScene(wxPaintDC &drawContext)
Composites one frame (base art, celestial body, atmosphere, streetlights, pills) into the off-screen ...
Definition: HomeScenePanel.cpp:496
int myBaseCacheBlendBucket
Bucketed day/night blend the base cache was built at.
Definition: HomeScenePanel.h:45
wxColour Co2DotColour(float co2) const
Picks the status-dot colour for a CO2 reading, using the configured fresh/elevated thresholds and (ac...
Definition: HomeScenePanel.cpp:189
void EnsureBaseCache(int width, int height, int blendBucket)
Rebuilds the cached day/night-crossfaded base image, but only when the draw size or the bucketed blen...
Definition: HomeScenePanel.cpp:358
static constexpr double DESIGN_WIDTH
The SVG authoring width overlays are positioned against.
Definition: HomeScenePanel.h:30
void Update(const RumPi::SelectedSensorReadings &readings)
Stores the latest sensor snapshot (on the UI thread) and schedules a repaint so the overlays reflect ...
Definition: HomeScenePanel.cpp:127
void DrawCelestialBody(wxGraphicsContext *graphicsContext, int width, int height)
Draws the procedural sun (day) or moon (night) arcing across the sky by real local time,...
Definition: HomeScenePanel.cpp:580
void OnTimer(wxTimerEvent &event)
Timer handler: advances the wind and cloud animation phases (a baseline drift plus an amount proporti...
Definition: HomeScenePanel.cpp:445
wxColour myCo2HighColour
Indicator colour for the "high" CO2 band.
Definition: HomeScenePanel.h:69
double mySceneAspect
The scene's aspect ratio.
Definition: HomeScenePanel.h:32
wxBitmapBundle LoadSceneBundle(const wxString &folder, const wxString &baseName, const char *embeddedSvg) const
Loads a scene image bundle, preferring a user-supplied file (svg, then raster) in the images folder a...
Definition: HomeScenePanel.cpp:258
RumPi::SelectedSensorReadings myReadings
Definition: HomeScenePanel.h:39
void DrawAtmosphere(wxGraphicsContext *graphicsContext, int width, int height)
Draws the reading-driven atmospheric overlays: dawn/dusk glow, temperature tint, humidity clouds,...
Definition: HomeScenePanel.cpp:668
wxBitmapBundle myNightScene
Night base art (SVG bundle).
Definition: HomeScenePanel.h:36
void DrawStreetlights(wxGraphicsContext *graphicsContext, int width, int height)
Draws the default scene's lamp posts, lit by the TSL2591 light level (brighter the darker it gets) an...
Definition: HomeScenePanel.cpp:836
void OnSize(wxSizeEvent &event)
Size handler: schedules a repaint so the scene re-scales to the new panel size.
Definition: HomeScenePanel.cpp:426
wxBitmapBundle myDayScene
Day base art (SVG bundle).
Definition: HomeScenePanel.h:35
double myHazeOpacity
Maximum haze overlay opacity.
Definition: HomeScenePanel.h:64
double myDuskGlowOpacity
Maximum dusk-glow overlay opacity.
Definition: HomeScenePanel.h:61
double myTempCoolBelow
Temperature below which the tint reads "cool".
Definition: HomeScenePanel.h:60
void DrawPills(wxGraphicsContext *graphicsContext, int width, int height)
Draws the glanceable info pills: the location and clock along the top, and a bottom strip of reading ...
Definition: HomeScenePanel.cpp:911
double myCloudPhase
Current cloud animation phase.
Definition: HomeScenePanel.h:52
double myWindPhase
Current wind animation phase.
Definition: HomeScenePanel.h:51
double LocalTimeInHours() const
Gets the current local time as a fractional number of hours (e.g.
Definition: HomeScenePanel.cpp:146
HomeScenePanel(wxWindow *parent)
Builds the scene panel: loads the tunable settings from ClientConfig, seeds and loads the day/night S...
Definition: HomeScenePanel.cpp:52
double myWindOpacity
Maximum wind overlay opacity.
Definition: HomeScenePanel.h:66
double NightAmount() const
Computes how "night" it is now, from 0.0 (full day) to 1.0 (full night), using a sun-elevation proxy ...
Definition: HomeScenePanel.cpp:165
wxBitmap myBaseCache
Cached crossfaded base image.
Definition: HomeScenePanel.h:42
double myCo2FreshMax
Upper CO2 bound for the "fresh" band.
Definition: HomeScenePanel.h:57
double myCloudOpacity
Maximum cloud overlay opacity.
Definition: HomeScenePanel.h:63
int myBaseCacheWidth
Width the base cache was built at.
Definition: HomeScenePanel.h:43
wxTimer myAnimationTimer
Timer that advances the animation phases between snapshots.
Definition: HomeScenePanel.h:53