message parser + simulators

better response on commands and UI_changed event
This commit is contained in:
2024-08-23 22:15:23 +02:00
parent 864f99a359
commit 8161d33245
2 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ json Simulators::changed_UI_items()
json after = this->m_simulators.at(m_current_simulator)->get_UI_items();
json changed;
changed["event"] = "UI_changed";
changed["event"]["type"] = "UI_changed";
json diff = json::diff(m_before, after);
@@ -110,7 +110,7 @@ json Simulators::changed_UI_items()
{
std::string path = item["path"];
std::string index_s = path.substr(10, path.find("/", 10) - 10);
changed["UI_items"].push_back(after["UI_items"][std::stoul(index_s)]);
changed["event"]["UI_items"].push_back(after["UI_items"][std::stoul(index_s)]);
}
m_before = after;