Browse Source

Sono heart beats for master is added.

Arash Aletayeb 10 months ago
parent
commit
01c3263691
  1. 4
      developHw.pro.user
  2. 4
      include/model/hardware/core/lowLevelApi/TrxBoard.h
  3. 1
      include/model/hardware/core/lowLevelApi/TrxBoardUtils/e2promFormat.h
  4. 3
      include/model/hardware/core/lowLevelApi/register/misc/Misc.h
  5. 56
      include/model/hardware/core/lowLevelApi/register/misc/registerDefinition/StatusVector.h
  6. 3
      include/model/hardware/core/lowLevelApi/register/scenPlayer/ScenPlayer.h
  7. 8
      include/model/hardware/core/lowLevelApi/register/scenPlayer/registerDefinition/ScenPlayerCtrl.h
  8. 261
      mainwindow.cpp
  9. 52
      mainwindow.ui
  10. 49
      src/model/hardware/core/lowLevelApi/TrxBoard.cpp
  11. 45
      src/model/hardware/core/lowLevelApi/register/misc/Misc.cpp
  12. 7
      src/model/hardware/core/lowLevelApi/register/scenPlayer/ScenPlayer.cpp

4
developHw.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2023-12-12T15:55:00. -->
<!-- Written by QtCreator 4.10.0, 2024-01-16T18:26:44. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -285,7 +285,7 @@
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">0</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>

4
include/model/hardware/core/lowLevelApi/TrxBoard.h

@ -9,6 +9,7 @@
#include <QByteArray>
#include <QTime>
#include <QDebug>
#include <QTimer>
#include "register/clockDistributer/ClockDistributer.h"
#include "register/boardsCtrlMngt/BoardsCtrlMngt.h"
@ -48,6 +49,7 @@ class TrxBoard : public QObject
Q_OBJECT
private:
QTimer* _sonoLiveTimer;
QByteArray bin;
QVector<quint8> _swapVec;
QVector<quint32> _unsignedQntzrVec;
@ -60,6 +62,7 @@ private:
const quint32 _offsetSlave1;
const quint32 _offsetSlave2;
bool _sonoHeartBeats;
bool _allow;
bool _run;
qint32 _swCounter;
@ -155,6 +158,7 @@ private:
* _scenParams;
void sonoLiveTimeout();
void sendPacket(void);
void delay(quint16 ms) const;

1
include/model/hardware/core/lowLevelApi/TrxBoardUtils/e2promFormat.h

@ -59,6 +59,7 @@ struct systemE2proms
EepromStatus trx;
EepromStatus prbCtrl;
EepromStatus mps;
FpgaCodeVersion fpgaCodeVersion;
};
#endif // E2PROMFORMAT_H

3
include/model/hardware/core/lowLevelApi/register/misc/Misc.h

@ -27,7 +27,8 @@ struct StatusVec
bool thermalErr;
bool pgErr;
bool probeDisconnectErr;
bool fanFault;
bool fan1Fault;
bool fan2Fault;
bool dintrlvFrameLost;
bool dintrlvOffsetAddrErr;
bool dintrlvSramOver4MErr;

56
include/model/hardware/core/lowLevelApi/register/misc/registerDefinition/StatusVector.h

