mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 21:00:05 +00:00
Update default palettes
This commit is contained in:
parent
1d597eb120
commit
bc9f057871
1 changed files with 23 additions and 21 deletions
|
|
@ -16,26 +16,26 @@ namespace settings
|
||||||
|
|
||||||
static const std::string logPrefix_ = "scwx::qt::settings::palette_settings";
|
static const std::string logPrefix_ = "scwx::qt::settings::palette_settings";
|
||||||
|
|
||||||
static const std::vector<std::string> kPaletteNames_ = {
|
static const std::unordered_map<std::string, std::string> kDefaultPalettes_ {
|
||||||
// Level 2 / Common Products
|
// Level 2 / Common Products
|
||||||
"BR",
|
{"BR", ":/res/palettes/wct/DR.pal"},
|
||||||
"BV",
|
{"BV", ":/res/palettes/wct/DV.pal"},
|
||||||
"SW",
|
{"SW", ":/res/palettes/wct/SW.pal"},
|
||||||
"ZDR",
|
{"ZDR", ":/res/palettes/wct/ZDR.pal"},
|
||||||
"PHI2",
|
{"PHI2", ":/res/palettes/wct/KDP2.pal"},
|
||||||
"CC",
|
{"CC", ":/res/palettes/wct/CC.pal"},
|
||||||
// Level 3 Products
|
// Level 3 Products
|
||||||
"DOD",
|
{"DOD", ":/res/palettes/wct/DOD_DSD.pal"},
|
||||||
"DSD",
|
{"DSD", ":/res/palettes/wct/DOD_DSD.pal"},
|
||||||
"ET",
|
{"ET", ":/res/palettes/wct/ET.pal"},
|
||||||
"OHP",
|
{"OHP", ":/res/palettes/wct/OHP.pal"},
|
||||||
"OHPIN",
|
{"OHPIN", ""},
|
||||||
"PHI3",
|
{"PHI3", ":/res/palettes/wct/KDP.pal"},
|
||||||
"SRV",
|
{"SRV", ":/res/palettes/wct/SRV.pal"},
|
||||||
"STP",
|
{"STP", ":/res/palettes/wct/STP.pal"},
|
||||||
"STPIN",
|
{"STPIN", ""},
|
||||||
"VIL",
|
{"VIL", ":/res/palettes/wct/VIL.pal"},
|
||||||
"???"};
|
{"???", ":/res/palettes/wct/Default16.pal"}};
|
||||||
|
|
||||||
static const std::map<
|
static const std::map<
|
||||||
awips::Phenomenon,
|
awips::Phenomenon,
|
||||||
|
|
@ -49,7 +49,6 @@ static const std::map<
|
||||||
{awips::Phenomenon::Tornado, {{255, 0, 0, 255}, {127, 0, 0, 255}}}};
|
{awips::Phenomenon::Tornado, {{255, 0, 0, 255}, {127, 0, 0, 255}}}};
|
||||||
|
|
||||||
static const std::string kDefaultKey_ {"???"};
|
static const std::string kDefaultKey_ {"???"};
|
||||||
static const std::string kDefaultPalette_ {""};
|
|
||||||
static const awips::Phenomenon kDefaultPhenomenon_ {awips::Phenomenon::Marine};
|
static const awips::Phenomenon kDefaultPhenomenon_ {awips::Phenomenon::Marine};
|
||||||
|
|
||||||
class PaletteSettingsImpl
|
class PaletteSettingsImpl
|
||||||
|
|
@ -57,14 +56,17 @@ class PaletteSettingsImpl
|
||||||
public:
|
public:
|
||||||
explicit PaletteSettingsImpl()
|
explicit PaletteSettingsImpl()
|
||||||
{
|
{
|
||||||
for (const std::string& name : kPaletteNames_)
|
for (const auto& palette : kDefaultPalettes_)
|
||||||
{
|
{
|
||||||
|
const std::string& name = palette.first;
|
||||||
|
const std::string& defaultValue = palette.second;
|
||||||
|
|
||||||
auto result =
|
auto result =
|
||||||
palette_.emplace(name, SettingsVariable<std::string> {name});
|
palette_.emplace(name, SettingsVariable<std::string> {name});
|
||||||
|
|
||||||
SettingsVariable<std::string>& settingsVariable = result.first->second;
|
SettingsVariable<std::string>& settingsVariable = result.first->second;
|
||||||
|
|
||||||
settingsVariable.SetDefault(kDefaultPalette_);
|
settingsVariable.SetDefault(defaultValue);
|
||||||
|
|
||||||
variables_.push_back(&settingsVariable);
|
variables_.push_back(&settingsVariable);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue