mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Start using spdlog library
b CAN
This commit is contained in:
@@ -30,27 +30,27 @@ json command_parser(json command)
|
||||
switch (cmd)
|
||||
{
|
||||
case Command::get_UI_element:
|
||||
std::cout << type << ": " << command["id"] << std::endl;
|
||||
spdlog::info("{}: {}", type, std::string(command["id"]));
|
||||
j["response"]["type"] = type;
|
||||
j["response"]["UI_item"] = g_simulators.invoke_active_simulator()->get_UI_item(command["id"])->to_json();
|
||||
break;
|
||||
case Command::get_UI_elements:
|
||||
std::cout << type << std::endl;
|
||||
spdlog::info("{}", type);
|
||||
j["response"]["type"] = type;
|
||||
j["response"]["UI_items"] = g_simulators.invoke_active_simulator()->get_UI_items()["UI_items"];
|
||||
break;
|
||||
case Command::switch_simulator:
|
||||
std::cout << type << " to " << command["name"] << std::endl;
|
||||
spdlog::info("{} to {}", type, std::string(command["name"]));
|
||||
g_simulators.switch_simulator(command["name"]);
|
||||
j["response"]["type"] = type;
|
||||
break;
|
||||
case Command::get_active_simulator_name:
|
||||
std::cout << type << std::endl;
|
||||
spdlog::info("{}", type);
|
||||
j["response"]["type"] = type;
|
||||
j["response"]["name"] = g_simulators.active_simulator_name();
|
||||
break;
|
||||
case Command::get_simulators:
|
||||
std::cout << type << std::endl;
|
||||
spdlog::info("{}", type);
|
||||
j["response"]["type"] = type;
|
||||
j["response"]["simulators"] = g_simulators.list_simulators();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user