-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettingsdialog.h
69 lines (51 loc) · 1.3 KB
/
settingsdialog.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#include "ui_settingsdialog.h"
#include <QDialog>
#include <QSerialPort>
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
enum class InterpretType
{
TYPE_RAW,
TYPE_STRING
};
struct Settings
{
QString name;
qint32 baudRate;
QString stringBaudRate;
QSerialPort::DataBits dataBits;
QString stringDataBits;
QSerialPort::Parity parity;
QString stringParity;
QSerialPort::StopBits stopBits;
QString stringStopBits;
QSerialPort::FlowControl flowControl;
QString stringFlowControl;
InterpretType txType;
InterpretType rxType;
};
explicit SettingsDialog(QWidget * parent);
Settings getSettings();
signals:
void refreshRequest();
void settingsApplied(SettingsDialog::Settings*);
private slots:
void showPortInfo(int idx);
void apply();
void checkCustomBaudRatePolicy(int idx);
void checkCustomDevicePathPolicy(int idx);
void refreshBtn_clicked();
private:
void fillPortsParameters();
void fillPortsInfo();
void updateSettings();
private:
Ui::SettingsDialog m_ui{};
Settings m_currentSettings{};
QIntValidator m_intValidator{0, 4000000, this};
};
#endif // SETTINGSDIALOG_H