diff --git a/developHw.pro.user b/developHw.pro.user index 70729e8..a7e59d4 100644 --- a/developHw.pro.user +++ b/developHw.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/include/model/hardware/core/TrxBoard.h b/include/model/hardware/core/TrxBoard.h index 26a24e8..630b649 100644 --- a/include/model/hardware/core/TrxBoard.h +++ b/include/model/hardware/core/TrxBoard.h @@ -63,7 +63,7 @@ private: qint32 _swCounter; qint32 _hwCounter; - SonoDevice _device; + SonoDevice _device; AdcVoltages* _adc; VoltagesPg* _pg; @@ -128,8 +128,6 @@ private: * scenParams; - HardwarePacketEngine packetEngine; - void setScenario(ScenGenHardwareOutput* scenParams); void sram_clear (void); @@ -143,6 +141,9 @@ signals: void sendFramePacket(QByteArray newPacket); public: + + HardwarePacketEngine packetEngine; + TrxBoard(); ~TrxBoard(); diff --git a/include/model/hardware/core/register/Register.h b/include/model/hardware/core/register/Register.h index 2a7ce66..55d3190 100644 --- a/include/model/hardware/core/register/Register.h +++ b/include/model/hardware/core/register/Register.h @@ -15,6 +15,8 @@ private: { } + quint32 cumulativeValue; + protected: quint32 _bar; quint32 _offset; @@ -43,11 +45,13 @@ public: bool isUpdated(); + void clearCumulative(void); + void update(); void updateLong(); void updateArray(bool isVariable = false, quint8 arrayLength = 0); - void updateArrayLong(quint8 interval, quint32 arrayLength); + void updateArrayLong(quint8 interval, quint32 arrayLength, bool _isCumulative=false); void sync(); void syncArray(); diff --git a/include/model/hardware/core/register/afe/Afe.h b/include/model/hardware/core/register/afe/Afe.h index b9a3468..3042178 100644 --- a/include/model/hardware/core/register/afe/Afe.h +++ b/include/model/hardware/core/register/afe/Afe.h @@ -128,7 +128,7 @@ struct AfeConfig eLnaHpfProg lnaHpfProg; }; - +Q_DECLARE_METATYPE(AfeConfig) class Afe { diff --git a/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h b/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h index 6f2adfa..3700bcc 100644 --- a/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h +++ b/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h @@ -208,12 +208,6 @@ private: quint8 prbSel, BoardsCtrlMngt* boards); - void timerShot(quint16 ms) const; - void timerStop(void) const; - -//private slots: - bool checkTimeout(void) const; - public: explicit BoardsCtrlMngt(SonoDevice* device) : BoardsSpecs(device) { @@ -229,6 +223,10 @@ public: delete _mpsDacs; } + void timerShot(quint16 ms) const; + void timerStop(void) const; + bool checkTimeout(void) const; + quint32 getPid(void) const; quint32 getVid(void) const; diff --git a/include/model/hardware/core/register/sram/Sram.h b/include/model/hardware/core/register/sram/Sram.h index 101ed33..97db245 100644 --- a/include/model/hardware/core/register/sram/Sram.h +++ b/include/model/hardware/core/register/sram/Sram.h @@ -11,7 +11,8 @@ #include "registerDefinition/SoftwareMetaData.h" #define INDEX_INTERVAL 1U -#define TX_RX_INTERVAL 27U +#define TX_INTERVAL 27U +#define RX_INTERVAL 27*8 #define INNER_RX_INTERVAL 3U #define META_DATA_INTERVAL 1U #define META_DATA_LENGTH 16U diff --git a/include/model/hardware/core/register/sram/registerDefinition/Index.h b/include/model/hardware/core/register/sram/registerDefinition/Index.h index 70f71c4..2909a58 100644 --- a/include/model/hardware/core/register/sram/registerDefinition/Index.h +++ b/include/model/hardware/core/register/sram/registerDefinition/Index.h @@ -44,9 +44,9 @@ private: value = _index->lastLineInFrame[static_cast(index)] ? 1 : 0; lastLineInFrame->setValueLong(value); - dLineNum->setValueLong(_index->dLineNum[static_cast(index)] - 1); + dLineNum->setValueLong(_index->dLineNum[static_cast(index)]); - dEnsembleNum->setValueLong(_index->dEnsembleNum[static_cast(index)] - 1); + dEnsembleNum->setValueLong(_index->dEnsembleNum[static_cast(index)]); if (index==0) frameType->setValueLong(_index->frameType); diff --git a/include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h b/include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h index 6fdb88f..587d7aa 100644 --- a/include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h +++ b/include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h @@ -28,7 +28,7 @@ private: void prepareData(quint32 index) override { - rxR0CenterActiveElementNumber->setValueLong(_rx->rxR0CenterActiveElementNumber[static_cast(index)] - 1); + rxR0CenterActiveElementNumber->setValueLong(_rx->rxR0CenterActiveElementNumber[static_cast(index)]); interceptXPos->setValueLong(static_cast(interceptXPosQ[static_cast(index)])); diff --git a/include/model/hardware/core/register/sram/registerDefinition/TxParams.h b/include/model/hardware/core/register/sram/registerDefinition/TxParams.h index ea8016c..ffabd8d 100644 --- a/include/model/hardware/core/register/sram/registerDefinition/TxParams.h +++ b/include/model/hardware/core/register/sram/registerDefinition/TxParams.h @@ -24,7 +24,7 @@ private: void prepareData(quint32 index) override { - txStartActiveElementNumber->setValueLong(_tx->txStartActiveElementNumber[static_cast(index)] - 1); + txStartActiveElementNumber->setValueLong(_tx->txStartActiveElementNumber[static_cast(index)]); txActiveElementNumber->setValueLong(_tx->txActiveElementNumber[static_cast(index)]); diff --git a/include/model/scenarioGenerator/dto/hardware/HardwareOutput.h b/include/model/scenarioGenerator/dto/hardware/HardwareOutput.h index 8511445..32747de 100644 --- a/include/model/scenarioGenerator/dto/hardware/HardwareOutput.h +++ b/include/model/scenarioGenerator/dto/hardware/HardwareOutput.h @@ -11,7 +11,7 @@ struct ScenGenHardwareOutput_t { quint32 focusTypeNumber; quint32 totalTxShotNumber; - QVector rxBeamFormerNumber; + QList rxBeamFormerNumber; QVector pulseInterval; quint8 frameType; diff --git a/mainwindow.cpp b/mainwindow.cpp index 38c11ea..35e962e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2545,7 +2545,7 @@ void MainWindow::on_btn_getFpgaVersion_clicked() /*************************************************************************************************/ template -void MainWindow::datasetBranch(const string &branchPath, T datasetValue[][3057]) +void MainWindow::datasetBranch(const string &branchPath, T datasetValue[MAX_ARRAY_DEPTH]) { const H5std_string datasetPath(branchPath); DataSet datasetType = _file.openDataSet(datasetPath); @@ -2565,213 +2565,218 @@ void MainWindow::setScenario(const string &h5Path) { /****************** /sramParameters/frameType ******************/ datasetBranch ("/sramParameters/frameType", floatArray); - scenParams.frameType = static_cast(floatArray[0][0]); + scenParams.frameType = static_cast(floatArray[0]); /****************** /sramParameters/totalTxShotNo ******************/ datasetBranch ("/sramParameters/totalTxShotNo", floatArray); - scenParams.totalTxShotNumber = static_cast(floatArray[0][0]); + scenParams.totalTxShotNumber = static_cast(floatArray[0]); /******************* /sramParameters/focusTypeNo *******************/ datasetBranch ("/sramParameters/focusTypeNo", floatArray); - scenParams.focusTypeNumber = static_cast(floatArray[0][0]); + scenParams.focusTypeNumber = static_cast(floatArray[0]); /******************* /sramParameters/rxBeamformerNo *******************/ datasetBranch ("/sramParameters/rxBeamformerNo", floatArray); scenParams.rxBeamFormerNumber.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxBeamFormerNumber.push_back(static_cast(floatArray[0][var])); + scenParams.rxBeamFormerNumber.push_back(static_cast(floatArray[var])); + +// for(auto j=0; j("/sramParameters/pulseInterval", floatArray); scenParams.pulseInterval.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.pulseInterval.push_back(floatArray[0][var]); + scenParams.pulseInterval.push_back(floatArray[var]); /**************** /sramParameters/indexParameters/shotPropertiesIndex ********************/ datasetBranch ("/sramParameters/indexParameters/shotPropertiesIndex", floatArray); scenParams.indexParams.shotPropertiesIndex.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.indexParams.shotPropertiesIndex.push_back(static_cast(floatArray[0][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++) - scenParams.indexParams.pulsePropertiesIndex.push_back(static_cast(floatArray[0][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++) - scenParams.indexParams.receiverConfigurationIndex.push_back(static_cast(floatArray[0][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++) - scenParams.indexParams.firstLineInFrame.push_back(static_cast(floatArray[0][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++) - scenParams.indexParams.lastLineInFrame.push_back(static_cast(floatArray[0][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++) - scenParams.indexParams.dLineNum.push_back(static_cast(floatArray[0][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++) - scenParams.indexParams.dEnsembleNum.push_back(static_cast(floatArray[0][var])); + scenParams.indexParams.dEnsembleNum.push_back(static_cast(floatArray[var])); /**************** /sramParameters/txParameters/txFocusXPos ********************/ datasetBranch ("/sramParameters/txParameters/txFocusXPos", floatArray); scenParams.txParams.txFocusXPos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.txParams.txFocusXPos.push_back(floatArray[0][var]); + scenParams.txParams.txFocusXPos.push_back(floatArray[var]); /**************** /sramParameters/txParameters/txFocusYPos ********************/ datasetBranch ("/sramParameters/txParameters/txFocusYPos", floatArray); scenParams.txParams.txFocusYPos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.txParams.txFocusYPos.push_back(floatArray[0][var]); + scenParams.txParams.txFocusYPos.push_back(floatArray[var]); /**************** /sramParameters/txParameters/txFocusZPos ********************/ datasetBranch ("/sramParameters/txParameters/txFocusZPos", floatArray); scenParams.txParams.txFocusZPos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.txParams.txFocusZPos.push_back(floatArray[0][var]); + scenParams.txParams.txFocusZPos.push_back(floatArray[var]); /**************** /sramParameters/txParameters/txStartActiveElementNo ********************/ datasetBranch ("/sramParameters/txParameters/txStartActiveElementNo", floatArray); scenParams.txParams.txStartActiveElementNumber.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.txParams.txStartActiveElementNumber.push_back(static_cast(floatArray[0][var])); + scenParams.txParams.txStartActiveElementNumber.push_back(static_cast(floatArray[var])); /**************** /sramParameters/txParameters/txActiveElementNo ********************/ datasetBranch ("/sramParameters/txParameters/txActiveElementNo", floatArray); scenParams.txParams.txActiveElementNumber.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.txParams.txActiveElementNumber.push_back(static_cast(floatArray[0][var])); + scenParams.txParams.txActiveElementNumber.push_back(static_cast(floatArray[var])); /**************** /sramParameters/txParameters/maxDelayQ ********************/ datasetBranch ("/sramParameters/txParameters/maxDelayQ", floatArray); scenParams.txParams.maxDelayQ.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.txParams.maxDelayQ.push_back(static_cast(floatArray[0][var])); + scenParams.txParams.maxDelayQ.push_back(static_cast(floatArray[var])); /**************** /sramParameters/rxParameters/rxR0CenterActiveElementNo ********************/ datasetBranch ("/sramParameters/rxParameters/rxR0CenterActiveElementNo", floatArray); scenParams.rxParams.rxR0CenterActiveElementNumber.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.rxR0CenterActiveElementNumber.push_back(static_cast(floatArray[0][var])); + scenParams.rxParams.rxR0CenterActiveElementNumber.push_back(static_cast(floatArray[var])); /**************** /sramParameters/rxParameters/rxR0ActiveElementNo ********************/ datasetBranch ("/sramParameters/rxParameters/rxR0ActiveElementNo", floatArray); scenParams.rxParams.rxR0ActiveElementNumber.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.rxR0ActiveElementNumber.push_back(static_cast(floatArray[0][var])); + scenParams.rxParams.rxR0ActiveElementNumber.push_back(static_cast(floatArray[var])); /**************** /sramParameters/rxParameters/rxActiveElementStep ********************/ datasetBranch ("/sramParameters/rxParameters/rxActiveElementStep", floatArray); scenParams.rxParams.rxActiveElementStep.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.rxActiveElementStep.push_back(floatArray[0][var]); + scenParams.rxParams.rxActiveElementStep.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/interceptPointFiringTime ********************/ datasetBranch ("/sramParameters/rxParameters/interceptPointFiringTime", floatArray); scenParams.rxParams.interceptPointFiringTime.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.interceptPointFiringTime.push_back(static_cast(floatArray[0][var])); + scenParams.rxParams.interceptPointFiringTime.push_back(static_cast(floatArray[var])); /**************** /sramParameters/rxParameters/rxFocusPointNo ********************/ datasetBranch ("/sramParameters/rxParameters/rxFocusPointNo", floatArray); scenParams.rxParams.rxFocusPointNumber.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.rxFocusPointNumber.push_back(static_cast(floatArray[0][var])); + scenParams.rxParams.rxFocusPointNumber.push_back(static_cast(floatArray[var])); /**************** /sramParameters/rxParameters/r0Position ********************/ datasetBranch ("/sramParameters/rxParameters/r0Position", floatArray); scenParams.rxParams.r0Position.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.r0Position.push_back(floatArray[0][var]); + scenParams.rxParams.r0Position.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/thetaCos ********************/ datasetBranch ("/sramParameters/rxParameters/thetaCos", floatArray); scenParams.rxParams.thetaCos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.thetaCos.push_back(floatArray[0][var]); + scenParams.rxParams.thetaCos.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/thetaSin ********************/ datasetBranch ("/sramParameters/rxParameters/thetaSin", floatArray); scenParams.rxParams.thetaSin.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.thetaSin.push_back(floatArray[0][var]); + scenParams.rxParams.thetaSin.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/phiCos ********************/ datasetBranch ("/sramParameters/rxParameters/phiCos", floatArray); scenParams.rxParams.phiCos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.phiCos.push_back(floatArray[0][var]); + scenParams.rxParams.phiCos.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/phiSin ********************/ datasetBranch ("/sramParameters/rxParameters/phiSin", floatArray); scenParams.rxParams.phiSin.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.phiSin.push_back(floatArray[0][var]); + scenParams.rxParams.phiSin.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/interceptXPos ********************/ datasetBranch ("/sramParameters/rxParameters/interceptXPos", floatArray); scenParams.rxParams.interceptXPos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.interceptXPos.push_back(floatArray[0][var]); + scenParams.rxParams.interceptXPos.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/interceptYPos ********************/ datasetBranch ("/sramParameters/rxParameters/interceptYPos", floatArray); scenParams.rxParams.interceptYPos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.interceptYPos.push_back(floatArray[0][var]); + scenParams.rxParams.interceptYPos.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/interceptZPos ********************/ datasetBranch ("/sramParameters/rxParameters/interceptZPos", floatArray); scenParams.rxParams.interceptZPos.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.interceptZPos.push_back(floatArray[0][var]); + scenParams.rxParams.interceptZPos.push_back(floatArray[var]); /**************** /sramParameters/rxParameters/txR0MinDelayQ ********************/ datasetBranch ("/sramParameters/rxParameters/txR0MinDelayQ", floatArray); scenParams.rxParams.txR0MinDelayQ.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.txR0MinDelayQ.push_back(static_cast(floatArray[0][var])); + scenParams.rxParams.txR0MinDelayQ.push_back(static_cast(floatArray[var])); /**************** /sramParameters/rxParameters/rxR0MinDelayQ ********************/ datasetBranch ("/sramParameters/rxParameters/rxR0MinDelayQ", floatArray); scenParams.rxParams.rxR0MinDelayQ.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.rxR0MinDelayQ.push_back(static_cast(floatArray[0][var])); + scenParams.rxParams.rxR0MinDelayQ.push_back(static_cast(floatArray[var])); /**************** /sramParameters/rxParameters/rxR0MaxDelayQ ********************/ datasetBranch ("/sramParameters/rxParameters/rxR0MaxDelayQ", floatArray); scenParams.rxParams.rxR0MaxDelayQ.clear(); for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) - scenParams.rxParams.rxR0MaxDelayQ.push_back(static_cast(floatArray[0][var])); + scenParams.rxParams.rxR0MaxDelayQ.push_back(static_cast(floatArray[var])); /**************** /registerParameters/pulseTypeNo ********************/ datasetBranch ("/registerParameters/pulseTypeNo", floatArray); - scenParams.hwRegister.pulseTypeNumber = static_cast(floatArray[0][0]); + scenParams.hwRegister.pulseTypeNumber = static_cast(floatArray[0]); /**************** /registerParameters/rxBeamformerTypeNo ********************/ datasetBranch ("/registerParameters/rxBeamformerTypeNo", floatArray); - scenParams.hwRegister.rxBeamFormerTypeNumber = static_cast(floatArray[0][0]); + scenParams.hwRegister.rxBeamFormerTypeNumber = static_cast(floatArray[0]); /**************** /registerParameters/receiverConfigTypeNo ********************/ datasetBranch ("/registerParameters/receiverConfigTypeNo", floatArray); - scenParams.hwRegister.receiverConfigTypeNumber = static_cast(floatArray[0][0]); + scenParams.hwRegister.receiverConfigTypeNumber = static_cast(floatArray[0]); /**************** /registerParameters/blendWeight ********************/ datasetBranch ("/registerParameters/blendWeight", floatArray); @@ -2783,7 +2788,7 @@ void MainWindow::setScenario(const string &h5Path) tempBlendWeight.clear(); for (quint32 j = 0; j < 512; j++) { - tempBlendWeight.push_back(floatArray[i][j]); + tempBlendWeight.push_back(floatArray[j + i * 512]); } scenParams.hwRegister.blendWeight.push_back(tempBlendWeight); } @@ -2792,39 +2797,39 @@ void MainWindow::setScenario(const string &h5Path) datasetBranch ("/registerParameters/freqLut", floatArray); scenParams.hwRegister.freqLut.clear(); for (quint32 var = 0; var < 8; var++) - scenParams.hwRegister.freqLut.push_back(floatArray[0][var]); + scenParams.hwRegister.freqLut.push_back(floatArray[var]); /**************** /registerParameters/dTgcLut ********************/ datasetBranch ("/registerParameters/dTgcLut", floatArray); scenParams.hwRegister.dtgcLut.clear(); for (quint32 var = 0; var < 1024; var++) - scenParams.hwRegister.dtgcLut.push_back(floatArray[0][var]); + scenParams.hwRegister.dtgcLut.push_back(floatArray[var]); /**************** /registerParameters/elementXPositions ********************/ datasetBranch ("/registerParameters/elementXPositions", floatArray); scenParams.hwRegister.elementXPosition.clear(); for (quint32 var = 0; var < 192; var++) - scenParams.hwRegister.elementXPosition.push_back(floatArray[0][var]); + scenParams.hwRegister.elementXPosition.push_back(floatArray[var]); /**************** /registerParameters/elementYPositions ********************/ datasetBranch ("/registerParameters/elementYPositions", floatArray); scenParams.hwRegister.elementYPosition.clear(); for (quint32 var = 0; var < 192; var++) - scenParams.hwRegister.elementYPosition.push_back(floatArray[0][var]); + scenParams.hwRegister.elementYPosition.push_back(floatArray[var]); /**************** /registerParameters/elementZPositions ********************/ datasetBranch ("/registerParameters/elementZPositions", floatArray); scenParams.hwRegister.elementZPosition.clear(); for (quint32 var = 0; var < 192; var++) - scenParams.hwRegister.elementZPosition.push_back(floatArray[0][var]); + scenParams.hwRegister.elementZPosition.push_back(floatArray[var]); /**************** /registerParameters/scenarioStartIndex ********************/ datasetBranch ("/registerParameters/scenarioStartIndex", floatArray); - scenParams.hwRegister.scenarioStartIndex = static_cast(floatArray[0][0]); + scenParams.hwRegister.scenarioStartIndex = static_cast(floatArray[0]); /**************** /registerParameters/scenarioEndIndex ********************/ datasetBranch ("/registerParameters/scenarioEndIndex", floatArray); - scenParams.hwRegister.scenarioEndIndex = static_cast(floatArray[0][0]); + scenParams.hwRegister.scenarioEndIndex = static_cast(floatArray[0]); /**************** /registerParameters/apodizationLut ********************/ datasetBranch ("/registerParameters/apodizationLut", floatArray); @@ -2836,7 +2841,7 @@ void MainWindow::setScenario(const string &h5Path) tempApodization.clear(); for (quint32 j = 0; j < 3057; j++) { - tempApodization.push_back(static_cast(floatArray[i][j])); + tempApodization.push_back(static_cast(floatArray[j + i * 3057])); } scenParams.hwRegister.apodizationLut.push_back(tempApodization); } @@ -2851,7 +2856,7 @@ void MainWindow::setScenario(const string &h5Path) tempAtgc.clear(); for (quint32 j = 0; j < 128; j++) { - tempAtgc.push_back(static_cast(floatArray[i][j])); + tempAtgc.push_back(static_cast(floatArray[j + i * 128])); } scenParams.hwRegister.atgcLut.push_back(tempAtgc); } @@ -2866,7 +2871,7 @@ void MainWindow::setScenario(const string &h5Path) tempLpf.clear(); for (quint32 j = 0; j < 48; j++) { - tempLpf.push_back(static_cast(floatArray[i][j])); + tempLpf.push_back(static_cast(floatArray[j + i * 48])); } scenParams.hwRegister.lpfLut.push_back(tempLpf); } @@ -2877,7 +2882,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++) { - halfPeriod.push_back(static_cast(floatArray[0][j])); + halfPeriod.push_back(static_cast(floatArray[j])); } @@ -2887,7 +2892,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++) { - halfCycleNo.push_back(static_cast(floatArray[0][j])); + halfCycleNo.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/pulseProperties/pulseVoltSel ********************/ @@ -2896,7 +2901,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++) { - pulseVoltSel.push_back(static_cast(floatArray[0][j])); + pulseVoltSel.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/pulseProperties/startPhase ********************/ @@ -2905,7 +2910,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++) { - startPhase.push_back(static_cast(floatArray[0][j])); + startPhase.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/pulseProperties/dampingPulseWidth ********************/ @@ -2914,7 +2919,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++) { - dampingPulseWidth.push_back(static_cast(floatArray[0][j])); + dampingPulseWidth.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/pulseProperties ********************/ @@ -2939,7 +2944,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++) { - mla.push_back(static_cast(floatArray[0][j])); + mla.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/rxBeamformerProperties/lag ********************/ @@ -2948,7 +2953,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++) { - lag.push_back(static_cast(floatArray[0][j])); + lag.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/rxBeamformerProperties/apodizationSel ********************/ @@ -2957,7 +2962,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++) { - apodizationSel.push_back(static_cast(floatArray[0][j])); + apodizationSel.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/rxBeamformerProperties ********************/ @@ -2980,7 +2985,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - receiverCfgMla.push_back(static_cast(floatArray[0][j])); + receiverCfgMla.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/lineMode ********************/ @@ -2989,7 +2994,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - lineMode.push_back(static_cast(floatArray[0][j])); + lineMode.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/aTgcSel ********************/ @@ -2998,7 +3003,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - aTgcSel.push_back(static_cast(floatArray[0][j])); + aTgcSel.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/stbEn ********************/ @@ -3007,7 +3012,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - stbEn.push_back(static_cast(floatArray[0][j])); + stbEn.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/stb ********************/ @@ -3016,7 +3021,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - stb.push_back(static_cast(floatArray[0][j])); + stb.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/subtractFilterEn ********************/ @@ -3025,7 +3030,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - subtractFilterEn.push_back(static_cast(floatArray[0][j])); + subtractFilterEn.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/dcCancelEn ********************/ @@ -3034,7 +3039,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - dcCancelEn.push_back(static_cast(floatArray[0][j])); + dcCancelEn.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/ncoFreqSel ********************/ @@ -3043,7 +3048,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - ncoFreqSel.push_back(static_cast(floatArray[0][j])); + ncoFreqSel.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/lpfSel ********************/ @@ -3052,7 +3057,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - lpfSel.push_back(static_cast(floatArray[0][j])); + lpfSel.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/absEn ********************/ @@ -3061,7 +3066,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - absEn.push_back(static_cast(floatArray[0][j])); + absEn.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/focusNo ********************/ @@ -3070,7 +3075,7 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - focusNo.push_back(static_cast(floatArray[0][j])); + focusNo.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/lineFilterEn ********************/ @@ -3079,35 +3084,35 @@ void MainWindow::setScenario(const string &h5Path) for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - lineFilterEn.push_back(static_cast(floatArray[0][j])); + lineFilterEn.push_back(static_cast(floatArray[j])); } -// /**************** /registerParameters/receiverConfigProperties/dpeEn ********************/ -// datasetBranch ("/registerParameters/receiverConfigProperties/dpeEn", floatArray); -// QList dpeEn; + /**************** /registerParameters/receiverConfigProperties/dpeEn ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/dpeEn", floatArray); + QList dpeEn; -// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) -// { -// dpeEn.push_back(static_cast(floatArray[0][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; + /**************** /registerParameters/receiverConfigProperties/ddcEn ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/ddcEn", floatArray); + QList ddcEn; -// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) -// { -// ddcEn.push_back(static_cast(floatArray[0][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; + /**************** /registerParameters/receiverConfigProperties/wmfEn ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/wmfEn", floatArray); + QList wmfEn; -// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) -// { -// wmfEn.push_back(static_cast(floatArray[0][j])); -// } + for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) + { + wmfEn.push_back(static_cast(floatArray[j])); + } /**************** /registerParameters/receiverConfigProperties ********************/ ReceiverConfig_t receiverCfgObj; @@ -3117,11 +3122,11 @@ void MainWindow::setScenario(const string &h5Path) { receiverCfgObj.mla = receiverCfgMla.at(j); receiverCfgObj.stb = stb.at(j); - receiverCfgObj.ddcn = 1; + receiverCfgObj.ddcn = ddcEn.at(j); receiverCfgObj.absEn = absEn.at(j); - receiverCfgObj.dpeEn = 0; + receiverCfgObj.dpeEn = dpeEn.at(j); receiverCfgObj.stbEn = stbEn.at(j); - receiverCfgObj.wmfEn = 0; + receiverCfgObj.wmfEn = wmfEn.at(j); receiverCfgObj.lpfSel = lpfSel.at(j); receiverCfgObj.aTgcSel = aTgcSel.at(j); receiverCfgObj.focusNo = focusNo.at(j); @@ -3134,13 +3139,7 @@ void MainWindow::setScenario(const string &h5Path) scenParams.hwRegister.receiverConfigProps.push_back(receiverCfgObj); } -// for (auto i=0; i<1; i++) -// { -// for(auto j=0; j<20; j++) -// { -// qDebug() << scenParams.hwRegister.atgcLut[3][j]; -// } -// } + _trx.setScenario(scenParams); @@ -3150,6 +3149,29 @@ void MainWindow::setScenario(const string &h5Path) qDebug() << e.what(); } + + //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(); + ui->l_scenFillingDone->setText("done"); changeLabelTextColor(ui->l_scenFillingDone, Qt::green); } @@ -3183,8 +3205,6 @@ void MainWindow::on_btn_setScenario_clicked() } /*************************************************************************************************/ - - void MainWindow::on_btn_setAtgcMode_clicked() { auto aTgcMode = ui->cb_aTgcMode->currentIndex(); @@ -3197,6 +3217,18 @@ void MainWindow::on_btn_setAtgcMode_clicked() _trx.setAtgcMode(Manual, static_cast(aTgcValue)); } +/*************************************************************************************************/ +template +QByteArray MainWindow::Uint2ByteArray(T data) +{ + QByteArray byte; + QDataStream out (&byte, QIODevice::WriteOnly); + out.setByteOrder(QDataStream::LittleEndian); + out << data; + + return byte; +} + /*************************************************************************************************/ /**************************************** EEPROM *************************************************/ /*************************************************************************************************/ diff --git a/mainwindow.h b/mainwindow.h index 700c501..4087caa 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -64,8 +64,7 @@ #define ULTIMATE_LOG_COUNT 50 -#define MAX_ARRAY_LENGTH 3057U -#define MAX_ARRAY_DEPTH 4U +#define MAX_ARRAY_DEPTH 131072U QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } @@ -126,11 +125,15 @@ private: H5File _file; - int32_t intArray [MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH]; - float_t floatArray[MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH]; +// 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 - void datasetBranch(const string& branchPath, T datasetValue[][3057]); + void datasetBranch(const string& branchPath, T datasetValue[MAX_ARRAY_DEPTH]); + + template + QByteArray Uint2ByteArray(T data); void setScenario(const string& h5Path); diff --git a/src/model/hardware/core/TrxBoard.cpp b/src/model/hardware/core/TrxBoard.cpp index 852e19e..f20bee0 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) @@ -136,10 +136,9 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2( _sram = new Sram(&_device); _dsp = new Dsp(&_device); - _adc = new AdcVoltages; _pg = new VoltagesPg; - scenParams = new ScenGenHardwareOutput; + scenParams = new ScenGenHardwareOutput; _allow = false; _run = false; @@ -181,7 +180,7 @@ TrxBoard::~TrxBoard() delete _adc; delete _pg; - delete scenParams; + delete scenParams; } TrxBoard::HwRegister::~HwRegister() @@ -211,7 +210,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t scenGenHw) { scenParams->focusTypeNumber = scenGenHw.focusTypeNumber; scenParams->totalTxShotNumber = scenGenHw.totalTxShotNumber; - scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber; + scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber.toVector(); scenParams->scenarioStartIndex = scenGenHw.hwRegister.scenarioStartIndex; scenParams->scenarioEndIndex = scenGenHw.hwRegister.scenarioEndIndex; @@ -527,8 +526,12 @@ QList TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) switch (sel) { - case slave0 : + case slave0: + this->_afeSlave0->setReadRegEnable(true); + this->_bCtrlMngt->timerShot(1); + while(!(this->_bCtrlMngt->checkTimeout())); + for (quint8 i=0; i < _afeModuleOffset.size(); i++) { offset = (_fpgaOffset.at(slave0) + _afeModuleOffset.at(i) + afeRegAddr) * 4; @@ -537,8 +540,12 @@ QList TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) this->_afeSlave0->setReadRegEnable(false); break; - case slave1 : + case slave1: + this->_afeSlave1->setReadRegEnable(true); + this->_bCtrlMngt->timerShot(1); + while(!(this->_bCtrlMngt->checkTimeout())); + for (quint8 i=0; i < _afeModuleOffset.size(); i++) { offset = (_fpgaOffset.at(slave1) + _afeModuleOffset.at(i) + afeRegAddr) * 4; @@ -547,8 +554,12 @@ QList TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) this->_afeSlave1->setReadRegEnable(false); break; - case slave2 : + case slave2: + this->_afeSlave2->setReadRegEnable(true); + this->_bCtrlMngt->timerShot(1); + while(!(this->_bCtrlMngt->checkTimeout())); + for (quint8 i=0; i < _afeModuleOffset.size(); i++) { offset = (_fpgaOffset.at(slave2) + _afeModuleOffset.at(i) + afeRegAddr) * 4; diff --git a/src/model/hardware/core/register/Register.cpp b/src/model/hardware/core/register/Register.cpp index d0e64ff..626eb5e 100644 --- a/src/model/hardware/core/register/Register.cpp +++ b/src/model/hardware/core/register/Register.cpp @@ -54,7 +54,13 @@ bool Register::isUpdated() auto temp = _isUpdated; _isUpdated = false; - return temp; + return temp; +} + +/*************************************************************************************************/ +void Register::clearCumulative(void) +{ + cumulativeValue=0; } /*************************************************************************************************/ @@ -106,22 +112,41 @@ void Register::updateArray(bool isVariable, quint8 arrayLength) //update arra } /*************************************************************************************************/ -void Register::updateArrayLong(quint8 interval, quint32 arrayLength) +void Register::updateArrayLong(quint8 interval, quint32 arrayLength, bool _isCumulative) { quint64 value; - for(quint32 i = 0; i < arrayLength; i++) - { - prepareData(i); - - value = 0; - for(auto j = 0; j < _fields.length(); j++) - { - value |= _fields[j]->getRegisterWriteValueLong(); - } - - _device->device.writeLong(_bar, _offset + interval * i * 8, value); - } + if (_isCumulative) + { + for(quint32 i = 0; i < arrayLength; i++) + { + prepareData(cumulativeValue); + + value = 0; + for(auto j = 0; j < _fields.length(); j++) + { + value |= _fields[j]->getRegisterWriteValueLong(); + } + + _device->device.writeLong(_bar, _offset + interval * i * 8, value); + cumulativeValue++; + } + } + else + { + for(quint32 i = 0; i < arrayLength; i++) + { + prepareData(i); + + value = 0; + for(auto j = 0; j < _fields.length(); j++) + { + value |= _fields[j]->getRegisterWriteValueLong(); + } + + _device->device.writeLong(_bar, _offset + interval * i * 8, value); + } + } } /*************************************************************************************************/ diff --git a/src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp b/src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp index aac17c6..5920f30 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); diff --git a/src/model/hardware/core/register/sram/Sram.cpp b/src/model/hardware/core/register/sram/Sram.cpp index bd8eb0b..b0f36b2 100644 --- a/src/model/hardware/core/register/sram/Sram.cpp +++ b/src/model/hardware/core/register/sram/Sram.cpp @@ -33,42 +33,47 @@ void Sram::setSramIndex(quint32 &totalTxShotNumber, SramIndex *index) const void Sram::setSramTx(quint32 &focusTypeNumber, SramTx *tx) const { this->_tx->setTxParams(tx); - this->_tx->updateArrayLong(TX_RX_INTERVAL, focusTypeNumber); + this->_tx->updateArrayLong(TX_INTERVAL, focusTypeNumber); this->_txFocus->setTxParamsFocus(tx); - this->_txFocus->updateArrayLong(TX_RX_INTERVAL, focusTypeNumber); + this->_txFocus->updateArrayLong(TX_INTERVAL, focusTypeNumber); } void Sram::setSramRx(QVector &rxBeamFormerNumber, quint32 &focusTypeNumber, SramRx *rx) const { this->_rx->setRxParams(rx); - this->_rx->updateArrayLong(TX_RX_INTERVAL, focusTypeNumber); + this->_rx->updateArrayLong(TX_INTERVAL, focusTypeNumber); quint32 rxDegreeBaseOffset = this->_rxDegree->getCurrentOffset(); quint32 rxPosBaseOffset = this->_rxPos->getCurrentOffset(); quint32 rxDelayBaseOffset = this->_rxDelay->getCurrentOffset(); + this->_rxDegree->clearCumulative(); + this->_rxPos->clearCumulative(); + this->_rxDelay->clearCumulative(); + + this->_rxDegree->setRxParamsDegree(rx); + this->_rxPos->setRxParamsPos(rx); + this->_rxDelay->setRxParamsDelay(rx); + for (quint32 i=0; i < focusTypeNumber; i++) { - this->_rxDegree->setRxParamsDegree(rx); - this->_rxDegree->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast(i))); + this->_rxDegree->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast(i)), true); quint32 rxDegreeCurOffset = this->_rxDegree->getCurrentOffset(); - this->_rxDegree->changeOffset(rxDegreeCurOffset + TX_RX_INTERVAL); + this->_rxDegree->changeOffset(rxDegreeCurOffset + RX_INTERVAL); - this->_rxPos->setRxParamsPos(rx); - this->_rxPos->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast(i))); + this->_rxPos->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast(i)), true); quint32 rxPosCurOffset = this->_rxPos->getCurrentOffset(); - this->_rxPos->changeOffset(rxPosCurOffset + TX_RX_INTERVAL); + this->_rxPos->changeOffset(rxPosCurOffset + RX_INTERVAL); - this->_rxDelay->setRxParamsDelay(rx); - this->_rxDelay->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast(i))); + this->_rxDelay->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast(i)), true); quint32 rxDelayCurOffset = this->_rxDelay->getCurrentOffset(); - this->_rxDelay->changeOffset(rxDelayCurOffset + TX_RX_INTERVAL); + this->_rxDelay->changeOffset(rxDelayCurOffset + RX_INTERVAL); } this->_rxDegree->changeOffset(rxDegreeBaseOffset); // return to base offset address this->_rxPos->changeOffset(rxPosBaseOffset); // return to base offset address - this->_rxDelay->changeOffset(rxDelayBaseOffset ); // return to base offset address + this->_rxDelay->changeOffset(rxDelayBaseOffset); // return to base offset address } void Sram::setSramMetaData(QList &metaData) const