Browse Source

Batch/Sub batch id track is added in read packet function.

Arash Aletayeb 1 year ago
parent
commit
22d42f566f
  1. 38
      developHw.pro.user
  2. 4
      include/model/hardware/core/lowLevelApi/TrxBoard.h
  3. 3
      mainwindow.cpp
  4. 21
      src/model/hardware/core/lowLevelApi/TrxBoard.cpp

38
developHw.pro.user

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2023-08-05T11:34:44. -->
<!-- Written by QtCreator 4.10.0, 2023-11-05T16:53:16. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{78e1b4e9-45e9-48b6-8eb1-81a1a4312d47}</value>
<value type="QByteArray">{57f3fc68-5876-4e15-8009-f5f2beb5bfae}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
@ -55,8 +55,30 @@
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">2</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
@ -69,7 +91,7 @@
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/hasis/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -125,7 +147,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/hasis/Desktop/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -181,7 +203,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/hasis/Desktop/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -304,8 +326,8 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">developHw</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">developHw2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/hasis/Desktop/hardware/Develop_HardwareTest/developHw/developHw.pro</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/arash/Desktop/hardware/Develop_HardwareTest/developHw/developHw.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
@ -315,7 +337,7 @@
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/hasis/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/arash/Desktop/hardware/Develop_HardwareTest/build-developHw-Desktop_Qt_5_13_1_GCC_64bit-Debug</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>

4
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 /////////////////////////////

3
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();

21
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<quint16>(framePacket[128])) & 0x00FF) |
(((static_cast<quint16>(framePacket[129])) << 8) & 0xFF00);
auto subBbatch = ((static_cast<quint16>(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<float>& 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)

Loading…
Cancel
Save