mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 01:50:06 +00:00 
			
		
		
		
	Connect auto-refreshed data to map widget
This commit is contained in:
		
							parent
							
								
									000b6cbd86
								
							
						
					
					
						commit
						5039fea3b9
					
				
					 1 changed files with 31 additions and 0 deletions
				
			
		|  | @ -273,6 +273,35 @@ void MapWidget::SelectRadarProduct(common::Level2Product product) | |||
|       }, | ||||
|       Qt::QueuedConnection); | ||||
| 
 | ||||
|    connect( | ||||
|       p->radarProductManager_.get(), | ||||
|       &manager::RadarProductManager::NewLevel2DataAvailable, | ||||
|       this, | ||||
|       [&](std::chrono::system_clock::time_point latestTime) | ||||
|       { | ||||
|          std::shared_ptr<request::NexradFileRequest> request = | ||||
|             std::make_shared<request::NexradFileRequest>(); | ||||
| 
 | ||||
|          connect(request.get(), | ||||
|                  &request::NexradFileRequest::RequestComplete, | ||||
|                  this, | ||||
|                  [&](std::shared_ptr<request::NexradFileRequest> request) | ||||
|                  { | ||||
|                     auto record = request->radar_product_record(); | ||||
| 
 | ||||
|                     if (record != nullptr) | ||||
|                     { | ||||
|                        SelectRadarProduct(record); | ||||
|                     } | ||||
|                  }); | ||||
| 
 | ||||
|          // TODO: If live data is enabled
 | ||||
|          util::async( | ||||
|             [=]() | ||||
|             { p->radarProductManager_->LoadLevel2Data(latestTime, request); }); | ||||
|       }, | ||||
|       Qt::QueuedConnection); | ||||
| 
 | ||||
|    util::async( | ||||
|       [=]() | ||||
|       { | ||||
|  | @ -293,6 +322,8 @@ void MapWidget::SelectRadarProduct(common::Level2Product product) | |||
|    { | ||||
|       AddLayers(); | ||||
|    } | ||||
| 
 | ||||
|    p->radarProductManager_->EnableLevel2Refresh(true); | ||||
| } | ||||
| 
 | ||||
| void MapWidget::SelectRadarProduct( | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat