New system for band plans

This commit is contained in:
Ryzerth
2020-12-23 00:11:12 +01:00
parent a08758ea54
commit a93681a980
8 changed files with 37 additions and 25 deletions

View File

@ -108,20 +108,7 @@ namespace bandplan {
}
}
void loadColorTable(std::string path) {
if (!std::filesystem::exists(path)) {
spdlog::error("Band Plan Color Table file does not exist");
return;
}
if (!std::filesystem::is_regular_file(path)) {
spdlog::error("Band Plan Color Table file isn't a file...");
return;
}
std::ifstream file(path.c_str());
json data;
file >> data;
file.close();
colorTable = data.get<std::map<std::string, BandPlanColor_t>>();
void loadColorTable(json table) {
colorTable = table.get<std::map<std::string, BandPlanColor_t>>();
}
};

View File

@ -38,7 +38,7 @@ namespace bandplan {
void loadBandPlan(std::string path);
void loadFromDir(std::string path);
void loadColorTable(std::string path);
void loadColorTable(json table);
extern std::map<std::string, BandPlan_t> bandplans;
extern std::vector<std::string> bandplanNames;