Files
CodeRepository/Samples/Sample.BaiduMap/DeviceStatusPanel.h
chenzhen 222dda1e43 1,新增“App_ThermalImageSystem”;
2,新增“Apps”;
3,新增“Common”;
4,新增“FileList”;
5,新增“MediaX”;
6,新增“OpenSource”;
7,新增“Samples”;
8,新增“SoftwareBusinessLines”.
2026-02-14 23:03:23 +08:00

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