-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.hpp
More file actions
37 lines (31 loc) · 982 Bytes
/
Config.hpp
File metadata and controls
37 lines (31 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
/**
* @file Config.hpp
* @brief Configuration management for MCCOutlet
*/
#include <filesystem>
#include <optional>
#include <string>
namespace mccoutlet {
struct AppConfig {
// Stream settings
std::string stream_name = "MCCDaq";
std::string stream_type = "RawBrainSignal";
// Device settings
int device_index = 0;
int low_channel = 0;
int high_channel = 5;
double sample_rate = 16384.0;
int range = -1; ///< uldaq Range enum value, -1 = auto-select first
bool scaled = true; ///< true = calibrated voltage, false = raw ADC integers
};
class ConfigManager {
public:
static std::optional<AppConfig> load(const std::filesystem::path& path);
static bool save(const AppConfig& config, const std::filesystem::path& path);
static std::filesystem::path findConfigFile(
const std::string& filename,
const std::optional<std::filesystem::path>& hint = std::nullopt
);
};
} // namespace mccoutlet