com_client/sipm_deubg_qt.h

44 lines
941 B
C++

#ifndef SIPM_DEUBG_QT_H
#define SIPM_DEUBG_QT_H
#include <qtimer.h>
#include <QMainWindow>
#include <QSerialPort>
QT_BEGIN_NAMESPACE
namespace Ui {
class sipm_deubg_qt;
}
QT_END_NAMESPACE
class sipm_deubg_qt : public QMainWindow {
Q_OBJECT
QSerialPort *serial;
public:
sipm_deubg_qt(QWidget *parent = nullptr);
~sipm_deubg_qt();
void load_default_settings();
void open_com_port();
void close_com_port();
void lock_config_ui();
void unlock_config_ui();
void sipm_cmd_send(int cmd , char *data, int len);
void sipm_read_gain();
void sipm_read_SN();
void sipm_read_temp();
void sipm_set_gain();
public slots:
void data_append();
void scan_com_port();
void start_scan_com_port();
private:
Ui::sipm_deubg_qt *ui;
QTimer *scan_com;
};
#define CHECK_SERRIAL_IS_OPEN() if (serial == nullptr || !serial->isOpen()) { \
return; \
}
#endif // SIPM_DEUBG_QT_H