[traffic] Use traff_storage to read hardcoded poll feeds

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-06-16 22:12:28 +03:00
parent af8b748c59
commit 371a58f6f9

View File

@@ -13,6 +13,7 @@
#include "platform/platform.hpp" #include "platform/platform.hpp"
#include "traffxml/traff_model_xml.hpp" #include "traffxml/traff_model_xml.hpp"
#include "traffxml/traff_storage.hpp"
using namespace std::chrono; using namespace std::chrono;
@@ -367,16 +368,14 @@ bool TrafficManager::IsSubscribed()
bool TrafficManager::Poll() bool TrafficManager::Poll()
{ {
// TODO // TODO
//std::string path("/home/michael/src/organicmaps/data/test_data/traff/PL-A18-Krzyzowa-Lipiany.xml"); //std::string fileName("test_data/traff/PL-A18-Krzyzowa-Lipiany.xml");
std::string path("/home/michael/src/organicmaps/data/test_data/traff/PL-A18-Krzyzowa-Lipiany-bidir.xml"); std::string fileName("test_data/traff/PL-A18-Krzyzowa-Lipiany-bidir.xml");
//std::string path("/home/michael/src/organicmaps/data/test_data/traff/LT-A1-Vezaiciai-Endriejavas.xml"); //std::string fileName("test_data/traff/LT-A1-Vezaiciai-Endriejavas.xml");
traffxml::LocalStorage storage(fileName);
pugi::xml_document document; pugi::xml_document document;
auto const load_result = document.load_file(path.data()); auto const load_result = storage.Load(document);
if (!load_result) if (!load_result)
{
LOG(LERROR, ("Can't load file", path, ":", load_result.description()));
return false; return false;
}
std::setlocale(LC_ALL, "en_US.UTF-8"); std::setlocale(LC_ALL, "en_US.UTF-8");
traffxml::TraffFeed feed; traffxml::TraffFeed feed;