|
|
@ -4,7 +4,7 @@ template<class T> |
|
|
|
QByteArray TrxBoard::uintLittleEndian2ByteArray(T& data) const |
|
|
|
{ |
|
|
|
QByteArray byte; |
|
|
|
QDataStream out (&byte, QIODevice::WriteOnly); |
|
|
|
QDataStream out(&byte, QIODevice::WriteOnly); |
|
|
|
out.setByteOrder(QDataStream::LittleEndian); |
|
|
|
out << data; |
|
|
|
|
|
|
@ -15,7 +15,7 @@ template<class T> |
|
|
|
T TrxBoard::byteArray2UintLittleEndian(QByteArray& byte) const |
|
|
|
{ |
|
|
|
T data; |
|
|
|
QDataStream in (byte); |
|
|
|
QDataStream in(byte); |
|
|
|
in.setByteOrder(QDataStream::LittleEndian); |
|
|
|
in >> data; |
|
|
|
|
|
|
@ -39,8 +39,10 @@ void TrxBoard::readData() |
|
|
|
{ |
|
|
|
_hwCounter++; |
|
|
|
|
|
|
|
if (_hwCounter > HW_BUFFER_NUM) |
|
|
|
if(_hwCounter > HW_BUFFER_NUM) |
|
|
|
{ |
|
|
|
_hwCounter = 1; |
|
|
|
} |
|
|
|
|
|
|
|
_device.copy(_hwCounter - 1, _swCounter); |
|
|
|
|
|
|
@ -66,20 +68,20 @@ void TrxBoard::readData() |
|
|
|
void TrxBoard::sramClear(eSramClear clearMode) |
|
|
|
{ |
|
|
|
quint32 num(0); |
|
|
|
if (clearMode == all) |
|
|
|
if(clearMode == all) |
|
|
|
{ |
|
|
|
while (num < SRAM_SIZE) |
|
|
|
while(num < SRAM_SIZE) |
|
|
|
{ |
|
|
|
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0); |
|
|
|
num += sizeof (quint64); |
|
|
|
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0); |
|
|
|
num += sizeof(quint64); |
|
|
|
} |
|
|
|
} |
|
|
|
if (clearMode == first4M) |
|
|
|
if(clearMode == first4M) |
|
|
|
{ |
|
|
|
while (num < SRAM_SIZE / 4) |
|
|
|
while(num < SRAM_SIZE / 4) |
|
|
|
{ |
|
|
|
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0); |
|
|
|
num += sizeof (quint64); |
|
|
|
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0); |
|
|
|
num += sizeof(quint64); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -96,28 +98,66 @@ void TrxBoard::scenParamsFilling(TrxBoard::eScenParams cmd) |
|
|
|
else |
|
|
|
{ |
|
|
|
_allow = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::afeAdcsSync() const |
|
|
|
{ |
|
|
|
quint32 syncErr(0); |
|
|
|
|
|
|
|
this->_bCtrlMngt->timerShot(20); |
|
|
|
while(!(this->_bCtrlMngt->checkTimeout())) |
|
|
|
{ |
|
|
|
; |
|
|
|
} |
|
|
|
|
|
|
|
this->_misc->setSyncMode(AdcSyncMode); |
|
|
|
this->_misc->setManualSync(true); |
|
|
|
this->_misc->setManualSync(false); |
|
|
|
this->_misc->setManualSync(BfSyncMode); |
|
|
|
|
|
|
|
this->_bCtrlMngt->timerShot(1); |
|
|
|
while(!((this->_afeSlave0->getAfeSyncDone()) && |
|
|
|
(this->_afeSlave1->getAfeSyncDone()) && |
|
|
|
(this->_afeSlave2->getAfeSyncDone()))) |
|
|
|
{ |
|
|
|
if(this->_bCtrlMngt->checkTimeout()) |
|
|
|
{ |
|
|
|
throw SonoException( |
|
|
|
"The timeout of the afe adcs sync is happend without receiving of sync done."); |
|
|
|
} |
|
|
|
} |
|
|
|
this->_bCtrlMngt->timerStop(); |
|
|
|
|
|
|
|
syncErr = this->_afeSlave0->getAfeSyncError(); |
|
|
|
syncErr += this->_afeSlave1->getAfeSyncError(); |
|
|
|
syncErr += this->_afeSlave2->getAfeSyncError(); |
|
|
|
|
|
|
|
if(syncErr != 0) |
|
|
|
{ |
|
|
|
throw SonoException("The error of the afe adcs sync is happend."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setSwapVector() |
|
|
|
{ |
|
|
|
_swapVec.clear(); |
|
|
|
_swapVec << 0 << 113 << 98 << 19 << 4 << 117 << 102 << 23 << 8 << 121 << 106 << 27 |
|
|
|
<< 12 << 125 << 110 << 31 << 16 << 1 << 114 << 99 << 20 << 5 << 118 << 103 |
|
|
|
<< 24 << 9 << 122 << 107 << 28 << 13 << 126 << 111 << 96 << 17 << 2 << 115 |
|
|
|
<< 100 << 21 << 6 << 119 << 104 << 25 << 10 << 123 << 108 << 29 << 14 << 127 |
|
|
|
<< 112 << 97 << 18 << 3 << 116 << 101 << 22 << 7 << 120 << 105 << 26 << 11 |
|
|
|
<< 124 << 109 << 30 << 15 << 32 << 145 << 130 << 51 << 36 << 149 << 134 << 55 |
|
|
|
<< 40 << 153 << 138 << 59 << 44 << 157 << 142 << 63 << 48 << 33 << 146 << 131 |
|
|
|
<< 52 << 37 << 150 << 135 << 56 << 41 << 154 << 139 << 60 << 45 << 158 << 143 |
|
|
|
<< 128 << 49 << 34 << 147 << 132 << 53 << 38 << 151 << 136 << 57 << 42 << 155 |
|
|
|
<< 140 << 61 << 46 << 159 << 144 << 129 << 50 << 35 << 148 << 133 << 54 << 39 |
|
|
|
<< 152 << 137 << 58 << 43 << 156 << 141 << 62 << 47 << 64 << 177 << 162 << 83 |
|
|
|
<< 68 << 181 << 166 << 87 << 72 << 185 << 170 << 91 << 76 << 189 << 174 << 95 |
|
|
|
<< 80 << 65 << 178 << 163 << 84 << 69 << 182 << 167 << 88 << 73 << 186 << 171 |
|
|
|
<< 92 << 77 << 190 << 175 << 160 << 81 << 66 << 179 << 164 << 85 << 70 << 183 |
|
|
|
<< 168 << 89 << 74 << 187 << 172 << 93 << 78 << 191 << 176 << 161 << 82 << 67 |
|
|
|
<< 180 << 165 << 86 << 71 << 184 << 169 << 90 << 75 << 188 << 173 << 94 << 79; |
|
|
|
_swapVec << 0 << 113 << 98 << 19 << 4 << 117 << 102 << 23 << 8 << 121 << 106 << 27 |
|
|
|
<< 12 << 125 << 110 << 31 << 16 << 1 << 114 << 99 << 20 << 5 << 118 << 103 |
|
|
|
<< 24 << 9 << 122 << 107 << 28 << 13 << 126 << 111 << 96 << 17 << 2 << 115 |
|
|
|
<< 100 << 21 << 6 << 119 << 104 << 25 << 10 << 123 << 108 << 29 << 14 << 127 |
|
|
|
<< 112 << 97 << 18 << 3 << 116 << 101 << 22 << 7 << 120 << 105 << 26 << 11 |
|
|
|
<< 124 << 109 << 30 << 15 << 32 << 145 << 130 << 51 << 36 << 149 << 134 << 55 |
|
|
|
<< 40 << 153 << 138 << 59 << 44 << 157 << 142 << 63 << 48 << 33 << 146 << 131 |
|
|
|
<< 52 << 37 << 150 << 135 << 56 << 41 << 154 << 139 << 60 << 45 << 158 << 143 |
|
|
|
<< 128 << 49 << 34 << 147 << 132 << 53 << 38 << 151 << 136 << 57 << 42 << 155 |
|
|
|
<< 140 << 61 << 46 << 159 << 144 << 129 << 50 << 35 << 148 << 133 << 54 << 39 |
|
|
|
<< 152 << 137 << 58 << 43 << 156 << 141 << 62 << 47 << 64 << 177 << 162 << 83 |
|
|
|
<< 68 << 181 << 166 << 87 << 72 << 185 << 170 << 91 << 76 << 189 << 174 << 95 |
|
|
|
<< 80 << 65 << 178 << 163 << 84 << 69 << 182 << 167 << 88 << 73 << 186 << 171 |
|
|
|
<< 92 << 77 << 190 << 175 << 160 << 81 << 66 << 179 << 164 << 85 << 70 << 183 |
|
|
|
<< 168 << 89 << 74 << 187 << 172 << 93 << 78 << 191 << 176 << 161 << 82 << 67 |
|
|
|
<< 180 << 165 << 86 << 71 << 184 << 169 << 90 << 75 << 188 << 173 << 94 << 79; |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setRomCrc() |
|
|
@ -125,7 +165,9 @@ void TrxBoard::setRomCrc() |
|
|
|
unsigned char crcArray[] = {0x4, 0x0, 0x13, 0x0, 0x27, 0x0, 0x28, 0x0, 0xEB, 0x1, |
|
|
|
0xAC, 0x5, 0xAC, 0x6, 0x4C, 0x6, 0xB0, 0x6, 0xB2}; |
|
|
|
for(auto var : crcArray) |
|
|
|
{ |
|
|
|
_eepromCrc.push_back(static_cast<char>(var)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setAfeModuleOffset() |
|
|
@ -142,15 +184,15 @@ void TrxBoard::setFpgaOffset() |
|
|
|
|
|
|
|
//QList<quint32> TrxBoard::signedVector2unsignedList (QVector<qint32>& sgnVec)
|
|
|
|
//{
|
|
|
|
// _unsignedQntzrList.clear();
|
|
|
|
//_unsignedQntzrList.clear();
|
|
|
|
//// std::list<uint> _usgnList (sgnVec.begin(), sgnVec.end());
|
|
|
|
//// _unsignedQntzrList.fromStdList(_usgnList);
|
|
|
|
// foreach (auto i, sgnVec)
|
|
|
|
// {
|
|
|
|
// _unsignedQntzrList.push_back(static_cast<quint32>(i));
|
|
|
|
// }
|
|
|
|
//foreach (auto i, sgnVec)
|
|
|
|
//{
|
|
|
|
//_unsignedQntzrList.push_back(static_cast<quint32>(i));
|
|
|
|
//}
|
|
|
|
|
|
|
|
// return _unsignedQntzrList;
|
|
|
|
//return _unsignedQntzrList;
|
|
|
|
//}
|
|
|
|
|
|
|
|
TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(0x800000) |
|
|
@ -242,11 +284,13 @@ void TrxBoard::init() |
|
|
|
sramClear(all); |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams) |
|
|
|
void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam& prbDepParams) |
|
|
|
{ |
|
|
|
/////////////////////////// DSP setting ///////////////////////////
|
|
|
|
if (prbDepParams.prbDepParams.apodizationLut.size() != APODIZATIONLUT_LUT_MAX) |
|
|
|
if(prbDepParams.prbDepParams.apodizationLut.size() != APODIZATIONLUT_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Apodization lut is out of range"); |
|
|
|
} |
|
|
|
QList<QList<quint32> > apodizationQ; |
|
|
|
foreach(auto vec, prbDepParams.prbDepParams.apodizationLut) |
|
|
|
{ |
|
|
@ -257,8 +301,10 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams) |
|
|
|
this->_beamFormerSlave2->apodizationLut(apodizationQ); |
|
|
|
scenParamsFilling(set); |
|
|
|
|
|
|
|
if (prbDepParams.prbDepParams.atgcLut.size() != ATGC_LUT_MAX) |
|
|
|
if(prbDepParams.prbDepParams.atgcLut.size() != ATGC_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Atgc lut is out of range"); |
|
|
|
} |
|
|
|
QList<QList<quint32> > atgcLutQ; |
|
|
|
foreach(auto vec, prbDepParams.prbDepParams.atgcLut) |
|
|
|
{ |
|
|
@ -266,8 +312,10 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams) |
|
|
|
} |
|
|
|
this->_dsp->atgcLut(atgcLutQ); |
|
|
|
|
|
|
|
if (prbDepParams.prbDepParams.lpfLut.size() != LPF_LUT_MAX) |
|
|
|
if(prbDepParams.prbDepParams.lpfLut.size() != LPF_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Lpf lut is out of range"); |
|
|
|
} |
|
|
|
QList<QList<quint32> > lpfLutQ; |
|
|
|
foreach(auto vec, prbDepParams.prbDepParams.lpfLut) |
|
|
|
{ |
|
|
@ -279,73 +327,106 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams) |
|
|
|
this->_afeSlave0->setAfeParams(prbDepParams.afeCfg); |
|
|
|
this->_afeSlave1->setAfeParams(prbDepParams.afeCfg); |
|
|
|
this->_afeSlave2->setAfeParams(prbDepParams.afeCfg); |
|
|
|
this->_afeSlave0->setAfeGblPwr(afePwrdnEnable); |
|
|
|
this->_afeSlave1->setAfeGblPwr(afePwrdnEnable); |
|
|
|
this->_afeSlave2->setAfeGblPwr(afePwrdnEnable); |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setScenario(ScenGenHardwareOutput_t &scenGenHw) |
|
|
|
void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw) |
|
|
|
{ |
|
|
|
if (this->_scenPlayer->control.getCommand()) |
|
|
|
if(this->_scenPlayer->control.getCommand()) |
|
|
|
{ |
|
|
|
scenPlayerStop(); |
|
|
|
} |
|
|
|
emulatorStop(); |
|
|
|
sramClear(first4M); |
|
|
|
|
|
|
|
scenParams->focusTypeNumber = scenGenHw.focusTypeNumber; |
|
|
|
if (scenParams->focusTypeNumber > FOCUS_TYPE_NUMBER_MAX) |
|
|
|
if(scenParams->focusTypeNumber > FOCUS_TYPE_NUMBER_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Focus type number is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->totalTxShotNumber = scenGenHw.totalTxShotNumber; |
|
|
|
if (scenParams->totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX) |
|
|
|
if(scenParams->totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Total tx shot number is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber.toVector(); |
|
|
|
if (scenParams->rxBeamFormerNumber.size() > RX_BEAMFORMER_NUMBER_MAX) |
|
|
|
if(scenParams->rxBeamFormerNumber.size() > RX_BEAMFORMER_NUMBER_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Rx beam former number is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->scenarioStartIndex = scenGenHw.hwRegister.scenarioStartIndex; |
|
|
|
scenParams->scenarioEndIndex = scenGenHw.hwRegister.scenarioEndIndex; |
|
|
|
|
|
|
|
if (scenParams->scenarioEndIndex > SCENARIO_INDEX_MAX) |
|
|
|
if(scenParams->scenarioEndIndex > SCENARIO_INDEX_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Scenario end index is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
if(scenParams->scenarioEndIndex < scenParams->scenarioStartIndex) |
|
|
|
{ |
|
|
|
throw SonoException( |
|
|
|
"The scenario end index must be greater than or equal to the scenario start index"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->blendWeight = scenGenHw.hwRegister.blendWeight; |
|
|
|
if (scenParams->hwRegister->blendWeight.size() != BLENDWEIGHT_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->blendWeight.size() != BLENDWEIGHT_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Blend weight lut is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->elementPosition->xPosition = scenGenHw.hwRegister.elementXPosition; |
|
|
|
if (scenParams->hwRegister->elementPosition->xPosition.size() != ELEMENT_POSITION_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->elementPosition->xPosition.size() != ELEMENT_POSITION_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Element position x is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->elementPosition->yPosition = scenGenHw.hwRegister.elementYPosition; |
|
|
|
if (scenParams->hwRegister->elementPosition->yPosition.size() != ELEMENT_POSITION_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->elementPosition->yPosition.size() != ELEMENT_POSITION_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Element position y is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->elementPosition->zPosition = scenGenHw.hwRegister.elementZPosition; |
|
|
|
if (scenParams->hwRegister->elementPosition->zPosition.size() != ELEMENT_POSITION_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->elementPosition->zPosition.size() != ELEMENT_POSITION_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Element position z is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->freqLut = scenGenHw.hwRegister.freqLut; |
|
|
|
if (scenParams->hwRegister->freqLut.size() != FREQUENCY_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->freqLut.size() != FREQUENCY_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Frequency lut is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->dtgcLut = scenGenHw.hwRegister.dtgcLut; |
|
|
|
if (scenParams->hwRegister->dtgcLut.size() != DTGC_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->dtgcLut.size() != DTGC_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Dtgc lut is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->pulseTypeNumber = scenGenHw.hwRegister.pulseTypeNumber; |
|
|
|
if (scenParams->hwRegister->pulseTypeNumber > PULSE_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->pulseTypeNumber > PULSE_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Pulse type number is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->rxBeamFormerTypeNumber = scenGenHw.hwRegister.rxBeamFormerTypeNumber; |
|
|
|
if (scenParams->hwRegister->rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Rx beam former type number is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->receiverConfigTypeNumber = |
|
|
|
scenGenHw.hwRegister.receiverConfigTypeNumber; |
|
|
|
if (scenParams->hwRegister->receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX) |
|
|
|
if(scenParams->hwRegister->receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Receiver config type number is out of range"); |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->pulse->clear(); |
|
|
|
foreach(auto i, scenGenHw.hwRegister.pulseProps) |
|
|
@ -366,7 +447,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t &scenGenHw) |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->hwRegister->configLut->clear(); |
|
|
|
foreach (auto k, scenGenHw.hwRegister.receiverConfigProps) |
|
|
|
foreach(auto k, scenGenHw.hwRegister.receiverConfigProps) |
|
|
|
{ |
|
|
|
scenParams->hwRegister->configLut->mla.append(k.mla); |
|
|
|
scenParams->hwRegister->configLut->stb.append(k.stb); |
|
|
@ -386,7 +467,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t &scenGenHw) |
|
|
|
} |
|
|
|
|
|
|
|
scenParams->indexParams->dLineNum = scenGenHw.indexParams.dLineNum; |
|
|
|
scenParams->indexParams->frameType=scenGenHw.frameType; |
|
|
|
scenParams->indexParams->frameType = scenGenHw.frameType; |
|
|
|
scenParams->indexParams->dEnsembleNum = scenGenHw.indexParams.dEnsembleNum; |
|
|
|
scenParams->indexParams->lastLineInFrame = scenGenHw.indexParams.lastLineInFrame; |
|
|
|
scenParams->indexParams->firstLineInFrame = scenGenHw.indexParams.firstLineInFrame; |
|
|
@ -529,7 +610,8 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams) |
|
|
|
QList<quint32> freqLutQ = _unsignedQntzrVec.toList(); |
|
|
|
this->_dsp->frequencyLut(freqLutQ); |
|
|
|
|
|
|
|
_unsignedQntzrVec = Calculation::qntzr(scenParams->hwRegister->dtgcLut, 0, 12, 8, 0, true, false); |
|
|
|
_unsignedQntzrVec = |
|
|
|
Calculation::qntzr(scenParams->hwRegister->dtgcLut, 0, 12, 8, 0, true, false); |
|
|
|
QList<quint32> dtgcLutQ = _unsignedQntzrVec.toList(); |
|
|
|
this->_dsp->dtgcLut(dtgcLutQ); |
|
|
|
|
|
|
@ -551,21 +633,22 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams) |
|
|
|
this->_sram->setSramTx(scenParams->focusTypeNumber, scenParams->txParams); |
|
|
|
|
|
|
|
this->_sram->setSramRx(scenParams->rxBeamFormerNumber, |
|
|
|
scenParams->focusTypeNumber, |
|
|
|
scenParams->rxParams); |
|
|
|
scenParams->focusTypeNumber, |
|
|
|
scenParams->rxParams); |
|
|
|
|
|
|
|
scenParamsFilling(set); |
|
|
|
|
|
|
|
////////////////////////////// Scen Index setting ////////////////////////////
|
|
|
|
this->_scenPlayer->setStartIndex(scenParams->scenarioStartIndex); |
|
|
|
this->_scenPlayer->setEndIndex(scenParams->scenarioEndIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut) |
|
|
|
{ |
|
|
|
if (lineFilterLut.size() != LINE_FILTER_LUT_MAX) |
|
|
|
if(lineFilterLut.size() != LINE_FILTER_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Line filter lut is out of range"); |
|
|
|
} |
|
|
|
_unsignedQntzrVec = Calculation::qntzr(lineFilterLut, 0, 9, 8, 0, true, false); |
|
|
|
QList<quint32> lineFilterLutQ = _unsignedQntzrVec.toList(); |
|
|
|
this->_dsp->lineFilterCoefficient(lineFilterLutQ); |
|
|
@ -573,8 +656,10 @@ void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut) |
|
|
|
|
|
|
|
void TrxBoard::setStbCoefficient(QVector<quint32>& stbLut) |
|
|
|
{ |
|
|
|
if (stbLut.size() != STB_COEFFICIENT_LUT_MAX) |
|
|
|
if(stbLut.size() != STB_COEFFICIENT_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Stb lut is out of range"); |
|
|
|
} |
|
|
|
QList<quint32> stbLutQ = stbLut.toList(); |
|
|
|
this->_dsp->stbCoefficient(stbLutQ); |
|
|
|
} |
|
|
@ -586,29 +671,31 @@ void TrxBoard::setAtgcMode(eAtgcMode mode, quint16 value) const |
|
|
|
|
|
|
|
void TrxBoard::setDtgcLut(QVector<float>& dtgcLut) |
|
|
|
{ |
|
|
|
if (dtgcLut.size() != DTGC_LUT_MAX) |
|
|
|
if(dtgcLut.size() != DTGC_LUT_MAX) |
|
|
|
{ |
|
|
|
throw SonoException("Dtgc lut is out of range"); |
|
|
|
} |
|
|
|
_unsignedQntzrVec = Calculation::qntzr(dtgcLut, 0, 12, 8, 0, true, false); |
|
|
|
QList<quint32> dtgcLutQ = _unsignedQntzrVec.toList(); |
|
|
|
this->_dsp->dtgcLut(dtgcLutQ); |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setFramesMetaData(const QByteArray &metaData) const |
|
|
|
void TrxBoard::setFramesMetaData(const QByteArray& metaData) const |
|
|
|
{ |
|
|
|
QList<quint64> data; |
|
|
|
QByteArray temp; |
|
|
|
qint32 num(0); |
|
|
|
|
|
|
|
while (num < metaData.size()) |
|
|
|
while(num < metaData.size()) |
|
|
|
{ |
|
|
|
for (quint8 j=0; j < sizeof (quint64); j++) |
|
|
|
for(quint8 j = 0; j < sizeof(quint64); j++) |
|
|
|
{ |
|
|
|
temp.append(metaData[j+num]); |
|
|
|
temp.append(metaData[j + num]); |
|
|
|
} |
|
|
|
|
|
|
|
data.push_back(byteArray2UintLittleEndian <quint64>(temp)); |
|
|
|
data.push_back(byteArray2UintLittleEndian<quint64>(temp)); |
|
|
|
temp.clear(); |
|
|
|
num += sizeof (quint64); |
|
|
|
num += sizeof(quint64); |
|
|
|
} |
|
|
|
this->_sram->setSramMetaData(data); |
|
|
|
} |
|
|
@ -620,18 +707,18 @@ void TrxBoard::setScenarioCompare(const QString scenPath) |
|
|
|
QString saveFile = scenPath + createSramBinary; |
|
|
|
QFile sramFile(saveFile); |
|
|
|
|
|
|
|
if (!sramFile.open(QIODevice::WriteOnly)) |
|
|
|
if(!sramFile.open(QIODevice::WriteOnly)) |
|
|
|
{ |
|
|
|
throw SonoException("Couldn't create the sram binary file due to the wrong path probably."); |
|
|
|
} |
|
|
|
|
|
|
|
quint32 num(0); |
|
|
|
quint64 value(0); |
|
|
|
while (num < SRAM_SIZE/4) |
|
|
|
while(num < SRAM_SIZE / 4) |
|
|
|
{ |
|
|
|
value = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num)); |
|
|
|
sramFile.write(uintLittleEndian2ByteArray<quint64>(value)); |
|
|
|
num += sizeof (quint64); |
|
|
|
value = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num)); |
|
|
|
sramFile.write(uintLittleEndian2ByteArray<quint64>(value)); |
|
|
|
num += sizeof(quint64); |
|
|
|
} |
|
|
|
|
|
|
|
sramFile.flush(); |
|
|
@ -648,20 +735,22 @@ void TrxBoard::setScenarioCompare(const QString scenPath) |
|
|
|
|
|
|
|
if(!csvReadFile.open(QFile::ReadOnly)) |
|
|
|
{ |
|
|
|
throw SonoException("Could not open the register's scenario params due to the wrong path probably."); |
|
|
|
throw SonoException( |
|
|
|
"Could not open the register's scenario params due to the wrong path probably."); |
|
|
|
} |
|
|
|
|
|
|
|
QString registerCompareScenario = "/hardware/registerCompare.csv"; |
|
|
|
QString regCompareParamsPath = scenPath + registerCompareScenario; |
|
|
|
QFile csvWriteFile(regCompareParamsPath); |
|
|
|
|
|
|
|
if (!csvWriteFile.open(QFile::WriteOnly)) |
|
|
|
if(!csvWriteFile.open(QFile::WriteOnly)) |
|
|
|
{ |
|
|
|
throw SonoException("Couldn't create the register compare file due to the wrong path probably."); |
|
|
|
throw SonoException( |
|
|
|
"Couldn't create the register compare file due to the wrong path probably."); |
|
|
|
} |
|
|
|
|
|
|
|
quint32 bar = 0; |
|
|
|
qint64 readSize = 0; |
|
|
|
qint64 readSize = 0; |
|
|
|
QString line; |
|
|
|
|
|
|
|
auto size = csvReadFile.size(); |
|
|
@ -674,16 +763,15 @@ void TrxBoard::setScenarioCompare(const QString scenPath) |
|
|
|
auto boardValue = _device.device.readWord(bar, address); |
|
|
|
|
|
|
|
auto res = "NOK"; |
|
|
|
if (boardValue == baseValue) |
|
|
|
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); |
|
|
|
|
|
|
|
.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); |
|
|
@ -706,7 +794,8 @@ void TrxBoard::setScenarioCompare(const QString scenPath) |
|
|
|
|
|
|
|
if(!sramReadFile.open(QFile::ReadOnly)) |
|
|
|
{ |
|
|
|
throw SonoException("Could not open the sram's scenario params due to the wrong path probably."); |
|
|
|
throw SonoException( |
|
|
|
"Could not open the sram's scenario params due to the wrong path probably."); |
|
|
|
} |
|
|
|
|
|
|
|
qint64 sramScenarioLength = sramReadFile.size(); |
|
|
@ -719,29 +808,28 @@ void TrxBoard::setScenarioCompare(const QString scenPath) |
|
|
|
quint64 fileValue(0); |
|
|
|
QByteArray temp; |
|
|
|
|
|
|
|
while (num < sramScenarioLength) |
|
|
|
while(num < sramScenarioLength) |
|
|
|
{ |
|
|
|
boardValue = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num)); |
|
|
|
|
|
|
|
for (quint8 j=0; j < sizeof (quint64); j++) |
|
|
|
for(quint8 j = 0; j < sizeof(quint64); j++) |
|
|
|
{ |
|
|
|
temp.append(fileByte[j+num]); |
|
|
|
temp.append(fileByte[j + num]); |
|
|
|
} |
|
|
|
|
|
|
|
fileValue = byteArray2UintLittleEndian <quint64>(temp); |
|
|
|
fileValue = byteArray2UintLittleEndian<quint64>(temp); |
|
|
|
|
|
|
|
if (boardValue != fileValue) |
|
|
|
if(boardValue != fileValue) |
|
|
|
{ |
|
|
|
throw SonoException("The sram scenario file is different to the sram params of board."); |
|
|
|
} |
|
|
|
temp.clear(); |
|
|
|
num += sizeof (quint64); |
|
|
|
num += sizeof(quint64); |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef DEVELOP_UI |
|
|
|
emit sramVerifyMessage("Successful comparision without any difference."); |
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) |
|
|
@ -750,15 +838,18 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) |
|
|
|
quint32 offset(0); |
|
|
|
afeRegValue.clear(); |
|
|
|
|
|
|
|
switch (sel) |
|
|
|
switch(sel) |
|
|
|
{ |
|
|
|
case slave0: |
|
|
|
|
|
|
|
this->_afeSlave0->setReadRegEnable(true); |
|
|
|
this->_bCtrlMngt->timerShot(1); |
|
|
|
while(!(this->_bCtrlMngt->checkTimeout())); |
|
|
|
while(!(this->_bCtrlMngt->checkTimeout())) |
|
|
|
{ |
|
|
|
; |
|
|
|
} |
|
|
|
|
|
|
|
for (quint8 i=0; i < _afeModuleOffset.size(); i++) |
|
|
|
for(quint8 i = 0; i < _afeModuleOffset.size(); i++) |
|
|
|
{ |
|
|
|
offset = (_fpgaOffset.at(slave0) + _afeModuleOffset.at(i) + afeRegAddr) * 4; |
|
|
|
afeRegValue.push_back(this->_device.device.readWord(BAR_REG, offset)); |
|
|
@ -770,9 +861,12 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) |
|
|
|
|
|
|
|
this->_afeSlave1->setReadRegEnable(true); |
|
|
|
this->_bCtrlMngt->timerShot(1); |
|
|
|
while(!(this->_bCtrlMngt->checkTimeout())); |
|
|
|
while(!(this->_bCtrlMngt->checkTimeout())) |
|
|
|
{ |
|
|
|
; |
|
|
|
} |
|
|
|
|
|
|
|
for (quint8 i=0; i < _afeModuleOffset.size(); i++) |
|
|
|
for(quint8 i = 0; i < _afeModuleOffset.size(); i++) |
|
|
|
{ |
|
|
|
offset = (_fpgaOffset.at(slave1) + _afeModuleOffset.at(i) + afeRegAddr) * 4; |
|
|
|
afeRegValue.push_back(this->_device.device.readWord(BAR_REG, offset)); |
|
|
@ -784,9 +878,12 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) |
|
|
|
|
|
|
|
this->_afeSlave2->setReadRegEnable(true); |
|
|
|
this->_bCtrlMngt->timerShot(1); |
|
|
|
while(!(this->_bCtrlMngt->checkTimeout())); |
|
|
|
while(!(this->_bCtrlMngt->checkTimeout())) |
|
|
|
{ |
|
|
|
; |
|
|
|
} |
|
|
|
|
|
|
|
for (quint8 i=0; i < _afeModuleOffset.size(); i++) |
|
|
|
for(quint8 i = 0; i < _afeModuleOffset.size(); i++) |
|
|
|
{ |
|
|
|
offset = (_fpgaOffset.at(slave2) + _afeModuleOffset.at(i) + afeRegAddr) * 4; |
|
|
|
afeRegValue.push_back(this->_device.device.readWord(BAR_REG, offset)); |
|
|
@ -800,7 +897,6 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr) |
|
|
|
|
|
|
|
void TrxBoard::slaveFpgaProgram(const QString path) |
|
|
|
{ |
|
|
|
|
|
|
|
scenParamsFilling(clear); |
|
|
|
|
|
|
|
if(MOUNTED_SLAVE_FPGA <= 0 || MOUNTED_SLAVE_FPGA >= 8) |
|
|
@ -827,7 +923,7 @@ void TrxBoard::slaveFpgaProgram(const QString path) |
|
|
|
|
|
|
|
this->_fpgaProgram->program(bitFileData, MOUNTED_SLAVE_FPGA); |
|
|
|
|
|
|
|
|
|
|
|
afeAdcsSync(); |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::setBeamFormerMode(eClkMode mode) const |
|
|
@ -837,7 +933,6 @@ void TrxBoard::setBeamFormerMode(eClkMode mode) const |
|
|
|
|
|
|
|
void TrxBoard::scenPlayerStart(void) |
|
|
|
{ |
|
|
|
|
|
|
|
if(_allow) |
|
|
|
{ |
|
|
|
_run = false; |
|
|
@ -905,8 +1000,10 @@ void TrxBoard::emulatorInit(EmulatorProperties* config) const |
|
|
|
|
|
|
|
void TrxBoard::fillRam(QString path) |
|
|
|
{ |
|
|
|
if (this->_scenPlayer->control.getCommand()) |
|
|
|
if(this->_scenPlayer->control.getCommand()) |
|
|
|
{ |
|
|
|
scenPlayerStop(); |
|
|
|
} |
|
|
|
emulatorStop(); |
|
|
|
|
|
|
|
QFile emulFile(path); |
|
|
@ -929,16 +1026,18 @@ void TrxBoard::fillRam(QString path) |
|
|
|
sramData = emulFile.readAll(); |
|
|
|
emulFile.close(); |
|
|
|
|
|
|
|
while (num < sramData.size()) |
|
|
|
while(num < sramData.size()) |
|
|
|
{ |
|
|
|
for (quint8 j=0; j < sizeof (quint64); j++) |
|
|
|
for(quint8 j = 0; j < sizeof(quint64); j++) |
|
|
|
{ |
|
|
|
temp.append(sramData[j+num]); |
|
|
|
temp.append(sramData[j + num]); |
|
|
|
} |
|
|
|
|
|
|
|
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), byteArray2UintLittleEndian <quint64>(temp)); |
|
|
|
this->_device.device.writeLong(BAR_SRAM, |
|
|
|
static_cast<quint32>(num), |
|
|
|
byteArray2UintLittleEndian<quint64>(temp)); |
|
|
|
temp.clear(); |
|
|
|
num += sizeof (quint64); |
|
|
|
num += sizeof(quint64); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -980,7 +1079,7 @@ quint32 TrxBoard::vendorId() const |
|
|
|
return vid; |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::trxState(EepromStatus &romStatus) const |
|
|
|
void TrxBoard::trxState(EepromStatus& romStatus) const |
|
|
|
{ |
|
|
|
QByteArray id; |
|
|
|
QByteArray crcChk; |
|
|
@ -988,16 +1087,20 @@ void TrxBoard::trxState(EepromStatus &romStatus) const |
|
|
|
romStatus.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->trxEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->trxEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::mpsState(EepromStatus &romStatus) const |
|
|
|
void TrxBoard::mpsState(EepromStatus& romStatus) const |
|
|
|
{ |
|
|
|
QByteArray id; |
|
|
|
QByteArray crcChk; |
|
|
@ -1005,16 +1108,20 @@ void TrxBoard::mpsState(EepromStatus &romStatus) const |
|
|
|
romStatus.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->mpsEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->mpsEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::prbCtrlState(EepromStatus &romStatus) const |
|
|
|
void TrxBoard::prbCtrlState(EepromStatus& romStatus) const |
|
|
|
{ |
|
|
|
QByteArray id; |
|
|
|
QByteArray crcChk; |
|
|
@ -1022,44 +1129,60 @@ void TrxBoard::prbCtrlState(EepromStatus &romStatus) const |
|
|
|
romStatus.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::selectedPrbState(EepromStatus &romStatus, eSelectProbe prbSel) const |
|
|
|
void TrxBoard::selectedPrbState(EepromStatus& romStatus, eSelectProbe prbSel) const |
|
|
|
{ |
|
|
|
QVector<bool> vec; |
|
|
|
QByteArray id; |
|
|
|
QByteArray crcChk; |
|
|
|
|
|
|
|
vec = this->_bCtrlMngt->getConnectedPrb(); |
|
|
|
if (prbSel == prbA && !vec.at(0)) |
|
|
|
if(prbSel == prbA && !vec.at(0)) |
|
|
|
{ |
|
|
|
throw SonoException("This probe is disconnected"); |
|
|
|
} |
|
|
|
|
|
|
|
if (prbSel == prbB && !vec.at(1)) |
|
|
|
if(prbSel == prbB && !vec.at(1)) |
|
|
|
{ |
|
|
|
throw SonoException("This probe is disconnected"); |
|
|
|
} |
|
|
|
|
|
|
|
if (prbSel == prbC && !vec.at(2)) |
|
|
|
if(prbSel == prbC && !vec.at(2)) |
|
|
|
{ |
|
|
|
throw SonoException("This probe is disconnected"); |
|
|
|
} |
|
|
|
|
|
|
|
if (prbSel == prbD && !vec.at(3)) |
|
|
|
if(prbSel == prbD && !vec.at(3)) |
|
|
|
{ |
|
|
|
throw SonoException("This probe is disconnected"); |
|
|
|
} |
|
|
|
|
|
|
|
romStatus.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, prbSel-1); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, prbSel - 1); |
|
|
|
romStatus.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, prbSel-1); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, prbSel - 1); |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
romStatus.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::prbState(PrbCase* prb) const |
|
|
@ -1080,13 +1203,18 @@ void TrxBoard::prbState(PrbCase* prb) const |
|
|
|
prb->prbA.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i); |
|
|
|
prb->prbA.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
prb->prbA.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
crcChk = |
|
|
|
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
prb->prbA.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
prb->prbA.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -1102,13 +1230,18 @@ void TrxBoard::prbState(PrbCase* prb) const |
|
|
|
prb->prbB.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i); |
|
|
|
prb->prbB.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
prb->prbB.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
crcChk = |
|
|
|
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
prb->prbB.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
prb->prbB.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -1124,13 +1257,18 @@ void TrxBoard::prbState(PrbCase* prb) const |
|
|
|
prb->prbC.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i); |
|
|
|
prb->prbC.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
prb->prbC.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
crcChk = |
|
|
|
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
prb->prbC.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
prb->prbC.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -1146,13 +1284,18 @@ void TrxBoard::prbState(PrbCase* prb) const |
|
|
|
prb->prbD.ConnectionMode = connected; |
|
|
|
|
|
|
|
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i); |
|
|
|
prb->prbD.id = byteArray2UintBigEndian<quint16> (id); |
|
|
|
prb->prbD.id = byteArray2UintBigEndian<quint16>(id); |
|
|
|
|
|
|
|
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if (crcChk == _eepromCrc) |
|
|
|
crcChk = |
|
|
|
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i); |
|
|
|
if(crcChk == _eepromCrc) |
|
|
|
{ |
|
|
|
prb->prbD.errorCode = EEPROM_NO_ERROR; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
prb->prbD.errorCode = EEPROM_CRC_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -1173,8 +1316,9 @@ QString TrxBoard::trxInfo() const |
|
|
|
getFpgasCodeVersion(&version); |
|
|
|
|
|
|
|
QString info = QString(this->_bCtrlMngt->trxEepromRead(EEPROM_INFO_BEGIN, EEPROM_INFO_NUMBER)); |
|
|
|
return (info + "(FPM-V " + QString::number(version.masterCode, 10) |
|
|
|
+ ", FPS-V " + QString::number(version.slave0Code, 10) + ")"); |
|
|
|
|
|
|
|
return (info + "(FPM-V " + QString::number(version.masterCode, 10) + |
|
|
|
", FPS-V " + QString::number(version.slave0Code, 10) + ")"); |
|
|
|
} |
|
|
|
|
|
|
|
QString TrxBoard::mpsInfo() const |
|
|
@ -1189,7 +1333,9 @@ QString TrxBoard::prbCtrlInfo() const |
|
|
|
|
|
|
|
QByteArray TrxBoard::selectedPrbImpulseResponse(quint8 prbSel) const |
|
|
|
{ |
|
|
|
return this->_bCtrlMngt->prbEepromRead(EEPROM_IMPULSE_RESPONSE_BEGIN, EEPROM_IMPULSE_RESPONSE_NUMBER, prbSel); |
|
|
|
return this->_bCtrlMngt->prbEepromRead(EEPROM_IMPULSE_RESPONSE_BEGIN, |
|
|
|
EEPROM_IMPULSE_RESPONSE_NUMBER, |
|
|
|
prbSel); |
|
|
|
} |
|
|
|
|
|
|
|
void TrxBoard::prbImpulseResponse(ConnectedPrbInfo* prbInfo) const |
|
|
@ -1268,7 +1414,10 @@ void TrxBoard::mpsSetAo(float voltA, float voltB) const |
|
|
|
|
|
|
|
void TrxBoard::selectProbe(eSelectProbe prbSel) |
|
|
|
{ |
|
|
|
scenPlayerStop(); |
|
|
|
if(this->_scenPlayer->control.getCommand()) |
|
|
|
{ |
|
|
|
scenPlayerStop(); |
|
|
|
} |
|
|
|
this->_bCtrlMngt->setProbeSelect(prbSel); |
|
|
|
} |
|
|
|
|
|
|
@ -1348,3 +1497,8 @@ void TrxBoard::sramParityClear() |
|
|
|
val = this->_device.device.readLong(BAR_SRAM, 0); |
|
|
|
this->_device.device.writeLong(BAR_SRAM, 0, val); |
|
|
|
} |
|
|
|
|
|
|
|
quint32 TrxBoard::getFrameLostCounter() const |
|
|
|
{ |
|
|
|
return (this->_misc->getFrameLostCount()); |
|
|
|
} |
|
|
|