mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 12:30:05 +00:00 
			
		
		
		
	Add NoUpdateReason of NotAvailable, driven by ProductNotAvailable
This commit is contained in:
		
							parent
							
								
									449d8cb796
								
							
						
					
					
						commit
						a306fb4363
					
				
					 8 changed files with 49 additions and 16 deletions
				
			
		|  | @ -317,7 +317,8 @@ void TimelineManager::ReceiveRadarSweepNotUpdated(std::size_t mapIndex, | |||
|                                                   types::NoUpdateReason reason) | ||||
| { | ||||
|    if (!p->radarSweepMonitorActive_ || | ||||
|        reason == types::NoUpdateReason::NotLoaded) | ||||
|        (reason == types::NoUpdateReason::NotLoaded || | ||||
|         reason == types::NoUpdateReason::NotAvailable)) | ||||
|    { | ||||
|       return; | ||||
|    } | ||||
|  |  | |||
|  | @ -25,6 +25,7 @@ enum class NoUpdateReason | |||
| { | ||||
|    NoChange, | ||||
|    NotLoaded, | ||||
|    NotAvailable, | ||||
|    InvalidProduct, | ||||
|    InvalidData | ||||
| }; | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ namespace scwx::qt::types | |||
| 
 | ||||
| enum class RadarProductLoadStatus : std::uint8_t | ||||
| { | ||||
|    ProductNotLoaded, | ||||
|    ProductLoaded, | ||||
|    ListingProducts, | ||||
|    LoadingProduct, | ||||
|  |  | |||
|  | @ -548,17 +548,20 @@ void Level2ProductView::ComputeSweep() | |||
| 
 | ||||
|    std::shared_ptr<wsr88d::rda::ElevationScan> radarData; | ||||
|    std::chrono::system_clock::time_point       requestedTime {selected_time()}; | ||||
|    std::tie(radarData, | ||||
|             p->elevationCut_, | ||||
|             p->elevationCuts_, | ||||
|             std::ignore, | ||||
|             std::ignore) = | ||||
|    types::RadarProductLoadStatus               loadStatus {}; | ||||
|    std::tie( | ||||
|       radarData, p->elevationCut_, p->elevationCuts_, std::ignore, loadStatus) = | ||||
|       radarProductManager->GetLevel2Data( | ||||
|          p->dataBlockType_, p->selectedElevation_, requestedTime); | ||||
| 
 | ||||
|    set_load_status(loadStatus); | ||||
| 
 | ||||
|    if (radarData == nullptr) | ||||
|    { | ||||
|       Q_EMIT SweepNotComputed(types::NoUpdateReason::NotLoaded); | ||||
|       Q_EMIT SweepNotComputed( | ||||
|          loadStatus == types::RadarProductLoadStatus::ProductNotAvailable ? | ||||
|             types::NoUpdateReason::NotAvailable : | ||||
|             types::NoUpdateReason::NotLoaded); | ||||
|       return; | ||||
|    } | ||||
|    if ((radarData == p->elevationScan_) && | ||||
|  |  | |||
|  | @ -136,9 +136,12 @@ void Level3RadialView::ComputeSweep() | |||
|    std::shared_ptr<wsr88d::rpg::Level3Message> message; | ||||
|    std::chrono::system_clock::time_point       requestedTime {selected_time()}; | ||||
|    std::chrono::system_clock::time_point       foundTime; | ||||
|    std::tie(message, foundTime, std::ignore) = | ||||
|    types::RadarProductLoadStatus               loadStatus {}; | ||||
|    std::tie(message, foundTime, loadStatus) = | ||||
|       radarProductManager->GetLevel3Data(GetRadarProductName(), requestedTime); | ||||
| 
 | ||||
|    set_load_status(loadStatus); | ||||
| 
 | ||||
|    // If a different time was found than what was requested, update it
 | ||||
|    if (requestedTime != foundTime) | ||||
|    { | ||||
|  | @ -148,7 +151,10 @@ void Level3RadialView::ComputeSweep() | |||
|    if (message == nullptr) | ||||
|    { | ||||
|       logger_->debug("Level 3 data not found"); | ||||
|       Q_EMIT SweepNotComputed(types::NoUpdateReason::NotLoaded); | ||||
|       Q_EMIT SweepNotComputed( | ||||
|          loadStatus == types::RadarProductLoadStatus::ProductNotAvailable ? | ||||
|             types::NoUpdateReason::NotAvailable : | ||||
|             types::NoUpdateReason::NotLoaded); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
|  | @ -121,9 +121,12 @@ void Level3RasterView::ComputeSweep() | |||
|    std::shared_ptr<wsr88d::rpg::Level3Message> message; | ||||
|    std::chrono::system_clock::time_point       requestedTime {selected_time()}; | ||||
|    std::chrono::system_clock::time_point       foundTime; | ||||
|    std::tie(message, foundTime, std::ignore) = | ||||
|    types::RadarProductLoadStatus               loadStatus {}; | ||||
|    std::tie(message, foundTime, loadStatus) = | ||||
|       radarProductManager->GetLevel3Data(GetRadarProductName(), requestedTime); | ||||
| 
 | ||||
|    set_load_status(loadStatus); | ||||
| 
 | ||||
|    // If a different time was found than what was requested, update it
 | ||||
|    if (requestedTime != foundTime) | ||||
|    { | ||||
|  | @ -133,7 +136,10 @@ void Level3RasterView::ComputeSweep() | |||
|    if (message == nullptr) | ||||
|    { | ||||
|       logger_->debug("Level 3 data not found"); | ||||
|       Q_EMIT SweepNotComputed(types::NoUpdateReason::NotLoaded); | ||||
|       Q_EMIT SweepNotComputed( | ||||
|          loadStatus == types::RadarProductLoadStatus::ProductNotAvailable ? | ||||
|             types::NoUpdateReason::NotAvailable : | ||||
|             types::NoUpdateReason::NotLoaded); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
|  | @ -58,6 +58,8 @@ public: | |||
|    std::chrono::system_clock::time_point selectedTime_; | ||||
|    bool                                  showSmoothedRangeFolding_ {false}; | ||||
|    bool                                  smoothingEnabled_ {false}; | ||||
|    types::RadarProductLoadStatus         loadStatus_ { | ||||
|       types::RadarProductLoadStatus::ProductNotLoaded}; | ||||
| 
 | ||||
|    std::shared_ptr<manager::RadarProductManager> radarProductManager_; | ||||
| 
 | ||||
|  | @ -90,6 +92,11 @@ std::optional<float> RadarProductView::elevation() const | |||
|    return {}; | ||||
| } | ||||
| 
 | ||||
| types::RadarProductLoadStatus RadarProductView::load_status() const | ||||
| { | ||||
|    return p->loadStatus_; | ||||
| } | ||||
| 
 | ||||
| std::shared_ptr<manager::RadarProductManager> | ||||
| RadarProductView::radar_product_manager() const | ||||
| { | ||||
|  | @ -126,6 +133,11 @@ std::mutex& RadarProductView::sweep_mutex() | |||
|    return p->sweepMutex_; | ||||
| } | ||||
| 
 | ||||
| void RadarProductView::set_load_status(types::RadarProductLoadStatus loadStatus) | ||||
| { | ||||
|    p->loadStatus_ = loadStatus; | ||||
| } | ||||
| 
 | ||||
| void RadarProductView::set_radar_product_manager( | ||||
|    std::shared_ptr<manager::RadarProductManager> radarProductManager) | ||||
| { | ||||
|  |  | |||
|  | @ -38,11 +38,12 @@ public: | |||
|    [[nodiscard]] virtual std::shared_ptr<common::ColorTable> | ||||
|    color_table() const = 0; | ||||
|    [[nodiscard]] virtual const std::vector<boost::gil::rgba8_pixel_t>& | ||||
|                                               color_table_lut() const; | ||||
|    [[nodiscard]] virtual std::uint16_t        color_table_min() const; | ||||
|    [[nodiscard]] virtual std::uint16_t        color_table_max() const; | ||||
|    [[nodiscard]] virtual std::optional<float> elevation() const; | ||||
|    [[nodiscard]] virtual float                range() const; | ||||
|                                                color_table_lut() const; | ||||
|    [[nodiscard]] virtual std::uint16_t         color_table_min() const; | ||||
|    [[nodiscard]] virtual std::uint16_t         color_table_max() const; | ||||
|    [[nodiscard]] virtual std::optional<float>  elevation() const; | ||||
|    [[nodiscard]] types::RadarProductLoadStatus load_status() const; | ||||
|    [[nodiscard]] virtual float                 range() const; | ||||
|    [[nodiscard]] virtual std::chrono::system_clock::time_point | ||||
|                                                    sweep_time() const; | ||||
|    [[nodiscard]] virtual float                     unit_scale() const = 0; | ||||
|  | @ -98,6 +99,8 @@ protected: | |||
|    virtual void DisconnectRadarProductManager() = 0; | ||||
|    virtual void UpdateColorTableLut()           = 0; | ||||
| 
 | ||||
|    void set_load_status(types::RadarProductLoadStatus loadStatus); | ||||
| 
 | ||||
| protected slots: | ||||
|    virtual void ComputeSweep(); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat