From 85175143a4d31f1b9acd586368a9bf4a1906e60a Mon Sep 17 00:00:00 2001 From: Arash Aletayeb Date: Sun, 13 Jun 2021 13:19:26 +0200 Subject: [PATCH] The functions of scenPlayerStop & emulatorStop are added to setScenario The mpsDacsValues are changed to under 3v The scenPlayerStop function is called by selectProbe --- developHw.pro.user | 7 +- include/model/hardware/core/TrxBoard.h | 2 +- .../registerDefinition/ApodizationLut.h | 4 +- .../registerDefinition/ElementPositionLut.h | 2 +- .../register/dsp/registerDefinition/AtgcLut.h | 2 +- .../dsp/registerDefinition/BlendWeight.h | 2 +- .../register/dsp/registerDefinition/DtgcLut.h | 2 +- .../register/dsp/registerDefinition/LpfLut.h | 2 +- mainwindow.cpp | 237 +++++++++++++----- mainwindow.h | 14 +- mainwindow.ui | 201 +++++++++++---- qcustomplot.cpp | 0 qcustomplot.h | 0 src/model/hardware/core/TrxBoard.cpp | 12 +- .../boardsCtrlMngt/BoardsCtrlMngt.cpp | 12 +- .../core/register/fpgaProgram/FpgaProgram.cpp | 18 +- 16 files changed, 375 insertions(+), 142 deletions(-) mode change 100755 => 100644 qcustomplot.cpp mode change 100755 => 100644 qcustomplot.h diff --git a/developHw.pro.user b/developHw.pro.user index a7e59d4..404eb68 100644 --- a/developHw.pro.user +++ b/developHw.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -304,8 +304,8 @@ 2 developHw - - Qt4ProjectManager.Qt4RunConfiguration:/home/hasis/Desktop/Develop_HardwareTest/developHw/developHw.pro + developHw2 + Qt4ProjectManager.Qt4RunConfiguration:/home/hasis/Desktop/New/Develop_HardwareTest/developHw/developHw.pro 3768 false @@ -314,7 +314,6 @@ false false true - true /home/hasis/Desktop/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug diff --git a/include/model/hardware/core/TrxBoard.h b/include/model/hardware/core/TrxBoard.h index 630b649..0a877bc 100644 --- a/include/model/hardware/core/TrxBoard.h +++ b/include/model/hardware/core/TrxBoard.h @@ -202,7 +202,7 @@ public: void mpsReset(void) const; void mpsSetAo(float voltA, float voltB) const; - void selectProbe(eSelectProbe prbSel) const; + void selectProbe(eSelectProbe prbSel); void getHealthStatus(HealthStatus* healStat) const; //////////////////////////////// BPI Flash API ///////////////////////////////// diff --git a/include/model/hardware/core/register/beamFormer/registerDefinition/ApodizationLut.h b/include/model/hardware/core/register/beamFormer/registerDefinition/ApodizationLut.h index 1925bef..b335487 100644 --- a/include/model/hardware/core/register/beamFormer/registerDefinition/ApodizationLut.h +++ b/include/model/hardware/core/register/beamFormer/registerDefinition/ApodizationLut.h @@ -19,8 +19,8 @@ private: void prepareData(quint32 index) override { - apodizationPrp->setValue(_apodization.at(static_cast(index))); - //apodizationPrp->setValue(_apodization[static_cast(index)]); + //apodizationPrp->setValue(_apodization.at(static_cast(index))); + apodizationPrp->setValue(_apodization[static_cast(index)]); } public: diff --git a/include/model/hardware/core/register/beamFormer/registerDefinition/ElementPositionLut.h b/include/model/hardware/core/register/beamFormer/registerDefinition/ElementPositionLut.h index 0092a74..2ab9ba1 100644 --- a/include/model/hardware/core/register/beamFormer/registerDefinition/ElementPositionLut.h +++ b/include/model/hardware/core/register/beamFormer/registerDefinition/ElementPositionLut.h @@ -19,7 +19,7 @@ private: void prepareData(quint32 index) override { - elementPositionPrp->setValue(_elementPosition.at(static_cast(index))); + elementPositionPrp->setValue(_elementPosition[static_cast(index)]); } public: diff --git a/include/model/hardware/core/register/dsp/registerDefinition/AtgcLut.h b/include/model/hardware/core/register/dsp/registerDefinition/AtgcLut.h index 4f0b5a8..3dfb9b3 100644 --- a/include/model/hardware/core/register/dsp/registerDefinition/AtgcLut.h +++ b/include/model/hardware/core/register/dsp/registerDefinition/AtgcLut.h @@ -19,7 +19,7 @@ private: void prepareData(quint32 index) override { - atgcLut->setValue(_atgcLut.at(static_cast(index))); + atgcLut->setValue(_atgcLut[static_cast(index)]); } public: diff --git a/include/model/hardware/core/register/dsp/registerDefinition/BlendWeight.h b/include/model/hardware/core/register/dsp/registerDefinition/BlendWeight.h index 59ce65a..af1038b 100644 --- a/include/model/hardware/core/register/dsp/registerDefinition/BlendWeight.h +++ b/include/model/hardware/core/register/dsp/registerDefinition/BlendWeight.h @@ -19,7 +19,7 @@ private: void prepareData(quint32 index) override { - blendWeight->setValue(_blendWeight.at(static_cast(index))); + blendWeight->setValue(_blendWeight[static_cast(index)]); } public: diff --git a/include/model/hardware/core/register/dsp/registerDefinition/DtgcLut.h b/include/model/hardware/core/register/dsp/registerDefinition/DtgcLut.h index 040ec44..619a5cf 100644 --- a/include/model/hardware/core/register/dsp/registerDefinition/DtgcLut.h +++ b/include/model/hardware/core/register/dsp/registerDefinition/DtgcLut.h @@ -19,7 +19,7 @@ private: void prepareData(quint32 index) override { - dtgcLut->setValue(_dtLut.at(static_cast(index))); + dtgcLut->setValue(_dtLut[static_cast(index)]); } public: diff --git a/include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h b/include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h index be1edc8..12d6782 100644 --- a/include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h +++ b/include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h @@ -19,7 +19,7 @@ private: void prepareData(quint32 index) override { - lpfLut->setValue(_lpfLut.at(static_cast(index))); + lpfLut->setValue(_lpfLut[static_cast(index)]); } public: diff --git a/mainwindow.cpp b/mainwindow.cpp index 35e962e..f599998 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -51,7 +51,7 @@ MainWindow::MainWindow(QWidget *parent) ui->rbtn_reg->setChecked(_settings->value(REG_ACCESS_SEL).value()); ui->rbtn_offset->setChecked(!_settings->value(REG_ACCESS_SEL).value()); ui->tb_fpgaBit->setText(_settings->value(FPGA_FILE_PATH).value()); - ui->tb_h5File->setText(_settings->value(SCENARIO_FILE_PATH).value()); + ui->tb_scenFilesPath->setText(_settings->value(SCENARIO_FILE_PATH).value()); // connect(this, &MainWindow::updateBlockProgressValue, this, &MainWindow::newBlockProgressValue); // connect(this, &MainWindow::updateFpgaProgressValue, this, &MainWindow::newFpgaProgressValue); @@ -76,6 +76,7 @@ MainWindow::MainWindow(QWidget *parent) ui->btn_updateRdbackValue->setText(UPDATE); ui->l_detectedProbe->setText("None"); ui->btn_dmaLogLast->setHidden(true); + ui->btn_prbRomWrite->setDisabled(true); // uint32_t offsetdbgCmd[3] = {0x140000*4,0x240000*4,0x340000*4}; // auto value = 0; @@ -2556,7 +2557,6 @@ void MainWindow::datasetBranch(const string &branchPath, T datasetValue[MAX_ARRA /*************************************************************************************************/ void MainWindow::setScenario(const string &h5Path) { - const H5std_string filePath(h5Path); H5File file (filePath, H5F_ACC_RDONLY); _file = file; @@ -2564,8 +2564,9 @@ void MainWindow::setScenario(const string &h5Path) try { /****************** /sramParameters/frameType ******************/ - datasetBranch ("/sramParameters/frameType", floatArray); - scenParams.frameType = static_cast(floatArray[0]); +// datasetBranch ("/sramParameters/frameType", floatArray); +// scenParams.frameType = static_cast(floatArray[0]); + scenParams.frameType = 0; /****************** /sramParameters/totalTxShotNo ******************/ datasetBranch ("/sramParameters/totalTxShotNo", floatArray); @@ -2581,11 +2582,6 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) scenParams.rxBeamFormerNumber.push_back(static_cast(floatArray[var])); -// for(auto j=0; j("/sramParameters/pulseInterval", floatArray); scenParams.pulseInterval.clear(); @@ -2595,43 +2591,43 @@ void MainWindow::setScenario(const string &h5Path) /**************** /sramParameters/indexParameters/shotPropertiesIndex ********************/ datasetBranch ("/sramParameters/indexParameters/shotPropertiesIndex", floatArray); scenParams.indexParams.shotPropertiesIndex.clear(); - for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.shotPropertiesIndex.push_back(static_cast(floatArray[var])); /**************** /sramParameters/indexParameters/pulsePropertiesIndex ********************/ datasetBranch ("/sramParameters/indexParameters/pulsePropertiesIndex", floatArray); scenParams.indexParams.pulsePropertiesIndex.clear(); - for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.pulsePropertiesIndex.push_back(static_cast(floatArray[var])); /**************** /sramParameters/indexParameters/receiverConfigurationIndex ********************/ datasetBranch ("/sramParameters/indexParameters/receiverConfigurationIndex", floatArray); scenParams.indexParams.receiverConfigurationIndex.clear(); - for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.receiverConfigurationIndex.push_back(static_cast(floatArray[var])); /**************** /sramParameters/indexParameters/firstLineInFrame ********************/ datasetBranch ("/sramParameters/indexParameters/firstLineInFrame", floatArray); scenParams.indexParams.firstLineInFrame.clear(); - for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.firstLineInFrame.push_back(static_cast(floatArray[var])); /**************** /sramParameters/indexParameters/lastLineInFrame ********************/ datasetBranch ("/sramParameters/indexParameters/lastLineInFrame", floatArray); scenParams.indexParams.lastLineInFrame.clear(); - for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.lastLineInFrame.push_back(static_cast(floatArray[var])); /**************** /sramParameters/indexParameters/dLineNum ********************/ datasetBranch ("/sramParameters/indexParameters/dLineNum", floatArray); scenParams.indexParams.dLineNum.clear(); - for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.dLineNum.push_back(static_cast(floatArray[var])); /**************** /sramParameters/indexParameters/dEnsembleNum ********************/ datasetBranch ("/sramParameters/indexParameters/dEnsembleNum", floatArray); scenParams.indexParams.dEnsembleNum.clear(); - for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.dEnsembleNum.push_back(static_cast(floatArray[var])); /**************** /sramParameters/txParameters/txFocusXPos ********************/ @@ -2846,6 +2842,11 @@ void MainWindow::setScenario(const string &h5Path) scenParams.hwRegister.apodizationLut.push_back(tempApodization); } +// for(auto j=0; j<100; j++) +// { +// qDebug() << scenParams.hwRegister.apodizationLut[3][j]; +// } + /**************** /registerParameters/aTgcLut ********************/ datasetBranch ("/registerParameters/aTgcLut", floatArray); scenParams.hwRegister.atgcLut.clear(); @@ -2876,6 +2877,14 @@ void MainWindow::setScenario(const string &h5Path) scenParams.hwRegister.lpfLut.push_back(tempLpf); } + /**************** /registerParameters/lineFilter ********************/ + //datasetBranch ("/registerParameters/lpfLut", floatArray); + QVector lineFilter; + lineFilter.push_back(0x0); + lineFilter.push_back(0x0); + lineFilter.push_back(0x1); + _trx.setLineFilterCoefficient(lineFilter); + /**************** /registerParameters/pulseProperties/halfPeriod ********************/ datasetBranch ("/registerParameters/pulseProperties/halfPeriod", floatArray); QList halfPeriod; @@ -3088,31 +3097,31 @@ void MainWindow::setScenario(const string &h5Path) } /**************** /registerParameters/receiverConfigProperties/dpeEn ********************/ - datasetBranch ("/registerParameters/receiverConfigProperties/dpeEn", floatArray); - QList dpeEn; +// datasetBranch ("/registerParameters/receiverConfigProperties/dpeEn", floatArray); +// QList dpeEn; - for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) - { - dpeEn.push_back(static_cast(floatArray[j])); - } +// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) +// { +// dpeEn.push_back(static_cast(floatArray[j])); +// } /**************** /registerParameters/receiverConfigProperties/ddcEn ********************/ - datasetBranch ("/registerParameters/receiverConfigProperties/ddcEn", floatArray); - QList ddcEn; +// datasetBranch ("/registerParameters/receiverConfigProperties/ddcEn", floatArray); +// QList ddcEn; - for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) - { - ddcEn.push_back(static_cast(floatArray[j])); - } +// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) +// { +// ddcEn.push_back(static_cast(floatArray[j])); +// } /**************** /registerParameters/receiverConfigProperties/wmfEn ********************/ - datasetBranch ("/registerParameters/receiverConfigProperties/wmfEn", floatArray); - QList wmfEn; +// datasetBranch ("/registerParameters/receiverConfigProperties/wmfEn", floatArray); +// QList wmfEn; - for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) - { - wmfEn.push_back(static_cast(floatArray[j])); - } +// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) +// { +// wmfEn.push_back(static_cast(floatArray[j])); +// } /**************** /registerParameters/receiverConfigProperties ********************/ ReceiverConfig_t receiverCfgObj; @@ -3122,11 +3131,14 @@ void MainWindow::setScenario(const string &h5Path) { receiverCfgObj.mla = receiverCfgMla.at(j); receiverCfgObj.stb = stb.at(j); - receiverCfgObj.ddcn = ddcEn.at(j); + //receiverCfgObj.ddcn = ddcEn.at(j); + receiverCfgObj.ddcn = 1; receiverCfgObj.absEn = absEn.at(j); - receiverCfgObj.dpeEn = dpeEn.at(j); + //receiverCfgObj.dpeEn = dpeEn.at(j); + receiverCfgObj.dpeEn = 0; receiverCfgObj.stbEn = stbEn.at(j); - receiverCfgObj.wmfEn = wmfEn.at(j); + //receiverCfgObj.wmfEn = wmfEn.at(j); + receiverCfgObj.wmfEn = 0; receiverCfgObj.lpfSel = lpfSel.at(j); receiverCfgObj.aTgcSel = aTgcSel.at(j); receiverCfgObj.focusNo = focusNo.at(j); @@ -3149,61 +3161,154 @@ void MainWindow::setScenario(const string &h5Path) qDebug() << e.what(); } + ui->btn_scenStart->setText("Scenario Start"); + ui->btn_emulator->setText("Emulator Start"); - //QString saveFile = QFileDialog::getSaveFileName(this, "Save"); - QString saveFile = "/home/hasis/Desktop/Develop_HardwareTest/saveSram.bin"; - - QFile sramFile(saveFile); - - if (!sramFile.open(QIODevice::WriteOnly)){ - QMessageBox::warning(this, "Warning", "Cann't save the file: " + sramFile.errorString()); - return; - } + ui->l_scenFillingDone->setText("done"); + changeLabelTextColor(ui->l_scenFillingDone, Qt::green); +} - quint32 num(0); - quint64 value(0); - while (num < SRAM_SIZE/4) - { - value = _usd->device->device.readLong(BAR_SRAM, static_cast(num)); - sramFile.write(Uint2ByteArray(value)); - num += sizeof (quint64); - } +/*************************************************************************************************/ +void MainWindow::on_btn_setScenario_clicked() +{ + _timeout->stop(); + ui->l_scenFillingDone->setText("doing"); + changeLabelTextColor(ui->l_scenFillingDone, Qt::red); - sramFile.flush(); - sramFile.close(); + QString sramScenario = "/scenGenOutput/scenario.h5"; + QString h5Path = ui->tb_scenFilesPath->text() + sramScenario; - ui->l_scenFillingDone->setText("done"); - changeLabelTextColor(ui->l_scenFillingDone, Qt::green); + auto scenFuture = QtConcurrent::run(this, &MainWindow::setScenario, h5Path.toStdString()); + scenEndWather.setFuture(scenFuture); } /*************************************************************************************************/ -void MainWindow::on_btn_h5Browse_clicked() +void MainWindow::on_btn_scenBrowse_clicked() { QFileDialog fileDialog; - fileDialog.setNameFilters({"Scenario file (*.h5)"}); + fileDialog.setFileMode(QFileDialog::Directory); + fileDialog.setOption(QFileDialog::ShowDirsOnly); auto result = fileDialog.exec(); if(result) { auto selectedPath = fileDialog.selectedFiles()[0]; - ui->tb_h5File->setText(selectedPath); + ui->tb_scenFilesPath->setText(selectedPath); _settings->setValue(SCENARIO_FILE_PATH, selectedPath); } } /*************************************************************************************************/ -void MainWindow::on_btn_setScenario_clicked() +void MainWindow::verifySramParams(QString& sramParamsPath) +{ + +} + +/*************************************************************************************************/ +void MainWindow::on_btn_sramParamsVerifying_clicked() +{ + + +} + +/*************************************************************************************************/ +void MainWindow::verifyRegisterParams(QString& regParamsPath) +{ + QString registerScenario = "/hardware/register.csv"; + QString regReadParamsPath = regParamsPath + registerScenario; + QFile csvReadFile(regReadParamsPath); + if(!csvReadFile.open(QFile::ReadOnly)) + { + MESSAGE_BOX("Could not open the register's scenario params."); + return; + } + + QString registerCompareScenario = "/hardware/registerCompare.csv"; + QString regCompareParamsPath = regParamsPath + registerCompareScenario; + QFile csvWriteFile(regCompareParamsPath); + csvWriteFile.open(QFile::WriteOnly); + + quint32 bar = 0; + qint64 readSize = 0; + QString line; + + auto size = csvReadFile.size(); + while(readSize < size) + { + line = csvReadFile.readLine(); + auto sl = line.split(','); + auto address = sl[0].toUInt(Q_NULLPTR, 16); + auto baseValue = sl[1].toUInt(Q_NULLPTR, 16); + auto boardValue = _usd->readWord(address, bar); + + auto res = "NOK"; + if (boardValue == baseValue) + { + res = "OK"; + } + + auto str = QStringLiteral("%1,%2,%3,%4") + .arg(address, 8, 16, QLatin1Char('0')) + .arg(baseValue, 8, 16, QLatin1Char('0')) + .arg(boardValue, 8, 16, QLatin1Char('0')).arg(res); + + + csvWriteFile.write(str.toStdString().c_str(), str.length()); + csvWriteFile.write("\r\n", 2); + + readSize += static_cast(line.length()); + //delay(1); + } + + csvReadFile.close(); + + csvWriteFile.flush(); + csvWriteFile.close(); + + ui->l_verifyRegisterParams->setText("done"); + changeLabelTextColor(ui->l_verifyRegisterParams, Qt::green); + +} + +/*************************************************************************************************/ +void MainWindow::on_btn_registerParamsVerifying_clicked() { _timeout->stop(); - ui->l_scenFillingDone->setText("doing"); - changeLabelTextColor(ui->l_scenFillingDone, Qt::red); + ui->l_verifyRegisterParams->setText("doing"); + changeLabelTextColor(ui->l_verifyRegisterParams, Qt::red); - QString h5Path = ui->tb_h5File->text(); + QString regParamsPath = ui->tb_scenFilesPath->text(); - auto scenFuture = QtConcurrent::run(this, &MainWindow::setScenario, h5Path.toStdString()); + auto scenFuture = QtConcurrent::run(this, &MainWindow::verifyRegisterParams, regParamsPath); scenEndWather.setFuture(scenFuture); } +/*************************************************************************************************/ +void MainWindow::on_btn_sramParamsGenerating_clicked() +{ + //QString saveFile = QFileDialog::getSaveFileName(this, "Save"); + QString saveFile = "/home/hasis/Desktop/Develop_HardwareTest/saveSram.bin"; + + QFile sramFile(saveFile); + + if (!sramFile.open(QIODevice::WriteOnly)){ + QMessageBox::warning(this, "Warning", "Cann't save the file: " + sramFile.errorString()); + return; + } + + quint32 num(0); + quint64 value(0); + while (num < SRAM_SIZE/4) + { + value = _usd->device->device.readLong(BAR_SRAM, static_cast(num)); + sramFile.write(Uint2ByteArray(value)); + num += sizeof (quint64); + } + + sramFile.flush(); + sramFile.close(); +} + /*************************************************************************************************/ void MainWindow::on_btn_setAtgcMode_clicked() { diff --git a/mainwindow.h b/mainwindow.h index 4087caa..da05b93 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -125,8 +125,6 @@ private: H5File _file; -// int32_t intArray [MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH]; -// float_t floatArray[MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH]; float_t floatArray[MAX_ARRAY_DEPTH]; template @@ -137,6 +135,10 @@ private: void setScenario(const string& h5Path); + void verifyRegisterParams(QString& regParamsPath); + + void verifySramParams(QString& sramParamsPath); + void fpgaProgrammer(QString path); void timeout(); @@ -349,10 +351,16 @@ private slots: void on_btn_afeConfig_clicked(); - void on_btn_h5Browse_clicked(); + void on_btn_scenBrowse_clicked(); void on_btn_setScenario_clicked(); + void on_btn_sramParamsVerifying_clicked(); + + void on_btn_registerParamsVerifying_clicked(); + + void on_btn_sramParamsGenerating_clicked(); + signals: // void updateBlockProgressValue(int percentage, QProgressBar* prg); // void updateFpgaProgressValue(int percentage); diff --git a/mainwindow.ui b/mainwindow.ui index 3a9ae2f..373d8b7 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -27,7 +27,7 @@ - 1 + 2 @@ -404,10 +404,10 @@ - 0 - 230 - 370 - 71 + 449 + 210 + 351 + 91 @@ -449,7 +449,7 @@ - 150 + 140 40 38 15 @@ -462,7 +462,7 @@ - 190 + 180 40 71 23 @@ -472,7 +472,7 @@ - 280 + 260 40 80 23 @@ -487,9 +487,9 @@ 0 - 120 - 481 - 111 + 210 + 431 + 91 @@ -498,8 +498,8 @@ - 10 - 50 + 0 + 40 71 23 @@ -526,8 +526,8 @@ - 90 - 50 + 80 + 40 71 23 @@ -539,8 +539,8 @@ - 180 - 50 + 160 + 40 80 23 @@ -552,8 +552,8 @@ - 280 - 30 + 250 + 20 71 71 @@ -571,14 +571,14 @@ - 380 - 50 - 91 + 330 + 40 + 95 23 - Config + Default Config @@ -587,8 +587,8 @@ 0 10 - 741 - 105 + 791 + 181 @@ -606,7 +606,7 @@ 16777215 - 105 + 200 @@ -624,7 +624,7 @@ 10 30 - 721 + 771 27 @@ -632,15 +632,15 @@ - HDF5 file: + Scenario Files Path: - + - + Browse... @@ -648,44 +648,153 @@ - + - 10 + 690 70 - 82 - 17 + 91 + 48 - + - + - Filling: + Set Scenario - + + + + + Filling: + + + + + + + doing + + + + + + + + + + + 480 + 130 + 130 + 48 + + + + + - doing + Verify Sram Params + + + + + + Verifying: + + + + + + + doing + + + + + - + - 633 - 70 - 101 - 23 + 310 + 130 + 148 + 48 - - Set Scenario + + + + + Verify Register Params + + + + + + + + + Verifying: + + + + + + + doing + + + + + + + + + + + 10 + 130 + 150 + 48 + + + + + + Create Sram Binary + + + + + + + + + Creating: + + + + + + + doing + + + + + + diff --git a/qcustomplot.cpp b/qcustomplot.cpp old mode 100755 new mode 100644 diff --git a/qcustomplot.h b/qcustomplot.h old mode 100755 new mode 100644 diff --git a/src/model/hardware/core/TrxBoard.cpp b/src/model/hardware/core/TrxBoard.cpp index f20bee0..0b0d77e 100644 --- a/src/model/hardware/core/TrxBoard.cpp +++ b/src/model/hardware/core/TrxBoard.cpp @@ -34,9 +34,9 @@ void TrxBoard::readData() _device.copy(_hwCounter - 1, _swCounter); auto temp = QByteArray::fromRawData(_device.getBufferPtr(_swCounter), BUFFER_SIZE); - //packetEngine.newData(temp); + packetEngine.newData(temp); - emit sendFramePacket(temp); + //emit sendFramePacket(temp); _swCounter++; if(_swCounter >= SW_BUFFER_NUM) @@ -208,6 +208,8 @@ void TrxBoard::init() void TrxBoard::setScenario(ScenGenHardwareOutput_t scenGenHw) { + scenPlayerStop(); + emulatorStop(); scenParams->focusTypeNumber = scenGenHw.focusTypeNumber; scenParams->totalTxShotNumber = scenGenHw.totalTxShotNumber; scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber.toVector(); @@ -682,6 +684,9 @@ void TrxBoard::emulatorInit(EmulatorProperties* config) const void TrxBoard::fillRam(QString path) { + scenPlayerStop(); + emulatorStop(); + QFile emulFile(path); QByteArray sramData; QByteArray temp; @@ -920,8 +925,9 @@ void TrxBoard::mpsSetAo(float voltA, float voltB) const this->_bCtrlMngt->mpsHvSet(voltA, voltB); } -void TrxBoard::selectProbe(eSelectProbe prbSel) const +void TrxBoard::selectProbe(eSelectProbe prbSel) { + scenPlayerStop(); this->_bCtrlMngt->setProbeSelect(prbSel); } diff --git a/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp b/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp index 5f8d907..7f5ffeb 100644 --- a/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp +++ b/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp @@ -635,9 +635,15 @@ void BoardsCtrlMngt::mpsHvSet(float &hva, float &hvb) const { if (hva > hvb && hva <= HVA_MAX_VALUE) { - _mpsDacs->cwdValue = 0.0f; - _mpsDacs->hvaValue = hva; - _mpsDacs->hvbValue = hvb; + if (hva > 3.3f){ + _mpsDacs->cwdValue = 0.0f; + _mpsDacs->hvaValue = 3.3f; + _mpsDacs->hvbValue = 1.53f; + } + +// _mpsDacs->cwdValue = 0.0f; +// _mpsDacs->hvaValue = hva; +// _mpsDacs->hvbValue = hvb; getSupervisorI2cTimeout(); setMpsDacsValue (_mpsDacs); diff --git a/src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp b/src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp index 5920f30..aac17c6 100644 --- a/src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp +++ b/src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp @@ -30,12 +30,12 @@ void FpgaProgram::program(QByteArray& bitFileData, quint8 number) setSlaveFpgaNumber(number); - QProgressDialog progress; - progress.setMinimumSize(300,100); - progress.setLabelText("Please wait..."); - progress.setWindowTitle("Slaves FPGA Programming"); - progress.setRange(0,bitFileData.size()); - progress.setModal(true); +// QProgressDialog progress; +// progress.setMinimumSize(300,100); +// progress.setLabelText("Please wait..."); +// progress.setWindowTitle("Slaves FPGA Programming"); +// progress.setRange(0,bitFileData.size()); +// progress.setModal(true); while(progByte < bitFileData.size()) { @@ -70,9 +70,9 @@ void FpgaProgram::program(QByteArray& bitFileData, quint8 number) "Timeout is happened and the programming of the slave FPGAs is failed"); } - progress.setValue(progByte); - if (progress.wasCanceled()) - throw SonoException("Slaves fpga programming is canceled"); +// progress.setValue(progByte); +// if (progress.wasCanceled()) +// throw SonoException("Slaves fpga programming is canceled"); temp.clear(); progByte += sizeof(quint32);