RumPi Linux Client 1.0
A wxWidgets desktop dashboard that visualizes a RumPi robot's live sensor data as a condition-reactive scene
ClientConfig Class Reference

Loads the user-editable client settings from an INI file (via wxFileConfig) once at startup and exposes them as typed getters with sensible defaults. More...

#include <ClientConfig.h>

Public Member Functions

const wxString & GetLocation () const
 Gets the configured location name. More...
 
const wxString & GetImagesFolder () const
 Gets the configured images folder (with a leading ~ already expanded to the home directory). More...
 
int GetAnimationFps () const
 Gets the scene animation frame rate. More...
 
double GetCo2FreshMax () const
 Gets the upper CO2 bound for the "fresh" band. More...
 
double GetCo2ElevatedMax () const
 Gets the upper CO2 bound for the "elevated" band. More...
 
double GetTempWarmAbove () const
 Gets the temperature above which it reads "warm". More...
 
double GetTempCoolBelow () const
 Gets the temperature below which it reads "cool". More...
 
double GetDuskGlowOpacity () const
 Gets the maximum dusk-glow overlay opacity. More...
 
double GetTemperatureTintOpacity () const
 Gets the maximum temperature-tint overlay opacity. More...
 
double GetCloudOpacity () const
 Gets the maximum cloud overlay opacity. More...
 
double GetHazeOpacity () const
 Gets the maximum haze overlay opacity. More...
 
double GetMistOpacity () const
 Gets the maximum mist overlay opacity. More...
 
double GetWindOpacity () const
 Gets the maximum wind overlay opacity. More...
 
wxColour GetCo2FreshColour () const
 Gets the indicator colour for the "fresh" CO2 band. More...
 
wxColour GetCo2ElevatedColour () const
 Gets the indicator colour for the "elevated" CO2 band. More...
 
wxColour GetCo2HighColour () const
 Gets the indicator colour for the "high" CO2 band. More...
 

Static Public Member Functions

static ClientConfigGetInstance ()
 Gets the singleton instance, constructing (and loading) it on first call. More...
 

Private Member Functions

 ClientConfig ()
 Builds the config, seeding every field with its built-in default, then loads any overrides from the INI file. More...
 
 ClientConfig (const ClientConfig &)
 
ClientConfigoperator= (const ClientConfig &)
 
void Load ()
 Seeds the config file if missing, then reads every setting from it, expanding a leading ~ in the images folder and falling back to the built-in default for any missing key or malformed colour. More...
 
wxString ConfigFilePath () const
 Builds the path to the config file (~/rumpi_config.ini), alongside the ~/rumpi_logs and ~/rumpi_images folders. More...
 
void SeedDefaultFileIfMissing (const wxString &path) const
 Writes the commented default config file to the given path if it doesn't already exist. More...
 

Private Attributes

wxString myLocation
 The configured location name. More...
 
wxString myImagesFolder
 The configured images folder (a leading ~ is expanded to home). More...
 
int myAnimationFps
 The scene animation frame rate. More...
 
double myCo2FreshMax
 Upper CO2 bound for the "fresh" band. More...
 
double myCo2ElevatedMax
 Upper CO2 bound for the "elevated" band. More...
 
double myTempWarmAbove
 Temperature above which it reads "warm". More...
 
double myTempCoolBelow
 Temperature below which it reads "cool". More...
 
double myDuskGlowOpacity
 Maximum dusk-glow overlay opacity. More...
 
double myTemperatureTintOpacity
 Maximum temperature-tint overlay opacity. More...
 
double myCloudOpacity
 Maximum cloud overlay opacity. More...
 
double myHazeOpacity
 Maximum haze overlay opacity. More...
 
double myMistOpacity
 Maximum mist overlay opacity. More...
 
double myWindOpacity
 Maximum wind overlay opacity. More...
 
wxColour myCo2FreshColour
 Indicator colour for the "fresh" CO2 band. More...
 
wxColour myCo2ElevatedColour
 Indicator colour for the "elevated" CO2 band. More...
 
wxColour myCo2HighColour
 Indicator colour for the "high" CO2 band. More...
 

Detailed Description

Loads the user-editable client settings from an INI file (via wxFileConfig) once at startup and exposes them as typed getters with sensible defaults.

A commented default file is seeded on first run so the user has something to edit, and missing keys fall back to the built-in defaults. Access the shared instance via GetInstance(); the file is read once, so edits take effect on the next app start.

Author
Eddie O'Hagan
Date
8/13/2026

Constructor & Destructor Documentation

◆ ClientConfig() [1/2]

ClientConfig::ClientConfig ( )
private

