mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Move to Qt
Move to QTimer Remove unused submodules
This commit is contained in:
+1
-7
@@ -1,12 +1,6 @@
|
||||
[submodule "external/color"]
|
||||
path = external/color
|
||||
url = git@github.com:Sani7/cpp_color_lib.git
|
||||
[submodule "external/timer"]
|
||||
path = external/timer
|
||||
url = git@github.com:Sani7/cpp_timer.git
|
||||
[submodule "external/websocketpp"]
|
||||
path = external/websocketpp
|
||||
url = git@github.com:Sani7/websocketpp.git
|
||||
[submodule "external/spdlog"]
|
||||
path = external/spdlog
|
||||
url = git@github.com:gabime/spdlog.git
|
||||
url = git@github.com:gabime/spdlog.git
|
||||
Vendored
-2
@@ -1,4 +1,2 @@
|
||||
add_subdirectory(color)
|
||||
add_subdirectory(spdlog)
|
||||
add_subdirectory(timer)
|
||||
add_subdirectory(websocketpp)
|
||||
Vendored
-1
Submodule external/timer deleted from 693d29797d
Vendored
-1
Submodule external/websocketpp deleted from cbe02ed984
@@ -40,8 +40,7 @@ target_include_directories(server
|
||||
|
||||
target_link_libraries(server PRIVATE
|
||||
Qt::WebSockets
|
||||
UI
|
||||
Timer
|
||||
magic_enum::magic_enum
|
||||
spdlog
|
||||
UI
|
||||
)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "simulator_base.hpp"
|
||||
|
||||
Simulator_base::Simulator_base(std::string name, std::chrono::milliseconds interval, QObject* parrent)
|
||||
: QObject(parrent), m_name(name), m_timer([this] { timer(); }), m_interval(interval)
|
||||
: QObject(parrent), m_name(name), m_timer(new QTimer(this)), m_interval(interval)
|
||||
{
|
||||
connect(m_timer, &QTimer::timeout, this, [this]{timer();});
|
||||
}
|
||||
|
||||
std::string Simulator_base::name() const
|
||||
@@ -59,14 +60,14 @@ UI_item *Simulator_base::get_UI_item(std::string id) const
|
||||
void Simulator_base::run()
|
||||
{
|
||||
// Start the timer
|
||||
m_timer.setInterval(m_interval);
|
||||
m_timer->start(m_interval);
|
||||
run_at_startup();
|
||||
}
|
||||
|
||||
void Simulator_base::stop()
|
||||
{
|
||||
// Stop the simulator
|
||||
m_timer.stop();
|
||||
m_timer->stop();
|
||||
}
|
||||
|
||||
void Simulator_base::shutdown()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "UI.hpp"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "timer.hpp"
|
||||
#include <QTimer>
|
||||
|
||||
class Simulator_base : public QObject
|
||||
{
|
||||
@@ -89,6 +89,6 @@ class Simulator_base : public QObject
|
||||
std::string m_name;
|
||||
std::vector<UI_item *> m_UI_items;
|
||||
std::map<std::string, UI_item *> m_UI_items_map;
|
||||
Timer m_timer;
|
||||
QTimer* m_timer;
|
||||
std::chrono::milliseconds m_interval;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user