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);
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);
}
@ -466,7 +466,9 @@ void MainWindowImpl::UpdateRadarProductSelection(
UpdateLevel2ProductSelection(common::GetLevel2Product(product));
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::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_PALETTE = "";
@ -27,10 +27,10 @@ public:
void SetDefaults()
{
std::for_each(
paletteNames_.cbegin(),
paletteNames_.cend(),
[&](const std::string& name) { palette_[name] = DEFAULT_PALETTE; });
std::for_each(paletteNames_.cbegin(),
paletteNames_.cend(),
[&](const std::string& name)
{ palette_[name] = DEFAULT_PALETTE; });
}
std::unordered_map<std::string, std::string> palette_;
@ -66,10 +66,10 @@ boost::json::value PaletteSettings::ToJson() const
{
boost::json::object json;
std::for_each(
paletteNames_.cbegin(),
paletteNames_.cend(),
[&](const std::string& name) { json[name] = p->palette_[name]; });
std::for_each(paletteNames_.cbegin(),
paletteNames_.cend(),
[&](const std::string& name)
{ json[name] = p->palette_[name]; });
return json;
}
@ -94,7 +94,8 @@ PaletteSettings::Load(const boost::json::value* json, bool& jsonDirty)
{
std::for_each(paletteNames_.cbegin(),
paletteNames_.cend(),
[&](const std::string& name) {
[&](const std::string& name)
{
jsonDirty |= !util::json::FromJsonString(
json->as_object(),
name,