Hover over time for additional product information

This commit is contained in:
Dan Paulat 2023-11-19 07:56:52 -06:00
parent c2918daebf
commit 1e7df9f236
6 changed files with 107 additions and 6 deletions

View file

@ -9,6 +9,10 @@
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
#if !defined(_MSC_VER)
# include <date/date.h>
#endif
namespace scwx
{
namespace qt
@ -153,6 +157,44 @@ void Level3ProductView::SelectProduct(const std::string& productName)
p->product_ = productName;
}
std::vector<std::pair<std::string, std::string>>
Level3ProductView::GetDescriptionFields() const
{
std::vector<std::pair<std::string, std::string>> description {};
if (p->graphicMessage_ != nullptr)
{
const scwx::util::time_zone* currentZone;
#if defined(_MSC_VER)
currentZone = std::chrono::current_zone();
#else
currentZone = date::current_zone();
#endif
auto descriptionBlock = p->graphicMessage_->description_block();
if (descriptionBlock != nullptr)
{
auto volumeTime = scwx::util::TimePoint(
descriptionBlock->volume_scan_date(),
descriptionBlock->volume_scan_start_time() * 1000);
auto productTime = scwx::util::TimePoint(
descriptionBlock->generation_date_of_product(),
descriptionBlock->generation_time_of_product() * 1000);
description.emplace_back(
"Volume Time",
scwx::util::TimeString(volumeTime, currentZone, false));
description.emplace_back(
"Product Time",
scwx::util::TimeString(productTime, currentZone, false));
}
}
return description;
}
void Level3ProductView::LoadColorTable(
std::shared_ptr<common::ColorTable> colorTable)
{

View file

@ -38,6 +38,9 @@ public:
void SelectProduct(const std::string& productName) override;
std::vector<std::pair<std::string, std::string>>
GetDescriptionFields() const override;
protected:
std::shared_ptr<wsr88d::rpg::GraphicProductMessage>
graphic_product_message() const;

View file

@ -144,6 +144,12 @@ RadarProductView::GetCfpMomentData() const
return std::tie(data, dataSize, componentSize);
}
std::vector<std::pair<std::string, std::string>>
RadarProductView::GetDescriptionFields() const
{
return {};
}
std::chrono::system_clock::time_point RadarProductView::GetSelectedTime() const
{
return p->selectedTime_;

View file

@ -66,6 +66,9 @@ public:
GetCfpMomentData() const;
std::chrono::system_clock::time_point GetSelectedTime() const;
virtual std::vector<std::pair<std::string, std::string>>
GetDescriptionFields() const;
protected:
virtual boost::asio::thread_pool& thread_pool() = 0;