Erste lauffähige Version
This commit is contained in:
41
include/connectdialog.h
Normal file
41
include/connectdialog.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <QDialog>
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFormLayout>
|
||||
#include <QSerialPort>
|
||||
#include <QSerialPortInfo>
|
||||
|
||||
struct SerialConfig {
|
||||
QString portName;
|
||||
qint32 baudRate = 115200;
|
||||
QSerialPort::DataBits dataBits = QSerialPort::Data8;
|
||||
QSerialPort::Parity parity = QSerialPort::NoParity;
|
||||
QSerialPort::StopBits stopBits = QSerialPort::OneStop;
|
||||
QSerialPort::FlowControl flowControl = QSerialPort::NoFlowControl;
|
||||
QString logFilePath; // empty = no logging
|
||||
};
|
||||
|
||||
class ConnectDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConnectDialog(QWidget *parent = nullptr);
|
||||
|
||||
SerialConfig config() const;
|
||||
|
||||
private slots:
|
||||
void browseLogFile();
|
||||
void refreshPorts();
|
||||
|
||||
private:
|
||||
QComboBox *m_portCombo = nullptr;
|
||||
QComboBox *m_baudCombo = nullptr;
|
||||
QComboBox *m_dataBitsCombo = nullptr;
|
||||
QComboBox *m_parityCombo = nullptr;
|
||||
QComboBox *m_stopBitsCombo = nullptr;
|
||||
QComboBox *m_flowCombo = nullptr;
|
||||
QLineEdit *m_logPathEdit = nullptr;
|
||||
};
|
||||
Reference in New Issue
Block a user