aboutsummaryrefslogtreecommitdiff
path: root/confui/mainwindow.h
blob: 587c44731f551ff13d1f96e8e9f025f03315d2ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once

#include <QMainWindow>
#include <QtSerialPort/QSerialPort>

#include <QDebug>

#include "mesh_connector.h"
#include "serial.h"

class CDAutomationsTabWidget;
class CDNodeOverviewTabWidget;

/**
 * @brief main window
 *
 * creates menu bar and tabs
 * cascading refresh (automatic and manual)
 */
class CDMainWindow : public QMainWindow {
	Q_OBJECT

private:
	QMenuBar *menu_bar						   = nullptr;
	CDAutomationsTabWidget *automations_tab	   = nullptr;
	CDNodeOverviewTabWidget *node_overview_tab = nullptr;

public:
	CDMeshConnector *mesh_connector = nullptr;
	CDSerialConnector *serial_connector = nullptr;

	CDMainWindow(QWidget *parent = nullptr);
	~CDMainWindow();
	/** @brief update user interface */
	virtual void update();
	/** @brief menu bar refresh action handler */
	virtual void menu_refresh();
	/** @brief menu bar add automation action handler */
	virtual void menu_add_automation();
	/** @brief menu bar set serial port action handler */
	void menu_set_serial_port(string new_port);
};