aboutsummaryrefslogtreecommitdiff
path: root/confui/mainwindow.cpp
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-12-12 12:13:12 +0100
committerlonkaars <loek@pipeframe.xyz>2022-12-12 12:13:12 +0100
commit52571310d06e2c20d2959c7f6ca2d9e6a1cf281c (patch)
tree1ec3ac1e4008d11853c7c1db0b2f80b8f6561af7 /confui/mainwindow.cpp
parent28cd1a0d195637f8f55faf711a66a3e0249843dc (diff)
allow manual serial port specification
Diffstat (limited to 'confui/mainwindow.cpp')
-rw-r--r--confui/mainwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/confui/mainwindow.cpp b/confui/mainwindow.cpp
index b0a1857..1fd34c4 100644
--- a/confui/mainwindow.cpp
+++ b/confui/mainwindow.cpp
@@ -1,14 +1,17 @@
#include <QGridLayout>
#include <QMenuBar>
#include <QTabWidget>
+#include <iostream>
#include "mainwindow.h"
#include "ui_tab_automations.h"
#include "ui_tab_node_overview.h"
#include "serial.h"
+#include "main.h"
CDMeshConnector *g_cd_mesh_connector = nullptr;
CDSerialConnector *g_cd_serial = nullptr;
+QApplication* g_cd_app = nullptr;
CDMainWindow::~CDMainWindow() { delete this->mesh_connector; }
@@ -28,6 +31,10 @@ CDMainWindow::CDMainWindow(QWidget *parent) : QMainWindow(parent) {
tab_bar_widget->addTab(this->node_overview_tab, "node overview");
tab_bar_widget->addTab(this->automations_tab, "automations");
+ // manually connect to serial port
+ if (g_cd_app->arguments().length() > 1 && g_cd_app->arguments().at(1).length() > 0)
+ g_cd_serial->connect(g_cd_app->arguments().at(1).toStdString());
+
setMenuBar(menu_bar);
setCentralWidget(tab_bar_widget);
update();