Builds the config, seeding every field with its built-in default, then loads any overrides from the INI file.

Author
Eddie O'Hagan
Date
8/13/2026
//Constructed once by ClientConfig::GetInstance().

◆ ClientConfig() [2/2]

ClientConfig::ClientConfig ( const ClientConfig )
private

Member Function Documentation

◆ ConfigFilePath()

wxString ClientConfig::ConfigFilePath ( ) const
private

Builds the path to the config file (~/rumpi_config.ini), alongside the ~/rumpi_logs and ~/rumpi_images folders.

Author
Eddie O'Hagan
Date
8/13/2026
wxString path = ConfigFilePath();
wxString ConfigFilePath() const
Builds the path to the config file (~/rumpi_config.ini), alongside the ~/rumpi_logs and ~/rumpi_image...
Definition: ClientConfig.cpp:66
Returns
The full path to the config file.

◆ GetAnimationFps()

int ClientConfig::GetAnimationFps ( ) const

Gets the scene animation frame rate.

Author
Eddie O'Hagan
Date
8/13/2026
int fps = config.GetAnimationFps();
Returns
The animation frame rate.

◆ GetCloudOpacity()

double ClientConfig::GetCloudOpacity ( ) const

Gets the maximum cloud overlay opacity.

Author
Eddie O'Hagan
Date
8/13/2026
double opacity = config.GetCloudOpacity();
Returns
The cloud overlay opacity (0.0 - 1.0).

◆ GetCo2ElevatedColour()

wxColour ClientConfig::GetCo2ElevatedColour ( ) const

Gets the indicator colour for the "elevated" CO2 band.

Author
Eddie O'Hagan
Date
8/13/2026
wxColour colour = config.GetCo2ElevatedColour();
Returns
The "elevated" CO2 indicator colour.

◆ GetCo2ElevatedMax()

double ClientConfig::GetCo2ElevatedMax ( ) const

Gets the upper CO2 bound for the "elevated" band.

Author
Eddie O'Hagan
Date
8/13/2026
double max = config.GetCo2ElevatedMax();
Returns
The "elevated" CO2 upper bound.

◆ GetCo2FreshColour()

wxColour ClientConfig::GetCo2FreshColour ( ) const

Gets the indicator colour for the "fresh" CO2 band.

Author
Eddie O'Hagan
Date
8/13/2026
wxColour colour = config.GetCo2FreshColour();
Returns
The "fresh" CO2 indicator colour.

◆ GetCo2FreshMax()

double ClientConfig::GetCo2FreshMax ( ) const

Gets the upper CO2 bound for the "fresh" band.

Author
Eddie O'Hagan
Date
8/13/2026
double max = config.GetCo2FreshMax();
Returns
The "fresh" CO2 upper bound.

◆ GetCo2HighColour()

wxColour ClientConfig::GetCo2HighColour ( ) const

Gets the indicator colour for the "high" CO2 band.

Author
Eddie O'Hagan
Date
8/13/2026
wxColour colour = config.GetCo2HighColour();
Returns
The "high" CO2 indicator colour.

◆ GetDuskGlowOpacity()

double ClientConfig::GetDuskGlowOpacity ( ) const

Gets the maximum dusk-glow overlay opacity.

Author
Eddie O'Hagan
Date
8/13/2026
double opacity = config.GetDuskGlowOpacity();
Returns
The dusk-glow overlay opacity (0.0 - 1.0).

◆ GetHazeOpacity()

double ClientConfig::GetHazeOpacity ( ) const

Gets the maximum haze overlay opacity.

Author
Eddie O'Hagan
Date
8/13/2026
double opacity = config.GetHazeOpacity();
Returns
The haze overlay opacity (0.0 - 1.0).

◆ GetImagesFolder()

const wxString & ClientConfig::GetImagesFolder ( ) const

Gets the configured images folder (with a leading ~ already expanded to the home directory).

Author
Eddie O'Hagan
Date
8/13/2026
wxString folder = config.GetImagesFolder();
Returns
The images folder path.

◆ GetInstance()

ClientConfig & ClientConfig::GetInstance ( )
static

Gets the singleton instance, constructing (and loading) it on first call.

Author
Eddie O'Hagan
Date
8/13/2026
Loads the user-editable client settings from an INI file (via wxFileConfig) once at startup and expos...
Definition: ClientConfig.h:37
static ClientConfig & GetInstance()
Gets the singleton instance, constructing (and loading) it on first call.
Definition: ClientConfig.cpp:21
Returns
The single ClientConfig instance.

◆ GetLocation()

const wxString & ClientConfig::GetLocation ( ) const

Gets the configured location name.