@ -6,29 +6,30 @@
#undef BAR
#define PROBE_DETECTION_INTERRUPT_MASK 0x00000001
#define SRAM_1_PARITY_ERR_MASK 0x00000002
#define SRAM_2_PARITY_ERR_MASK 0x00000004
#define MPS_ERR_MASK 0x00000008
#define SCEN_RPI_ERR_MASK 0x00000010
#define SCEN_SYNC_ACK_ERR_MASK 0x00000020
#define SCEN_SRAM_ERR_MASK 0x00000040
#define MLA_SYNC_FIFO_ERR_MASK 0x00000080
#define MLA_SYNC_POINT_ERR_MASK 0x00000100
#define DINTRLV_FIFO_ERR_MASK 0x00000200
#define DINTRLV_POINT_ERR_MASK 0x00000400
#define PULSER_THD_MASK 0x00000800
#define THERMAL_ERR_MASK 0x00001000
#define PG_ERR_MASK 0x00002000
#define PROBE_DISCONNECT_ERR_MASK 0x00004000
#define FAN_FAULT_MASK 0x00008000
#define DINTRLV_FRAME_LOST_MASK 0x00020000
#define DINTRLV_OFFSET_ADDR_ERR_MASK 0x00040000
#define DINTRLV_SRAM_OVER_4M_ERR_MASK 0x00080000
#define DDC_LPF_RELOAD_ERR_MASK 0x00100000
#define ADC_FLAG_SYNC_ERR_MASK 0x00200000
#define EMUL_DMA_TRANSFER_ERR_MASK 0x40000000
#define DMA_CTRL_TRANSFER_ERR_MASK 0x80000000
#define PROBE_DETECTION_INTERRUPT_MASK 0x00000001
#define SRAM_1_PARITY_ERR_MASK 0x00000002
#define SRAM_2_PARITY_ERR_MASK 0x00000004
#define MPS_ERR_MASK 0x00000008
#define SCEN_RPI_ERR_MASK 0x00000010
#define SCEN_SYNC_ACK_ERR_MASK 0x00000020
#define SCEN_SRAM_ERR_MASK 0x00000040
#define MLA_SYNC_FIFO_ERR_MASK 0x00000080
#define MLA_SYNC_POINT_ERR_MASK 0x00000100
#define DINTRLV_FIFO_ERR_MASK 0x00000200
#define DINTRLV_POINT_ERR_MASK 0x00000400
#define PULSER_THD_MASK 0x00000800
#define THERMAL_ERR_MASK 0x00001000
#define PG_ERR_MASK 0x00002000
#define PROBE_DISCONNECT_ERR_MASK 0x00004000
#define FAN1_FAULT_MASK 0x00008000
#define FAN2_FAULT_MASK 0x00010000
#define DINTRLV_FRAME_LOST_MASK 0x00020000
#define DINTRLV_OFFSET_ADDR_ERR_MASK 0x00040000
#define DINTRLV_SRAM_OVER_4M_ERR_MASK 0x00080000
#define DDC_LPF_RELOAD_ERR_MASK 0x00100000
#define ADC_FLAG_SYNC_ERR_MASK 0x00200000
#define EMUL_DMA_TRANSFER_ERR_MASK 0x40000000
#define DMA_CTRL_TRANSFER_ERR_MASK 0x80000000
#define BAR 0U
#define OFFSET 0x0
@ -51,7 +52,8 @@ public:
Field* thermalErr;
Field* pgErr;
Field* probeDisconnectErr;
Field* fanFault;
Field* fan1Fault;
Field* fan2Fault;
Field* dintrlvFrameLost;
Field* dintrlvOffsetAddrErr;
Field* dintrlvSramOver4MErr;
@ -77,7 +79,8 @@ public:
ADD_UNSIGNED_FIELD(thermalErr, THERMAL_ERR_MASK);
ADD_UNSIGNED_FIELD(pgErr, PG_ERR_MASK);
ADD_UNSIGNED_FIELD(probeDisconnectErr, PROBE_DISCONNECT_ERR_MASK);
ADD_UNSIGNED_FIELD(fanFault, FAN_FAULT_MASK);
ADD_UNSIGNED_FIELD(fan1Fault, FAN1_FAULT_MASK);
ADD_UNSIGNED_FIELD(fan2Fault, FAN2_FAULT_MASK);
ADD_UNSIGNED_FIELD(dintrlvFrameLost, DINTRLV_FRAME_LOST_MASK);
ADD_UNSIGNED_FIELD(dintrlvOffsetAddrErr, DINTRLV_OFFSET_ADDR_ERR_MASK);
ADD_UNSIGNED_FIELD(dintrlvSramOver4MErr, DINTRLV_SRAM_OVER_4M_ERR_MASK);
@ -103,7 +106,8 @@ public:
#undef THERMAL_ERR_MASK
#undef PG_ERR_MASK
#undef PROBE_DISCONNECT_ERR_MASK
#undef FAN_FAULT_MASK
#undef FAN1_FAULT_MASK
#undef FAN2_FAULT_MASK
#undef DINTRLV_FRAME_LOST_MASK
#undef DINTRLV_OFFSET_ADDR_ERR_MASK
#undef DINTRLV_SRAM_OVER_4M_ERR_MASK

3
include/model/hardware/core/lowLevelApi/register/scenPlayer/ScenPlayer.h

@ -17,7 +17,8 @@ private:
ScenPlayerCtrl* _playerctrl;
void setCommand(bool start) const;
bool getCommand(void) const;
void pause (bool pause) const;
void pause(bool pause) const;
void setHeartBeats(bool heartBeat) const;
};
public:

