mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 18:30:06 +00:00
Merge pull request #344 from dpaulat/hotfix/live-level2-data-not-latest
Ensure live level 2 data displays correct scans
This commit is contained in:
commit
42314a64b2
3 changed files with 23 additions and 8 deletions
|
|
@ -1507,10 +1507,10 @@ RadarProductManager::GetLevel2Data(wsr88d::rda::DataBlockType dataBlockType,
|
|||
|
||||
if (recordRadarData != nullptr)
|
||||
{
|
||||
auto& radarData0 = (*recordRadarData)[0];
|
||||
auto collectionTime =
|
||||
auto& radarData0 = (*recordRadarData)[0];
|
||||
auto collectionTime = std::chrono::floor<std::chrono::seconds>(
|
||||
scwx::util::TimePoint(radarData0->modified_julian_date(),
|
||||
radarData0->collection_time());
|
||||
radarData0->collection_time()));
|
||||
|
||||
// Find the newest radar data, not newer than the selected time
|
||||
if (radarData == nullptr ||
|
||||
|
|
|
|||
|
|
@ -1801,7 +1801,16 @@ void MapWidgetImpl::RadarProductManagerConnect()
|
|||
(group == common::RadarProductGroup::Level2 ||
|
||||
context_->radar_product() == product))
|
||||
{
|
||||
widget_->SelectRadarProduct(record);
|
||||
if (group == common::RadarProductGroup::Level2)
|
||||
{
|
||||
// Level 2 products may have multiple time points,
|
||||
// ensure the latest is selected
|
||||
widget_->SelectRadarProduct(group, product);
|
||||
}
|
||||
else
|
||||
{
|
||||
widget_->SelectRadarProduct(record);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <boost/iostreams/copy.hpp>
|
||||
#include <boost/iostreams/filtering_streambuf.hpp>
|
||||
#include <boost/iostreams/filter/bzip2.hpp>
|
||||
#include <fmt/chrono.h>
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# pragma GCC diagnostic pop
|
||||
|
|
@ -187,10 +188,12 @@ Ar2vFile::GetElevationScan(rda::DataBlockType dataBlockType,
|
|||
|
||||
for (auto& scan : elevationScans)
|
||||
{
|
||||
auto& scanTime = scan.first;
|
||||
auto scanTime = std::chrono::floor<std::chrono::seconds>(scan.first);
|
||||
|
||||
if (elevationScan == nullptr ||
|
||||
(scanTime <= time && scanTime > foundTime))
|
||||
((scanTime <= time ||
|
||||
time == std::chrono::system_clock::time_point {}) &&
|
||||
scanTime > foundTime))
|
||||
{
|
||||
elevationScan = scan.second;
|
||||
foundTime = scanTime;
|
||||
|
|
@ -253,10 +256,13 @@ bool Ar2vFile::LoadData(std::istream& is)
|
|||
|
||||
if (dataValid)
|
||||
{
|
||||
auto timePoint = util::TimePoint(p->julianDate_, p->milliseconds_);
|
||||
|
||||
logger_->debug("Filename: {}", p->tapeFilename_);
|
||||
logger_->debug("Extension: {}", p->extensionNumber_);
|
||||
logger_->debug("Date: {}", p->julianDate_);
|
||||
logger_->debug("Time: {}", p->milliseconds_);
|
||||
logger_->debug("Date: {} ({:%Y-%m-%d})", p->julianDate_, timePoint);
|
||||
logger_->debug(
|
||||
"Time: {} ({:%H:%M:%S})", p->milliseconds_, timePoint);
|
||||
logger_->debug("ICAO: {}", p->icao_);
|
||||
|
||||
size_t decompressedRecords = p->DecompressLDMRecords(is);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue