mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
mainwindow
rename member vars
This commit is contained in:
+14
-14
@@ -10,8 +10,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
ui(new Ui::MainWindow),
|
ui(new Ui::MainWindow),
|
||||||
m_web_socket(new Web_socket_wrapper(QUrl("ws://localhost:9002"), this)),
|
m_web_socket(new Web_socket_wrapper(QUrl("ws://localhost:9002"), this)),
|
||||||
error_dialog(new NetworkError(this)),
|
m_error_dialog(new NetworkError(this)),
|
||||||
sims{{"Can_Debugger", new Can_Debugger(m_web_socket, this)},
|
m_sims{{"Can_Debugger", new Can_Debugger(m_web_socket, this)},
|
||||||
{"Scope_Mux_Tester", new Scope_Mux_Tester(m_web_socket, this)},
|
{"Scope_Mux_Tester", new Scope_Mux_Tester(m_web_socket, this)},
|
||||||
{"CVS_I10", new CVS_I10(m_web_socket, this)},
|
{"CVS_I10", new CVS_I10(m_web_socket, this)},
|
||||||
{"Test_Sim", new Test_Sim(m_web_socket, this)}}
|
{"Test_Sim", new Test_Sim(m_web_socket, this)}}
|
||||||
@@ -30,7 +30,7 @@ MainWindow::~MainWindow()
|
|||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
delete m_web_socket;
|
delete m_web_socket;
|
||||||
delete error_dialog;
|
delete m_error_dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setup_cb(void)
|
void MainWindow::setup_cb(void)
|
||||||
@@ -53,8 +53,8 @@ void MainWindow::hideEvent(QHideEvent* event)
|
|||||||
|
|
||||||
void MainWindow::defaultSim(QString name)
|
void MainWindow::defaultSim(QString name)
|
||||||
{
|
{
|
||||||
this->selected_sim_name = name;
|
this->m_selected_sim_name = name;
|
||||||
this->default_sim = true;
|
this->m_default_sim = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::pase_sim_names(json& sims)
|
void MainWindow::pase_sim_names(json& sims)
|
||||||
@@ -66,10 +66,10 @@ void MainWindow::pase_sim_names(json& sims)
|
|||||||
|
|
||||||
QThread::msleep(30);
|
QThread::msleep(30);
|
||||||
|
|
||||||
if (this->default_sim)
|
if (this->m_default_sim)
|
||||||
{
|
{
|
||||||
ui->comboBox->setCurrentText(this->selected_sim_name);
|
ui->comboBox->setCurrentText(this->m_selected_sim_name);
|
||||||
open_sim(this->selected_sim_name);
|
open_sim(this->m_selected_sim_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,8 +77,8 @@ void MainWindow::open_sim(QString sim_name)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
selected_sim = sims.at(sim_name);
|
m_selected_sim = m_sims.at(sim_name);
|
||||||
this->selected_sim_name = sim_name;
|
this->m_selected_sim_name = sim_name;
|
||||||
}
|
}
|
||||||
catch (const std::out_of_range& ex)
|
catch (const std::out_of_range& ex)
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ void MainWindow::open_sim(QString sim_name)
|
|||||||
void MainWindow::open_sim_window(void)
|
void MainWindow::open_sim_window(void)
|
||||||
{
|
{
|
||||||
this->hide();
|
this->hide();
|
||||||
selected_sim->show();
|
m_selected_sim->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::check_active_sim(QString name)
|
void MainWindow::check_active_sim(QString name)
|
||||||
@@ -100,13 +100,13 @@ void MainWindow::check_active_sim(QString name)
|
|||||||
if (name == "")
|
if (name == "")
|
||||||
{
|
{
|
||||||
QD << "Name not set";
|
QD << "Name not set";
|
||||||
m_web_socket->send_command(Web_socket_wrapper::Command::switch_simulator, selected_sim_name);
|
m_web_socket->send_command(Web_socket_wrapper::Command::switch_simulator, m_selected_sim_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QD << "Current sim:" << name;
|
QD << "Current sim:" << name;
|
||||||
|
|
||||||
if (name == selected_sim_name)
|
if (name == m_selected_sim_name)
|
||||||
{
|
{
|
||||||
QD << "Name set and right";
|
QD << "Name set and right";
|
||||||
open_sim_window();
|
open_sim_window();
|
||||||
@@ -114,7 +114,7 @@ void MainWindow::check_active_sim(QString name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QD << "Name set and wrong";
|
QD << "Name set and wrong";
|
||||||
m_web_socket->send_command(Web_socket_wrapper::Command::switch_simulator, selected_sim_name);
|
m_web_socket->send_command(Web_socket_wrapper::Command::switch_simulator, m_selected_sim_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_cmd_cb(json& j)
|
void MainWindow::on_cmd_cb(json& j)
|
||||||
|
|||||||
+6
-6
@@ -35,14 +35,14 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
void on_cmd_cb(json& j);
|
void on_cmd_cb(json& j);
|
||||||
|
|
||||||
bool default_sim = false;
|
bool m_default_sim = false;
|
||||||
QString selected_sim_name;
|
QString m_selected_sim_name;
|
||||||
QMainWindow* selected_sim;
|
QMainWindow* m_selected_sim;
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow* ui;
|
||||||
Web_socket_wrapper *m_web_socket;
|
Web_socket_wrapper *m_web_socket;
|
||||||
NetworkError* error_dialog;
|
NetworkError* m_error_dialog;
|
||||||
|
|
||||||
std::map<QString, SimulatorBase*> sims;
|
std::map<QString, SimulatorBase*> m_sims;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
Reference in New Issue
Block a user