8
include/model/hardware/core/lowLevelApi/register/scenPlayer/registerDefinition/ScenPlayerCtrl.h

@ -6,8 +6,9 @@
#undef BAR
#define START_MASK 0x00000001
#define PAUSE_MASK 0x00000004
#define START_MASK 0x00000001
#define PAUSE_MASK 0x00000004
#define HEART_BEATS_MASK 0x00000010
#define BAR 0U
#define OFFSET 0x800
@ -17,16 +18,19 @@ class ScenPlayerCtrl : public Register
public:
Field* start;
Field* pause;
Field* heartBeats;
ScenPlayerCtrl(SonoDevice* device) : Register(BAR, OFFSET, device)
{
ADD_UNSIGNED_FIELD(start, START_MASK);
ADD_UNSIGNED_FIELD(pause, PAUSE_MASK);
ADD_UNSIGNED_FIELD(heartBeats, HEART_BEATS_MASK);
}
};
#undef START_MASK
#undef PAUSE_MASK
#undef HEART_BEATS_MASK
#undef BAR
#undef OFFSET

261
mainwindow.cpp

@ -460,11 +460,11 @@ void MainWindow::timeout()
delay(1);
quint32 tachoFan1 = static_cast<quint32>(_healStatus->fanRpm->fan1);
ui->l_tachoFan1->setText(QString::number(tachoFan1));
ui->l_tachoFan1->setText((tachoFan1) ? "On" : "Off");
delay(1);
quint32 tachoFan2 = static_cast<quint32>(_healStatus->fanRpm->fan2);
ui->l_tachoFan2->setText(QString::number(tachoFan2));
ui->l_tachoFan2->setText((tachoFan2) ? "On" : "Off");
delay(1);
/******************* Power Good *********************/
@ -523,7 +523,7 @@ void MainWindow::timeout()
changeLabelTextColor(ui->l_frameLost, color);
delay(1);
bool fanFault = _vec->fanFault;
bool fanFault = (_vec->fan1Fault) | (_vec->fan2Fault);
ui->l_fan->setText(QVariant(fanFault).toString());
color = fanFault ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_fan, color);
@ -2978,7 +2978,7 @@ QByteArray str2BigEndianByteArray(QString str, int base, qint8 byteLength)
QByteArray qbInt;
for(qint8 i = byteLength - 1; i >= 0; i--)
{
qbInt.append(static_cast<qint8>((intStr >> (i*8)) & 0xFF));
qbInt.append(static_cast<qint8>((intStr >> (i * 8)) & 0xFF));
}
return qbInt;
@ -2989,11 +2989,12 @@ QString bigEndianByteArray2Str(QByteArray btArr, int base)
quint32 reconstructedNum(0);
for(auto i = btArr.length() - 1; i >= 0; i--)
{
reconstructedNum += static_cast<quint32>((static_cast<quint8>(btArr[btArr.length() - 1 - i]) << (i*8)));
reconstructedNum +=
static_cast<quint32>((static_cast<quint8>(btArr[btArr.length() - 1 - i]) << (i * 8)));
}
QString str = QString::number(reconstructedNum, base);
return str;
return str;
}
QByteArray str2BigEndianByteArray4SerialNo(QString str)
@ -3011,13 +3012,15 @@ QByteArray str2BigEndianByteArray4SerialNo(QString str)
for(qint8 i = 1; i >= 0; i--)
{
qbInt.append(static_cast<qint8>(((strByte34.toShort()) >> (i*8)) & 0xFF));
qbInt.append(static_cast<qint8>(((strByte34.toShort()) >> (i * 8)) & 0xFF));
}
return qbInt;
}
else
{
throw SonoException("Invalid board serial number.");
}
}
QString bigEndianByteArray2Str4SerialNo(QByteArray btArr)
@ -3025,11 +3028,14 @@ QString bigEndianByteArray2Str4SerialNo(QByteArray btArr)
quint16 reconstructedNum(0);
for(auto i = btArr.length() - 3; i >= 0; i--)
{
reconstructedNum += static_cast<quint16>((static_cast<quint8>(btArr[btArr.length() - 1 - i]) << (i*8)));
reconstructedNum +=
static_cast<quint16>((static_cast<quint8>(btArr[btArr.length() - 1 - i]) << (i * 8)));
}
QString str = "SPN." + QString::number(static_cast<quint8>(btArr[0])) + "."
+ QString::number(static_cast<quint8>(btArr[1])) + "." + QString::number(reconstructedNum);
return str;
QString str = "SPN." + QString::number(static_cast<quint8>(btArr[0])) + "." +
QString::number(static_cast<quint8>(btArr[1])) + "." + QString::number(
reconstructedNum);
return str;
}
QByteArray MainWindow::str2ByteArray (QString& str)
@ -3095,6 +3101,7 @@ QByteArray MainWindow::crcCalc(const QByteArray array)
quint8 crcValue = _trx.crcGenerator(array);
QByteArray crc;
crc.append(static_cast<qint8>(crcValue));
return crc;
}
@ -3244,11 +3251,11 @@ void MainWindow::on_btn_trxRomSerialNumber_clicked()
if(trxSerialNoWrEn)
{
QString serialNoStr = ui->tb_trxRomSerialNumber->text();
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr);
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER);
trxEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl);
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr);
trxEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl);
trxCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC);
@ -3338,55 +3345,70 @@ void MainWindow::on_btn_trxRomSlaveCodeVersion_clicked()
/*************************************************************************************************/
void MainWindow::on_chk_writeHeaderTrxRom_clicked(bool checked)
{
if(checked)
try
{
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER);
trxEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl);
if(checked)
{
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER);
trxEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl);
trxEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl);
qDebug() << _trx.trxRomHeader();
trxEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl);
delay(200);
qDebug() << bigEndianByteArray2Str(_trx.trxRomHeader(), 16);
}
}
catch(SonoException& e)
{
qDebug() << e.what();
}
}
/*************************************************************************************************/
void MainWindow::on_chk_clearTrxRom_clicked(bool checked)
{
if(checked)
try
{
if(checked)
{
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE);
trxEepromWrite(clearAll, 0, _bCtrl);
}
}
catch(SonoException& e)
{
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE);
trxEepromWrite(clearAll, 0, _bCtrl);
qDebug() << e.what();
}
}
///*************************************************************************************************/
//void MainWindow::on_btn_trxRomInfoWrite_clicked()
//{
// QString infoStr = ui->tb_trxRomInfo->toPlainText();
// try
// {
// QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
// trxEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
// QByteArray sendingArray = infoStr.toLatin1();
// trxEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
// }
// catch(SonoException& e)
// {
// qDebug() << e.what();
// }
//QString infoStr = ui->tb_trxRomInfo->toPlainText();
//try
//{
//QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
//trxEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
//QByteArray sendingArray = infoStr.toLatin1();
//trxEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
//}
//catch(SonoException& e)
//{
//qDebug() << e.what();
//}
//}
///*************************************************************************************************/
//void MainWindow::on_btn_trxRomInfoRead_clicked()
//{
// try
// {
// QString receivingStr = _trx.trxInfo();
// ui->tb_trxRomInfo->setText(receivingStr);
// }
// catch(SonoException& e)
// {
// qDebug() << e.what();
// }
//try
//{
//QString receivingStr = _trx.trxInfo();
//ui->tb_trxRomInfo->setText(receivingStr);
//}
//catch(SonoException& e)
//{
//qDebug() << e.what();
//}
//}
/*************************************************************************************************/
@ -3509,11 +3531,11 @@ void MainWindow::on_btn_mpsRomSerialNumber_clicked()
if(mpsSerialNoWrEn)
{
QString serialNoStr = ui->tb_mpsRomSerialNumber->text();
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr);
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER);
mpsEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl);
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr);
mpsEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl);
mpsCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC);
@ -3603,55 +3625,70 @@ void MainWindow::on_btn_mpsRomSupCodeVersion_clicked()
/*************************************************************************************************/
void MainWindow::on_chk_writeHeaderMpsRom_clicked(bool checked)
{
if(checked)
try
{
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER);
mpsEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl);
if(checked)
{
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER);
mpsEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl);
mpsEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl);
qDebug() << _trx.mpsRomHeader();
mpsEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl);
delay(200);
qDebug() << bigEndianByteArray2Str(_trx.mpsRomHeader(), 16);
}
}
catch(SonoException& e)
{
qDebug() << e.what();
}
}
/*************************************************************************************************/
void MainWindow::on_chk_clearMpsRom_clicked(bool checked)
{
if(checked)
try
{
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE);
mpsEepromWrite(clearAll, 0, _bCtrl);
if(checked)
{
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE);
mpsEepromWrite(clearAll, 0, _bCtrl);
}
}
catch(SonoException& e)
{
qDebug() << e.what();
}
}
///*************************************************************************************************/
//void MainWindow::on_btn_mpsRomInfoWrite_clicked()
//{
// QString infoStr = ui->tb_mpsRomInfo->toPlainText();
// try
// {
// QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
// mpsEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
// QByteArray sendingArray = infoStr.toLatin1();
// mpsEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
// }
// catch(SonoException& e)
// {
// qDebug() << e.what();
// }
//QString infoStr = ui->tb_mpsRomInfo->toPlainText();
//try
//{
//QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
//mpsEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
//QByteArray sendingArray = infoStr.toLatin1();
//mpsEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
//}
//catch(SonoException& e)
//{
//qDebug() << e.what();
//}
//}
///*************************************************************************************************/
//void MainWindow::on_btn_mpsRomInfoRead_clicked()
//{
// try
// {
// QString receivingStr = _trx.mpsInfo();
// ui->tb_mpsRomInfo->setText(receivingStr);
// }
// catch(SonoException& e)
// {
// qDebug() << e.what();
// }
//try
//{
//QString receivingStr = _trx.mpsInfo();
//ui->tb_mpsRomInfo->setText(receivingStr);
//}
//catch(SonoException& e)
//{
//qDebug() << e.what();
//}
//}
/*************************************************************************************************/
@ -3689,6 +3726,7 @@ void MainWindow::on_btn_prbCtrlRomId_clicked()
qDebug() << e.what();
}
}
/*************************************************************************************************/
void MainWindow::on_chk_prbCntlPidWrEn_clicked(bool checked)
{
@ -3773,11 +3811,11 @@ void MainWindow::on_btn_prbCntlRomSerialNumber_clicked()
if(prbCtrlSerialNoWrEn)
{
QString serialNoStr = ui->tb_prbCtrlRomSerialNumber->text();
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr);
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER);
prbCtrlEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl);
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr);
prbCtrlEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl);
prbCtrlCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC);
@ -3797,55 +3835,70 @@ void MainWindow::on_btn_prbCntlRomSerialNumber_clicked()
/*************************************************************************************************/
void MainWindow::on_chk_writeHeaderPrbCtrlRom_clicked(bool checked)
{
if(checked)
try
{
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER);
prbCtrlEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl);
if(checked)
{
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER);
prbCtrlEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl);
prbCtrlEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl);
qDebug() << _trx.prbCtrlRomHeader();
prbCtrlEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl);
delay(200);
qDebug() << bigEndianByteArray2Str(_trx.prbCtrlRomHeader(), 16);
}
}
catch(SonoException& e)
{
qDebug() << e.what();
}
}
/*************************************************************************************************/
void MainWindow::on_chk_clearPrbCtrlRom_clicked(bool checked)
{
if(checked)
try
{
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE);
prbCtrlEepromWrite(clearAll, 0, _bCtrl);
if(checked)
{
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE);
prbCtrlEepromWrite(clearAll, 0, _bCtrl);
}
}
catch(SonoException& e)
{
qDebug() << e.what();
}
}
///*************************************************************************************************/
//void MainWindow::on_btn_prbCtrlRomInfoWrite_clicked()
//{
// QString infoStr = ui->tb_prbCtrlRomInfo->toPlainText();
// try
// {
// QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
// prbCtrlEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
// QByteArray sendingArray = infoStr.toLatin1();
// prbCtrlEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
// }
// catch(SonoException& e)
// {
// qDebug() << e.what();
// }
//QString infoStr = ui->tb_prbCtrlRomInfo->toPlainText();
//try
//{
//QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
//prbCtrlEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
//QByteArray sendingArray = infoStr.toLatin1();
//prbCtrlEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
//}
//catch(SonoException& e)
//{
//qDebug() << e.what();
//}
//}
///*************************************************************************************************/
//void MainWindow::on_btn_prbCtrlRomInfoRead_clicked()
//{
// try
// {
// QString receivingStr = _trx.prbCtrlInfo();
// ui->tb_prbCtrlRomInfo->setText(receivingStr);
// }
// catch(SonoException& e)
// {
// qDebug() << e.what();
// }
//try
//{
//QString receivingStr = _trx.prbCtrlInfo();
//ui->tb_prbCtrlRomInfo->setText(receivingStr);
//}
//catch(SonoException& e)
//{
//qDebug() << e.what();
//}
//}
/*************************************************************************************************/

