mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:00:04 +00:00
Add indicator of what level is currently being updated with level 2 chunks.
This commit is contained in:
parent
6ca76b9eca
commit
0bda6296c0
9 changed files with 114 additions and 4 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <scwx/qt/types/time_types.hpp>
|
||||
#include <scwx/qt/util/geographic_lib.hpp>
|
||||
#include <scwx/common/constants.hpp>
|
||||
#include <scwx/provider/aws_level2_chunks_data_provider.hpp>
|
||||
#include <scwx/provider/nexrad_data_provider_factory.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
#include <scwx/util/map.hpp>
|
||||
|
|
@ -271,6 +272,8 @@ public:
|
|||
common::Level3ProductCategoryMap availableCategoryMap_ {};
|
||||
std::shared_mutex availableCategoryMutex_ {};
|
||||
|
||||
float incomingLevel2Elevation_ {-90};
|
||||
|
||||
std::unordered_map<boost::uuids::uuid,
|
||||
std::shared_ptr<ProviderManager>,
|
||||
boost::hash<boost::uuids::uuid>>
|
||||
|
|
@ -450,6 +453,11 @@ float RadarProductManager::gate_size() const
|
|||
return (is_tdwr()) ? 150.0f : 250.0f;
|
||||
}
|
||||
|
||||
float RadarProductManager::incoming_level_2_elevation() const
|
||||
{
|
||||
return p->incomingLevel2Elevation_;
|
||||
}
|
||||
|
||||
std::string RadarProductManager::radar_id() const
|
||||
{
|
||||
return p->radarId_;
|
||||
|
|
@ -1542,6 +1550,16 @@ RadarProductManager::GetLevel2Data(wsr88d::rda::DataBlockType dataBlockType,
|
|||
foundTime = std::chrono::floor<std::chrono::seconds>(
|
||||
scwx::util::TimePoint(radarData0->modified_julian_date(),
|
||||
radarData0->collection_time()));
|
||||
|
||||
const float incomingElevation =
|
||||
std::dynamic_pointer_cast<provider::AwsLevel2ChunksDataProvider>(
|
||||
p->level2ChunksProviderManager_->provider_)
|
||||
->GetCurrentElevation();
|
||||
if (incomingElevation != p->incomingLevel2Elevation_)
|
||||
{
|
||||
p->incomingLevel2Elevation_ = incomingElevation;
|
||||
Q_EMIT IncomingLevel2ElevationChanged(incomingElevation);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // It is not in the chunk provider, so get it from the archive
|
||||
|
|
@ -1576,6 +1594,12 @@ RadarProductManager::GetLevel2Data(wsr88d::rda::DataBlockType dataBlockType,
|
|||
elevationCut = recordElevationCut;
|
||||
elevationCuts = std::move(recordElevationCuts);
|
||||
foundTime = collectionTime;
|
||||
|
||||
if (p->incomingLevel2Elevation_ != -90)
|
||||
{
|
||||
p->incomingLevel2Elevation_ = -90;
|
||||
Q_EMIT IncomingLevel2ElevationChanged(-90);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,10 +43,11 @@ public:
|
|||
|
||||
[[nodiscard]] const std::vector<float>&
|
||||
coordinates(common::RadialSize radialSize, bool smoothingEnabled) const;
|
||||
[[nodiscard]] const scwx::util::time_zone* default_time_zone() const;
|
||||
[[nodiscard]] bool is_tdwr() const;
|
||||
[[nodiscard]] float gate_size() const;
|
||||
[[nodiscard]] std::string radar_id() const;
|
||||
[[nodiscard]] const scwx::util::time_zone* default_time_zone() const;
|
||||
[[nodiscard]] float gate_size() const;
|
||||
[[nodiscard]] float incoming_level_2_elevation() const;
|
||||
[[nodiscard]] bool is_tdwr() const;
|
||||
[[nodiscard]] std::string radar_id() const;
|
||||
[[nodiscard]] std::shared_ptr<config::RadarSite> radar_site() const;
|
||||
|
||||
void Initialize();
|
||||
|
|
@ -148,6 +149,7 @@ signals:
|
|||
void NewDataAvailable(common::RadarProductGroup group,
|
||||
const std::string& product,
|
||||
std::chrono::system_clock::time_point latestTime);
|
||||
void IncomingLevel2ElevationChanged(float incomingElevation);
|
||||
|
||||
private:
|
||||
std::unique_ptr<RadarProductManagerImpl> p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue