From 69d5a36f551966b01442a62a49f6b405847a01b4 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Mon, 20 Jan 2025 22:15:14 -0600 Subject: [PATCH] When viewing live level 2 data, ensure the latest scan is selected --- scwx-qt/source/scwx/qt/map/map_widget.cpp | 11 ++++++++++- wxdata/source/scwx/wsr88d/ar2v_file.cpp | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index f7ba99ae..cc501408 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -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); + } } }); } diff --git a/wxdata/source/scwx/wsr88d/ar2v_file.cpp b/wxdata/source/scwx/wsr88d/ar2v_file.cpp index ca92db56..1069fbcd 100644 --- a/wxdata/source/scwx/wsr88d/ar2v_file.cpp +++ b/wxdata/source/scwx/wsr88d/ar2v_file.cpp @@ -191,7 +191,9 @@ Ar2vFile::GetElevationScan(rda::DataBlockType dataBlockType, auto scanTime = std::chrono::floor(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;