|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QTime>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QList>
|
|
|
|
#include <QString>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QtConcurrent/QtConcurrent>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QColormap>
|
|
|
|
#include <QProgressDialog>
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <QFuture>
|
|
|
|
#include <QFutureWatcher>
|
|
|
|
#include <QMovie>
|
|
|
|
#include <QElapsedTimer>
|
|
|
|
|
|
|
|
#include "qcustomplot.h"
|
|
|
|
#include "include/model/hardware/core/TrxBoard.h"
|
|
|
|
#include "hdf5Scenario/hdf5Scenario.h"
|
|
|
|
#include "api.h"
|
|
|
|
|
|
|
|
#define MESSAGE_BOX(M) \
|
|
|
|
emit showMessage(M)
|
|
|
|
|
|
|
|
#define SCENARIO_FILE_PATH "scenarioFilePath"
|
|
|
|
#define BITE_FILE_PATH "biteFilePath"
|
|
|
|
#define ADC_SIM_FILE_PATH "adcSimFilePath"
|
|
|
|
#define PARAM_FILE_PATH "paramFilePath"
|
|
|
|
#define TX_DAC_FILE_PATH "txDacFilePath"
|
|
|
|
#define FPGA_FILE_PATH "fpgaFilePath"
|
|
|
|
#define REG_ACCESS_SEL "regAccessType"
|
|
|
|
|
|
|
|
|
|
|
|
#define START "Start"
|
|
|
|
#define STOP "Stop"
|
|
|
|
|
|
|
|
#define PAUSE "Pause"
|
|
|
|
#define RESUME "Resume"
|
|
|
|
|
|
|
|
#define ON "On"
|
|
|
|
#define OFF "Off"
|
|
|
|
|
|
|
|
#define THSD_State_Update "THSD State Update"
|
|
|
|
|
|
|
|
#define DACS_ENABLE "DACs_Enable"
|
|
|
|
|
|
|
|
#define UPDATE "Update"
|
|
|
|
|
|
|
|
#define VALID "Valid"
|
|
|
|
|
|
|
|
#define ENABLE "Enable"
|
|
|
|
#define DISABLE "Disable"
|
|
|
|
|
|
|
|
#define TRANSFER_LENGTH 128 * 1024
|
|
|
|
#define TRANSFER_RATE 30.0f
|
|
|
|
#define RAM_BUFFER_OFFSET 0U
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
|
|
|
|
TrxBoard _trx;
|
|
|
|
|
|
|
|
QMovie *movie;
|
|
|
|
|
|
|
|
QSettings* _settings;
|
|
|
|
|
|
|
|
UltraSoundDevice* _usd;
|
|
|
|
|
|
|
|
QMutex _mutex;
|
|
|
|
|
|
|
|
QCPColorMap *_colorMap;
|
|
|
|
|
|
|
|
QFutureWatcher<void> biteLogWatcher;
|
|
|
|
|
|
|
|
QFutureWatcher<void> dmaLogWatcher;
|
|
|
|
|
|
|
|
static QThread* _uiThread;
|
|
|
|
|
|
|
|
QTimer* _timeout;
|
|
|
|
|
|
|
|
QEventLoop loop;
|
|
|
|
|
|
|
|
QTimer delayTimer;
|
|
|
|
|
|
|
|
EmulatorProperties* _emul;
|
|
|
|
|
|
|
|
BoardsCtrlMngt* _bCtrl;
|
|
|
|
|
|
|
|
SupervisorRbValue* _supRbValue;
|
|
|
|
|
|
|
|
MpsFaultStatus* _faultStatus;
|
|
|
|
|
|
|
|
HealthStatus* _healStatus;
|
|
|
|
|
|
|
|
FpgaCodeVersion* _version;
|
|
|
|
|
|
|
|
StatusVec* _vec;
|
|
|
|
|
|
|
|
PrbCase* _prb;
|
|
|
|
|
|
|
|
AfeConfig _afeConfig;
|
|
|
|
|
|
|
|
void setScenarioCompare(const QString& scenPath);
|
|
|
|
|
|
|
|
void timeout();
|
|
|
|
|
|
|
|
void delay(int ms);
|
|
|
|
|
|
|
|
const QString enum2String (ePg state) const;
|
|
|
|
|
|
|
|
void changeLabelTextColor(QLabel* label, QColor color);
|
|
|
|
|
|
|
|
void setAfeConfig (void);
|
|
|
|
|
|
|
|
void logPcie(QString logPath, quint32 logCount);
|
|
|
|
|
|
|
|
void continuousFrameRepresent(void);
|
|
|
|
|
|
|
|
QByteArray str2ByteArray (QString& str);
|
|
|
|
|
|
|
|
QString uint2IdString (quint32& id);
|
|
|
|
|
|
|
|
QString byteArray2InfoString (QByteArray& arr);
|
|
|
|
|
|
|
|
QString releaseCodeVersion (quint32 &value);
|
|
|
|
|
|
|
|
void getProbeColor (const QBrush brush, const int item);
|
|
|
|
|
|
|
|
void gifActive(void);
|
|
|
|
|
|
|
|
void biteLogThreadFinished();
|
|
|
|
|
|
|
|
void dmaLogThreadFinished();
|
|
|
|
|
|
|
|
void dmaLogLayoutVisible(bool show);
|
|
|
|
|
|
|
|
QString _biteLogFolder = "/home/hasis/Desktop/TrxBoardFile/_log/BITe/";
|
|
|
|
QString _dmaLogFolder = "/home/hasis/Desktop/TrxBoardFile/_log/dma/";
|
|
|
|
QString _emulFolder = "/home/hasis/Desktop/TrxBoardFile/emulator/";
|
|
|
|
|
|
|
|
QVector<QByteArray> _dmaBuffer;
|
|
|
|
QByteArray _lastBuffer;
|
|
|
|
quint32 _dmaLogCount;
|
|
|
|
quint16 _frameCount;
|
|
|
|
quint16 _batchIdBuff;
|
|
|
|
double_t fps;
|
|
|
|
double_t fpsBuf;
|
|
|
|
bool _dmaLog;
|
|
|
|
bool _dmaRun;
|
|
|
|
bool _dmaShow;
|
|
|
|
bool _getPacket;
|
|
|
|
bool _fpsFlag;
|
|
|
|
|
|
|
|
// uncrustify off
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void exitApp();
|
|
|
|
|
|
|
|
void setScenario(const string& h5Path);
|
|
|
|
|
|
|
|
void getFramePacket (QByteArray packet);
|
|
|
|
|
|
|
|
void getSramBinaryCreateFlag (void);
|
|
|
|
|
|
|
|
void getRegisterCsvCompareFlag (void);
|
|
|
|
|
|
|
|
void getSramVerifyMessage(QString message);
|
|
|
|
|
|
|
|
void getPrbChange();
|
|
|
|
|
|
|
|
void getFrameLost();
|
|
|
|
|
|
|
|
void getLabelState(QLabel* label, QString str, QColor color);
|
|
|
|
|
|
|
|
void getFpgaProgrammer (QString path);
|
|
|
|
|
|
|
|
void getProgrammingGif(void);
|
|
|
|
|
|
|
|
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 on_btn_fpgaBrowse_clicked();
|
|
|
|
|
|
|
|
void on_btn_fpgaProgram_clicked();
|
|
|
|
|
|
|
|
void newMessage(QString message);
|
|
|
|
|
|
|
|
void on_cb_selectedProbe_currentIndexChanged(int index);
|
|
|
|
|
|
|
|
void on_btn_updateRdbackValue_clicked();
|
|
|
|
|
|
|
|
void on_btn_supJump_clicked();
|
|
|
|
|
|
|
|
void on_btn_setAo_clicked();
|
|
|
|
|
|
|
|
void on_btn_getFpgaVersion_clicked();
|
|
|
|
|
|
|
|
void on_btn_setAtgcMode_clicked();
|
|
|
|
|
|
|
|
void on_btn_scenStart_clicked();
|
|
|
|
|
|
|
|
void on_btn_emulator_clicked();
|
|
|
|
|
|
|
|
void on_btn_dmaShow_clicked();
|
|
|
|
|
|
|
|
void on_btn_dmaLogLast_clicked();
|
|
|
|
|
|
|
|
void on_btn_afeRead_clicked();
|
|
|
|
|
|
|
|
void on_chk_continuousShowing_clicked();
|
|
|
|
|
|
|
|
void show3d();
|
|
|
|
|
|
|
|
void show2d();
|
|
|
|
|
|
|
|
void catchLogCount(quint32 counter, quint32 logRange, QProgressDialog* _progress);
|
|
|
|
|
|
|
|
void on_chk_mpsInit_clicked();
|
|
|
|
|
|
|
|
void on_btn_scenBrowse_clicked();
|
|
|
|
|
|
|
|
void on_btn_setScenario_clicked();
|
|
|
|
|
|
|
|
void on_btn_setScenVerification_clicked();
|
|
|
|
|
|
|
|
void on_btn_setIdx_clicked();
|
|
|
|
|
|
|
|
void on_btn_trxRomInfoWrite_clicked();
|
|
|
|
|
|
|
|
void on_btn_trxRomIdWrite_clicked();
|
|
|
|
|
|
|
|
void on_btn_mpsRomIdWrite_clicked();
|
|
|
|
|
|
|
|
void on_btn_mpsRomInfoWrite_clicked();
|
|
|
|
|
|
|
|
void on_btn_prbCtrlRomIdWrite_clicked();
|
|
|
|
|
|
|
|
void on_btn_prbCtrlRomInfoWrite_clicked();
|
|
|
|
|
|
|
|
void on_btn_prbRomImpulseRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_trxRomIdRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_trxRomInfoRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_mpsRomIdRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_mpsRomInfoRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_prbCtrlRomIdRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_prbCtrlRomInfoRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_prbRomIdRead_clicked();
|
|
|
|
|
|
|
|
void on_btn_scenInfo_clicked();
|
|
|
|
|
|
|
|
void on_btn_setBiteLog_clicked();
|
|
|
|
|
|
|
|
void on_btn_biteBrowse_clicked();
|
|
|
|
|
|
|
|
void on_btn_setAdcLog_clicked();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void showMessage(QString message);
|
|
|
|
void threeDReady();
|
|
|
|
void twoDReady();
|
|
|
|
void sendLogCount(quint32 counter, quint32 logRange, QProgressDialog* _progress);
|
|
|
|
void connectedPrbChange();
|
|
|
|
void frameLostCall();
|
|
|
|
void labelState(QLabel* label, QString str, QColor color);
|
|
|
|
void fpgaProgrammer(QString path);
|
|
|
|
void scenarioReady(const string& h5Path);
|
|
|
|
void programmingGif();
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|