mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 18:10:05 +00:00 
			
		
		
		
	Update VCP display
This commit is contained in:
		
							parent
							
								
									8d55413d03
								
							
						
					
					
						commit
						cae04fad37
					
				
					 11 changed files with 113 additions and 5 deletions
				
			
		|  | @ -6,6 +6,7 @@ | |||
| #include <scwx/qt/ui/flow_layout.hpp> | ||||
| #include <scwx/common/characters.hpp> | ||||
| #include <scwx/common/products.hpp> | ||||
| #include <scwx/common/vcp.hpp> | ||||
| 
 | ||||
| #include <QSplitter> | ||||
| #include <QToolButton> | ||||
|  | @ -50,6 +51,7 @@ public: | |||
|    void UpdateRadarProductSelection(common::RadarProductGroup group, | ||||
|                                     const std::string&        product); | ||||
|    void UpdateRadarProductSettings(); | ||||
|    void UpdateVcp(); | ||||
| 
 | ||||
|    MainWindow*       mainWindow_; | ||||
|    QMapboxGLSettings settings_; | ||||
|  | @ -76,6 +78,10 @@ MainWindow::MainWindow(QWidget* parent) : | |||
| { | ||||
|    ui->setupUi(this); | ||||
| 
 | ||||
|    ui->vcpLabel->setVisible(false); | ||||
|    ui->vcpValueLabel->setVisible(false); | ||||
|    ui->vcpDescriptionLabel->setVisible(false); | ||||
| 
 | ||||
|    p->ConfigureMapLayout(); | ||||
| 
 | ||||
|    // Add Level 2 Products
 | ||||
|  | @ -243,6 +249,7 @@ void MainWindowImpl::ConfigureMapLayout() | |||
|                { | ||||
|                   if (maps_[mapIndex] == activeMap_) | ||||
|                   { | ||||
|                      UpdateVcp(); | ||||
|                      UpdateRadarProductSettings(); | ||||
|                   } | ||||
|                }, | ||||
|  | @ -270,6 +277,7 @@ void MainWindowImpl::HandleFocusChange(QWidget* focused) | |||
|       UpdateRadarProductSelection(mapWidget->GetRadarProductGroup(), | ||||
|                                   mapWidget->GetRadarProductName()); | ||||
|       UpdateRadarProductSettings(); | ||||
|       UpdateVcp(); | ||||
|    } | ||||
| } | ||||
| 
 | ||||
|  | @ -415,6 +423,28 @@ void MainWindowImpl::UpdateRadarProductSettings() | |||
|    UpdateElevationSelection(currentElevation); | ||||
| } | ||||
| 
 | ||||
| void MainWindowImpl::UpdateVcp() | ||||
| { | ||||
|    uint16_t vcp = activeMap_->GetVcp(); | ||||
| 
 | ||||
|    if (vcp != 0) | ||||
|    { | ||||
|       mainWindow_->ui->vcpLabel->setVisible(true); | ||||
|       mainWindow_->ui->vcpValueLabel->setVisible(true); | ||||
|       mainWindow_->ui->vcpDescriptionLabel->setVisible(true); | ||||
| 
 | ||||
|       mainWindow_->ui->vcpValueLabel->setText(QString::number(vcp)); | ||||
|       mainWindow_->ui->vcpDescriptionLabel->setText( | ||||
|          tr(common::GetVcpDescription(vcp).c_str())); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       mainWindow_->ui->vcpLabel->setVisible(false); | ||||
|       mainWindow_->ui->vcpValueLabel->setVisible(false); | ||||
|       mainWindow_->ui->vcpDescriptionLabel->setVisible(false); | ||||
|    } | ||||
| } | ||||
| 
 | ||||
| } // namespace main
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  |  | |||
|  | @ -163,6 +163,19 @@ std::string MapWidget::GetRadarProductName() const | |||
|    } | ||||
| } | ||||
| 
 | ||||
