mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:20:06 +00:00 
			
		
		
		
	Add types for audio alerts
This commit is contained in:
		
							parent
							
								
									e1ccc1ebb8
								
							
						
					
					
						commit
						9486d2364a
					
				
					 7 changed files with 97 additions and 1 deletions
				
			
		|  | @ -37,6 +37,17 @@ std::string GetAlertActionName(AlertAction alertAction) | |||
|    return alertActionName_.at(alertAction); | ||||
| } | ||||
| 
 | ||||
| const std::vector<awips::Phenomenon>& GetAlertAudioPhenomena() | ||||
| { | ||||
|    static const std::vector<awips::Phenomenon> phenomena_ { | ||||
|       awips::Phenomenon::FlashFlood, | ||||
|       awips::Phenomenon::SevereThunderstorm, | ||||
|       awips::Phenomenon::SnowSquall, | ||||
|       awips::Phenomenon::Tornado}; | ||||
| 
 | ||||
|    return phenomena_; | ||||
| } | ||||
| 
 | ||||
| } // namespace types
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  |  | |||
|  | @ -1,8 +1,10 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/awips/phenomenon.hpp> | ||||
| #include <scwx/util/iterator.hpp> | ||||
| 
 | ||||
| #include <string> | ||||
| #include <vector> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -23,6 +25,8 @@ typedef scwx::util::Iterator<AlertAction, AlertAction::Go, AlertAction::View> | |||
| AlertAction GetAlertAction(const std::string& name); | ||||
| std::string GetAlertActionName(AlertAction alertAction); | ||||
| 
 | ||||
| const std::vector<awips::Phenomenon>& GetAlertAudioPhenomena(); | ||||
| 
 | ||||
| } // namespace types
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  |  | |||
							
								
								
									
										29
									
								
								scwx-qt/source/scwx/qt/types/location_types.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								scwx-qt/source/scwx/qt/types/location_types.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | |||
| #include <scwx/qt/types/location_types.hpp> | ||||
| #include <scwx/util/enum.hpp> | ||||
| 
 | ||||
| #include <unordered_map> | ||||
| 
 | ||||
| #include <boost/algorithm/string.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace types | ||||
| { | ||||
| 
 | ||||
| static const std::unordered_map<LocationMethod, std::string> | ||||
|    locationMethodName_ {{LocationMethod::Fixed, "Fixed"}, | ||||
|                         {LocationMethod::Track, "Track"}, | ||||
|                         {LocationMethod::Unknown, "?"}}; | ||||
| 
 | ||||
| SCWX_GET_ENUM(LocationMethod, GetLocationMethod, locationMethodName_) | ||||
| 
 | ||||
| const std::string& GetLocationMethodName(LocationMethod locationMethod) | ||||
| { | ||||
|    return locationMethodName_.at(locationMethod); | ||||
| } | ||||
| 
 | ||||
| } // namespace types
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
							
								
								
									
										29
									
								
								scwx-qt/source/scwx/qt/types/location_types.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								scwx-qt/source/scwx/qt/types/location_types.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/util/iterator.hpp> | ||||
| 
 | ||||
| #include <string> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace types | ||||
| { | ||||
| 
 | ||||
| enum class LocationMethod | ||||
| { | ||||
|    Fixed, | ||||
|    Track, | ||||
|    Unknown | ||||
| }; | ||||
| typedef scwx::util:: | ||||
|    Iterator<LocationMethod, LocationMethod::Fixed, LocationMethod::Track> | ||||
|       LocationMethodIterator; | ||||
| 
 | ||||
| LocationMethod     GetLocationMethod(const std::string& name); | ||||
| const std::string& GetLocationMethodName(LocationMethod locationMethod); | ||||
| 
 | ||||
| } // namespace types
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat