simulators

add warnings
This commit is contained in:
2024-12-30 12:08:13 +01:00
parent 000ede8cc1
commit 058de6a749
+7
View File
@@ -30,10 +30,12 @@ void Simulators::run()
{ {
if (this->m_simulators.empty()) if (this->m_simulators.empty())
{ {
spdlog::warn("no simulators found");
return; return;
} }
if (this->m_current_simulator.empty()) if (this->m_current_simulator.empty())
{ {
spdlog::warn("no active simulator");
return; return;
} }
@@ -45,10 +47,12 @@ void Simulators::stop()
{ {
if (this->m_simulators.empty()) if (this->m_simulators.empty())
{ {
spdlog::warn("no simulators found");
return; return;
} }
if (this->m_current_simulator.empty()) if (this->m_current_simulator.empty())
{ {
spdlog::warn("no active simulator");
return; return;
} }
@@ -59,15 +63,18 @@ void Simulators::switch_simulator(std::string name)
{ {
if (this->m_simulators.empty()) if (this->m_simulators.empty())
{ {
spdlog::warn("no simulators found");
return; return;
} }
if (!this->m_current_simulator.empty()) if (!this->m_current_simulator.empty())
{ {
spdlog::info("stopping current simulator {} and switching to {}", m_current_simulator, name);
this->m_simulators.at(m_current_simulator)->stop(); this->m_simulators.at(m_current_simulator)->stop();
} }
if (this->m_simulators.find(name) == this->m_simulators.end()) if (this->m_simulators.find(name) == this->m_simulators.end())
{ {
spdlog::warn("simulator {} not found", name);
return; return;
} }