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.
328 lines
7.0 KiB
328 lines
7.0 KiB
4 years ago
|
#ifndef MAINWINDOW_H
|
||
|
#define MAINWINDOW_H
|
||
|
|
||
|
#include <QTimer>
|
||
|
#include <QLabel>
|
||
|
#include <QList>
|
||
|
#include <QDebug>
|
||
|
#include <QSettings>
|
||
|
#include <QtConcurrent/QtConcurrent>
|
||
|
#include <QMessageBox>
|
||
|
#include <QFileDialog>
|
||
|
#include <QMainWindow>
|
||
|
#include "include/model/hardware/core/TrxBoard.h"
|
||
|
#include "api.h"
|
||
|
|
||
|
#define MESSAGE_BOX(M) \
|
||
|
emit showMessage(M)
|
||
|
|
||
|
#define SCENARIO_FILE_PATH "scenarioFilePath"
|
||
|
#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 HV_ON "HV_On"
|
||
|
#define HV_OFF "HV_Off"
|
||
|
|
||
|
#define MOTOR_ON "Motor_On"
|
||
|
#define MOTOR_OFF "Motor_Off"
|
||
|
|
||
|
#define PWR1_ON "Pwr1_On"
|
||
|
#define PWR1_OFF "Pwr1_Off"
|
||
|
|
||
|
#define PWR2_ON "Pwr2_On"
|
||
|
#define PWR2_OFF "Pwr2_Off"
|
||
|
|
||
|
#define PWR3_ON "Pwr3_On"
|
||
|
#define PWR3_OFF "Pwr3_Off"
|
||
|
|
||
|
#define PWR4_ON "Pwr4_On"
|
||
|
#define PWR4_OFF "Pwr4_Off"
|
||
|
|
||
|
#define TRIG_ON "Trig_On"
|
||
|
#define TRIG_OFF "Trig_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"
|
||
|
|
||
|
|
||
|
QT_BEGIN_NAMESPACE
|
||
|
namespace Ui { class MainWindow; }
|
||
|
QT_END_NAMESPACE
|
||
|
|
||
|
class MainWindow : public QMainWindow
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
MainWindow(QWidget *parent = nullptr);
|
||
|
~MainWindow();
|
||
|
|
||
|
private:
|
||
|
Ui::MainWindow *ui;
|
||
|
|
||
|
TrxBoard trx;
|
||
|
|
||
|
//WaitDialog* _dial;
|
||
|
|
||
|
QSettings* _settings;
|
||
|
|
||
|
UltraSoundDevice* _usd;
|
||
|
|
||
|
QTimer* _timer;
|
||
|
|
||
|
int _counter = 0;
|
||
|
|
||
|
bool _run;
|
||
|
|
||
|
BoardsCtrlMngt* _bCtrl;
|
||
|
|
||
|
ReceiverConfiguration* _receiveConfig;
|
||
|
void setReceiverConfiguration (void);
|
||
|
|
||
|
QList<quint32> _lineFilter;
|
||
|
void setLineFilter (void);
|
||
|
|
||
|
QList<quint32> _freq;
|
||
|
void setFreqLut (void);
|
||
|
|
||
|
QList<quint32> _stb;
|
||
|
void setStbCoeff (void);
|
||
|
|
||
|
QList<quint32> _dTgc;
|
||
|
void setDTgc (void);
|
||
|
|
||
|
QList<QList<quint32>> _aTgc;
|
||
|
void setATgc (void);
|
||
|
|
||
|
QList<QList<quint32>> _blendWeight;
|
||
|
void setBlendWeight (void);
|
||
|
|
||
|
QList<QList<quint32>> _lpf;
|
||
|
void setLpf (void);
|
||
|
|
||
|
//void fpgaProgrammer(QString path);
|
||
|
|
||
|
void timeout();
|
||
|
|
||
|
void changeLabelTextColor(QLabel* label, QColor color);
|
||
|
|
||
|
private slots:
|
||
|
|
||
|
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, QProgressBar* prg);
|
||
|
// void newFpgaProgressValue(int percentage);
|
||
|
|
||
|
// void newBlockProgressVisibility(bool show, QProgressBar* prg);
|
||
|
|
||
|
// void newFpgaProgressVisibility(bool show);
|
||
|
|
||
|
|
||
|
void on_btn_fpgaBrowse_clicked();
|
||
|
|
||
|
void on_btn_fpgaProgram_clicked();
|
||
|
|
||
|
void newMessage(QString message);
|
||
|
|
||
|
// void threadFinished();
|
||
|
|
||
|
// void on_btn_scenarioBrowse_clicked();
|
||
|
|
||
|
// void on_btn_scenarioVerify_clicked();
|
||
|
|
||
|
// void on_btn_ParamBrowse_clicked();
|
||
|
|
||
|
// void on_btn_scenarioUpload_clicked();
|
||
|
|
||
|
// void on_btn_scenarioStartStop_clicked();
|
||
|
|
||
|
// void on_btn_scenarioPauseResume_clicked();
|
||
|
|
||
|
// void on_btn_txDacBrowse_clicked();
|
||
|
|
||
|
// void on_btn_txDacUpload_clicked();
|
||
|
|
||
|
// void on_btn_txDacStartStop_clicked();
|
||
|
|
||
|
// void on_btn_txDacOnOff_clicked();
|
||
|
|
||
|
void on_cb_selectedProbe_currentIndexChanged(int index);
|
||
|
|
||
|
// void on_btn_pllClkSt_clicked();
|
||
|
|
||
|
// void on_btn_pllClkTps_clicked();
|
||
|
|
||
|
// void on_btn_HVOnOff_clicked();
|
||
|
|
||
|
// void on_btn_motorOnOff_clicked();
|
||
|
|
||
|
// void on_btn_pwr1OnOff_clicked();
|
||
|
|
||
|
// void on_btn_pwr2OnOff_clicked();
|
||
|
|
||
|
// void on_btn_pwr3OnOff_clicked();
|
||
|
|
||
|
// void on_btn_pwr4OnOff_clicked();
|
||
|
|
||
|
void delay(int ms);
|
||
|
|
||
|
// float resDiv(uint32_t r1, uint32_t r2, uint adcValue);
|
||
|
|
||
|
// void on_btn_mulDacTrig_clicked();
|
||
|
|
||
|
// void on_btn_thsdStateUpdate_clicked();
|
||
|
|
||
|
// void on_pushButton_3_clicked();
|
||
|
|
||
|
// void on_btn_hvRegulatorConfig_clicked();
|
||
|
|
||
|
// void on_btn_pm5RegulatorConfig_clicked();
|
||
|
|
||
|
// void on_btn_pwrDacsEnable_clicked();
|
||
|
|
||
|
// void on_btn_DacsOnOff_clicked();
|
||
|
|
||
|
void on_btn_updateRdbackValue_clicked();
|
||
|
|
||
|
// void on_btn_supJump_clicked();
|
||
|
|
||
|
// void on_chk_sup24v_stateChanged(int arg1);
|
||
|
|
||
|
|
||
|
// void on_btn_dmaStart_2_clicked();
|
||
|
|
||
|
// void on_btn_dmaStop_2_clicked();
|
||
|
|
||
|
// void on_btn_dmaBrowse_2_clicked();
|
||
|
|
||
|
// void on_btn_dmaShow_2_clicked();
|
||
|
|
||
|
// void on_chk_usrMulDac_stateChanged(int arg1);
|
||
|
|
||
|
// void on_btn_afeProg_clicked();
|
||
|
|
||
|
// void on_btn_gtReg_clicked();
|
||
|
|
||
|
// void on_btn_browse_clicked();
|
||
|
|
||
|
// void on_btn_dbgTransferStrt_clicked();
|
||
|
|
||
|
// void on_btn_adcLoggerStrt_clicked();
|
||
|
|
||
|
// void on_prg_adcLoggerFileWr_valueChanged(int value);
|
||
|
|
||
|
// void on_btn_adcSimBrowse_clicked();
|
||
|
|
||
|
// void on_btn_adcSimStart_clicked();
|
||
|
|
||
|
// void on_btn_adcLoggerAutoCount_clicked();
|
||
|
|
||
|
// void on_btn_eepromTest_clicked();
|
||
|
|
||
|
// void on_btn_scenRead_clicked();
|
||
|
|
||
|
// void on_btn_getFpgaVersion_clicked();
|
||
|
|
||
|
// void on_btn_txTrig_clicked();
|
||
|
|
||
|
//private:
|
||
|
|
||
|
|
||
|
|
||
|
// QString _logFolder = "/home/hasis/Desktop/TrxBoardFile/_log/dma/";
|
||
|
// QString _adcloggerFolder = "/home/hasis/Desktop/TrxBoardFile/_log/adc/";
|
||
|
// QVector<QByteArray> _dmaBuffer;
|
||
|
// QByteArray _lastBuffer;
|
||
|
// QMutex _mutex;
|
||
|
// int _dmaLogCount = 0;
|
||
|
// bool _dmaRun;
|
||
|
// bool _dmaLog = false;
|
||
|
// bool _csvReadStopFlag = false;
|
||
|
// bool _adcLoggerDone = false;
|
||
|
// bool _adcLoggerTrnsDone = false;
|
||
|
// int _swCounter;
|
||
|
// int _hwCounter;
|
||
|
|
||
|
// void readPcie();
|
||
|
// void logPcie();
|
||
|
|
||
|
// void adcLoggerStatusCheck();
|
||
|
|
||
|
// QString WhichFpgaFailed(quint32 status);
|
||
|
// void binFileUploader(quint32 bar, quint32 offset, QString path, QProgressBar* prg);
|
||
|
// void binAdcFileUploader(quint32 bar, QString path, QProgressBar* prg);
|
||
|
// void CsvFileUploader(quint32 bar, QString path, QProgressBar *prg);
|
||
|
// void CsvFileChecker(quint32 bar, QString pathBase, QString pathTarget, QProgressBar* prg);
|
||
|
// void AdcLogCsvFileWriter(QString folderPath, QProgressBar* prg);
|
||
|
// void scenarioFileVerifier(quint32 bar, quint32 offset, QString path);
|
||
|
//
|
||
|
// quint64 byteArrayTo64LittleEndian(QByteArray data);
|
||
|
// quint32 byteArrayTo32LittleEndian(QByteArray data);
|
||
|
// quint32 byteArrayTo32BigEndian(QByteArray data);
|
||
|
|
||
|
//
|
||
|
|
||
|
// void scenarioStart();
|
||
|
// void scenarioStop();
|
||
|
|
||
|
// bool checkTermalShutdown(quint8 value);
|
||
|
|
||
|
|
||
|
void on_btn_receiveConfig_clicked();
|
||
|
|
||
|
void on_btn_lineFilter_clicked();
|
||
|
|
||
|
void on_btn_freqLut_clicked();
|
||
|
|
||
|
void on_btn_blendWeight_clicked();
|
||
|
|
||
|
void on_btn_atgc_clicked();
|
||
|
|
||
|
void on_btn_dtgc_clicked();
|
||
|
|
||
|
void on_btn_lpf_clicked();
|
||
|
|
||
|
void on_btn_stbCoeff_clicked();
|
||
|
|
||
|
void on_btn_setAtgcMode_clicked();
|
||
|
|
||
|
signals:
|
||
|
// void updateBlockProgressValue(int percentage, QProgressBar* prg);
|
||
|
// void updateFpgaProgressValue(int percentage);
|
||
|
|
||
|
// void updateBlockProgressVisibility(bool show, QProgressBar* prg);
|
||
|
// void updateFpgaProgressVisibility(bool show);
|
||
|
|
||
|
void showMessage(QString message);
|
||
|
|
||
|
};
|
||
|
#endif // MAINWINDOW_H
|
||
|
|