websocket

add ping pong to simbase, mainwindow and websocket wrapper
This commit is contained in:
2026-02-01 18:59:36 +01:00
parent e72ec3e01d
commit 34cdcd6078
4 changed files with 43 additions and 1 deletions
+3
View File
@@ -19,6 +19,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->setupUi(this);
this->setWindowTitle("Simulator Selector");
m_error_dialog->set_error("Connection timed out\nCheck if the server is running");
//Default sim
//defaultSim("CVS_I10");
@@ -37,6 +39,7 @@ void MainWindow::setup_cb(void)
{
connect(m_web_socket, &Web_socket_wrapper::on_command_cb, this, [=](json& j){on_cmd_cb(j);});
connect(m_web_socket, &Web_socket_wrapper::on_connected, this, [=]{m_web_socket->send_command(Web_socket_wrapper::Command::get_simulators);});
connect(m_web_socket, &Web_socket_wrapper::on_closed, this, [=]{m_error_dialog->open();});
}
void MainWindow::showEvent( QShowEvent* event )