[traff_assessment_tool] Basic traffic message panel

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-08-19 00:16:17 +03:00
parent 16708aae7f
commit 2663eda820
7 changed files with 306 additions and 123 deletions

View File

@@ -42,6 +42,7 @@ class TrafficManager final : public traffxml::TraffSourceManager
public:
using CountryInfoGetterFn = std::function<storage::CountryInfoGetter const &()>;
using CountryParentNameGetterFn = std::function<std::string(std::string const &)>;
using TrafficUpdateCallbackFn = std::function<void(bool)>;
/**
* @brief Global state of traffic information.
@@ -303,6 +304,15 @@ public:
*/
void Clear();
/**
* @brief Registers a callback function which gets called on traffic updates.
*
* Intended for testing.
*
* @param fn The callback function.
*/
void SetTrafficUpdateCallbackFn(TrafficUpdateCallbackFn && fn);
private:
/**
@@ -682,6 +692,13 @@ private:
* thread).
*/
std::map<MwmSet::MwmId, traffic::TrafficInfo::Coloring> m_allMwmColoring;
/**
* @brief Callback function which gets called on traffic updates.
*
* Intended for testing.
*/
std::optional<TrafficUpdateCallbackFn> m_trafficUpdateCallbackFn;
};
extern std::string DebugPrint(TrafficManager::TrafficState state);