mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:10:06 +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,6 +8,7 @@ | |||
| #include <scwx/qt/map/radar_product_layer.hpp> | ||||
| #include <scwx/qt/map/radar_range_layer.hpp> | ||||
| #include <scwx/qt/view/radar_product_view_factory.hpp> | ||||
| #include <scwx/util/time.hpp> | ||||
| 
 | ||||
| #include <QApplication> | ||||
| #include <QColor> | ||||
|  | @ -246,6 +247,17 @@ void MapWidget::SelectRadarProduct(common::Level2Product product) | |||
|    } | ||||
| } | ||||
| 
 | ||||
| void MapWidget::SelectRadarProduct(const std::string&        radarId, | ||||
|                                    common::RadarProductGroup group, | ||||
|                                    const std::string&        product, | ||||
|                                    std::chrono::system_clock::time_point time) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(debug) | ||||
|       << logPrefix_ << "SelectRadarProduct(" << radarId << ", " | ||||
|       << common::GetRadarProductGroupName(group) << ", " << product << ", " | ||||
|       << util::TimeString(time) << ")"; | ||||
| } | ||||
| 
 | ||||
| void MapWidget::SetActive(bool isActive) | ||||
| { | ||||
|    p->context_->settings_.isActive_ = isActive; | ||||
|  |  | |||
|  | @ -2,6 +2,7 @@ | |||
| 
 | ||||
| #include <scwx/common/products.hpp> | ||||
| 
 | ||||
| #include <chrono> | ||||
| #include <memory> | ||||
| 
 | ||||
| #include <QMapboxGL> | ||||
|  | @ -39,6 +40,10 @@ public: | |||
| 
 | ||||
|    void SelectElevation(float elevation); | ||||
|    void SelectRadarProduct(common::Level2Product product); | ||||
|    void SelectRadarProduct(const std::string&                    radarId, | ||||
|                            common::RadarProductGroup             group, | ||||
|                            const std::string&                    product, | ||||
|                            std::chrono::system_clock::time_point time); | ||||
|    void SetActive(bool isActive); | ||||
|    void SetMapParameters(double latitude, | ||||
|                          double longitude, | ||||
|  |  | |||
|  | @ -1,13 +1,9 @@ | |||
| // Enable chrono formatters
 | ||||
| #ifndef __cpp_lib_format | ||||
| #   define __cpp_lib_format 202110L | ||||
| #endif | ||||
| 
 | ||||
| #include <scwx/qt/map/overlay_layer.hpp> | ||||
| #include <scwx/qt/gl/draw/rectangle.hpp> | ||||
| #include <scwx/qt/gl/shader_program.hpp> | ||||
| #include <scwx/qt/gl/text_shader.hpp> | ||||
| #include <scwx/qt/util/font.hpp> | ||||
| #include <scwx/util/time.hpp> | ||||
| 
 | ||||
| #include <chrono> | ||||
| #include <execution> | ||||
|  | @ -105,18 +101,9 @@ void OverlayLayer::Render(const QMapbox::CustomLayerRenderParameters& params) | |||
| 
 | ||||
|    if (p->sweepTimeNeedsUpdate_ && context()->radarProductView_ != nullptr) | ||||
|    { | ||||
|       using namespace std::chrono; | ||||
|       auto sweepTime = | ||||
|          time_point_cast<seconds>(context()->radarProductView_->sweep_time()); | ||||
| 
 | ||||
|       if (sweepTime.time_since_epoch().count() != 0) | ||||
|       { | ||||
|          zoned_time         zt = {current_zone(), sweepTime}; | ||||
|          std::ostringstream os; | ||||
|          os << zt; | ||||
|          p->sweepTimeString_ = os.str(); | ||||
|       } | ||||
| 
 | ||||
|       p->sweepTimeString_ = | ||||
|          scwx::util::TimeString(context()->radarProductView_->sweep_time(), | ||||
|                                 std::chrono::current_zone()); | ||||
|       p->sweepTimeNeedsUpdate_ = false; | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat