diff --git a/developHw.pro.user b/developHw.pro.user index 6cc52da..c2c7d31 100644 --- a/developHw.pro.user +++ b/developHw.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {78e1b4e9-45e9-48b6-8eb1-81a1a4312d47} + {57f3fc68-5876-4e15-8009-f5f2beb5bfae} ProjectExplorer.Project.ActiveTarget @@ -55,8 +55,30 @@ ProjectExplorer.Project.PluginSettings + + true + false + true + true + true + true + + + 0 + true true + + true + true + Builtin.DefaultTidyAndClazy + 2 + true + + + + true + @@ -69,7 +91,7 @@ 0 0 - /home/hasis/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug + /home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug true @@ -125,7 +147,7 @@ true - /home/hasis/Desktop/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Release + /home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Release true @@ -181,7 +203,7 @@ true - /home/hasis/Desktop/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Profile + /home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Profile true @@ -304,8 +326,8 @@ 2 developHw - developHw2 - Qt4ProjectManager.Qt4RunConfiguration:/home/hasis/Desktop/hardware/Develop_HardwareTest/developHw/developHw.pro + + Qt4ProjectManager.Qt4RunConfiguration:/home/arash/Desktop/hardware/Develop_HardwareTest/developHw/developHw.pro 3768 false @@ -315,7 +337,7 @@ false true - /home/hasis/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug + /home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug 1 diff --git a/include/model/hardware/core/lowLevelApi/TrxBoard.h b/include/model/hardware/core/lowLevelApi/TrxBoard.h index 09c5f2f..fc80af6 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoard.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoard.h @@ -211,6 +211,8 @@ public: void afeAdcsSync(const quint8& slaveMounted); void gtReadReset(void); #endif + qint32 preSubBatch; + qint32 preBatch; TrxBoard(); ~TrxBoard(); @@ -230,7 +232,7 @@ public: void scenPlayerStop(bool afeHvPwrOff = false); //void scenPlayerPause (bool pause) const; - void setFramesMetaData(const QByteArray& metaData) const; + void setFramesMetaData(const QByteArray& metaData); void setMChangeParams(SramTx* tx, SramRx* rx) const; /////////////////////////////// Built-in Test API ///////////////////////////// diff --git a/mainwindow.cpp b/mainwindow.cpp index 380afd4..975e3d1 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1514,6 +1514,9 @@ void MainWindow::on_btn_scenStart_clicked() auto str = ui->btn_scenStart->text(); if(str == "Scenario Start") { + _trx.preSubBatch = -1; + _trx.preBatch = 0; + _frame.clear(); _lastBuffer.clear(); _bufferedFrame.clear(); diff --git a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp index bce578a..68a9dd0 100644 --- a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp +++ b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp @@ -77,6 +77,20 @@ void TrxBoard::readData() auto framePacket = QByteArray::fromRawData(_device.getBufferPtr(_swCounter), BUFFER_SIZE); + + auto batch = ((static_cast(framePacket[128])) & 0x00FF) | + (((static_cast(framePacket[129])) << 8) & 0xFF00); + auto subBbatch = ((static_cast(framePacket[130])) & 0x00FF); + + if((batch == preBatch && subBbatch - preSubBatch != 1) || + (preSubBatch == -1 && (batch != 0 || subBbatch != 0)) || + (batch - preBatch > 1) || + (batch - preBatch == 1 && subBbatch != 0)) + { + throw SonoException("Batch/subBatch id error is occured."); + } + preBatch = batch; + preSubBatch = subBbatch; #ifdef DEVELOP_UI emit sendFramePacket(framePacket); #else @@ -1136,8 +1150,11 @@ void TrxBoard::setDtgcLut(QVector& dtgcLut) this->_dsp->dtgcLut(dtgcLutQ); } -void TrxBoard::setFramesMetaData(const QByteArray& metaData) const +void TrxBoard::setFramesMetaData(const QByteArray& metaData) { + preSubBatch = -1; + preBatch = 0; + qint32 metaLength = metaData.length(); if(!metaLength) { @@ -2037,7 +2054,7 @@ void TrxBoard::spiFlashProgram(QString path) bin = binFile.readAll(); binFile.close(); - this->_spiFlash->writeBin(bin, golden); + this->_spiFlash->writeBin(bin, update); } void TrxBoard::spiFlashRead(QString path)