mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 09:30:05 +00:00 
			
		
		
		
	Fixing map connections for updating elevation selection
This commit is contained in:
		
							parent
							
								
									689f3dc464
								
							
						
					
					
						commit
						8d55413d03
					
				
					 1 changed files with 23 additions and 20 deletions
				
			
		|  | @ -41,7 +41,6 @@ public: | ||||||
| 
 | 
 | ||||||
|    void ConfigureMapLayout(); |    void ConfigureMapLayout(); | ||||||
|    void HandleFocusChange(QWidget* focused); |    void HandleFocusChange(QWidget* focused); | ||||||
|    void InitializeConnections(); |  | ||||||
|    void SelectElevation(map::MapWidget* mapWidget, float elevation); |    void SelectElevation(map::MapWidget* mapWidget, float elevation); | ||||||
|    void SelectRadarProduct(map::MapWidget*       mapWidget, |    void SelectRadarProduct(map::MapWidget*       mapWidget, | ||||||
|                            common::Level2Product product); |                            common::Level2Product product); | ||||||
|  | @ -93,9 +92,10 @@ MainWindow::MainWindow(QWidget* parent) : | ||||||
|          tr(common::GetLevel2Description(product).c_str())); |          tr(common::GetLevel2Description(product).c_str())); | ||||||
|       level2Layout->addWidget(toolButton); |       level2Layout->addWidget(toolButton); | ||||||
| 
 | 
 | ||||||
|       connect(toolButton, &QToolButton::clicked, this, [=]() { |       connect(toolButton, | ||||||
|          p->SelectRadarProduct(p->activeMap_, product); |               &QToolButton::clicked, | ||||||
|       }); |               this, | ||||||
|  |               [=]() { p->SelectRadarProduct(p->activeMap_, product); }); | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|    QLayout* elevationLayout = new ui::FlowLayout(); |    QLayout* elevationLayout = new ui::FlowLayout(); | ||||||
|  | @ -104,8 +104,6 @@ MainWindow::MainWindow(QWidget* parent) : | ||||||
|    ui->settingsGroupBox->setVisible(false); |    ui->settingsGroupBox->setVisible(false); | ||||||
|    ui->declutterCheckbox->setVisible(false); |    ui->declutterCheckbox->setVisible(false); | ||||||
| 
 | 
 | ||||||
|    p->InitializeConnections(); |  | ||||||
| 
 |  | ||||||
|    p->SelectRadarProduct(p->activeMap_, common::Level2Product::Reflectivity); |    p->SelectRadarProduct(p->activeMap_, common::Level2Product::Reflectivity); | ||||||
|    if (p->maps_.at(1) != nullptr) |    if (p->maps_.at(1) != nullptr) | ||||||
|    { |    { | ||||||
|  | @ -207,7 +205,8 @@ void MainWindowImpl::ConfigureMapLayout() | ||||||
| 
 | 
 | ||||||
|    maps_.resize(mapCount); |    maps_.resize(mapCount); | ||||||
| 
 | 
 | ||||||
|    auto MoveSplitter = [=](int pos, int index) { |    auto MoveSplitter = [=](int pos, int index) | ||||||
|  |    { | ||||||
|       QSplitter* s = dynamic_cast<QSplitter*>(sender()); |       QSplitter* s = dynamic_cast<QSplitter*>(sender()); | ||||||
| 
 | 
 | ||||||
|       if (s != nullptr) |       if (s != nullptr) | ||||||
|  | @ -235,6 +234,19 @@ void MainWindowImpl::ConfigureMapLayout() | ||||||
|                     &map::MapWidget::MapParametersChanged, |                     &map::MapWidget::MapParametersChanged, | ||||||
|                     this, |                     this, | ||||||
|                     &MainWindowImpl::UpdateMapParameters); |                     &MainWindowImpl::UpdateMapParameters); | ||||||
|  | 
 | ||||||
|  |             connect( | ||||||
|  |                maps_[mapIndex], | ||||||
|  |                &map::MapWidget::RadarSweepUpdated, | ||||||
|  |                this, | ||||||
|  |                [=]() | ||||||
|  |                { | ||||||
|  |                   if (maps_[mapIndex] == activeMap_) | ||||||
|  |                   { | ||||||
|  |                      UpdateRadarProductSettings(); | ||||||
|  |                   } | ||||||
|  |                }, | ||||||
|  |                Qt::QueuedConnection); | ||||||
|          } |          } | ||||||
| 
 | 
 | ||||||
|          hs->addWidget(maps_[mapIndex]); |          hs->addWidget(maps_[mapIndex]); | ||||||
|  | @ -261,16 +273,6 @@ void MainWindowImpl::HandleFocusChange(QWidget* focused) | ||||||
|    } |    } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MainWindowImpl::InitializeConnections() |  | ||||||
| { |  | ||||||
|    connect( |  | ||||||
|       activeMap_, |  | ||||||
|       &map::MapWidget::RadarSweepUpdated, |  | ||||||
|       this, |  | ||||||
|       [this]() { UpdateRadarProductSettings(); }, |  | ||||||
|       Qt::QueuedConnection); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void MainWindowImpl::SelectElevation(map::MapWidget* mapWidget, float elevation) | void MainWindowImpl::SelectElevation(map::MapWidget* mapWidget, float elevation) | ||||||
| { | { | ||||||
|    mapWidget->SelectElevation(elevation); |    mapWidget->SelectElevation(elevation); | ||||||
|  | @ -399,9 +401,10 @@ void MainWindowImpl::UpdateRadarProductSettings() | ||||||
|                              common::Characters::DEGREE); |                              common::Characters::DEGREE); | ||||||
|          layout->addWidget(toolButton); |          layout->addWidget(toolButton); | ||||||
| 
 | 
 | ||||||
|          connect(toolButton, &QToolButton::clicked, this, [=]() { |          connect(toolButton, | ||||||
|             SelectElevation(activeMap_, elevationCut); |                  &QToolButton::clicked, | ||||||
|          }); |                  this, | ||||||
|  |                  [=]() { SelectElevation(activeMap_, elevationCut); }); | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       elevationCuts_           = elevationCuts; |       elevationCuts_           = elevationCuts; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat