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.
85 lines
1.8 KiB
85 lines
1.8 KiB
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QSettings>
|
|
|
|
#include "waitdialog.h"
|
|
|
|
#include "api.h"
|
|
|
|
#define BIN_FILE_PATH "binFilePath"
|
|
#define FPGA_FILE_PATH "fpgaFilePath"
|
|
#define BIN_OFFSET "binOffset"
|
|
#define BIN_BAR_INDEX "binBarIndex"
|
|
#define REG_ACCESS_SEL "regAccessType"
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class MainWindow; }
|
|
QT_END_NAMESPACE
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
private slots:
|
|
void on_btn_browse_clicked();
|
|
|
|
void on_btn_binUpload_clicked();
|
|
|
|
void on_btn_binVerify_clicked();
|
|
|
|
void on_rbtn_reg_toggled(bool checked);
|
|
|
|
void on_rbtn_offset_toggled(bool checked);
|
|
|
|
void on_btn_readReg_clicked();
|
|
|
|
void on_btn_writeReg_clicked();
|
|
|
|
void newBlockProgressValue(int percentage);
|
|
|
|
void newFpgaProgressValue(int percentage);
|
|
|
|
void newBlockProgressVisibility(bool show);
|
|
|
|
void newFpgaProgressVisibility(bool show);
|
|
|
|
void on_btn_fpgaBrowse_clicked();
|
|
|
|
void on_btn_fpgaProgram_clicked();
|
|
|
|
void newMessage(QString message);
|
|
|
|
void threadFinished();
|
|
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
|
|
WaitDialog* _dial;
|
|
|
|
QSettings* _settings;
|
|
|
|
UltraSoundDevice* _usd;
|
|
|
|
void binaryFileUploader(quint32 bar, quint32 offset, QString path);
|
|
void binaryFileVerifier(quint32 bar, quint32 offset, QString path);
|
|
void fpgaProgrammer(quint32 bar, quint32 offset, QString path);
|
|
quint32 byteArrayTo32LittleEndian(QByteArray data);
|
|
quint32 byteArrayTo32BigEndian(QByteArray data);
|
|
|
|
signals:
|
|
void updateBlockProgressValue(int percentage);
|
|
void updateFpgaProgressValue(int percentage);
|
|
void updateBlockProgressVisibility(bool show);
|
|
void updateFpgaProgressVisibility(bool show);
|
|
void showMessage(QString message);
|
|
|
|
};
|
|
#endif // MAINWINDOW_H
|
|
|