mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:20:06 +00:00
Update radar product and elevation selection when active map changes
This commit is contained in:
parent
b78011a2d3
commit
337296ac3c
8 changed files with 159 additions and 31 deletions
|
|
@ -47,6 +47,9 @@ public:
|
|||
common::Level2Product product);
|
||||
void SetActiveMap(map::MapWidget* mapWidget);
|
||||
void UpdateElevationSelection(float elevation);
|
||||
void UpdateLevel2ProductSelection(common::Level2Product product);
|
||||
void UpdateRadarProductSelection(common::RadarProductGroup group,
|
||||
const std::string& product);
|
||||
void UpdateRadarProductSettings();
|
||||
|
||||
MainWindow* mainWindow_;
|
||||
|
|
@ -252,6 +255,9 @@ void MainWindowImpl::HandleFocusChange(QWidget* focused)
|
|||
if (mapWidget != nullptr)
|
||||
{
|
||||
SetActiveMap(mapWidget);
|
||||
UpdateRadarProductSelection(mapWidget->GetRadarProductGroup(),
|
||||
mapWidget->GetRadarProductName());
|
||||
UpdateRadarProductSettings();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -285,20 +291,8 @@ void MainWindowImpl::SelectRadarProduct(map::MapWidget* mapWidget,
|
|||
|
||||
if (mapWidget == activeMap_)
|
||||
{
|
||||
for (QToolButton* toolButton :
|
||||
mainWindow_->ui->level2ProductFrame->findChildren<QToolButton*>())
|
||||
{
|
||||
if (toolButton->text().toStdString() == productName)
|
||||
{
|
||||
toolButton->setCheckable(true);
|
||||
toolButton->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
toolButton->setChecked(false);
|
||||
toolButton->setCheckable(false);
|
||||
}
|
||||
}
|
||||
UpdateLevel2ProductSelection(product);
|
||||
UpdateRadarProductSettings();
|
||||
}
|
||||
|
||||
mapWidget->SelectRadarProduct(product);
|
||||
|
|
@ -349,6 +343,39 @@ void MainWindowImpl::UpdateMapParameters(
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindowImpl::UpdateLevel2ProductSelection(common::Level2Product product)
|
||||
{
|
||||
const std::string& productName = common::GetLevel2Name(product);
|
||||
|
||||
for (QToolButton* toolButton :
|
||||
mainWindow_->ui->level2ProductFrame->findChildren<QToolButton*>())
|
||||
{
|
||||
if (toolButton->text().toStdString() == productName)
|
||||
{
|
||||
toolButton->setCheckable(true);
|
||||
toolButton->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
toolButton->setChecked(false);
|
||||
toolButton->setCheckable(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowImpl::UpdateRadarProductSelection(
|
||||
common::RadarProductGroup group, const std::string& product)
|
||||
{
|
||||
switch (group)
|
||||
{
|
||||
case common::RadarProductGroup::Level2:
|
||||
UpdateLevel2ProductSelection(common::GetLevel2Product(product));
|
||||
break;
|
||||
|
||||
default: UpdateLevel2ProductSelection(common::Level2Product::Unknown); break;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowImpl::UpdateRadarProductSettings()
|
||||
{
|
||||
float currentElevation = activeMap_->GetElevation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue