78 lines
1.5 KiB
C++
78 lines
1.5 KiB
C++
#ifndef WIDGET_H
|
|
#define WIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QDebug>
|
|
#include <QMessageBox>
|
|
#include <QSerialPort>
|
|
#include <QSerialPortInfo>
|
|
#include <QCloseEvent>
|
|
#include <QRegExp>
|
|
#include <QRegExpValidator>
|
|
#include <QLabel>
|
|
#include <QThread>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class Widget; }
|
|
QT_END_NAMESPACE
|
|
|
|
class Widget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Widget(QWidget *parent = nullptr);
|
|
~Widget();
|
|
|
|
private slots:
|
|
void on_SerialPort_refresh_pushButton_clicked();
|
|
|
|
void on_Open_Serial_pushButton_clicked();
|
|
|
|
void on_get_data_pushButton_clicked();
|
|
|
|
//槽函数
|
|
void get_configdata(void);
|
|
void getIdData(void);
|
|
void write_ack(void);
|
|
|
|
void on_pushButton_clicked();
|
|
|
|
void on_pushButton_2_clicked();
|
|
|
|
void on_pushButton_3_clicked();
|
|
|
|
void on_pushButton_4_clicked();
|
|
|
|
void on_pushButton_5_clicked();
|
|
|
|
void on_pushButton_6_clicked();
|
|
|
|
void on_pushButton_7_clicked();
|
|
|
|
void on_Get_ID_pushButton_clicked();
|
|
|
|
void on_Trans_password_pushButton_clicked();
|
|
|
|
void on_pushButton_8_clicked();
|
|
|
|
private:
|
|
Ui::Widget *ui;
|
|
//关闭窗口提示
|
|
void closeEvent(QCloseEvent *event) override;
|
|
//关闭控件
|
|
void disable__(void);
|
|
//打开控件
|
|
void able__(void);
|
|
//crc校验
|
|
uint16_t modbusCrc16(const uint8_t *data, const int len);
|
|
//加密
|
|
void tea_encrypt(uint32_t *v, uint32_t *k);
|
|
//串口
|
|
QSerialPort * Serial_port;
|
|
|
|
QLabel *error1_status_label[16];
|
|
|
|
};
|
|
#endif // WIDGET_H
|