Start using spdlog library

b CAN
This commit is contained in:
2024-08-27 11:10:37 +02:00
parent d24168e5d1
commit 3f1cf62d5c
10 changed files with 72 additions and 18 deletions
+5 -5
View File
@@ -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;