| uint16_t MapWidget::GetVcp() const | ||||
| { | ||||
| 
 | ||||
|    if (p->context_->radarProductView_ != nullptr) | ||||
|    { | ||||
|       return p->context_->radarProductView_->vcp(); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       return 0; | ||||
|    } | ||||
| } | ||||
| 
 | ||||
| void MapWidget::SelectElevation(float elevation) | ||||
| { | ||||
|    if (p->context_->radarProductView_ != nullptr) | ||||
|  |  | |||
|  | @ -35,6 +35,7 @@ public: | |||
|    std::vector<float>        GetElevationCuts() const; | ||||
|    common::RadarProductGroup GetRadarProductGroup() const; | ||||
|    std::string               GetRadarProductName() const; | ||||
|    uint16_t                  GetVcp() const; | ||||
| 
 | ||||
|    void SelectElevation(float elevation); | ||||
|    void SelectRadarProduct(common::Level2Product product); | ||||
|  |  | |||
|  | @ -54,6 +54,7 @@ public: | |||
|        elevationCut_ {}, | ||||
|        elevationCuts_ {}, | ||||
|        range_ {}, | ||||
|        vcp_ {}, | ||||
|        sweepTime_ {}, | ||||
|        colorTable_ {}, | ||||
|        colorTableLut_ {}, | ||||
|  | @ -94,6 +95,7 @@ public: | |||
|    float              elevationCut_; | ||||
|    std::vector<float> elevationCuts_; | ||||
|    float              range_; | ||||
|    uint16_t           vcp_; | ||||
| 
 | ||||
|    std::chrono::system_clock::time_point sweepTime_; | ||||
| 
 | ||||
|  | @ -173,6 +175,11 @@ std::chrono::system_clock::time_point Level2ProductView::sweep_time() const | |||
|    return p->sweepTime_; | ||||
| } | ||||
| 
 | ||||
| uint16_t Level2ProductView::vcp() const | ||||
| { | ||||
|    return p->vcp_; | ||||
| } | ||||
| 
 | ||||
| const std::vector<float>& Level2ProductView::vertices() const | ||||
| { | ||||
|    return p->vertices_; | ||||
|  | @ -305,7 +312,8 @@ void Level2ProductView::UpdateColorTable() | |||
|    std::for_each(std::execution::par_unseq, | ||||
|                  dataRange.begin(), | ||||
|                  dataRange.end(), | ||||
|                  [&](uint16_t i) { | ||||
|                  [&](uint16_t i) | ||||
|                  { | ||||
|                     if (i == RANGE_FOLDED) | ||||
|                     { | ||||
|                        lut[i - *dataRange.begin()] = p->colorTable_->rf_color(); | ||||
|  | @ -378,6 +386,7 @@ void Level2ProductView::ComputeSweep() | |||
|       momentData0->data_moment_range_sample_interval() * (gates - 0.5f); | ||||
|    p->sweepTime_ = util::TimePoint(radarData0->modified_julian_date(), | ||||
|                                    radarData0->collection_time()); | ||||
|    p->vcp_       = volumeData0->volume_coverage_pattern_number(); | ||||
| 
 | ||||
|    // Calculate vertices
 | ||||
|    timer.start(); | ||||
|  |  | |||
|  | @ -35,6 +35,7 @@ public: | |||
|    float                                 elevation() const override; | ||||
|    float                                 range() const override; | ||||
|    std::chrono::system_clock::time_point sweep_time() const override; | ||||
|    uint16_t                              vcp() const override; | ||||
|    const std::vector<float>&             vertices() const override; | ||||
| 
 | ||||
|    void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override; | ||||
|  |  | |||
|  | @ -32,6 +32,7 @@ public: | |||
|    virtual float                                 elevation() const; | ||||
|    virtual float                                 range() const; | ||||
|    virtual std::chrono::system_clock::time_point sweep_time() const; | ||||
|    virtual uint16_t                              vcp() const      = 0; | ||||
|    virtual const std::vector<float>&             vertices() const = 0; | ||||
| 
 | ||||
|    void Initialize(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat