|
|
|
#include "model/hardware/core/TrxBoard.h"
|
|
|
|
|
|
|
|
#include <QtConcurrent/QtConcurrent>
|
|
|
|
#include <chrono>
|
|
|
|
#include <thread>
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief Return board name
|
|
|
|
* @details The function will return the name of hardware based on hardware
|
|
|
|
* provided data
|
|
|
|
* @attention This value is a shadow value, to update it call @updateInfo()
|
|
|
|
* @return The name of board
|
|
|
|
*/
|
|
|
|
QString TrxBoard::getName()
|
|
|
|
{
|
|
|
|
return _name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief Return board version
|
|
|
|
* @details The function will return the version of hardware based on hardware
|
|
|
|
* provided data
|
|
|
|
* @attention This value is a shadow value, to update it call @updateInfo()
|
|
|
|
* @return The version of board
|
|
|
|
*/
|
|
|
|
QString TrxBoard::getVersion()
|
|
|
|
{
|
|
|
|
return _version;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief PowerBoard::selfTest
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
bool TrxBoard::selfTest()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief TrxBoard::updateInfo
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
/*************************************************************************************************/
|
|
|
|
bool TrxBoard::updateInfo()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief TrxBoard::updateStatus
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
/*************************************************************************************************/
|
|
|
|
bool TrxBoard::updateStatus()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
///*************************************************************************************************/
|
|
|
|
///**
|
|
|
|
// * @brief TrxBoard::slaveProgramming
|
|
|
|
// */
|
|
|
|
///*************************************************************************************************/
|
|
|
|
//void fpgaProgrammer (QString path)
|
|
|
|
//{
|
|
|
|
// QFile file(path);
|
|
|
|
|
|
|
|
// if (!file.open(QFile::ReadOnly))
|
|
|
|
// {
|
|
|
|
// MESSAGE_BOX("Could not open bit file, aborting operation");
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// const auto actualSize = file.size();
|
|
|
|
// auto readSize = 0;
|
|
|
|
// while(readSize < actualSize)
|
|
|
|
// {
|
|
|
|
// QByteArray chunk = file.read(4);
|
|
|
|
// _slaveProgRegs.setSlaveProg(chunk);
|
|
|
|
// try
|
|
|
|
// {
|
|
|
|
// auto temp = _slaveProgRegs.getSlaveProgStatus();
|
|
|
|
// while ((temp & 0x01) == 0x01)
|
|
|
|
// {
|
|
|
|
// temp = _slaveProgRegs.getSlaveProgStatus();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if((temp & 0x08) == 0x08)
|
|
|
|
// {
|
|
|
|
// QString failedFpga = _slaveProgRegs.WhichFpgaFailed(temp);
|
|
|
|
// QString a = "init_fail flag raised, Failed FPGAs: " + failedFpga;
|
|
|
|
// throw(myexception(a.toUtf8().data()));
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if((temp & 0x10) == 0x10)
|
|
|
|
// {
|
|
|
|
// throw(myexception("time_out flag raised"));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// catch (myexception e)
|
|
|
|
// {
|
|
|
|
// MESSAGE_BOX(e.what());
|
|
|
|
|
|
|
|
// emit updateFpgaProgressVisibility(false);
|
|
|
|
|
|
|
|
// file.close();
|
|
|
|
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// readSize += 4;
|
|
|
|
|
|
|
|
// auto percentage = (readSize * 100 / actualSize);
|
|
|
|
// emit updateFpgaProgressValue(percentage);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// auto temp = _slaveProgRegs.getSlaveProgStatus();
|
|
|
|
// while(((temp >> 1) & 0x03) == 0)
|
|
|
|
// {
|
|
|
|
// temp = _slaveProgRegs.getSlaveProgStatus();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if((temp & 0x02) == 0x02)
|
|
|
|
// {
|
|
|
|
// MESSAGE_BOX("FPGA programming finished with success");
|
|
|
|
// }
|
|
|
|
// else if((temp & 0x04) == 0x04)
|
|
|
|
// {
|
|
|
|
// QString failedFpga = _slaveProgRegs.WhichFpgaFailed(temp);
|
|
|
|
|
|
|
|
// MESSAGE_BOX("FPGA programming failed, Failed FPGAs: " + failedFpga);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// emit updateFpgaProgressVisibility(false);
|
|
|
|
|
|
|
|
// file.close();
|
|
|
|
//}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief TrxBoard::start
|
|
|
|
*/
|
|
|
|
/*************************************************************************************************/
|
|
|
|
void TrxBoard::start()
|
|
|
|
{
|
|
|
|
_device.stopTransfer();
|
|
|
|
|
|
|
|
_swCounter = 0;
|
|
|
|
_hwCounter = _device.getCounter();
|
|
|
|
|
|
|
|
_device.setRamOffsetAddress(0);
|
|
|
|
_device.setTransferLength(128 * 1024);
|
|
|
|
_device.setOptions(false);
|
|
|
|
_device.setMode(true);
|
|
|
|
_device.setTransferRate(25.0f);
|
|
|
|
|
|
|
|
_device.startTransfer(true);
|
|
|
|
_run = true;
|
|
|
|
//QtConcurrent::run(this, &TrxBoard::readData);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief TrxBoard::stop
|
|
|
|
*/
|
|
|
|
/*************************************************************************************************/
|
|
|
|
void TrxBoard::stop()
|
|
|
|
{
|
|
|
|
_device.stopTransfer();
|
|
|
|
_run = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* @brief TrxBoard::readData
|
|
|
|
*/
|
|
|
|
/*************************************************************************************************/
|
|
|
|
//void TrxBoard::readData()
|
|
|
|
//{
|
|
|
|
// while(_run)
|
|
|
|
// {
|
|
|
|
// auto cnt = _device.getCounter();
|
|
|
|
|
|
|
|
// if(cnt == 0)
|
|
|
|
// {
|
|
|
|
// std::this_thread::sleep_for(std::chrono::milliseconds(3));
|
|
|
|
// _hwCounter = 0;
|
|
|
|
// continue;
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// if(cnt != _hwCounter)
|
|
|
|
// {
|
|
|
|
// _hwCounter++;
|
|
|
|
|
|
|
|
// _device.copy(_hwCounter - 1, _swCounter);
|
|
|
|
|
|
|
|
// auto temp = QByteArray::fromRawData(_device.getBufferPtr(_swCounter), BUFFER_SIZE);
|
|
|
|
// packetEngine.newData(temp);
|
|
|
|
|
|
|
|
// _swCounter++;
|
|
|
|
// if(_swCounter >= SW_BUFFER_NUM)
|
|
|
|
// {
|
|
|
|
// _swCounter = 0;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/*************************************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TrxBoard::scenParamsFilling(TrxBoard::eScenParams cmd)
|
|
|
|
{
|
|
|
|
static quint8 scenParams = 0;
|
|
|
|
scenParams = cmd ? (scenParams+cmd) : (cmd);
|
|
|
|
if (scenParams >= TOTAL_SCEN_LUT_SRAM)
|
|
|
|
{
|
|
|
|
scenParams = TOTAL_SCEN_LUT_SRAM;
|
|
|
|
_allow = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_allow = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x4000000), _offsetSlave2(0x8000000)
|
|
|
|
{
|
|
|
|
_beamFormerSlave0 = new BeamFormer (&_device, _offsetSlave0);
|
|
|
|
_beamFormerSlave1 = new BeamFormer (&_device, _offsetSlave1);
|
|
|
|
_beamFormerSlave2 = new BeamFormer (&_device, _offsetSlave2);
|
|
|
|
_clkDistributer = new ClockDistributer(&_device);
|
|
|
|
_fpgaProgram = new FpgaProgram (&_device);
|
|
|
|
_scenPlayer = new ScenPalyer (&_device);
|
|
|
|
_bCtrlMngt = new BoardsCtrlMngt (&_device);
|
|
|
|
_bpiFlash = new BpiFlash (&_device);
|
|
|
|
//_dmaCtrl = new DmaCtrl (_device);
|
|
|
|
_dsp = new Dsp (&_device);
|
|
|
|
|
|
|
|
setSwapVector();
|
|
|
|
|
|
|
|
///////////////////////////////// Old TRX //////////////////////////////////
|
|
|
|
_run = true;
|
|
|
|
//_device.init();
|
|
|
|
/*************************************************************************************************/
|
|
|
|
/*************************************************************************************************/
|
|
|
|
}
|
|
|
|
|
|
|
|
TrxBoard::~TrxBoard()
|
|
|
|
{
|
|
|
|
delete _beamFormerSlave0;
|
|
|
|
delete _beamFormerSlave1;
|
|
|
|
delete _beamFormerSlave2;
|
|
|
|
delete _clkDistributer;
|
|
|
|
delete _fpgaProgram;
|
|
|
|
delete _scenPlayer;
|
|
|
|
delete _bCtrlMngt;
|
|
|
|
delete _bpiFlash;
|
|
|
|
//delete _dmaCtrl;
|
|
|
|
delete _dsp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenProbeElementPosition(ProbeElementPosition *element)
|
|
|
|
{
|
|
|
|
QList<QList<quint32>> elementPosition;
|
|
|
|
QList<quint32> x;
|
|
|
|
QList<quint32> y;
|
|
|
|
QList<quint32> z;
|
|
|
|
|
|
|
|
for (quint8 i=0; i<3; i++)
|
|
|
|
{
|
|
|
|
for (quint8 j=0; j<SLAVE_ELEMENT_SEGMENT; j++)
|
|
|
|
{
|
|
|
|
x.append(element->xPosition.at(_swapVec.at(j + i * SLAVE_ELEMENT_SEGMENT)));
|
|
|
|
y.append(element->yPosition.at(_swapVec.at(j + i * SLAVE_ELEMENT_SEGMENT)));
|
|
|
|
z.append(element->zPosition.at(_swapVec.at(j + i * SLAVE_ELEMENT_SEGMENT)));
|
|
|
|
}
|
|
|
|
|
|
|
|
elementPosition.append(x);
|
|
|
|
elementPosition.append(y);
|
|
|
|
elementPosition.append(z);
|
|
|
|
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
case 0 : this->_beamFormerSlave0->probeElementPosition(elementPosition); break;
|
|
|
|
case 1 : this->_beamFormerSlave1->probeElementPosition(elementPosition); break;
|
|
|
|
case 2 : this->_beamFormerSlave2->probeElementPosition(elementPosition); break;
|
|
|
|
}
|
|
|
|
|
|
|
|
x.clear();
|
|
|
|
y.clear();
|
|
|
|
z.clear();
|
|
|
|
elementPosition.clear();
|
|
|
|
}
|
|
|
|
scenParamsFilling(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenRxBeamformerProperties(RxBeamformerProperties *rxBeamformer)
|
|
|
|
{
|
|
|
|
this->_beamFormerSlave0->rxBeamformerProperties(rxBeamformer);
|
|
|
|
this->_beamFormerSlave1->rxBeamformerProperties(rxBeamformer);
|
|
|
|
this->_beamFormerSlave2->rxBeamformerProperties(rxBeamformer);
|
|
|
|
scenParamsFilling(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenApodizationLut(QList<QList<quint32> > &apodization)
|
|
|
|
{
|
|
|
|
this->_beamFormerSlave0->apodizationLut(apodization);
|
|
|
|
this->_beamFormerSlave1->apodizationLut(apodization);
|
|
|
|
this->_beamFormerSlave2->apodizationLut(apodization);
|
|
|
|
scenParamsFilling(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenPulseProperties(PulseProperties *pulse)
|
|
|
|
{
|
|
|
|
this->_beamFormerSlave0->pulseProperties(pulse);
|
|
|
|
this->_beamFormerSlave1->pulseProperties(pulse);
|
|
|
|
this->_beamFormerSlave2->pulseProperties(pulse);
|
|
|
|
scenParamsFilling(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenAfeLut(AfeProperties *afe)
|
|
|
|
{
|
|
|
|
this->_beamFormerSlave0->afeLut(afe);
|
|
|
|
this->_beamFormerSlave1->afeLut(afe);
|
|
|
|
this->_beamFormerSlave2->afeLut(afe);
|
|
|
|
scenParamsFilling(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrxBoard::scenReceiverConfigurationLut(ReceiverConfiguration *configLut) const
|
|
|
|
{
|
|
|
|
this->_dsp->receiverConfigurationLut(configLut);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenLineFilterCoefficient(QList<quint32> &lineFilterLut) const
|
|
|
|
{
|
|
|
|
this->_dsp->lineFilterCoefficient(lineFilterLut);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenStbCoefficient(QList<quint32> &stbLut) const
|
|
|
|
{
|
|
|
|
this->_dsp->stbCoefficient(stbLut);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenFrequencyLut(QList<quint32> &freqLut) const
|
|
|
|
{
|
|
|
|
this->_dsp->frequencyLut(freqLut);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenBlendWeight(QList<QList<quint32> > &blendWeight) const
|
|
|
|
{
|
|
|
|
this->_dsp->blendWeight(blendWeight);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::setAtgcMode(eAtgcMode mode, quint16 value) const
|
|
|
|
{
|
|
|
|
this->_dsp->atgcMode(mode, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenDtgcLut(QList<quint32> &dtgcLut) const
|
|
|
|
{
|
|
|
|
this->_dsp->dtgcLut(dtgcLut);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenAtgcLut(QList<QList<quint32> > &atgcLut) const
|
|
|
|
{
|
|
|
|
this->_dsp->atgcLut(atgcLut);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenLpfLut(QList<QList<quint32> > &lpfLut) const
|
|
|
|
{
|
|
|
|
this->_dsp->lpfLut(lpfLut);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::slaveFpgaProgram(QString path)
|
|
|
|
{
|
|
|
|
QFile bitFile(path);
|
|
|
|
|
|
|
|
if (bitFile.fileName().isEmpty())
|
|
|
|
{
|
|
|
|
throw SonoException("No file is selected");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!bitFile.open(QIODevice::ReadOnly))
|
|
|
|
{
|
|
|
|
throw SonoException("Couldn't open bit file programming");
|
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray bitFileData = bitFile.readAll();
|
|
|
|
this->_fpgaProgram->program(bitFileData, SLAVE_FPGA_NUMBER);
|
|
|
|
|
|
|
|
bitFileData.clear();
|
|
|
|
bitFile.close();
|
|
|
|
|
|
|
|
scenParamsFilling(clear);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::setBeamFormerMode(eClkMode mode) const
|
|
|
|
{
|
|
|
|
this->_clkDistributer->clockMode(CLOCK_DIVISION, mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::setScenPlayerIndex(quint32 &startIdx, quint32 &endIdx) const
|
|
|
|
{
|
|
|
|
this->_scenPlayer->setStartIndex(startIdx);
|
|
|
|
this->_scenPlayer->setEndIndex(endIdx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenPlayerStart(bool start) const
|
|
|
|
{
|
|
|
|
if (_allow)
|
|
|
|
{
|
|
|
|
this->_beamFormerSlave0->regValid(true);
|
|
|
|
this->_beamFormerSlave1->regValid(true);
|
|
|
|
this->_beamFormerSlave2->regValid(true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
throw SonoException("Total scenario luts and sram parameters are not written compeletely");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this->_scenPlayer->control.command(start);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenPlayerPause(bool pause) const
|
|
|
|
{
|
|
|
|
this->_scenPlayer->control.pause(pause);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::scenPlayerStop(bool stop) const
|
|
|
|
{
|
|
|
|
this->_scenPlayer->control.command(!stop);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
quint32 TrxBoard::deviceId() const
|
|
|
|
{
|
|
|
|
auto pid = this->_bCtrlMngt->getPid();
|
|
|
|
return pid;
|
|
|
|
}
|
|
|
|
|
|
|
|
quint32 TrxBoard::vendorId() const
|
|
|
|
{
|
|
|
|
auto vid = this->_bCtrlMngt->getVid();
|
|
|
|
return vid;
|
|
|
|
}
|
|
|
|
|
|
|
|
quint32 TrxBoard::trxId() const
|
|
|
|
{
|
|
|
|
QByteArray id = this->_bCtrlMngt->trxEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER);
|
|
|
|
return byteArray2Uint32BigEndian(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
quint32 TrxBoard::mpsId() const
|
|
|
|
{
|
|
|
|
QByteArray id = this->_bCtrlMngt->mpsEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER);
|
|
|
|
return byteArray2Uint32BigEndian(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
quint32 TrxBoard::prbCtrlId() const
|
|
|
|
{
|
|
|
|
QByteArray id = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER);
|
|
|
|
return byteArray2Uint32BigEndian(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
quint32 TrxBoard::prbId(quint8 prbSel) const
|
|
|
|
{
|
|
|
|
QByteArray id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER, prbSel);
|
|
|
|
return byteArray2Uint32BigEndian(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<quint32> TrxBoard::getConnectedPrbId() const
|
|
|
|
{
|
|
|
|
QList<quint32> list;
|
|
|
|
QVector<bool> vec;
|
|
|
|
QByteArray id;
|
|
|
|
list.clear();
|
|
|
|
vec.clear();
|
|
|
|
id.clear();
|
|
|
|
vec = this->_bCtrlMngt->getConnectedPrb();
|
|
|
|
|
|
|
|
for (quint8 i=0; i < vec.size(); i++)
|
|
|
|
{
|
|
|
|
if (vec.at(i))
|
|
|
|
{
|
|
|
|
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER, i);
|
|
|
|
list.append(byteArray2Uint32BigEndian(id));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
list.append(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString TrxBoard::trxInfo() const
|
|
|
|
{
|
|
|
|
QString str = QString(this->_bCtrlMngt->trxEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER));
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString TrxBoard::mpsInfo() const
|
|
|
|
{
|
|
|
|
QString str = QString(this->_bCtrlMngt->mpsEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER));
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString TrxBoard::prbCtrlInfo() const
|
|
|
|
{
|
|
|
|
QString str = QString(this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER));
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString TrxBoard::prbInfo(quint8 prbSel) const
|
|
|
|
{
|
|
|
|
QString str = QString(this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER, prbSel));
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<QString> TrxBoard::getConnectedPrbInfo() const
|
|
|
|
{
|
|
|
|
QList<QString> list;
|
|
|
|
QVector<bool> vec;
|
|
|
|
QString str;
|
|
|
|
list.clear();
|
|
|
|
vec.clear();
|
|
|
|
str.clear();
|
|
|
|
|
|
|
|
vec = this->_bCtrlMngt->getConnectedPrb();
|
|
|
|
|
|
|
|
for (quint8 i=0; i < vec.size(); i++)
|
|
|
|
{
|
|
|
|
if (vec.at(i))
|
|
|
|
{
|
|
|
|
str = QString(this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER, i));
|
|
|
|
list.append(str);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
list.append("NULL");
|
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrxBoard::supervisorRbValue(SupervisorRbValue *sValue) const
|
|
|
|
{
|
|
|
|
this->_bCtrlMngt->getSupervisorValue(sValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::mpsFaultStatus(MpsFaultStatus *faultStatus) const
|
|
|
|
{
|
|
|
|
this->_bCtrlMngt->getMpsFault(faultStatus);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::mpsReset() const
|
|
|
|
{
|
|
|
|
this->_bCtrlMngt->setMpsReset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::mpsSetAo(float voltA, float voltB) const
|
|
|
|
{
|
|
|
|
this->_bCtrlMngt->mpsHvSet(voltA, voltB);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrxBoard::selectProbe(eSelectProbe prbSel) const
|
|
|
|
{
|
|
|
|
this->_bCtrlMngt->setProbeSelect(prbSel);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::getHealthStatus(HealthStatus* healStat) const
|
|
|
|
{
|
|
|
|
// healStat->criticalComponentTemperature = this->_bCtrlMngt->getTrxFpgaTemp();
|
|
|
|
healStat->systemTemperature = this->_bCtrlMngt->getTrxTempSensor();
|
|
|
|
healStat->adcMon = this->_bCtrlMngt->getTrxBoardVoltages();
|
|
|
|
healStat->voltsPg = this->_bCtrlMngt->getTrxVoltagesPg();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::init() const
|
|
|
|
{
|
|
|
|
this->_bCtrlMngt->mpsInit();
|
|
|
|
this->_bCtrlMngt->prbCtrlInit();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TrxBoard::mcsProgram(QString path)
|
|
|
|
{
|
|
|
|
QFile mcsFile(path);
|
|
|
|
|
|
|
|
if (mcsFile.fileName().isEmpty())
|
|
|
|
{
|
|
|
|
//throw exception("No file is selected: " + mcsFile.errorString());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!mcsFile.open(QIODevice::ReadOnly))
|
|
|
|
{
|
|
|
|
//throw exception("Couldn't open mcs file programming: " + mcsFile.errorString());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray mcsFileData = mcsFile.readAll();
|
|
|
|
this->_bpiFlash->writeMcs(mcsFileData);
|
|
|
|
|
|
|
|
mcsFileData.clear();
|
|
|
|
mcsFile.close();
|
|
|
|
|
|
|
|
scenParamsFilling(clear);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrxBoard::mcsVerify(QString path) const
|
|
|
|
{
|
|
|
|
QFile mcsFile(path);
|
|
|
|
|
|
|
|
if (mcsFile.fileName().isEmpty())
|
|
|
|
{
|
|
|
|
//throw exception("No file is selected: " + mcsFile.errorString());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!mcsFile.open(QIODevice::WriteOnly))
|
|
|
|
{
|
|
|
|
//throw exception("Couldn't open mcs file to verify: " + mcsFile.errorString());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTextStream save(&mcsFile);
|
|
|
|
|
|
|
|
(*_mcsList).clear();
|
|
|
|
this->_bpiFlash->readMcs(_mcsList);
|
|
|
|
|
|
|
|
for (auto i=0; i < MCS_FILE_SIZE; i++)
|
|
|
|
{
|
|
|
|
save << (*_mcsList).at(i);
|
|
|
|
}
|
|
|
|
mcsFile.flush();
|
|
|
|
mcsFile.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|