Updating test product messages to expose additional details

This commit is contained in:
Dan Paulat 2022-10-16 12:49:29 -05:00
parent 3692ef75f2
commit 612874f830
7 changed files with 80 additions and 2 deletions

View file

@ -40,6 +40,21 @@ public:
TextEventManager::TextEventManager() : p(std::make_unique<Impl>(this)) {}
TextEventManager::~TextEventManager() = default;
size_t TextEventManager::message_count(const types::TextEventKey& key) const
{
size_t messageCount = 0u;
std::shared_lock lock(p->textEventMutex_);
auto it = p->textEventMap_.find(key);
if (it != p->textEventMap_.cend())
{
messageCount = it->second.size();
}
return messageCount;
}
std::vector<std::shared_ptr<awips::TextProductMessage>>
TextEventManager::message_list(const types::TextEventKey& key) const
{

View file

@ -23,6 +23,7 @@ public:
explicit TextEventManager();
~TextEventManager();
size_t message_count(const types::TextEventKey& key) const;
std::vector<std::shared_ptr<awips::TextProductMessage>>
message_list(const types::TextEventKey& key) const;

View file

@ -13,9 +13,18 @@ namespace types
static const std::string logPrefix_ = "scwx::qt::types::text_event_key";
std::string TextEventKey::ToFullString() const
{
return std::format("{} {} {} {:04}",
officeId_,
awips::GetPhenomenonText(phenomenon_),
awips::GetSignificanceText(significance_),
etn_);
}
std::string TextEventKey::ToString() const
{
return std::format("{}.{}.{}.{}",
return std::format("{}.{}.{}.{:04}",
officeId_,
awips::GetPhenomenonCode(phenomenon_),
awips::GetSignificanceCode(significance_),

View file

@ -20,6 +20,7 @@ struct TextEventKey
{
}
std::string ToFullString() const;
std::string ToString() const;
bool operator==(const TextEventKey& o) const;