Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
config_reader.h
Go to the documentation of this file.
1//
2// Copyright (c) 2023, DefenceX PTY LTD
3//
4// This file is part of the VivoeX project developed by DefenceX.
5//
6// Licensed under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
7// License. See the LICENSE file in the project root for full license details.
8//
12
13#ifndef HMICORE_CONFIG_READER_H_
14#define HMICORE_CONFIG_READER_H_
15
16#include <memory>
17#include <string>
18
19#include "config.pb.h" // NOLINT
20#include "hmicore/gva.h"
22
23namespace gva {
24
31 public:
37
42
46 void WriteData() const;
47
49 std::unique_ptr<config::Gva> current_config_;
50
52 std::string config_file_ = "config.pb";
53};
54
57 public:
63 uint32_t GetThemeBackground() const;
64
70 uint32_t GetTableBackground() const;
71
77 uint16_t GetThemeLabelStyle() const;
78
85
92
98 uint32_t GetThemeLabelBackgroundEnabled() const;
99
105 uint32_t GetThemeLabelBackgroundDisabled() const;
106
113
119 uint32_t GetThemeLabelTextEnabledSelected() const;
120
126 uint32_t GetThemeLabelTextEnabled() const;
127
133 uint32_t GetThemeLabelTextDisabled() const;
134
141
147 uint32_t GetThemeLabelBorderEnabledSelected() const;
148
154 uint32_t GetThemeLabelBorderEnabled() const;
155
161 uint32_t GetThemeLabelBorderDisabled() const;
162
169
176
183
190
197
203 uint32_t GetThemeLabelBorderThickness() const;
204
210 uint32_t GetThemeTableBorderThickness() const;
211
217 uint32_t GetThemeStatusBackground() const;
218
224 uint32_t GetThemeStatusBorder() const;
225
231 uint32_t GetThemeStatusText() const;
232
238 uint32_t GetThemeAlert() const;
239
245 uint32_t GetThemeCritical() const;
246
252 std::string GetThemeFont() const;
253};
254
257 public:
261 explicit ConfigData(const ConfigData& other) = delete;
262
263 ~ConfigData() = delete;
264
268 void operator=(ConfigData&) = delete;
269
270 // Static methods should be defined outside the class.
271
281 static ConfigData* GetInstance();
282
287 std::string GetConfigFilename() const;
288
294 int GetZoom() const;
295
301 void SetZoom(int zoom) const;
302
308 double GetTestLon() const;
309
315 void SetTestLon(double lon) const;
316
322 double GetTestLat() const;
323
329 void SetTestLat(double lat) const;
330
337 bool GetFullscreen() const;
338
344 void SetFullscreen(bool fullscreen) const;
345
352 bool GetMapEnabled() const;
353
358 void SetMapEnabled(bool enabled) const;
359
365 std::string GetMapPath() const;
366
372 std::string GetStylesheetPath() const;
373
379 std::string GetLogPath() const;
380
386 std::string GetLogFilename() const;
387
393 std::string GetImagePath() const;
394
400 std::string GetGpsDevice() const;
401
407 std::string GetOdbDevice() const;
408
414 uint32_t GetKeyBinding(GvaKeyEnum key) const;
415
421 double GetBrightness() const;
422
428 void SetBrightness(double brightness);
429
430 protected:
435 ConfigData() = default;
436
443 uint32_t LookupKey(config::Key key) const;
444
447};
448
449} // namespace gva
450
451#endif // HMICORE_CONFIG_READER_H_
All the configuration data read in at startup, this is the abstraction layer and file format / type c...
Definition config_reader.h:30
void WriteData() const
Write contents of protobuf.
Definition config_reader.cc:102
ConfigDataBase()
Construct a new Config Data Base object.
Definition config_reader.cc:29
~ConfigDataBase()
Destroy the Config Data object.
Definition config_reader.cc:88
std::string config_file_
The default config data.
Definition config_reader.h:52
std::unique_ptr< config::Gva > current_config_
CThe current config data.
Definition config_reader.h:49
Class defining the theme.
Definition config_reader.h:56
uint32_t GetThemeLabelBorderThickness() const
Get the Theme Label Border Thickness object.
Definition config_reader.cc:266
uint32_t GetThemeAlert() const
Get the Theme Alert object.
Definition config_reader.cc:284
uint32_t GetThemeBackground() const
Get the Theme Background object.
Definition config_reader.cc:151
uint32_t GetThemeLabelBorderEnabled() const
Get the Theme Label Border Enabled object.
Definition config_reader.cc:197
uint32_t GetThemeTableBorderThickness() const
Get the Table Label Border Thickness object.
Definition config_reader.cc:270
uint32_t GetThemeLabelBackgroundEnabledSelected() const
Get the Theme Label Background Enabled Selected object.
Definition config_reader.cc:161
uint32_t GetThemeStatusBackground() const
Get the Theme Status Background object.
Definition config_reader.cc:274
LineType GetThemeLabelLineDisabled() const
Get the Theme Label Line Disabled object.
Definition config_reader.cc:238
LineType GetThemeLabelLineEnabledSelectedChanging() const
Get the Theme Label Line Enabled Selected Changing object.
Definition config_reader.cc:205
uint16_t GetThemeLabelStyle() const
Get the Theme Label Style object.
Definition config_reader.cc:155
uint32_t GetThemeLabelBackgroundEnabled() const
Get the Theme Label Background Active object.
Definition config_reader.cc:165
uint32_t GetThemeStatusBorder() const
Get the Theme Status Border object.
Definition config_reader.cc:278
std::string GetThemeFont() const
Get the Theme Font object.
Definition config_reader.cc:288
uint32_t GetTableBackground() const
Get the Table Background object.
Definition config_reader.cc:153
uint32_t GetThemeCritical() const
Get the Theme Critical object.
Definition config_reader.cc:286
uint32_t GetThemeLabelBackgroundEnabledSelectedChanging() const
Get the Theme Label Background Enabled Selected Changing object.
Definition config_reader.cc:157
uint32_t GetThemeLabelBackgroundDisabled() const
Get the Theme Label Background Disabled object.
Definition config_reader.cc:169
uint32_t GetThemeLabelBorderEnabledSelected() const
Get the Theme Label Border Enabled Selected object.
Definition config_reader.cc:193
uint32_t GetThemeLabelTextEnabledSelectedChanging() const
Get the Theme Label Text Enabled Selected Changing object.
Definition config_reader.cc:173
widget::ModeEnum GetPpiMode() const
Get the Ppi Mode object.
Definition config_reader.cc:249
LineType GetThemeLabelLineEnabledSelected() const
Get the Theme Label Line Enabled Selected object.
Definition config_reader.cc:216
LineType GetThemeLabelLineEnabled() const
Get the Theme Label Line Enabled object.
Definition config_reader.cc:227
uint32_t GetThemeLabelTextEnabledSelected() const
Get the Theme Label Text Enabled Selected object.
Definition config_reader.cc:177
uint32_t GetThemeLabelTextEnabled() const
Get the Theme Label Text Enabled object.
Definition config_reader.cc:181
uint32_t GetThemeStatusText() const
Get the Theme Status Text object.
Definition config_reader.cc:282
uint32_t GetThemeLabelBorderDisabled() const
Get the Theme Label Border Disabled object.
Definition config_reader.cc:201
uint32_t GetThemeLabelTextDisabled() const
Get the Theme Label Text Disabled object.
Definition config_reader.cc:185
uint32_t GetThemeLabelBorderEnabledSelectedChanging() const
Get the Theme Label Border Enabled Selected Changing object.
Definition config_reader.cc:189
Class defining the config data.
Definition config_reader.h:256
std::string GetOdbDevice() const
Get the Odb Device path to virtual port.
Definition config_reader.cc:303
void SetBrightness(double brightness)
Set the Brightness attribute.
Definition config_reader.cc:382
int GetZoom() const
Get the Zoom object.
Definition config_reader.cc:115
static ConfigData * GetInstance()
Get the Instance object.
Definition config_reader.cc:93
void SetTestLat(double lat) const
Set the Test Lat object.
Definition config_reader.cc:125
void operator=(ConfigData &)=delete
Singletons should not be assignable.
double GetTestLat() const
Get the Test Lat object.
Definition config_reader.cc:123
void SetFullscreen(bool fullscreen) const
Set the Fullscreen object.
Definition config_reader.cc:129
static ConfigData * config_
The config data singleton.
Definition config_reader.h:446
void SetTestLon(double lon) const
Set the Test Lon object.
Definition config_reader.cc:121
std::string GetGpsDevice() const
Get the Gps Device path to virtual port.
Definition config_reader.cc:302
std::string GetLogPath() const
Get the Log Path object.
Definition config_reader.cc:290
void SetMapEnabled(bool enabled) const
Set the Map Enabled object.
Definition config_reader.cc:133
std::string GetImagePath() const
Get the Image Path object.
Definition config_reader.cc:294
void SetZoom(int zoom) const
Set the Zoom object.
Definition config_reader.cc:117
double GetTestLon() const
Get the Test Lon object.
Definition config_reader.cc:119
ConfigData()=default
Construct a new Config Data object.
uint32_t LookupKey(config::Key key) const
Lookup the actual key binding value from the config data.
Definition config_reader.cc:384
bool GetMapEnabled() const
Get the Map Enabled object.
Definition config_reader.cc:131
ConfigData(const ConfigData &other)=delete
Singletons should not be cloneable.
double GetBrightness() const
Get the Brightness attribute.
Definition config_reader.cc:380
std::string GetMapPath() const
Get the Map Path for the installed OSMScout maps.
Definition config_reader.cc:135
uint32_t GetKeyBinding(GvaKeyEnum key) const
Get the Key Binding attribute.
Definition config_reader.cc:305
std::string GetLogFilename() const
Get the Log Filename object.
Definition config_reader.cc:292
std::string GetStylesheetPath() const
Get the Stylesheet Path for the OSMScout stylesheets.
Definition config_reader.cc:143
bool GetFullscreen() const
Get the Fullscreen object.
Definition config_reader.cc:127
std::string GetConfigFilename() const
Get the Config Filename object.
GvaKeyEnum
These are physical GVA keys around the display.
Definition gva.h:67
LineType
Enum for the label states.
Definition gva.h:54
ModeEnum
The Plan Position Indicator modes, different visual styles.
Definition widget_types.h:64