You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
157 lines
3.4 KiB
157 lines
3.4 KiB
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QtCore/QVariant>
|
|
#include <QtWidgets/QAction>
|
|
#include <QtWidgets/QApplication>
|
|
#include <QtWidgets/QGridLayout>
|
|
#include <QtWidgets/QLabel>
|
|
#include <QtWidgets/QMainWindow>
|
|
#include <QtWidgets/QMenu>
|
|
#include <QtWidgets/QMenuBar>
|
|
#include <QtWidgets/QPushButton>
|
|
#include <QtWidgets/QStatusBar>
|
|
#include <QtWidgets/QTextBrowser>
|
|
#include <QtWidgets/QTextEdit>
|
|
#include <QtWidgets/QWidget>
|
|
//
|
|
|
|
#include <fstream>
|
|
#include <functional>
|
|
#include <iostream>
|
|
#include <list>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <set>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "logger.hpp"
|
|
#include "qfunction.hpp"
|
|
#include "zexception.hpp"
|
|
#include "zqthread.hpp"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
QT_END_NAMESPACE
|
|
|
|
typedef enum {
|
|
kreg_val_type_dotted_hex, // 点分16进制
|
|
kreg_val_type_dotted_decimal, // 点分10进制
|
|
kreg_val_type_str,
|
|
kreg_val_type_hex,
|
|
kreg_val_type_decimal,
|
|
kreg_val_type_binary,
|
|
kreg_val_type_freq,
|
|
kreg_val_type_signal,
|
|
} reg_val_type_t;
|
|
|
|
class DispalyRegIterm {
|
|
public:
|
|
QLabel *label = 0;
|
|
QTextBrowser *regBrowser = 0;
|
|
QTextEdit *regEditer = 0;
|
|
QPushButton *writerButton = 0;
|
|
uint32_t regvalcache;
|
|
reg_val_type_t regvaltype;
|
|
};
|
|
|
|
class MainWindow : public QMainWindow {
|
|
Q_OBJECT
|
|
|
|
private:
|
|
std::map<int32_t, DispalyRegIterm *> m_regdisplayer;
|
|
|
|
std::unique_ptr<iflytop::ZQThread> m_thread;
|
|
|
|
public:
|
|
Ui::MainWindow *ui;
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
void constructUI();
|
|
|
|
private slots:
|
|
void doinui_slot(QFunction);
|
|
void on_readDeviceVersion_clicked();
|
|
|
|
void on_readDeviceState_clicked();
|
|
|
|
void on_readTime_clicked();
|
|
|
|
void on_syncTime_clicked();
|
|
|
|
void on_readAllRecords_clicked();
|
|
|
|
void on_startUploadRecord_clicked();
|
|
|
|
void on_readSensorInfo_clicked();
|
|
|
|
void on_readSN_clicked();
|
|
|
|
void on_stopUploadRecord_clicked();
|
|
|
|
void on_delRecord_clicked();
|
|
#if 0
|
|
void on_startCapture_clicked();
|
|
|
|
void on_stopCapture_clicked();
|
|
#endif
|
|
|
|
void on_startRealtimeReport_clicked();
|
|
|
|
void on_stopRealtimeReport_clicked();
|
|
|
|
void on_clearPreview_clicked();
|
|
|
|
void on_TestCmd_readSubIcRegs_clicked();
|
|
|
|
void on_TestCmd_writeSubICReg_clicked();
|
|
|
|
void on_TestCmd_startCapture_clicked();
|
|
|
|
void on_TestCmd_stopCapture_clicked();
|
|
|
|
void on_TestCmd_writeSubICRegMask_clicked();
|
|
|
|
void on_TestCmd_changeECGSrcToSquareWave_clicked();
|
|
|
|
void on_resetDevice_clicked();
|
|
|
|
void on_FilterUpdateParameter_clicked();
|
|
|
|
void on_buttonTabWidget_currentChanged(int index);
|
|
|
|
void on_TestCmd_writeSubICAllReg_clicked();
|
|
|
|
void on_setEcgInTestMode_clicked();
|
|
|
|
void on_setEcgInNormalMode_clicked();
|
|
|
|
void on_setEcgReportDataInRawMode__1_clicked();
|
|
|
|
void on_setEcgReportDataInRawMode__0_clicked();
|
|
|
|
signals:
|
|
void doinui_signal(QFunction);
|
|
|
|
private:
|
|
static void log_output(QtMsgType type, const QMessageLogContext &context, const QString &msg);
|
|
void ishow(const char *fmt, ...);
|
|
void instructionPreviewClear();
|
|
void reportPreviewShow(const char *fmt, ...);
|
|
void blockDataUploadPreviewShow(const char *fmt, ...);
|
|
void rawDataPreviewShow(const char *fmt, ...);
|
|
|
|
void displayWave(int16_t wave1, int16_t wave2, int16_t wave3);
|
|
|
|
void displayInfo(bool suc, QString info);
|
|
|
|
private:
|
|
void processException(std::zexception &e);
|
|
};
|
|
#endif // MAINWINDOW_H
|