diff --git a/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp b/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp index ba3162e9..05cc26a5 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -313,7 +314,7 @@ void GeoIcons::Render(const QMapLibre::CustomLayerRenderParameters& params, // Selected time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; glUniform1i( p->uSelectedTimeLocation_, @@ -930,7 +931,7 @@ bool GeoIcons::RunMousePicking( // If no time has been selected, use the current time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; // For each pickable icon diff --git a/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp b/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp index aa376b00..e35cca4f 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -284,7 +285,7 @@ void GeoLines::Render(const QMapLibre::CustomLayerRenderParameters& params) // Selected time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; glUniform1i( p->uSelectedTimeLocation_, @@ -723,7 +724,7 @@ bool GeoLines::RunMousePicking( // If no time has been selected, use the current time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; // For each pickable line diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp index 9ce7dc8f..21dd25c2 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -295,7 +296,7 @@ void PlacefileIcons::Render( // Selected time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; glUniform1i( p->uSelectedTimeLocation_, @@ -720,7 +721,7 @@ bool PlacefileIcons::RunMousePicking( // If no time has been selected, use the current time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; // For each pickable icon diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp index 16d4d19b..b14a2723 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -264,7 +265,7 @@ void PlacefileImages::Render( // Selected time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; glUniform1i( p->uSelectedTimeLocation_, diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp index 134d9c6b..b908389c 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -248,7 +249,7 @@ void PlacefileLines::Render( // Selected time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; glUniform1i( p->uSelectedTimeLocation_, @@ -526,7 +527,7 @@ bool PlacefileLines::RunMousePicking( // If no time has been selected, use the current time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; // For each pickable line diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp index 646739ef..a30991f9 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include @@ -259,7 +260,7 @@ void PlacefilePolygons::Render( // Selected time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; glUniform1i( p->uSelectedTimeLocation_, diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp index 832a1292..93aa4461 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -127,7 +128,7 @@ void PlacefileText::Impl::RenderTextDrawItem( // If no time has been selected, use the current time std::chrono::system_clock::time_point selectedTime = (selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : selectedTime_; const bool thresholdMet = diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp index 5ad54bc7..222713ae 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include @@ -203,7 +204,7 @@ void PlacefileTriangles::Render( // Selected time std::chrono::system_clock::time_point selectedTime = (p->selectedTime_ == std::chrono::system_clock::time_point {}) ? - std::chrono::system_clock::now() : + scwx::util::time::now() : p->selectedTime_; glUniform1i( p->uSelectedTimeLocation_, diff --git a/scwx-qt/source/scwx/qt/manager/alert_manager.cpp b/scwx-qt/source/scwx/qt/manager/alert_manager.cpp index 748e0943..41e74d7a 100644 --- a/scwx-qt/source/scwx/qt/manager/alert_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/alert_manager.cpp @@ -2,12 +2,13 @@ #include #include #include +#include #include +#include #include #include #include -#include -#include +#include #include #include @@ -172,7 +173,7 @@ void AlertManager::Impl::HandleAlert(const types::TextEventKey& key, // If the event has ended or is inactive, or if the alert is not enabled, // skip it - if (eventEnd < std::chrono::system_clock::now() || !alertActive || + if (eventEnd < scwx::util::time::now() || !alertActive || !audioSettings.alert_enabled(phenomenon).GetValue()) { continue; diff --git a/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp b/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp index 13787496..bda6e232 100644 --- a/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -821,7 +822,7 @@ void RadarProductManagerImpl::RefreshDataSync( auto latestTime = providerManager->provider_->FindLatestTime(); auto updatePeriod = providerManager->provider_->update_period(); auto lastModified = providerManager->provider_->last_modified(); - auto sinceLastModified = std::chrono::system_clock::now() - lastModified; + auto sinceLastModified = scwx::util::time::now() - lastModified; // For the default interval, assume products are updated at a // constant rate. Expect the next product at a time based on the @@ -939,7 +940,7 @@ RadarProductManager::GetActiveVolumeTimes( [&](const auto& date) { // Don't query for a time point in the future - if (date > std::chrono::system_clock::now()) + if (date > scwx::util::time::now()) { return; } @@ -1259,7 +1260,7 @@ void RadarProductManagerImpl::PopulateProductTimes( [&](const auto& date) { // Don't query for a time point in the future - if (date > std::chrono::system_clock::now()) + if (date > scwx::util::time::now()) { return; } @@ -1556,7 +1557,7 @@ RadarProductManager::GetLevel2Data(wsr88d::rda::DataBlockType dataBlockType, bool needArchive = true; static const auto maxChunkDelay = std::chrono::minutes(10); const std::chrono::system_clock::time_point firstValidChunkTime = - (isEpox ? std::chrono::system_clock::now() : time) - maxChunkDelay; + (isEpox ? scwx::util::time::now() : time) - maxChunkDelay; // See if we have this one in the chunk provider. auto chunkFile = std::dynamic_pointer_cast( diff --git a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp index d7759275..009f2441 100644 --- a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp @@ -678,7 +678,7 @@ void TextEventManager::Impl::Refresh() // If the time jumps, we should attempt to load from no later than the // previous load time auto loadTime = - std::chrono::floor(std::chrono::system_clock::now()); + std::chrono::floor(scwx::util::time::now()); auto startTime = loadTime - loadHistoryDuration_; if (prevLoadTime_ != std::chrono::sys_time {}) diff --git a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp index 0bcf4f68..70c4b2ed 100644 --- a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp @@ -218,7 +218,7 @@ void TimelineManager::AnimationStepBegin() p->pinnedTime_ == std::chrono::system_clock::time_point {}) { // If the selected view type is live, select the current products - p->SelectTimeAsync(std::chrono::system_clock::now() - p->loopTime_); + p->SelectTimeAsync(scwx::util::time::now() - p->loopTime_); } else { @@ -385,8 +385,8 @@ TimelineManager::Impl::GetLoopStartAndEndTimes() if (viewType_ == types::MapTime::Live || pinnedTime_ == std::chrono::system_clock::time_point {}) { - endTime = std::chrono::floor( - std::chrono::system_clock::now()); + endTime = + std::chrono::floor(scwx::util::time::now()); } else { @@ -656,8 +656,8 @@ void TimelineManager::Impl::Step(Direction direction) { if (direction == Direction::Back) { - newTime = std::chrono::floor( - std::chrono::system_clock::now()); + newTime = + std::chrono::floor(scwx::util::time::now()); } else { @@ -688,7 +688,7 @@ void TimelineManager::Impl::Step(Direction direction) newTime += 1min; // If the new time is more than 2 minutes in the future, stop stepping - if (newTime > std::chrono::system_clock::now() + 2min) + if (newTime > scwx::util::time::now() + 2min) { break; } diff --git a/scwx-qt/source/scwx/qt/map/alert_layer.cpp b/scwx-qt/source/scwx/qt/map/alert_layer.cpp index 6599e0e5..7bea5938 100644 --- a/scwx-qt/source/scwx/qt/map/alert_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/alert_layer.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -581,8 +582,7 @@ void AlertLayer::Impl::ScheduleRefresh() // Expires at the top of the next minute std::chrono::system_clock::time_point now = - std::chrono::floor( - std::chrono::system_clock::now()); + std::chrono::floor(scwx::util::time::now()); refreshTimer_.expires_at(now + 1min); refreshTimer_.async_wait( diff --git a/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp b/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp index 4dfeca41..0fa55d96 100644 --- a/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp +++ b/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -67,7 +68,7 @@ bool AlertProxyModel::filterAcceptsRow(int sourceRow, .value(); // Compare end time to current - if (endTime < std::chrono::system_clock::now()) + if (endTime < scwx::util::time::now()) { acceptAlertActiveFilter = false; } diff --git a/scwx-qt/source/scwx/qt/ui/animation_dock_widget.cpp b/scwx-qt/source/scwx/qt/ui/animation_dock_widget.cpp index 85fdb74f..eac16c44 100644 --- a/scwx-qt/source/scwx/qt/ui/animation_dock_widget.cpp +++ b/scwx-qt/source/scwx/qt/ui/animation_dock_widget.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -81,8 +82,7 @@ AnimationDockWidget::AnimationDockWidget(QWidget* parent) : p->timeZone_ = date::get_tzdb().locate_zone("UTC"); #endif const std::chrono::sys_seconds currentTimePoint = - std::chrono::floor( - std::chrono::system_clock::now()); + std::chrono::floor(scwx::util::time::now()); p->SetTimePoint(currentTimePoint); // Update maximum date on a timer diff --git a/scwx-qt/source/scwx/qt/view/overlay_product_view.cpp b/scwx-qt/source/scwx/qt/view/overlay_product_view.cpp index 3200dcca..ccc41b9d 100644 --- a/scwx-qt/source/scwx/qt/view/overlay_product_view.cpp +++ b/scwx-qt/source/scwx/qt/view/overlay_product_view.cpp @@ -187,7 +187,7 @@ void OverlayProductView::Impl::LoadProduct( header.date_of_message(), header.time_of_message() * 1000); // If the record is from the last 30 minutes - if (productTime + 30min >= std::chrono::system_clock::now() || + if (productTime + 30min >= scwx::util::time::now() || (selectedTime_ != std::chrono::system_clock::time_point {} && productTime + 30min >= selectedTime_)) { diff --git a/wxdata/source/scwx/provider/aws_level2_chunks_data_provider.cpp b/wxdata/source/scwx/provider/aws_level2_chunks_data_provider.cpp index 74a9afd7..f7de36ca 100644 --- a/wxdata/source/scwx/provider/aws_level2_chunks_data_provider.cpp +++ b/wxdata/source/scwx/provider/aws_level2_chunks_data_provider.cpp @@ -302,7 +302,7 @@ AwsLevel2ChunksDataProvider::Impl::GetScanTime(const std::string& prefix) if (scanTimeIt != scanTimes_.cend()) { // If the time is greater than 2 hours ago, it may be a new scan - auto replaceBy = system_clock::now() - hours {2}; + auto replaceBy = util::time::now() - hours {2}; if (scanTimeIt->second > replaceBy) { return scanTimeIt->second; @@ -333,8 +333,7 @@ AwsLevel2ChunksDataProvider::Impl::ListObjects() size_t newObjects = 0; const size_t totalObjects = 0; - const std::chrono::system_clock::time_point now = - std::chrono::system_clock::now(); + const std::chrono::system_clock::time_point now = util::time::now(); if (currentScan_.valid_ && !currentScan_.hasAllFiles_ && lastTimeListed_ + std::chrono::minutes(2) > now) diff --git a/wxdata/source/scwx/provider/aws_nexrad_data_provider.cpp b/wxdata/source/scwx/provider/aws_nexrad_data_provider.cpp index dceb45d8..97528a9e 100644 --- a/wxdata/source/scwx/provider/aws_nexrad_data_provider.cpp +++ b/wxdata/source/scwx/provider/aws_nexrad_data_provider.cpp @@ -352,7 +352,7 @@ std::pair AwsNexradDataProvider::Refresh() logger_->debug("Refresh()"); - auto today = floor(system_clock::now()); + auto today = floor(util::time::now()); auto yesterday = today - days {1}; std::unique_lock lock(p->refreshMutex_); @@ -388,7 +388,7 @@ void AwsNexradDataProvider::Impl::PruneObjects() { using namespace std::chrono; - auto today = floor(system_clock::now()); + auto today = floor(util::time::now()); auto yesterday = today - days {1}; std::unique_lock lock(objectsMutex_); diff --git a/wxdata/source/scwx/provider/warnings_provider.cpp b/wxdata/source/scwx/provider/warnings_provider.cpp index 78eb687c..a762cd99 100644 --- a/wxdata/source/scwx/provider/warnings_provider.cpp +++ b/wxdata/source/scwx/provider/warnings_provider.cpp @@ -108,7 +108,7 @@ WarningsProvider::LoadUpdatedFiles( std::vector> updatedFiles; const std::chrono::sys_time now = - std::chrono::floor(std::chrono::system_clock::now()); + std::chrono::floor(util::time::now()); std::chrono::sys_time currentHour = (startTime != std::chrono::sys_time {}) ? startTime :