mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Lint
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#include "simulator_base.hpp"
|
#include "simulator_base.hpp"
|
||||||
|
|
||||||
Simulator_base::Simulator_base(std::string name, Communication* com,
|
Simulator_base::Simulator_base(std::string name, Communication *com, std::chrono::milliseconds interval,
|
||||||
std::chrono::milliseconds interval, QObject *parent)
|
QObject *parent)
|
||||||
: QObject(parent), m_name(name), m_timer(new QTimer(this)), m_interval(interval), m_com(com)
|
: QObject(parent), m_name(name), m_timer(new QTimer(this)), m_interval(interval), m_com(com)
|
||||||
{
|
{
|
||||||
connect(m_timer, &QTimer::timeout, this, [this] { timer(); });
|
connect(m_timer, &QTimer::timeout, this, [this] { timer(); });
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
#define PUSH_UI_ITEM(item) push_ui_item(&item)
|
#define PUSH_UI_ITEM(item) push_ui_item(&item)
|
||||||
struct Communication
|
struct Communication
|
||||||
{
|
{
|
||||||
CAN_Wrapper* c_if1 = nullptr;
|
CAN_Wrapper *c_if1 = nullptr;
|
||||||
CAN_Wrapper* c_if2 = nullptr;
|
CAN_Wrapper *c_if2 = nullptr;
|
||||||
QSerialPort* s_if1 = nullptr;
|
QSerialPort *s_if1 = nullptr;
|
||||||
QSerialPort* s_if2 = nullptr;
|
QSerialPort *s_if2 = nullptr;
|
||||||
QSerialPort* s_if3 = nullptr;
|
QSerialPort *s_if3 = nullptr;
|
||||||
QSerialPort* s_if4 = nullptr;
|
QSerialPort *s_if4 = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Simulator_base : public QObject
|
class Simulator_base : public QObject
|
||||||
@@ -27,7 +27,7 @@ class Simulator_base : public QObject
|
|||||||
* @param name The name of the simulator
|
* @param name The name of the simulator
|
||||||
* @param interval The interval of the timer (default is 100ms)
|
* @param interval The interval of the timer (default is 100ms)
|
||||||
*/
|
*/
|
||||||
Simulator_base(std::string name, Communication* comms,
|
Simulator_base(std::string name, Communication *comms,
|
||||||
std::chrono::milliseconds interval = std::chrono::milliseconds(100), QObject *parent = nullptr);
|
std::chrono::milliseconds interval = std::chrono::milliseconds(100), QObject *parent = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -117,5 +117,5 @@ class Simulator_base : public QObject
|
|||||||
std::vector<UI_item *> m_UI_items;
|
std::vector<UI_item *> m_UI_items;
|
||||||
QTimer *m_timer;
|
QTimer *m_timer;
|
||||||
std::chrono::milliseconds m_interval;
|
std::chrono::milliseconds m_interval;
|
||||||
Communication* m_com;
|
Communication *m_com;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
#include "simulator_base.hpp"
|
#include "simulator_base.hpp"
|
||||||
#include "websocket.hpp"
|
#include "websocket.hpp"
|
||||||
|
|
||||||
#define INSERT_SIMULATOR(type) \
|
#define INSERT_SIMULATOR(type) m_simulators.insert(std::make_pair(type().name(), std::make_unique<type>(&m_com, this)));
|
||||||
m_simulators.insert(std::make_pair(type().name(), std::make_unique<type>(&m_com, this)));
|
|
||||||
|
|
||||||
class Simulators : public QObject
|
class Simulators : public QObject
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include "can_debugger.hpp"
|
#include "can_debugger.hpp"
|
||||||
|
|
||||||
Can_Debugger::Can_Debugger(Communication *com, QObject *parent)
|
Can_Debugger::Can_Debugger(Communication *com, QObject *parent)
|
||||||
: Simulator_base("Can Debugger", com, std::chrono::milliseconds(100), parent),
|
: Simulator_base("Can Debugger", com, std::chrono::milliseconds(100), parent), m_wrapper(com->c_if1),
|
||||||
m_wrapper(com->c_if1), m_can_ui(Color::Black, Color::White)
|
m_can_ui(Color::Black, Color::White)
|
||||||
{
|
{
|
||||||
PUSH_UI_ITEM(m_can_ui);
|
PUSH_UI_ITEM(m_can_ui);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "test_sim.hpp"
|
#include "test_sim.hpp"
|
||||||
|
|
||||||
Test_Sim::Test_Sim(Communication* com, QObject *parent)
|
Test_Sim::Test_Sim(Communication *com, QObject *parent)
|
||||||
: Simulator_base("Test Sim", com, std::chrono::milliseconds(1000), parent),
|
: Simulator_base("Test Sim", com, std::chrono::milliseconds(1000), parent),
|
||||||
m_button("Off", Color::White, Color::Red),
|
m_button("Off", Color::White, Color::Red),
|
||||||
m_combobox(Color::White, Color::Black, {"Option 1", "Option 2", "Option 3"}, 0),
|
m_combobox(Color::White, Color::Black, {"Option 1", "Option 2", "Option 3"}, 0),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class Test_Sim : public Simulator_base
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Test_Sim(Communication* comms = nullptr, QObject *parent = nullptr);
|
explicit Test_Sim(Communication *comms = nullptr, QObject *parent = nullptr);
|
||||||
void timer() override;
|
void timer() override;
|
||||||
void run_at_startup() override;
|
void run_at_startup() override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user