52
mainwindow.ui

@ -2273,6 +2273,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;Master FPGA Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>MFV</string>
</property>
@ -2294,6 +2297,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;Master FPGA Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
@ -2358,6 +2364,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;Slave FPGA Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>SFV</string>
</property>
@ -2379,6 +2388,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;Slave FPGA Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
@ -2567,7 +2579,7 @@
<rect>
<x>0</x>
<y>20</y>
<width>97</width>
<width>102</width>
<height>61</height>
</rect>
</property>
@ -2580,6 +2592,8 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
@ -2592,6 +2606,8 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
@ -3224,7 +3240,7 @@
<rect>
<x>0</x>
<y>20</y>
<width>97</width>
<width>102</width>
<height>61</height>
</rect>
</property>
@ -3237,6 +3253,8 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
@ -3249,6 +3267,8 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
@ -3263,13 +3283,13 @@
<rect>
<x>600</x>
<y>40</y>
<width>151</width>
<width>181</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
@ -3680,6 +3700,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;MicroController Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>UCV</string>
</property>
@ -3701,6 +3724,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;MicroController Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
@ -3765,6 +3791,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;Supervisory Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>SVV</string>
</property>
@ -3786,6 +3815,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;Supervisory Version&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
@ -3804,7 +3836,7 @@
<rect>
<x>0</x>
<y>20</y>
<width>97</width>
<width>102</width>
<height>61</height>
</rect>
</property>
@ -3814,6 +3846,8 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
@ -3826,6 +3860,8 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
@ -7889,7 +7925,7 @@
<x>710</x>
<y>150</y>
<width>101</width>
<height>63</height>
<height>65</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_24">
@ -7897,14 +7933,14 @@
<widget class="QLabel" name="label_29">
<property name="font">
<font>
<pointsize>8</pointsize>
<pointsize>11</pointsize>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Tacho Fan(rpm)</string>
<string> Fans state</string>
</property>
</widget>
</item>

