mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
message parser + simulators
better response on commands and UI_changed event
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user