mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Move to id is size_t
This commit is contained in:
+10
-10
@@ -30,9 +30,9 @@ json Simulators::command_parser(json command)
|
||||
switch (cmd)
|
||||
{
|
||||
case Command::get_UI_element:
|
||||
spdlog::info("Command {}: {}", type, std::string(command.at("id")));
|
||||
spdlog::info("Command {}: {}", type, (size_t)command.at("id"));
|
||||
j["response"]["type"] = type;
|
||||
j["response"]["UI_item"] = invoke_active_simulator()->get_UI_item(command.at("id"))->to_json();
|
||||
j["response"]["UI_item"] = invoke_active_simulator()->get_UI_item(command.at("id"))->to_json(command.at("id"));
|
||||
break;
|
||||
case Command::get_UI_elements:
|
||||
spdlog::info("Command {}", type);
|
||||
@@ -81,26 +81,26 @@ void Simulators::event_handler(json event)
|
||||
switch (e)
|
||||
{
|
||||
case Event::clicked: {
|
||||
spdlog::debug("Event {}: {}", type, std::string(event.at("id")));
|
||||
invoke_active_simulator()->get_UI_item(std::string(event.at("id")))->click();
|
||||
spdlog::debug("Event {}: {}", type, (size_t)event.at("id"));
|
||||
invoke_active_simulator()->get_UI_item(event.at("id"))->click();
|
||||
break;
|
||||
}
|
||||
case Event::value_changed: {
|
||||
spdlog::debug("Event {}: {} {}", type, std::string(event.at("id")), (double)(event["value"]));
|
||||
invoke_active_simulator()->get_UI_item(std::string(event.at("id")))->set_value((double)event.at("value"));
|
||||
spdlog::debug("Event {}: {} {}", type, (size_t)event.at("id"), (double)(event["value"]));
|
||||
invoke_active_simulator()->get_UI_item(event.at("id"))->set_value((double)event.at("value"));
|
||||
break;
|
||||
}
|
||||
case Event::text_changed: {
|
||||
spdlog::debug("Event {}: {} {}", type, std::string(event.at("id")), std::string(event.at("text")));
|
||||
spdlog::debug("Event {}: {} {}", type, (size_t)event.at("id"), std::string(event.at("text")));
|
||||
invoke_active_simulator()
|
||||
->get_UI_item(std::string(event.at("id")))
|
||||
->get_UI_item(event.at("id"))
|
||||
->set_text(std::string(event.at("text")));
|
||||
break;
|
||||
}
|
||||
case Event::selected: {
|
||||
spdlog::debug("Event {}: {} {}", type, std::string(event.at("id")), std::string(event.at("selected")));
|
||||
spdlog::debug("Event {}: {} {}", type, (size_t)event.at("id"), std::string(event.at("selected")));
|
||||
invoke_active_simulator()
|
||||
->get_UI_item(std::string(event.at("id")))
|
||||
->get_UI_item(event.at("id"))
|
||||
->set_selected(std::string(event.at("selected")));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user