mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:40:06 +00:00 
			
		
		
		
	Updating radar site display fields to be more human-friendly
- Latitude/longitude in degrees N/S/E/W - Radar types with hyphens - Sort by raw decimal values
This commit is contained in:
		
							parent
							
								
									1bc6e714f5
								
							
						
					
					
						commit
						6e7a13494a
					
				
					 11 changed files with 186 additions and 5 deletions
				
			
		|  | @ -20,6 +20,9 @@ static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | |||
| static const std::string defaultRadarSiteFile_ = | ||||
|    ":/res/config/radar_sites.json"; | ||||
| 
 | ||||
| static const std::unordered_map<std::string, std::string> typeNameMap_ { | ||||
|    {"wsr88d", "WSR-88D"}, {"tdwr", "TDWR"}, {"?", "?"}}; | ||||
| 
 | ||||
| static std::unordered_map<std::string, std::shared_ptr<RadarSite>> | ||||
|                                                     radarSiteMap_; | ||||
| static std::unordered_map<std::string, std::string> siteIdMap_; | ||||
|  | @ -63,6 +66,19 @@ std::string RadarSite::type() const | |||
|    return p->type_; | ||||
| } | ||||
| 
 | ||||
| std::string RadarSite::type_name() const | ||||
| { | ||||
|    auto it = typeNameMap_.find(p->type_); | ||||
|    if (it != typeNameMap_.cend()) | ||||
|    { | ||||
|       return it->second; | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       return typeNameMap_.at("?"); | ||||
|    } | ||||
| } | ||||
| 
 | ||||
| std::string RadarSite::id() const | ||||
| { | ||||
|    return p->id_; | ||||
|  |  | |||
|  | @ -26,6 +26,7 @@ public: | |||
|    RadarSite& operator=(RadarSite&&) noexcept; | ||||
| 
 | ||||
|    std::string type() const; | ||||
|    std::string type_name() const; | ||||
|    std::string id() const; | ||||
|    double      latitude() const; | ||||
|    double      longitude() const; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat