59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
#ifndef USETTINGSRS_H
|
|
#define USETTINGSRS_H
|
|
|
|
#include <QWidget>
|
|
#include "QtSerialPort/QSerialPort"
|
|
|
|
namespace Ui {
|
|
class USettingsRS;
|
|
}
|
|
|
|
class QIntValidator;
|
|
|
|
class USettingsRS : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
void AfterDisconnection();
|
|
void AfterConnection();
|
|
|
|
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;
|
|
bool localEchoEnabled;
|
|
};
|
|
explicit USettingsRS(QWidget *parent = nullptr);
|
|
~USettingsRS();
|
|
|
|
Settings m_currentSettings;
|
|
void device_connect();
|
|
private slots:
|
|
void showPortInfo(int idx);
|
|
void apply();
|
|
void checkCustomBaudRatePolicy(int idx);
|
|
void checkCustomDevicePathPolicy(int idx);
|
|
|
|
private:
|
|
|
|
void fillPortsParameters();
|
|
void fillPortsInfo();
|
|
void updateSettings();
|
|
|
|
private:
|
|
Ui::USettingsRS *m_ui = nullptr;
|
|
|
|
QIntValidator *m_intValidator = nullptr;
|
|
};
|
|
|
|
#endif // USETTINGSRS_H
|