49
src/model/hardware/core/lowLevelApi/TrxBoard.cpp

@ -22,6 +22,12 @@ T TrxBoard::byteArray2UintLittleEndian(QByteArray& byte) const
return data;
}
void TrxBoard::sonoLiveTimeout()
{
_sonoHeartBeats = !_sonoHeartBeats;
this->_scenPlayer->control.setHeartBeats(_sonoHeartBeats);
}
void TrxBoard::sendPacket()
{
auto counter(0);
@ -341,6 +347,11 @@ QList<quint32> TrxBoard::systemStructure2List(systemE2proms &systemRoms)
dataset.append(systemRoms.trx.secondMbedCodeVersion);
dataset.append(systemRoms.mps.secondMbedCodeVersion);
dataset.append(systemRoms.fpgaCodeVersion.masterCode);
dataset.append(systemRoms.fpgaCodeVersion.slave0Code);
dataset.append(systemRoms.fpgaCodeVersion.slave1Code);
dataset.append(systemRoms.fpgaCodeVersion.slave2Code);
return dataset;
}
@ -364,6 +375,10 @@ void TrxBoard::systemLutCompletion()
systemRoms.mps.firstMbedCodeVersion = 1;
systemRoms.trx.secondMbedCodeVersion = 1;
systemRoms.mps.secondMbedCodeVersion = 1;
systemRoms.fpgaCodeVersion.masterCode = 2312111600;
systemRoms.fpgaCodeVersion.slave0Code = 2312111647;
systemRoms.fpgaCodeVersion.slave1Code = 2312111647;
systemRoms.fpgaCodeVersion.slave2Code = 2312111647;
_systemLut.append(systemStructure2List(systemRoms));
systemRoms.trx.pcbVersion = 2;
@ -373,6 +388,10 @@ void TrxBoard::systemLutCompletion()
systemRoms.mps.firstMbedCodeVersion = 1;
systemRoms.trx.secondMbedCodeVersion = 1;
systemRoms.mps.secondMbedCodeVersion = 1;
systemRoms.fpgaCodeVersion.masterCode = 2312111600;
systemRoms.fpgaCodeVersion.slave0Code = 2312111647;
systemRoms.fpgaCodeVersion.slave1Code = 2312111647;
systemRoms.fpgaCodeVersion.slave2Code = 2312111647;
_systemLut.append(systemStructure2List(systemRoms));
systemRoms.trx.pcbVersion = 2;
@ -382,6 +401,10 @@ void TrxBoard::systemLutCompletion()
systemRoms.mps.firstMbedCodeVersion = 1;
systemRoms.trx.secondMbedCodeVersion = 2;
systemRoms.mps.secondMbedCodeVersion = 1;
systemRoms.fpgaCodeVersion.masterCode = 2312111600;
systemRoms.fpgaCodeVersion.slave0Code = 2312111647;
systemRoms.fpgaCodeVersion.slave1Code = 2312111647;
systemRoms.fpgaCodeVersion.slave2Code = 2312111647;
_systemLut.append(systemStructure2List(systemRoms));
}
@ -428,6 +451,10 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(
_coreTemp = new criticalComponentTemperature;
_scenParams = new ScenGenHardwareParam;
_sonoLiveTimer = new QTimer;
connect(_sonoLiveTimer, &QTimer::timeout, this, &TrxBoard::sonoLiveTimeout);
_sonoHeartBeats = false;
_allow = false;
_run = false;
setSwapVector();
@ -435,6 +462,7 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(
setFpgaOffset();
setAfeModuleOffset();
systemLutCompletion();
}
TrxBoard::ScenHwRegister::ScenHwRegister()
@ -483,6 +511,8 @@ TrxBoard::~TrxBoard()
delete _coreVolt;
delete _coreTemp;
delete _scenParams;
delete _sonoLiveTimer;
}
TrxBoard::ScenHwRegister::~ScenHwRegister()
@ -1571,6 +1601,9 @@ void TrxBoard::scenPlayerStart(bool afeHvPwrOn)
#ifndef DEVELOP_UI
packetEngine.init();
#endif
_sonoLiveTimer->start(5000);
_sonoHeartBeats = true;
this->_scenPlayer->control.setHeartBeats(_sonoHeartBeats);
_run = true;
@ -1594,6 +1627,11 @@ void TrxBoard::scenPlayerStop(bool afeHvPwrOff)
while(_device.isDmaBusy());
//uncrustify on
_sonoLiveTimer->stop();
_sonoHeartBeats = false;
this->_scenPlayer->control.setHeartBeats(_sonoHeartBeats);
this->_scenPlayer->control.setCommand(false);
if(afeHvPwrOff)
@ -1685,6 +1723,10 @@ void TrxBoard::emulatorStart()
this->_device.startDma();
_sonoLiveTimer->start(5000);
_sonoHeartBeats = true;
this->_scenPlayer->control.setHeartBeats(_sonoHeartBeats);
_run = true;
QtConcurrent::run(this, &TrxBoard::readData);
@ -1692,6 +1734,11 @@ void TrxBoard::emulatorStart()
void TrxBoard::emulatorStop()
{
_sonoLiveTimer->stop();
_sonoHeartBeats = false;
this->_scenPlayer->control.setHeartBeats(_sonoHeartBeats);
_run = false;
this->_device.stopDma();
@ -1737,6 +1784,8 @@ void TrxBoard::checkSystemCompatibility()
currentSystemRoms.prbCtrl = prbCtrlE2prom;
currentSystemRoms.mps = mpsE2prom;
getFpgasCodeVersion(&currentSystemRoms.fpgaCodeVersion);
QList<quint32> currentSystem = systemStructure2List(currentSystemRoms);
systemCompare(currentSystem);

45
src/model/hardware/core/lowLevelApi/register/misc/Misc.cpp

@ -43,28 +43,29 @@ void Misc::getStatusVector(StatusVec *status) const
{
this->_status->sync();
status->pgErr = ((this->_status->pgErr->getValue()) != 0);
status->mpsErr = ((this->_status->mpsErr->getValue()) != 0);
status->fanFault = ((this->_status->fanFault->getValue()) != 0);
status->pulserThd = ((this->_status->pulserThd->getValue()) != 0);
status->scenPriErr = ((this->_status->scenPriErr->getValue()) != 0);
status->thermalErr = ((this->_status->thermalErr->getValue()) != 0);
status->scenSramErr = ((this->_status->scenSramErr->getValue()) != 0);
status->scenSyncAckErr = ((this->_status->scenSyncAckErr->getValue()) != 0);
status->mlaSyncFifoErr = ((this->_status->mlaSyncFifoErr->getValue()) != 0);
status->dintrlvFifoErr = ((this->_status->dintrlvFifoErr->getValue()) != 0);
status->adcFlagSyncErr = ((this->_status->adcFlagSyncErr->getValue()) != 0);
status->sram1ParityErr = ((this->_status->sram1ParityErr->getValue()) != 0);
status->sram2ParityErr = ((this->_status->sram2ParityErr->getValue()) != 0);
status->mlaSyncPointErr = ((this->_status->mlaSyncPointErr->getValue()) != 0);
status->ddcLpfReloadErr = ((this->_status->ddcLpfReloadErr->getValue()) != 0);
status->dintrlvPointErr = ((this->_status->dintrlvPointErr->getValue()) != 0);
status->dintrlvFrameLost = ((this->_status->dintrlvFrameLost->getValue()) != 0);
status->dmaCtrlTransferErr = ((this->_status->dmaCtrlTransferErr->getValue()) != 0);
status->emulDmaTransferErr = ((this->_status->emulDmaTransferErr->getValue()) != 0);
status->probeDisconnectErr = ((this->_status->probeDisconnectErr->getValue()) != 0);
status->dintrlvOffsetAddrErr = ((this->_status->dintrlvOffsetAddrErr->getValue()) != 0);
status->dintrlvSramOver4MErr = ((this->_status->dintrlvSramOver4MErr->getValue()) != 0);
status->pgErr = ((this->_status->pgErr->getValue()) != 0);
status->mpsErr = ((this->_status->mpsErr->getValue()) != 0);
status->fan1Fault = ((this->_status->fan1Fault->getValue()) != 0);
status->fan2Fault = ((this->_status->fan2Fault->getValue()) != 0);
status->pulserThd = ((this->_status->pulserThd->getValue()) != 0);
status->scenPriErr = ((this->_status->scenPriErr->getValue()) != 0);
status->thermalErr = ((this->_status->thermalErr->getValue()) != 0);
status->scenSramErr = ((this->_status->scenSramErr->getValue()) != 0);
status->scenSyncAckErr = ((this->_status->scenSyncAckErr->getValue()) != 0);
status->mlaSyncFifoErr = ((this->_status->mlaSyncFifoErr->getValue()) != 0);
status->dintrlvFifoErr = ((this->_status->dintrlvFifoErr->getValue()) != 0);
status->adcFlagSyncErr = ((this->_status->adcFlagSyncErr->getValue()) != 0);
status->sram1ParityErr = ((this->_status->sram1ParityErr->getValue()) != 0);
status->sram2ParityErr = ((this->_status->sram2ParityErr->getValue()) != 0);
status->mlaSyncPointErr = ((this->_status->mlaSyncPointErr->getValue()) != 0);
status->ddcLpfReloadErr = ((this->_status->ddcLpfReloadErr->getValue()) != 0);
status->dintrlvPointErr = ((this->_status->dintrlvPointErr->getValue()) != 0);
status->dintrlvFrameLost = ((this->_status->dintrlvFrameLost->getValue()) != 0);
status->dmaCtrlTransferErr = ((this->_status->dmaCtrlTransferErr->getValue()) != 0);
status->emulDmaTransferErr = ((this->_status->emulDmaTransferErr->getValue()) != 0);
status->probeDisconnectErr = ((this->_status->probeDisconnectErr->getValue()) != 0);
status->dintrlvOffsetAddrErr = ((this->_status->dintrlvOffsetAddrErr->getValue()) != 0);
status->dintrlvSramOver4MErr = ((this->_status->dintrlvSramOver4MErr->getValue()) != 0);
status->probeDetChanInterrupt = ((this->_status->probeDetChanInterrupt->getValue()) != 0);
}

7
src/model/hardware/core/lowLevelApi/register/scenPlayer/ScenPlayer.cpp

@ -55,3 +55,10 @@ void ScenPalyer::PlayerControl::pause(bool pause) const
_playerctrl->pause->setValue(pusCmd);
_playerctrl->update();
}
void ScenPalyer::PlayerControl::setHeartBeats(bool heartBeat) const
{
quint32 pulse = heartBeat ? 1 : 0;
_playerctrl->heartBeats->setValue(pulse);
_playerctrl->update();
}

Loading…
Cancel
Save