diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-12-10 16:05:58 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-12-10 16:05:58 +0100 |
commit | c265bc642b33c15f8446ceef318373a2f2bdee1d (patch) | |
tree | cdf2bcc9f19badf54a22a7c9fe7dde5ea8a7080a /confui/mainwindow.cpp | |
parent | 931fbf84e5a46649c9adf073e9b3d1d776af0b54 (diff) |
serial port list
Diffstat (limited to 'confui/mainwindow.cpp')
-rw-r--r-- | confui/mainwindow.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/confui/mainwindow.cpp b/confui/mainwindow.cpp index cff5002..8dcf077 100644 --- a/confui/mainwindow.cpp +++ b/confui/mainwindow.cpp @@ -5,14 +5,18 @@ #include "mainwindow.h" #include "ui_tab_automations.h" #include "ui_tab_node_overview.h" +#include "serial.h" CDMeshConnector *g_cd_mesh_connector = nullptr; +CDSerialConnector *g_cd_serial = nullptr; CDMainWindow::~CDMainWindow() { delete this->mesh_connector; } CDMainWindow::CDMainWindow(QWidget *parent) : QMainWindow(parent) { g_cd_mesh_connector = new CDMeshConnector(); this->mesh_connector = g_cd_mesh_connector; + g_cd_serial = new CDSerialConnector(); + this->serial_connector = g_cd_serial; menu_bar = new QMenuBar(this); @@ -47,8 +51,9 @@ void CDMainWindow::update() { QMenu *menu_options_serialport = menu_options->addMenu("serial port (FIXME)"); - menu_options_serialport->addAction("FIXME A"); - menu_options_serialport->addAction("FIXME B"); + vector<string> ports = CDSerialConnector::get_ports(); + for (string port : ports) + menu_options_serialport->addAction(QString::fromStdString(port)); } void CDMainWindow::menu_refresh() { update(); } |