45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
#ifndef CONFIG_MANAGER_H
|
|
#define CONFIG_MANAGER_H
|
|
|
|
#include <string>
|
|
#include <map>
|
|
|
|
class ConfigManager {
|
|
public:
|
|
ConfigManager();
|
|
|
|
// Load configuration
|
|
void load();
|
|
|
|
// Save configuration
|
|
void save();
|
|
|
|
// Getters and setters
|
|
int getWindowWidth() const { return windowWidth; }
|
|
int getWindowHeight() const { return windowHeight; }
|
|
int getPollingTime() const { return pollingTime; }
|
|
|
|
void setWindowWidth(int w) { windowWidth = w; }
|
|
void setWindowHeight(int h) { windowHeight = h; }
|
|
void setPollingTime(int t) { pollingTime = t; }
|
|
|
|
std::map<std::string, std::string> getSensorColors() const { return sensorColors; }
|
|
std::map<std::string, std::string> getSensorNames() const { return sensorNames; }
|
|
|
|
void setSensorColor(const std::string &id, const std::string &color) { sensorColors[id] = color; }
|
|
void setSensorName(const std::string &id, const std::string &name) { sensorNames[id] = name; }
|
|
|
|
private:
|
|
std::string getConfigFilePath() const;
|
|
|
|
mutable std::string cachedConfigPath;
|
|
int windowWidth;
|
|
int windowHeight;
|
|
int pollingTime;
|
|
|
|
std::map<std::string, std::string> sensorColors;
|
|
std::map<std::string, std::string> sensorNames;
|
|
};
|
|
|
|
#endif // CONFIG_MANAGER_H
|