|
@ -460,11 +460,11 @@ void MainWindow::timeout() |
|
|
delay(1); |
|
|
delay(1); |
|
|
|
|
|
|
|
|
quint32 tachoFan1 = static_cast<quint32>(_healStatus->fanRpm->fan1); |
|
|
quint32 tachoFan1 = static_cast<quint32>(_healStatus->fanRpm->fan1); |
|
|
ui->l_tachoFan1->setText(QString::number(tachoFan1)); |
|
|
ui->l_tachoFan1->setText((tachoFan1) ? "On" : "Off"); |
|
|
delay(1); |
|
|
delay(1); |
|
|
|
|
|
|
|
|
quint32 tachoFan2 = static_cast<quint32>(_healStatus->fanRpm->fan2); |
|
|
quint32 tachoFan2 = static_cast<quint32>(_healStatus->fanRpm->fan2); |
|
|
ui->l_tachoFan2->setText(QString::number(tachoFan2)); |
|
|
ui->l_tachoFan2->setText((tachoFan2) ? "On" : "Off"); |
|
|
delay(1); |
|
|
delay(1); |
|
|
|
|
|
|
|
|
/******************* Power Good *********************/ |
|
|
/******************* Power Good *********************/ |
|
@ -523,7 +523,7 @@ void MainWindow::timeout() |
|
|
changeLabelTextColor(ui->l_frameLost, color); |
|
|
changeLabelTextColor(ui->l_frameLost, color); |
|
|
delay(1); |
|
|
delay(1); |
|
|
|
|
|
|
|
|
bool fanFault = _vec->fanFault; |
|
|
bool fanFault = (_vec->fan1Fault) | (_vec->fan2Fault); |
|
|
ui->l_fan->setText(QVariant(fanFault).toString()); |
|
|
ui->l_fan->setText(QVariant(fanFault).toString()); |
|
|
color = fanFault ? Qt::red : Qt::green; |
|
|
color = fanFault ? Qt::red : Qt::green; |
|
|
changeLabelTextColor(ui->l_fan, color); |
|
|
changeLabelTextColor(ui->l_fan, color); |
|
@ -2989,7 +2989,8 @@ QString bigEndianByteArray2Str(QByteArray btArr, int base) |
|
|
quint32 reconstructedNum(0); |
|
|
quint32 reconstructedNum(0); |
|
|
for(auto i = btArr.length() - 1; i >= 0; i--) |
|
|
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); |
|
|
QString str = QString::number(reconstructedNum, base); |
|
|
|
|
|
|
|
@ -3017,18 +3018,23 @@ QByteArray str2BigEndianByteArray4SerialNo(QString str) |
|
|
return qbInt; |
|
|
return qbInt; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
|
|
|
{ |
|
|
throw SonoException("Invalid board serial number."); |
|
|
throw SonoException("Invalid board serial number."); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
QString bigEndianByteArray2Str4SerialNo(QByteArray btArr) |
|
|
QString bigEndianByteArray2Str4SerialNo(QByteArray btArr) |
|
|
{ |
|
|
{ |
|
|
quint16 reconstructedNum(0); |
|
|
quint16 reconstructedNum(0); |
|
|
for(auto i = btArr.length() - 3; i >= 0; i--) |
|
|
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 str = "SPN." + QString::number(static_cast<quint8>(btArr[0])) + "." + |
|
|
+ QString::number(static_cast<quint8>(btArr[1])) + "." + QString::number(reconstructedNum); |
|
|
QString::number(static_cast<quint8>(btArr[1])) + "." + QString::number( |
|
|
|
|
|
reconstructedNum); |
|
|
|
|
|
|
|
|
return str; |
|
|
return str; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -3095,6 +3101,7 @@ QByteArray MainWindow::crcCalc(const QByteArray array) |
|
|
quint8 crcValue = _trx.crcGenerator(array); |
|
|
quint8 crcValue = _trx.crcGenerator(array); |
|
|
QByteArray crc; |
|
|
QByteArray crc; |
|
|
crc.append(static_cast<qint8>(crcValue)); |
|
|
crc.append(static_cast<qint8>(crcValue)); |
|
|
|
|
|
|
|
|
return crc; |
|
|
return crc; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -3244,11 +3251,11 @@ void MainWindow::on_btn_trxRomSerialNumber_clicked() |
|
|
if(trxSerialNoWrEn) |
|
|
if(trxSerialNoWrEn) |
|
|
{ |
|
|
{ |
|
|
QString serialNoStr = ui->tb_trxRomSerialNumber->text(); |
|
|
QString serialNoStr = ui->tb_trxRomSerialNumber->text(); |
|
|
|
|
|
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr); |
|
|
|
|
|
|
|
|
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER); |
|
|
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER); |
|
|
trxEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
trxEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr); |
|
|
|
|
|
trxEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
trxEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
trxCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC); |
|
|
trxCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC); |
|
@ -3337,6 +3344,8 @@ void MainWindow::on_btn_trxRomSlaveCodeVersion_clicked() |
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_writeHeaderTrxRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_writeHeaderTrxRom_clicked(bool checked) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
if(checked) |
|
|
{ |
|
|
{ |
|
@ -3344,12 +3353,20 @@ void MainWindow::on_chk_writeHeaderTrxRom_clicked(bool checked) |
|
|
trxEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
trxEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
trxEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
trxEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
qDebug() << _trx.trxRomHeader(); |
|
|
delay(200); |
|
|
|
|
|
qDebug() << bigEndianByteArray2Str(_trx.trxRomHeader(), 16); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch(SonoException& e) |
|
|
|
|
|
{ |
|
|
|
|
|
qDebug() << e.what(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_clearTrxRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_clearTrxRom_clicked(bool checked) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
if(checked) |
|
|
{ |
|
|
{ |
|
@ -3357,6 +3374,11 @@ void MainWindow::on_chk_clearTrxRom_clicked(bool checked) |
|
|
trxEepromWrite(clearAll, 0, _bCtrl); |
|
|
trxEepromWrite(clearAll, 0, _bCtrl); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
catch(SonoException& e) |
|
|
|
|
|
{ |
|
|
|
|
|
qDebug() << e.what(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
///*************************************************************************************************/
|
|
|
///*************************************************************************************************/
|
|
|
//void MainWindow::on_btn_trxRomInfoWrite_clicked()
|
|
|
//void MainWindow::on_btn_trxRomInfoWrite_clicked()
|
|
@ -3509,11 +3531,11 @@ void MainWindow::on_btn_mpsRomSerialNumber_clicked() |
|
|
if(mpsSerialNoWrEn) |
|
|
if(mpsSerialNoWrEn) |
|
|
{ |
|
|
{ |
|
|
QString serialNoStr = ui->tb_mpsRomSerialNumber->text(); |
|
|
QString serialNoStr = ui->tb_mpsRomSerialNumber->text(); |
|
|
|
|
|
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr); |
|
|
|
|
|
|
|
|
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER); |
|
|
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER); |
|
|
mpsEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
mpsEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr); |
|
|
|
|
|
mpsEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
mpsEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
mpsCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC); |
|
|
mpsCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC); |
|
@ -3602,6 +3624,8 @@ void MainWindow::on_btn_mpsRomSupCodeVersion_clicked() |
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_writeHeaderMpsRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_writeHeaderMpsRom_clicked(bool checked) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
if(checked) |
|
|
{ |
|
|
{ |
|
@ -3609,12 +3633,20 @@ void MainWindow::on_chk_writeHeaderMpsRom_clicked(bool checked) |
|
|
mpsEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
mpsEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
mpsEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
mpsEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
qDebug() << _trx.mpsRomHeader(); |
|
|
delay(200); |
|
|
|
|
|
qDebug() << bigEndianByteArray2Str(_trx.mpsRomHeader(), 16); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch(SonoException& e) |
|
|
|
|
|
{ |
|
|
|
|
|
qDebug() << e.what(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_clearMpsRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_clearMpsRom_clicked(bool checked) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
if(checked) |
|
|
{ |
|
|
{ |
|
@ -3622,6 +3654,11 @@ void MainWindow::on_chk_clearMpsRom_clicked(bool checked) |
|
|
mpsEepromWrite(clearAll, 0, _bCtrl); |
|
|
mpsEepromWrite(clearAll, 0, _bCtrl); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
catch(SonoException& e) |
|
|
|
|
|
{ |
|
|
|
|
|
qDebug() << e.what(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
///*************************************************************************************************/
|
|
|
///*************************************************************************************************/
|
|
|
//void MainWindow::on_btn_mpsRomInfoWrite_clicked()
|
|
|
//void MainWindow::on_btn_mpsRomInfoWrite_clicked()
|
|
@ -3689,6 +3726,7 @@ void MainWindow::on_btn_prbCtrlRomId_clicked() |
|
|
qDebug() << e.what(); |
|
|
qDebug() << e.what(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_prbCntlPidWrEn_clicked(bool checked) |
|
|
void MainWindow::on_chk_prbCntlPidWrEn_clicked(bool checked) |
|
|
{ |
|
|
{ |
|
@ -3773,11 +3811,11 @@ void MainWindow::on_btn_prbCntlRomSerialNumber_clicked() |
|
|
if(prbCtrlSerialNoWrEn) |
|
|
if(prbCtrlSerialNoWrEn) |
|
|
{ |
|
|
{ |
|
|
QString serialNoStr = ui->tb_prbCtrlRomSerialNumber->text(); |
|
|
QString serialNoStr = ui->tb_prbCtrlRomSerialNumber->text(); |
|
|
|
|
|
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr); |
|
|
|
|
|
|
|
|
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER); |
|
|
QByteArray clearSerialNo = e2promClear(EEPROM_BOARD_SERIAL_NO_NUMBER); |
|
|
prbCtrlEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
prbCtrlEepromWrite(clearSerialNo, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
QByteArray sendingArray = str2BigEndianByteArray4SerialNo(serialNoStr); |
|
|
|
|
|
prbCtrlEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
prbCtrlEepromWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
prbCtrlCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC); |
|
|
prbCtrlCrcWrite(sendingArray, EEPROM_BOARD_SERIAL_NO_CRC); |
|
@ -3796,6 +3834,8 @@ void MainWindow::on_btn_prbCntlRomSerialNumber_clicked() |
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_writeHeaderPrbCtrlRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_writeHeaderPrbCtrlRom_clicked(bool checked) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
if(checked) |
|
|
{ |
|
|
{ |
|
@ -3803,12 +3843,20 @@ void MainWindow::on_chk_writeHeaderPrbCtrlRom_clicked(bool checked) |
|
|
prbCtrlEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
prbCtrlEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
|
|
|
|
|
|
prbCtrlEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
prbCtrlEepromWrite(headerArray, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
qDebug() << _trx.prbCtrlRomHeader(); |
|
|
delay(200); |
|
|
|
|
|
qDebug() << bigEndianByteArray2Str(_trx.prbCtrlRomHeader(), 16); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch(SonoException& e) |
|
|
|
|
|
{ |
|
|
|
|
|
qDebug() << e.what(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_clearPrbCtrlRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_clearPrbCtrlRom_clicked(bool checked) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
if(checked) |
|
|
{ |
|
|
{ |
|
@ -3816,6 +3864,11 @@ void MainWindow::on_chk_clearPrbCtrlRom_clicked(bool checked) |
|
|
prbCtrlEepromWrite(clearAll, 0, _bCtrl); |
|
|
prbCtrlEepromWrite(clearAll, 0, _bCtrl); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
catch(SonoException& e) |
|
|
|
|
|
{ |
|
|
|
|
|
qDebug() << e.what(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
///*************************************************************************************************/
|
|
|
///*************************************************************************************************/
|
|
|
//void MainWindow::on_btn_prbCtrlRomInfoWrite_clicked()
|
|
|
//void MainWindow::on_btn_prbCtrlRomInfoWrite_clicked()
|
|
|