Store last load status

This commit is contained in:
Dan Paulat 2025-08-30 20:30:32 -05:00
parent 341096af1d
commit 931dd2d0a7

View file

@ -63,6 +63,9 @@ public:
bool colorTableNeedsUpdate_ {false}; bool colorTableNeedsUpdate_ {false};
bool sweepNeedsUpdate_ {false}; bool sweepNeedsUpdate_ {false};
types::RadarProductLoadStatus lastLoadStatus_ {
types::RadarProductLoadStatus::ProductNotAvailable};
}; };
RadarProductLayer::RadarProductLayer(std::shared_ptr<gl::GlContext> glContext) : RadarProductLayer::RadarProductLayer(std::shared_ptr<gl::GlContext> glContext) :
@ -158,7 +161,12 @@ void RadarProductLayer::Initialize(
} }
if (reason == types::NoUpdateReason::NoChange) if (reason == types::NoUpdateReason::NoChange)
{ {
Q_EMIT NeedsRendering(); if (p->lastLoadStatus_ ==
types::RadarProductLoadStatus::ProductNotAvailable)
{
// Ensure the radar product is shown by re-rendering
Q_EMIT NeedsRendering();
}
} }
}); });
} }
@ -273,7 +281,6 @@ void RadarProductLayer::Render(
const std::shared_ptr<MapContext>& mapContext, const std::shared_ptr<MapContext>& mapContext,
const QMapLibre::CustomLayerRenderParameters& params) const QMapLibre::CustomLayerRenderParameters& params)
{ {
p->shaderProgram_->Use(); p->shaderProgram_->Use();
// Set OpenGL blend mode for transparency // Set OpenGL blend mode for transparency
@ -343,6 +350,12 @@ void RadarProductLayer::Render(
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
} }
if (radarProductView != nullptr)
{
// Save last load status
p->lastLoadStatus_ = radarProductView->load_status();
}
SCWX_GL_CHECK_ERROR(); SCWX_GL_CHECK_ERROR();
} }