mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:30:05 +00:00 
			
		
		
		
	Merge pull request #344 from dpaulat/hotfix/live-level2-data-not-latest
Ensure live level 2 data displays correct scans
This commit is contained in:
		
						commit
						42314a64b2
					
				
					 3 changed files with 23 additions and 8 deletions
				
			
		|  | @ -1507,10 +1507,10 @@ RadarProductManager::GetLevel2Data(wsr88d::rda::DataBlockType dataBlockType, | |||
| 
 | ||||
|          if (recordRadarData != nullptr) | ||||
|          { | ||||
|             auto& radarData0 = (*recordRadarData)[0]; | ||||
|             auto  collectionTime = | ||||
|             auto& radarData0     = (*recordRadarData)[0]; | ||||
|             auto  collectionTime = std::chrono::floor<std::chrono::seconds>( | ||||
|                scwx::util::TimePoint(radarData0->modified_julian_date(), | ||||
|                                      radarData0->collection_time()); | ||||
|                                      radarData0->collection_time())); | ||||
| 
 | ||||
|             // Find the newest radar data, not newer than the selected time
 | ||||
|             if (radarData == nullptr || | ||||
|  |  | |||
|  | @ -1801,7 +1801,16 @@ void MapWidgetImpl::RadarProductManagerConnect() | |||
|                             (group == common::RadarProductGroup::Level2 || | ||||
|                              context_->radar_product() == product)) | ||||
|                         { | ||||
|                            widget_->SelectRadarProduct(record); | ||||
|                            if (group == common::RadarProductGroup::Level2) | ||||
|                            { | ||||
|                               // Level 2 products may have multiple time points,
 | ||||
|                               // ensure the latest is selected
 | ||||
|                               widget_->SelectRadarProduct(group, product); | ||||
|                            } | ||||
|                            else | ||||
|                            { | ||||
|                               widget_->SelectRadarProduct(record); | ||||
|                            } | ||||
|                         } | ||||
|                      }); | ||||
|                } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat