clean up mainwindow files
This commit is contained in:
2026-02-14 14:32:15 +01:00
parent d07b282587
commit d02fc4b611
2 changed files with 11 additions and 6 deletions
+2
View File
@@ -1,5 +1,7 @@
#include "mainwindow.hpp" #include "mainwindow.hpp"
#include "simulator_base.hpp"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "web_socket_wrapper.hpp"
#include <QDirIterator> #include <QDirIterator>
#include <QLibrary> #include <QLibrary>
#include <QMessageBox> #include <QMessageBox>
+9 -6
View File
@@ -1,13 +1,16 @@
#pragma once #pragma once
#include "simulator_base.hpp" #include "nlohmann/json.hpp"
#include "web_socket_wrapper.hpp"
#include <QMainWindow> #include <QMainWindow>
#include <map> #include <map>
using json = nlohmann::json;
#define INSERT_SIMULATOR(type) \ #define INSERT_SIMULATOR(type) \
m_sims.insert(std::make_pair(type().sim_name(), std::make_unique<type>(m_web_socket.get(), this))) m_sims.insert(std::make_pair(type().sim_name(), std::make_unique<type>(m_web_socket.get(), this)))
Q_FORWARD_DECLARE_OBJC_CLASS(QMessageBox); Q_FORWARD_DECLARE_OBJC_CLASS(QMessageBox);
Q_FORWARD_DECLARE_OBJC_CLASS(Web_socket_wrapper);
Q_FORWARD_DECLARE_OBJC_CLASS(Simulator_base);
namespace Ui namespace Ui
{ {
@@ -22,6 +25,10 @@ class MainWindow : public QMainWindow
explicit MainWindow(QUrl ws_url, QString sim, QWidget *parent = nullptr); explicit MainWindow(QUrl ws_url, QString sim, QWidget *parent = nullptr);
~MainWindow(); ~MainWindow();
private:
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
void default_sim(QString name); void default_sim(QString name);
void pase_sim_names(json &sims); void pase_sim_names(json &sims);
void open_sim_window(void); void open_sim_window(void);
@@ -29,10 +36,6 @@ class MainWindow : public QMainWindow
void open_sim(QString sim_name); void open_sim(QString sim_name);
void setup_cb(void); void setup_cb(void);
private:
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
void on_cmd_cb(json &j); void on_cmd_cb(json &j);
bool m_default_sim = false; bool m_default_sim = false;