Adding STP to list of palettes

This commit is contained in:
Dan Paulat 2022-04-09 00:29:39 -05:00
parent 5e20ff9311
commit 41fda1e9cf
4 changed files with 21 additions and 18 deletions

View file

@ -119,7 +119,7 @@ MainWindow::MainWindow(QWidget* parent) :
ui->declutterCheckbox->setVisible(false); ui->declutterCheckbox->setVisible(false);
p->SelectRadarProduct(p->activeMap_, common::Level2Product::Reflectivity); p->SelectRadarProduct(p->activeMap_, common::Level2Product::Reflectivity);
if (p->maps_.at(1) != nullptr) if (p->maps_.size() > 1 && p->maps_.at(1) != nullptr)
{ {
p->SelectRadarProduct(p->maps_.at(1), common::Level2Product::Velocity); p->SelectRadarProduct(p->maps_.at(1), common::Level2Product::Velocity);
} }
@ -466,7 +466,9 @@ void MainWindowImpl::UpdateRadarProductSelection(
UpdateLevel2ProductSelection(common::GetLevel2Product(product)); UpdateLevel2ProductSelection(common::GetLevel2Product(product));
break; break;
default: UpdateLevel2ProductSelection(common::Level2Product::Unknown); break; default:
UpdateLevel2ProductSelection(common::Level2Product::Unknown);
break;
} }
} }

View file

@ -13,7 +13,7 @@ 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> paletteNames_ = { static const std::vector<std::string> paletteNames_ = {
"BR", "BV", "SW", "ZDR", "PHI", "CC", "???"}; "BR", "BV", "SW", "ZDR", "PHI", "CC", "STP", "???"};
static const std::string DEFAULT_KEY = "Default"; static const std::string DEFAULT_KEY = "Default";
static const std::string DEFAULT_PALETTE = ""; static const std::string DEFAULT_PALETTE = "";
@ -27,10 +27,10 @@ public:
void SetDefaults() void SetDefaults()
{ {
std::for_each( std::for_each(paletteNames_.cbegin(),
paletteNames_.cbegin(), paletteNames_.cend(),
paletteNames_.cend(), [&](const std::string& name)
[&](const std::string& name) { palette_[name] = DEFAULT_PALETTE; }); { palette_[name] = DEFAULT_PALETTE; });
} }
std::unordered_map<std::string, std::string> palette_; std::unordered_map<std::string, std::string> palette_;
@ -66,10 +66,10 @@ boost::json::value PaletteSettings::ToJson() const
{ {
boost::json::object json; boost::json::object json;
std::for_each( std::for_each(paletteNames_.cbegin(),
paletteNames_.cbegin(), paletteNames_.cend(),
paletteNames_.cend(), [&](const std::string& name)
[&](const std::string& name) { json[name] = p->palette_[name]; }); { json[name] = p->palette_[name]; });
return json; return json;
} }
@ -94,7 +94,8 @@ PaletteSettings::Load(const boost::json::value* json, bool& jsonDirty)
{ {
std::for_each(paletteNames_.cbegin(), std::for_each(paletteNames_.cbegin(),
paletteNames_.cend(), paletteNames_.cend(),
[&](const std::string& name) { [&](const std::string& name)
{
jsonDirty |= !util::json::FromJsonString( jsonDirty |= !util::json::FromJsonString(
json->as_object(), json->as_object(),
name, name,

@ -1 +1 @@
Subproject commit 19cd558cb25114221d2fce69b26eee912cd0d232 Subproject commit c82e24718e7d5a0ae0c47b460240990a1187b383

View file

@ -43,16 +43,16 @@ static const std::unordered_map<Level2Product, std::string> level2Palette_ {
{Level2Product::Unknown, "???"}}; {Level2Product::Unknown, "???"}};
static const std::unordered_map<int16_t, std::string> level3Palette_ { static const std::unordered_map<int16_t, std::string> level3Palette_ {
{19, "BR"}, {20, "BR"}, {27, "BV"}, {30, "SW"}, {31, "???"}, {19, "BR"}, {20, "BR"}, {27, "BV"}, {30, "SW"}, {31, "STP"},
{32, "BR"}, {37, "BR"}, {38, "BR"}, {41, "???"}, {50, "BR"}, {32, "BR"}, {37, "BR"}, {38, "BR"}, {41, "???"}, {50, "BR"},
{51, "BV"}, {56, "BV"}, {57, "???"}, {65, "BR"}, {66, "BR"}, {51, "BV"}, {56, "BV"}, {57, "???"}, {65, "BR"}, {66, "BR"},
{67, "BR"}, {78, "???"}, {79, "???"}, {80, "???"}, {81, "???"}, {67, "BR"}, {78, "STP"}, {79, "STP"}, {80, "STP"}, {81, "???"},
{86, "BV"}, {90, "BR"}, {93, "BV"}, {94, "BR"}, {97, "BR"}, {86, "BV"}, {90, "BR"}, {93, "BV"}, {94, "BR"}, {97, "BR"},
{98, "BR"}, {99, "BV"}, {113, "???"}, {132, "???"}, {133, "???"}, {98, "BR"}, {99, "BV"}, {113, "???"}, {132, "???"}, {133, "???"},
{134, "???"}, {135, "???"}, {137, "BR"}, {138, "???"}, {144, "???"}, {134, "???"}, {135, "???"}, {137, "BR"}, {138, "???"}, {144, "STP"},
{145, "???"}, {146, "???"}, {150, "???"}, {151, "???"}, {153, "BR"}, {145, "STP"}, {146, "STP"}, {150, "STP"}, {151, "STP"}, {153, "BR"},
{154, "BV"}, {155, "SW"}, {159, "ZDR"}, {161, "CC"}, {163, "PHI"}, {154, "BV"}, {155, "SW"}, {159, "ZDR"}, {161, "CC"}, {163, "PHI"},
{165, "???"}, {167, "CC"}, {168, "PHI"}, {169, "???"}, {170, "???"}, {165, "???"}, {167, "CC"}, {168, "PHI"}, {169, "STP"}, {170, "???"},
{171, "???"}, {172, "???"}, {173, "???"}, {174, "???"}, {175, "???"}, {171, "???"}, {172, "???"}, {173, "???"}, {174, "???"}, {175, "???"},
{176, "???"}, {177, "???"}, {178, "???"}, {179, "???"}, {180, "BR"}, {176, "???"}, {177, "???"}, {178, "???"}, {179, "???"}, {180, "BR"},
{181, "BR"}, {182, "BV"}, {184, "SW"}, {186, "BR"}, {193, "BR"}, {181, "BR"}, {182, "BV"}, {184, "SW"}, {186, "BR"}, {193, "BR"},