mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:30:06 +00:00
Select different products in different maps
This commit is contained in:
parent
dd452a0e2c
commit
4e61f82c5d
1 changed files with 29 additions and 16 deletions
|
|
@ -42,7 +42,8 @@ public:
|
||||||
void ConfigureMapLayout();
|
void ConfigureMapLayout();
|
||||||
void InitializeConnections();
|
void InitializeConnections();
|
||||||
void SelectElevation(map::MapWidget* mapWidget, float elevation);
|
void SelectElevation(map::MapWidget* mapWidget, float elevation);
|
||||||
void SelectRadarProduct(common::Level2Product product);
|
void SelectRadarProduct(map::MapWidget* mapWidget,
|
||||||
|
common::Level2Product product);
|
||||||
void UpdateElevationSelection(float elevation);
|
void UpdateElevationSelection(float elevation);
|
||||||
void UpdateRadarProductSettings(map::MapWidget* mapWidget);
|
void UpdateRadarProductSettings(map::MapWidget* mapWidget);
|
||||||
|
|
||||||
|
|
@ -87,7 +88,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||||
level2Layout->addWidget(toolButton);
|
level2Layout->addWidget(toolButton);
|
||||||
|
|
||||||
connect(toolButton, &QToolButton::clicked, this, [=]() {
|
connect(toolButton, &QToolButton::clicked, this, [=]() {
|
||||||
p->SelectRadarProduct(product);
|
p->SelectRadarProduct(p->activeMap_, product);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,7 +100,11 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||||
|
|
||||||
p->InitializeConnections();
|
p->InitializeConnections();
|
||||||
|
|
||||||
p->SelectRadarProduct(common::Level2Product::Reflectivity);
|
p->SelectRadarProduct(p->activeMap_, common::Level2Product::Reflectivity);
|
||||||
|
if (p->maps_.at(1) != nullptr)
|
||||||
|
{
|
||||||
|
p->SelectRadarProduct(p->maps_.at(1), common::Level2Product::Velocity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
|
@ -241,32 +246,40 @@ void MainWindowImpl::InitializeConnections()
|
||||||
void MainWindowImpl::SelectElevation(map::MapWidget* mapWidget, float elevation)
|
void MainWindowImpl::SelectElevation(map::MapWidget* mapWidget, float elevation)
|
||||||
{
|
{
|
||||||
mapWidget->SelectElevation(elevation);
|
mapWidget->SelectElevation(elevation);
|
||||||
UpdateElevationSelection(elevation);
|
|
||||||
|
if (mapWidget == activeMap_)
|
||||||
|
{
|
||||||
|
UpdateElevationSelection(elevation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowImpl::SelectRadarProduct(common::Level2Product product)
|
void MainWindowImpl::SelectRadarProduct(map::MapWidget* mapWidget,
|
||||||
|
common::Level2Product product)
|
||||||
{
|
{
|
||||||
const std::string& productName = common::GetLevel2Name(product);
|
const std::string& productName = common::GetLevel2Name(product);
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug)
|
BOOST_LOG_TRIVIAL(debug)
|
||||||
<< logPrefix_ << "Selecting Level 2 radar product: " << productName;
|
<< logPrefix_ << "Selecting Level 2 radar product: " << productName;
|
||||||
|
|
||||||
for (QToolButton* toolButton :
|
if (mapWidget == activeMap_)
|
||||||
mainWindow_->ui->level2ProductFrame->findChildren<QToolButton*>())
|
|
||||||
{
|
{
|
||||||
if (toolButton->text().toStdString() == productName)
|
for (QToolButton* toolButton :
|
||||||
|
mainWindow_->ui->level2ProductFrame->findChildren<QToolButton*>())
|
||||||
{
|
{
|
||||||
toolButton->setCheckable(true);
|
if (toolButton->text().toStdString() == productName)
|
||||||
toolButton->setChecked(true);
|
{
|
||||||
}
|
toolButton->setCheckable(true);
|
||||||
else
|
toolButton->setChecked(true);
|
||||||
{
|
}
|
||||||
toolButton->setChecked(false);
|
else
|
||||||
toolButton->setCheckable(false);
|
{
|
||||||
|
toolButton->setChecked(false);
|
||||||
|
toolButton->setCheckable(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activeMap_->SelectRadarProduct(product);
|
mapWidget->SelectRadarProduct(product);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowImpl::UpdateElevationSelection(float elevation)
|
void MainWindowImpl::UpdateElevationSelection(float elevation)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue