SDRPlusPlus/core/src/gui/widgets/bandplan.h

47 lines
1.2 KiB
C
Raw Normal View History

2020-08-04 21:34:56 +02:00
#pragma once
#include <json.hpp>
2020-08-05 21:13:53 +02:00
#include <imgui/imgui.h>
#include <stdint.h>
2020-08-04 21:34:56 +02:00
using nlohmann::json;
namespace bandplan {
struct Band_t {
std::string name;
std::string type;
double start;
double end;
2020-08-04 21:34:56 +02:00
};
void to_json(json& j, const Band_t& b);
void from_json(const json& j, Band_t& b);
struct BandPlan_t {
std::string name;
std::string countryName;
std::string countryCode;
std::string authorName;
std::string authorURL;
std::vector<Band_t> bands;
};
void to_json(json& j, const BandPlan_t& b);
void from_json(const json& j, BandPlan_t& b);
2020-08-05 21:13:53 +02:00
struct BandPlanColor_t {
uint32_t colorValue;
uint32_t transColorValue;
};
void to_json(json& j, const BandPlanColor_t& ct);
void from_json(const json& j, BandPlanColor_t& ct);
2020-08-04 21:34:56 +02:00
void loadBandPlan(std::string path);
void loadFromDir(std::string path);
2020-12-23 00:11:12 +01:00
void loadColorTable(json table);
2020-08-04 21:34:56 +02:00
extern std::map<std::string, BandPlan_t> bandplans;
extern std::vector<std::string> bandplanNames;
extern std::string bandplanNameTxt;
2020-08-05 21:13:53 +02:00
extern std::map<std::string, BandPlanColor_t> colorTable;
2020-08-04 21:34:56 +02:00
};