mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 23:50:05 +00:00 
			
		
		
		
	Connect radar product view signals in layer constructor, rather than initialize
If the radar product view updates at precisely the right time, color tables might not be initialized properly. The Initialize function would not have been able to properly update color tables, and the view signal would be emitted prior to the signals and slots being connected.
This commit is contained in:
		
							parent
							
								
									809adfd422
								
							
						
					
					
						commit
						0902f183fc
					
				
					 1 changed files with 9 additions and 10 deletions
				
			
		|  | @ -77,6 +77,15 @@ public: | ||||||
| RadarProductLayer::RadarProductLayer(std::shared_ptr<MapContext> context) : | RadarProductLayer::RadarProductLayer(std::shared_ptr<MapContext> context) : | ||||||
|     GenericLayer(context), p(std::make_unique<RadarProductLayerImpl>()) |     GenericLayer(context), p(std::make_unique<RadarProductLayerImpl>()) | ||||||
| { | { | ||||||
|  |    auto radarProductView = context->radar_product_view(); | ||||||
|  |    connect(radarProductView.get(), | ||||||
|  |            &view::RadarProductView::ColorTableUpdated, | ||||||
|  |            this, | ||||||
|  |            [this]() { p->colorTableNeedsUpdate_ = true; }); | ||||||
|  |    connect(radarProductView.get(), | ||||||
|  |            &view::RadarProductView::SweepComputed, | ||||||
|  |            this, | ||||||
|  |            [this]() { p->sweepNeedsUpdate_ = true; }); | ||||||
| } | } | ||||||
| RadarProductLayer::~RadarProductLayer() = default; | RadarProductLayer::~RadarProductLayer() = default; | ||||||
| 
 | 
 | ||||||
|  | @ -144,16 +153,6 @@ void RadarProductLayer::Initialize() | ||||||
|    gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |    gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||||||
|    gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |    gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||||||
|    gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |    gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | ||||||
| 
 |  | ||||||
|    auto radarProductView = context()->radar_product_view(); |  | ||||||
|    connect(radarProductView.get(), |  | ||||||
|            &view::RadarProductView::ColorTableUpdated, |  | ||||||
|            this, |  | ||||||
|            [this]() { p->colorTableNeedsUpdate_ = true; }); |  | ||||||
|    connect(radarProductView.get(), |  | ||||||
|            &view::RadarProductView::SweepComputed, |  | ||||||
|            this, |  | ||||||
|            [this]() { p->sweepNeedsUpdate_ = true; }); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void RadarProductLayer::UpdateSweep() | void RadarProductLayer::UpdateSweep() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat