mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:10:04 +00:00 
			
		
		
		
	Stub for selecting radar product on successful file load
This commit is contained in:
		
							parent
							
								
									2000f3acb1
								
							
						
					
					
						commit
						7c44bafeb5
					
				
					 8 changed files with 68 additions and 43 deletions
				
			
		|  | @ -8,9 +8,9 @@ namespace common | |||
| { | ||||
| 
 | ||||
| static const std::unordered_map<RadarProductGroup, std::string> | ||||
|    productGroupName_ {{RadarProductGroup::Level2, "L2"}, | ||||
|                       {RadarProductGroup::Level3, "L3"}, | ||||
|                       {RadarProductGroup::Unknown, "?"}}; | ||||
|    radarProductGroupName_ {{RadarProductGroup::Level2, "L2"}, | ||||
|                            {RadarProductGroup::Level3, "L3"}, | ||||
|                            {RadarProductGroup::Unknown, "?"}}; | ||||
| 
 | ||||
| static const std::unordered_map<Level2Product, std::string> level2Name_ { | ||||
|    {Level2Product::Reflectivity, "REF"}, | ||||
|  | @ -42,20 +42,20 @@ static const std::unordered_map<Level2Product, std::string> level2Palette_ { | |||
|    {Level2Product::ClutterFilterPowerRemoved, "???"}, | ||||
|    {Level2Product::Unknown, "???"}}; | ||||
| 
 | ||||
| const std::string& GetProductGroupName(RadarProductGroup group) | ||||
| const std::string& GetRadarProductGroupName(RadarProductGroup group) | ||||
| { | ||||
|    return productGroupName_.at(group); | ||||
|    return radarProductGroupName_.at(group); | ||||
| } | ||||
| 
 | ||||
| RadarProductGroup GetProductGroup(const std::string& name) | ||||
| RadarProductGroup GetRadarProductGroup(const std::string& name) | ||||
| { | ||||
|    auto result = std::find_if( | ||||
|       productGroupName_.cbegin(), | ||||
|       productGroupName_.cend(), | ||||
|       radarProductGroupName_.cbegin(), | ||||
|       radarProductGroupName_.cend(), | ||||
|       [&](const std::pair<RadarProductGroup, std::string>& pair) -> bool | ||||
|       { return pair.second == name; }); | ||||
| 
 | ||||
|    if (result != productGroupName_.cend()) | ||||
|    if (result != radarProductGroupName_.cend()) | ||||
|    { | ||||
|       return result->first; | ||||
|    } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat