mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:10:04 +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,16 +246,23 @@ 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); | ||||||
|  | 
 | ||||||
|  |    if (mapWidget == activeMap_) | ||||||
|  |    { | ||||||
|       UpdateElevationSelection(elevation); |       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; | ||||||
| 
 | 
 | ||||||
|  |    if (mapWidget == activeMap_) | ||||||
|  |    { | ||||||
|       for (QToolButton* toolButton : |       for (QToolButton* toolButton : | ||||||
|            mainWindow_->ui->level2ProductFrame->findChildren<QToolButton*>()) |            mainWindow_->ui->level2ProductFrame->findChildren<QToolButton*>()) | ||||||
|       { |       { | ||||||
|  | @ -265,8 +277,9 @@ void MainWindowImpl::SelectRadarProduct(common::Level2Product product) | ||||||
|             toolButton->setCheckable(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
	
	 Dan Paulat
						Dan Paulat