diff --git a/developHw.pro.user b/developHw.pro.user index d65bc11..1b66796 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 7c5f562..0ee1fdd 100644 --- a/include/model/hardware/core/TrxBoard.h +++ b/include/model/hardware/core/TrxBoard.h @@ -22,7 +22,7 @@ #define EEPROM_ID_BYTE_BEGIN 0U #define EEPROM_ID_BYTE_NUMBER 4U -#define EEPROM_INFO_BYTE_BEGIN 100U +#define EEPROM_INFO_BYTE_BEGIN 10U #define EEPROM_INFO_BYTE_NUMBER 5U @@ -53,6 +53,7 @@ class TrxBoard { private: QVector _swapVec; + QList* _mcsList; const quint32 _offsetSlave0; const quint32 _offsetSlave1; const quint32 _offsetSlave2; diff --git a/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h b/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h index 9f668c7..4060ef6 100644 --- a/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h +++ b/include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h @@ -3,6 +3,7 @@ #include #include +#include #include "registerDefinition/BoardsSpecs.h" #define TRX_ROM_MAX_LEN 131072U @@ -159,7 +160,7 @@ private: VoltagesPg* _pg; template - void eepromWrite (QByteArray& arr, quint32 addr, quint8 prbSel, T1* request, T2* status); + void eepromWrite (QString& str, quint32 addr, quint8 prbSel, T1* request, T2* status); template void setEepromWrite (EepromReq* _rom, T3* request); @@ -229,10 +230,10 @@ private: void setSetupCmdDacsOnOff(bool cwd, bool hvb, bool hva) const; void setMpsDacsValue (MpsDacs* _mpsDacs) const; - friend void trxEepromWrite(QByteArray& array, quint32 address, BoardsCtrlMngt* boards); - friend void mpsEepromWrite(QByteArray& array, quint32 address, BoardsCtrlMngt* boards); - friend void prbCtrlEepromWrite (QByteArray& array, quint32 address, BoardsCtrlMngt* boards); - friend void prbEepromWrite (QByteArray& array, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards); + friend void trxEepromWrite(QString str, quint32 address, BoardsCtrlMngt* boards); + friend void mpsEepromWrite(QString str, quint32 address, BoardsCtrlMngt* boards); + friend void prbCtrlEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards); + friend void prbEepromWrite (QString str, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards); void timerShot (quint16 ms) const; void timerStop (void) const; @@ -276,9 +277,9 @@ public: }; -void trxEepromWrite (QByteArray& array, quint32 address, BoardsCtrlMngt* boards); -void mpsEepromWrite (QByteArray& array, quint32 address, BoardsCtrlMngt* boards); -void prbCtrlEepromWrite (QByteArray& array, quint32 address, BoardsCtrlMngt* boards); -void prbEepromWrite (QByteArray& array, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards); +void trxEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards); +void mpsEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards); +void prbCtrlEepromWrite (QString str, quint32 address, BoardsCtrlMngt* boards); +void prbEepromWrite (QString str, quint32 address, quint8 prbSel, BoardsCtrlMngt* boards); #endif // BOARDSCTRLMNGT_H diff --git a/mainwindow.cpp b/mainwindow.cpp index b62541f..69a218c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -78,7 +78,7 @@ MainWindow::MainWindow(QWidget *parent) ui->btn_pwr4OnOff->setText(PWR4_ON); ui->btn_pllClkSt->setText(ON); ui->btn_pllClkTps->setText(ON); - ui->btn_mulDacTrig->setText(TRIG_ON); + //ui->btn_mulDacTrig->setText(TRIG_ON); ui->btn_thsdStateUpdate->setText(THSD_State_Update); ui->btn_pwrDacsEnable->setText(VALID); ui->btn_hvRegulatorConfig->setText(ENABLE); @@ -2819,3 +2819,82 @@ void MainWindow::on_btn_setAtgcMode_clicked() else trx.setAtgcMode(Manual, static_cast(aTgcValue)); } + + +void MainWindow::on_btn_trxRomWrite_clicked() +{ + QString txtStr = ui->tb_trxRomWrite->toPlainText(); + trxEepromWrite(txtStr, 0, _bCtrl); +} + +void MainWindow::on_btn_trxRomIdRead_clicked() +{ + quint32 id = trx.trxId(); + ui->tb_trxRomIdRead->setText(QString::number(id, 16)); +} + +void MainWindow::on_btn_trxRomInfoRead_clicked() +{ + QString infoStr = trx.trxInfo(); + ui->tb_trxRomInfoRead->setText(infoStr); +} + + +void MainWindow::on_btn_mpsRomWrite_clicked() +{ + QString txtStr = ui->tb_mpsRomWrite->toPlainText(); + mpsEepromWrite(txtStr, 0, _bCtrl); +} + +void MainWindow::on_btn_mpsRomIdRead_clicked() +{ + quint32 id = trx.mpsId(); + ui->tb_mpsRomIdRead->setText(QString::number(id, 16)); +} + +void MainWindow::on_btn_mpsRomInfoRead_clicked() +{ + QString infoStr = trx.mpsInfo(); + ui->tb_mpsRomInfoRead->setText(infoStr); +} + + +void MainWindow::on_btn_prbCtrlRomWrite_clicked() +{ + QString txtStr = ui->tb_prbCtrlRomWrite->toPlainText(); + prbCtrlEepromWrite(txtStr, 0, _bCtrl); +} + +void MainWindow::on_btn_prbCtrlRomIdRead_clicked() +{ + quint32 id = trx.prbCtrlId(); + ui->tb_prbCtrlRomIdRead->setText(QString::number(id, 16)); +} + +void MainWindow::on_btn_prbCtrlRomInfoRead_clicked() +{ + QString infoStr = trx.prbCtrlInfo(); + ui->tb_prbCtrlRomInfoRead->setText(infoStr); +} + + +void MainWindow::on_btn_prbRomWrite_clicked() +{ + auto sel = ui->cb_prbSelRom->currentIndex(); + QString txtStr = ui->tb_prbRomWrite->toPlainText(); + prbEepromWrite(txtStr, 0, static_cast(sel), _bCtrl); +} + +void MainWindow::on_btn_prbRomIdRead_clicked() +{ + auto sel = ui->cb_prbSelRom->currentIndex(); + quint32 id = trx.prbId(static_cast(sel)); + ui->tb_prbRomIdRead->setText(QString::number(id, 16)); +} + +void MainWindow::on_btn_prbRomInfoRead_clicked() +{ + auto sel = ui->cb_prbSelRom->currentIndex(); + QString infoStr = trx.prbInfo(static_cast(sel)); + ui->tb_prbRomInfoRead->setText(infoStr); +} diff --git a/mainwindow.h b/mainwindow.h index c2af9bb..c4c0283 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -313,6 +314,30 @@ private slots: void on_btn_setAtgcMode_clicked(); + void on_btn_trxRomWrite_clicked(); + + void on_btn_trxRomIdRead_clicked(); + + void on_btn_trxRomInfoRead_clicked(); + + void on_btn_mpsRomWrite_clicked(); + + void on_btn_mpsRomIdRead_clicked(); + + void on_btn_mpsRomInfoRead_clicked(); + + void on_btn_prbCtrlRomWrite_clicked(); + + void on_btn_prbCtrlRomIdRead_clicked(); + + void on_btn_prbCtrlRomInfoRead_clicked(); + + void on_btn_prbRomWrite_clicked(); + + void on_btn_prbRomIdRead_clicked(); + + void on_btn_prbRomInfoRead_clicked(); + signals: // void updateBlockProgressValue(int percentage, QProgressBar* prg); // void updateFpgaProgressValue(int percentage); diff --git a/mainwindow.ui b/mainwindow.ui index 84c5e90..8a1451f 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -17,14 +17,17 @@ - 10 + 0 9 - 751 - 271 + 811 + 311 + + + - 1 + 2 @@ -291,7 +294,7 @@ 0 - 140 + 150 741 105 @@ -672,7 +675,7 @@ 20 - 160 + 180 551 80 @@ -751,66 +754,547 @@ + + + E2PROMs + + + + + 10 + 0 + 791 + 71 + + + + TRX + + + + + 0 + 20 + 291 + 72 + + + + + + + Text: + + + + + + + + + + + + + + Write + + + + + + + + + 310 + 20 + 181 + 51 + + + + + + + ID: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + 510 + 20 + 281 + 72 + + + + + + + Info: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + + 10 + 70 + 791 + 71 + + + + MPS + + + + + 0 + 20 + 291 + 72 + + + + + + + Text: + + + + + + + + + + + + + + Write + + + + + + + + + 310 + 20 + 181 + 51 + + + + + + + ID: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + 510 + 20 + 281 + 72 + + + + + + + Info: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + + 10 + 140 + 791 + 71 + + + + ProbeCtrl + + + + + 0 + 20 + 291 + 72 + + + + + + + Text: + + + + + + + + + + + + + + Write + + + + + + + + + 310 + 20 + 181 + 51 + + + + + + + ID: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + 510 + 20 + 281 + 72 + + + + + + + Info: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + + 10 + 210 + 791 + 71 + + + + Probe + + + + + 100 + 20 + 251 + 72 + + + + + + + Text: + + + + + + + + + + + + + + Write + + + + + + + + + 360 + 20 + 181 + 51 + + + + + + + ID: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + 550 + 20 + 241 + 72 + + + + + + + Info: + + + + + + + + + + true + + + + + + + Read + + + + + + + + + 10 + 40 + 79 + 23 + + + + + + + + A + + + + + B + + + + + C + + + + + D + + + + + + + 10 + 20 + 65 + 15 + + + + Prb Select: + + + + 0 - 280 - 821 - 231 + 330 + 811 + 181 TRX Board - - - - 0 - 30 - 299 - 27 - - - - - - - Mul DAC: - - - - - - - - - - PushButton - - - - - - - - - 0 - 60 - 751 - 16 - - - - Qt::Horizontal - - 380 - 70 + 20 371 27 @@ -839,7 +1323,7 @@ 0 - 70 + 20 371 27 @@ -868,7 +1352,7 @@ 0 - 100 + 40 751 20 @@ -881,7 +1365,7 @@ 300 - 120 + 50 16 111 @@ -893,17 +1377,17 @@ - 580 - 30 - 234 - 27 + 540 + 130 + 166 + 17 - TRX Board Temperature: + On Board Temp: @@ -920,7 +1404,7 @@ 0 - 120 + 50 126 19 @@ -946,7 +1430,7 @@ 0 - 150 + 70 139 19 @@ -972,7 +1456,7 @@ 0 - 180 + 90 139 19 @@ -998,7 +1482,7 @@ 0 - 210 + 110 139 19 @@ -1024,7 +1508,7 @@ 160 - 180 + 90 141 25 @@ -1043,7 +1527,7 @@ 320 - 120 + 50 191 19 @@ -1069,7 +1553,7 @@ 320 - 140 + 70 191 19 @@ -1095,7 +1579,7 @@ 320 - 160 + 90 191 19 @@ -1121,7 +1605,7 @@ 320 - 180 + 110 191 19 @@ -1147,7 +1631,7 @@ 320 - 200 + 130 191 21 @@ -1173,7 +1657,7 @@ 540 - 120 + 50 171 19 @@ -1199,7 +1683,7 @@ 540 - 140 + 70 171 19 @@ -1225,7 +1709,7 @@ 540 - 160 + 90 172 19 @@ -1251,7 +1735,7 @@ 160 - 120 + 50 134 19 @@ -1273,50 +1757,11 @@ - - - - 310 - 30 - 90 - 23 - - - - usrMode - - - - - - 390 - 30 - 83 - 25 - - - - AFEs Prog - - - - - - 480 - 30 - 83 - 25 - - - - GT Reg - - 720 - 120 + 50 91 23 @@ -1329,7 +1774,7 @@ 720 - 140 + 70 81 17 @@ -1342,7 +1787,7 @@ 720 - 160 + 90 81 17 @@ -1355,7 +1800,7 @@ 720 - 180 + 110 81 17 @@ -1368,7 +1813,7 @@ 720 - 200 + 130 81 17 @@ -1377,65 +1822,6 @@ TextLabel - - - - 540 - 180 - 171 - 27 - - - - - - - prbNo: - - - - - - - 0 - - - - - - - eeprom - - - - - - - - - 630 - 210 - 80 - 16 - - - - ManualSync - - - - - - 540 - 210 - 90 - 23 - - - - TXTrig - - diff --git a/src/model/hardware/core/TrxBoard.cpp b/src/model/hardware/core/TrxBoard.cpp index 775c086..87bd637 100644 --- a/src/model/hardware/core/TrxBoard.cpp +++ b/src/model/hardware/core/TrxBoard.cpp @@ -648,15 +648,14 @@ void TrxBoard::mcsVerify(QString path) const return; } - QList* mcsList; QTextStream save(&mcsFile); - (*mcsList).clear(); - this->_bpiFlash->readMcs(mcsList); + (*_mcsList).clear(); + this->_bpiFlash->readMcs(_mcsList); for (auto i=0; i < MCS_FILE_SIZE; i++) { - save << (*mcsList).at(i); + save << (*_mcsList).at(i); } mcsFile.flush(); mcsFile.close(); diff --git a/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp b/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp index 704641c..9854206 100644 --- a/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp +++ b/src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp @@ -31,12 +31,12 @@ BoardsCtrlMngt::Gain::Gain() /************************************* Write Functions Template ************************************/ /***************************************************************************************************/ template -void BoardsCtrlMngt::eepromWrite(QByteArray &arr, quint32 addr, quint8 prbSel, T1* request, T2* status) +void BoardsCtrlMngt::eepromWrite(QString& str, quint32 addr, quint8 prbSel, T1* request, T2* status) { quint32 j(0); bool busy=true, error=false, done=false; - foreach (auto i, arr) + foreach (auto i, str) { timerShot(500); @@ -54,7 +54,7 @@ void BoardsCtrlMngt::eepromWrite(QByteArray &arr, quint32 addr, quint8 prbSel, T timerStop(); - _rom->dataIn = i; + _rom->dataIn = i.toLatin1(); _rom->address = addr+j; _rom->probeSelect = prbSel; setEepromWrite(_rom, request); @@ -902,47 +902,47 @@ QByteArray BoardsCtrlMngt::prbEepromRead(quint32 address, quint32 length, quint8 } -void trxEepromWrite(QByteArray &array, quint32 address, BoardsCtrlMngt* boards) +void trxEepromWrite(QString str, quint32 address, BoardsCtrlMngt* boards) { - if (array.size() >= static_cast(TRX_ROM_MAX_LEN)) + if (str.size() >= static_cast(TRX_ROM_MAX_LEN)) { // throw exception("Out of range writing into TRX eeprom "); return; } quint8 prbSel = 0; - boards->eepromWrite(array, address, prbSel, boards->_tRomReq, boards->_tRomStatus); + boards->eepromWrite(str, address, prbSel, boards->_tRomReq, boards->_tRomStatus); } -void mpsEepromWrite(QByteArray &array, quint32 address, BoardsCtrlMngt *boards) +void mpsEepromWrite(QString str, quint32 address, BoardsCtrlMngt *boards) { - if (array.size() >= static_cast(MPS_ROM_MAX_LEN)) + if (str.size() >= static_cast(MPS_ROM_MAX_LEN)) { // throw exception("Out of range writing into MPS eeprom "); return; } quint8 prbSel = 0; - boards->eepromWrite(array, address, prbSel, boards->_mRomReq, boards->_mRomStatus); + boards->eepromWrite(str, address, prbSel, boards->_mRomReq, boards->_mRomStatus); } -void prbCtrlEepromWrite(QByteArray &array, quint32 address, BoardsCtrlMngt *boards) +void prbCtrlEepromWrite(QString str, quint32 address, BoardsCtrlMngt *boards) { - if (array.size() >= static_cast(PRB_CTRL_ROM_MAX_LEN)) + if (str.size() >= static_cast(PRB_CTRL_ROM_MAX_LEN)) { // throw exception("Out of range writing into Probe Control eeprom "); return; } quint8 prbSel = 0; - boards->eepromWrite(array, address, prbSel, boards->_pCtrlRomReq, boards->_pCtrlRomStatus); + boards->eepromWrite(str, address, prbSel, boards->_pCtrlRomReq, boards->_pCtrlRomStatus); } -void prbEepromWrite(QByteArray &array, quint32 address, quint8 prbSel, BoardsCtrlMngt *boards) +void prbEepromWrite(QString str, quint32 address, quint8 prbSel, BoardsCtrlMngt *boards) { - if (array.size() >= static_cast(PRB_ROM_MAX_LEN)) + if (str.size() >= static_cast(PRB_ROM_MAX_LEN)) { // throw exception("Out of range writing into Probe eeprom "); return; } - boards->eepromWrite(array, address, prbSel, boards->_pRomReq, boards->_pRomStatus); + boards->eepromWrite(str, address, prbSel, boards->_pRomReq, boards->_pRomStatus); }