2,新增“Apps”; 3,新增“Common”; 4,新增“FileList”; 5,新增“MediaX”; 6,新增“OpenSource”; 7,新增“Samples”; 8,新增“SoftwareBusinessLines”.
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
#ifndef DEVICESTATUSPANEL_H
|
|
#define DEVICESTATUSPANEL_H
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
#include <QSerialPort>
|
|
|
|
namespace Ui {
|
|
class DeviceStatusPanel;
|
|
}
|
|
|
|
class DeviceStatusPanel : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
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;
|
|
};
|
|
|
|
public:
|
|
explicit DeviceStatusPanel(QWidget *parent = nullptr);
|
|
~DeviceStatusPanel();
|
|
|
|
protected:
|
|
void FillPortsParameters();
|
|
void FillPortsInfo();
|
|
void UpdateSettings();
|
|
|
|
void OpenSerialPort();
|
|
void CloseSerialPort();
|
|
|
|
private slots:
|
|
void OnClicked_OpenCloseSerialPort();
|
|
|
|
private:
|
|
Ui::DeviceStatusPanel *ui;
|
|
|
|
Settings m_varSerialPortSettings;
|
|
bool m_bIsOpen_SerialPort;
|
|
QSerialPort* m_pSerialPort;
|
|
};
|
|
|
|
#endif // DEVICESTATUSPANEL_H
|