mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
client
update to use qurl in main and mainwindow fix
This commit is contained in:
+5
-4
@@ -41,11 +41,12 @@ int main(int argc, char *argv[])
|
|||||||
parser.process(a);
|
parser.process(a);
|
||||||
// Initialize the logger
|
// Initialize the logger
|
||||||
init_logger();
|
init_logger();
|
||||||
SPDLOG_INFO("Starting GUI");
|
|
||||||
|
|
||||||
QString host = parser.value(hostOption);
|
QUrl url;
|
||||||
uint16_t port = parser.value(portOption).toUShort();
|
url.setScheme("ws");
|
||||||
MainWindow w(host, port);
|
url.setHost(parser.value(hostOption));
|
||||||
|
url.setPort(parser.value(portOption).toInt());
|
||||||
|
MainWindow w(url);
|
||||||
w.show();
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
#include "scope_mux_tester.hpp"
|
#include "scope_mux_tester.hpp"
|
||||||
#include "test.hpp"
|
#include "test.hpp"
|
||||||
|
|
||||||
MainWindow::MainWindow(QString host, uint16_t port, QWidget *parent)
|
MainWindow::MainWindow(QUrl ws_url, QWidget *parent)
|
||||||
: QMainWindow(parent), ui(new Ui::MainWindow),
|
: QMainWindow(parent), ui(new Ui::MainWindow),
|
||||||
m_web_socket(new Web_socket_wrapper(QUrl("ws://" + host + ":" + QString::number(port)), this)),
|
m_web_socket(new Web_socket_wrapper(ws_url)),
|
||||||
m_error_dialog(new NetworkError(this)), m_sims{{"Can_Debugger", new Can_Debugger(m_web_socket, this)},
|
m_error_dialog(new NetworkError(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)},
|
||||||
@@ -18,7 +18,7 @@ MainWindow::MainWindow(QString host, uint16_t port, QWidget *parent)
|
|||||||
this->setWindowTitle("Simulator Selector");
|
this->setWindowTitle("Simulator Selector");
|
||||||
|
|
||||||
m_error_dialog->set_error("Connection timed out\nCheck if the server is running");
|
m_error_dialog->set_error("Connection timed out\nCheck if the server is running");
|
||||||
ui->connection->setText("Connected to ws://" + host + ":" + QString::number(port));
|
ui->connection->setText("Connected to " + ws_url.toString());
|
||||||
// Default sim
|
// Default sim
|
||||||
// defaultSim("CVS_I10");
|
// defaultSim("CVS_I10");
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ class MainWindow : public QMainWindow
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QString host, uint16_t port, QWidget *parent = nullptr);
|
explicit MainWindow(QUrl ws_url, QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
void defaultSim(QString name);
|
void defaultSim(QString name);
|
||||||
|
|||||||
Reference in New Issue
Block a user