Author
Eddie O'Hagan
Date
8/13/2026
wxString location = config.GetLocation();
Returns
The location name.

◆ GetMistOpacity()

double ClientConfig::GetMistOpacity ( ) const

Gets the maximum mist overlay opacity.

Author
Eddie O'Hagan
Date
8/13/2026
double opacity = config.GetMistOpacity();
Returns
The mist overlay opacity (0.0 - 1.0).

◆ GetTempCoolBelow()

double ClientConfig::GetTempCoolBelow ( ) const

Gets the temperature below which it reads "cool".

Author
Eddie O'Hagan
Date
8/13/2026
double temp = config.GetTempCoolBelow();
Returns
The "cool" temperature threshold.

◆ GetTemperatureTintOpacity()

double ClientConfig::GetTemperatureTintOpacity ( ) const

Gets the maximum temperature-tint overlay opacity.

Author
Eddie O'Hagan
Date
8/13/2026
double opacity = config.GetTemperatureTintOpacity();
Returns
The temperature-tint overlay opacity (0.0 - 1.0).

◆ GetTempWarmAbove()

double ClientConfig::GetTempWarmAbove ( ) const

Gets the temperature above which it reads "warm".

Author
Eddie O'Hagan
Date
8/13/2026
double temp = config.GetTempWarmAbove();
Returns
The "warm" temperature threshold.

◆ GetWindOpacity()

double ClientConfig::GetWindOpacity ( ) const

Gets the maximum wind overlay opacity.

Author
Eddie O'Hagan
Date
8/13/2026
double opacity = config.GetWindOpacity();
Returns
The wind overlay opacity (0.0 - 1.0).

◆ Load()

void ClientConfig::Load ( )
private

Seeds the config file if missing, then reads every setting from it, expanding a leading ~ in the images folder and falling back to the built-in default for any missing key or malformed colour.

Author
Eddie O'Hagan
Date
8/13/2026
//Called once by the constructor.

◆ operator=()

ClientConfig & ClientConfig::operator= ( const ClientConfig )
private

◆ SeedDefaultFileIfMissing()

void ClientConfig::SeedDefaultFileIfMissing ( const wxString &  path) const
private

Writes the commented default config file to the given path if it doesn't already exist.

If writing fails, the getters still return the built-in defaults so the app keeps working.

Author
Eddie O'Hagan
Date
8/13/2026
void SeedDefaultFileIfMissing(const wxString &path) const
Writes the commented default config file to the given path if it doesn't already exist.
Definition: ClientConfig.cpp:85
Parameters
[in]pathThe config file path to seed.

Member Data Documentation

◆ myAnimationFps

int ClientConfig::myAnimationFps
private

The scene animation frame rate.

◆ myCloudOpacity

double ClientConfig::myCloudOpacity
private

Maximum cloud overlay opacity.

◆ myCo2ElevatedColour

wxColour ClientConfig::myCo2ElevatedColour
private

Indicator colour for the "elevated" CO2 band.

◆ myCo2ElevatedMax

double ClientConfig::myCo2ElevatedMax
private

Upper CO2 bound for the "elevated" band.

◆ myCo2FreshColour

wxColour ClientConfig::myCo2FreshColour
private

Indicator colour for the "fresh" CO2 band.

◆ myCo2FreshMax

double ClientConfig::myCo2FreshMax
private

Upper CO2 bound for the "fresh" band.

◆ myCo2HighColour

wxColour ClientConfig::myCo2HighColour
private

Indicator colour for the "high" CO2 band.

◆ myDuskGlowOpacity

double ClientConfig::myDuskGlowOpacity
private

Maximum dusk-glow overlay opacity.

◆ myHazeOpacity

double ClientConfig::myHazeOpacity
private

Maximum haze overlay opacity.

◆ myImagesFolder

wxString ClientConfig::myImagesFolder
private

The configured images folder (a leading ~ is expanded to home).

◆ myLocation

wxString ClientConfig::myLocation
private

The configured location name.

◆ myMistOpacity

double ClientConfig::myMistOpacity
private

Maximum mist overlay opacity.

◆ myTempCoolBelow

double ClientConfig::myTempCoolBelow
private

Temperature below which it reads "cool".

◆ myTemperatureTintOpacity

double ClientConfig::myTemperatureTintOpacity
private

Maximum temperature-tint overlay opacity.

◆ myTempWarmAbove

double ClientConfig::myTempWarmAbove
private

Temperature above which it reads "warm".

◆ myWindOpacity

double ClientConfig::myWindOpacity
private

Maximum wind overlay opacity.


The documentation for this class was generated from the following files: