39 lines
1003 B
C
39 lines
1003 B
C
|
#ifndef CONNECTIONSETTINGWIDGET_H
|
|||
|
#define CONNECTIONSETTINGWIDGET_H
|
|||
|
|
|||
|
#include <QWidget>
|
|||
|
#include "serialConnection.h"
|
|||
|
|
|||
|
namespace Ui {
|
|||
|
class ConnectionSettingWidget;
|
|||
|
}
|
|||
|
|
|||
|
class ConnectionSettingWidget : public QWidget
|
|||
|
{
|
|||
|
Q_OBJECT
|
|||
|
|
|||
|
public:
|
|||
|
explicit ConnectionSettingWidget(QWidget *parent = nullptr);
|
|||
|
explicit ConnectionSettingWidget(const QString &proto,QWidget *parent = nullptr);
|
|||
|
~ConnectionSettingWidget();
|
|||
|
void setProtocol(const QString &proto);
|
|||
|
void setParam(const QMap<QString,QString> ¶);
|
|||
|
bool isConnected();
|
|||
|
std::shared_ptr<SerialConnection> getConnection();
|
|||
|
QMap<QString,QString> getParam();
|
|||
|
signals:
|
|||
|
|
|||
|
public slots:
|
|||
|
void on_cmbCom_clicked();
|
|||
|
void on_toolBtnConnectSerial_clicked();
|
|||
|
|
|||
|
private:
|
|||
|
Ui::ConnectionSettingWidget *ui;
|
|||
|
QString protocol;
|
|||
|
void refreshComList();
|
|||
|
bool bSerialConnected = false;
|
|||
|
std::shared_ptr<SerialConnection> serialConnection;
|
|||
|
};
|
|||
|
|
|||
|
#endif // CONNECTIONSETTINGWIDGET_H
|