From 4efe904fe7715e7c5e5da058b0b96d8a9f897e81 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Mon, 20 Oct 2025 20:15:25 +0200 Subject: [PATCH] Improves logging and adds TODO for COM device Capitalize first letter. Adds a TODO comment to address future improvements regarding COM device handling. --- server/simulators.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/simulators.cpp b/server/simulators.cpp index 07428d1..28d2d97 100644 --- a/server/simulators.cpp +++ b/server/simulators.cpp @@ -16,6 +16,7 @@ Simulators::Simulators(uint16_t port, QString can_dev, QString uart_dev, QObject { m_server->moveToThread(m_server_thread); m_server_thread->start(); + //TODO: Cleanup this code and make it possible to add multiple com devices if (!can_dev.isEmpty()) { m_can_wrapper->connect_to_dev(can_dev); @@ -82,12 +83,12 @@ void Simulators::start() { if (this->m_simulators.empty()) { - SPDLOG_WARN("no simulators found"); + SPDLOG_WARN("No simulators found"); return; } if (this->m_current_simulator.empty()) { - SPDLOG_WARN("no active simulator"); + SPDLOG_WARN("No active simulator"); return; } @@ -99,12 +100,12 @@ void Simulators::stop() { if (this->m_simulators.empty()) { - SPDLOG_WARN("no simulators found"); + SPDLOG_WARN("No simulators found"); return; } if (this->m_current_simulator.empty()) { - SPDLOG_WARN("no active simulator"); + SPDLOG_WARN("No active simulator"); return; } @@ -115,18 +116,18 @@ void Simulators::switch_simulator(std::string name) { if (this->m_simulators.empty()) { - SPDLOG_WARN("no simulators found"); + SPDLOG_WARN("No simulators found"); return; } if (this->m_simulators.find(name) == this->m_simulators.end()) { - SPDLOG_WARN("simulator {} not found", name); + SPDLOG_WARN("Simulator {} not found", name); return; } if (!this->m_current_simulator.empty()) { - SPDLOG_INFO("stopping current simulator {} and switching to {}", m_current_simulator, name); + SPDLOG_INFO("Stopping current simulator {} and switching to {}", m_current_simulator, name); this->m_simulators.at(m_current_simulator)->stop(); disconnect(m_simulators.at(m_current_simulator).get()); }