|
@ -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); |
|
@ -2978,7 +2978,7 @@ QByteArray str2BigEndianByteArray(QString str, int base, qint8 byteLength) |
|
|
QByteArray qbInt; |
|
|
QByteArray qbInt; |
|
|
for(qint8 i = byteLength - 1; i >= 0; i--) |
|
|
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; |
|
|
return qbInt; |
|
@ -2989,11 +2989,12 @@ 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); |
|
|
|
|
|
|
|
|
return str; |
|
|
return str; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
QByteArray str2BigEndianByteArray4SerialNo(QString str) |
|
|
QByteArray str2BigEndianByteArray4SerialNo(QString str) |
|
@ -3011,13 +3012,15 @@ QByteArray str2BigEndianByteArray4SerialNo(QString str) |
|
|
|
|
|
|
|
|
for(qint8 i = 1; i >= 0; i--) |
|
|
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; |
|
|
return qbInt; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
|
|
|
{ |
|
|
throw SonoException("Invalid board serial number."); |
|
|
throw SonoException("Invalid board serial number."); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
QString bigEndianByteArray2Str4SerialNo(QByteArray btArr) |
|
|
QString bigEndianByteArray2Str4SerialNo(QByteArray btArr) |
|
@ -3025,11 +3028,14 @@ 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( |
|
|
return str; |
|
|
reconstructedNum); |
|
|
|
|
|
|
|
|
|
|
|
return str; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
QByteArray MainWindow::str2ByteArray (QString& str) |
|
|
QByteArray MainWindow::str2ByteArray (QString& 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); |
|
@ -3338,55 +3345,70 @@ void MainWindow::on_btn_trxRomSlaveCodeVersion_clicked() |
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_writeHeaderTrxRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_writeHeaderTrxRom_clicked(bool checked) |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
try |
|
|
{ |
|
|
{ |
|
|
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER); |
|
|
if(checked) |
|
|
trxEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
{ |
|
|
|
|
|
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER); |
|
|
|
|
|
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) |
|
|
{ |
|
|
{ |
|
|
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); |
|
|
qDebug() << e.what(); |
|
|
trxEepromWrite(clearAll, 0, _bCtrl); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
///*************************************************************************************************/
|
|
|
///*************************************************************************************************/
|
|
|
//void MainWindow::on_btn_trxRomInfoWrite_clicked()
|
|
|
//void MainWindow::on_btn_trxRomInfoWrite_clicked()
|
|
|
//{
|
|
|
//{
|
|
|
// QString infoStr = ui->tb_trxRomInfo->toPlainText();
|
|
|
//QString infoStr = ui->tb_trxRomInfo->toPlainText();
|
|
|
// try
|
|
|
//try
|
|
|
// {
|
|
|
//{
|
|
|
// QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
|
|
|
//QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
|
|
|
// trxEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
//trxEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
|
|
|
|
|
|
// QByteArray sendingArray = infoStr.toLatin1();
|
|
|
//QByteArray sendingArray = infoStr.toLatin1();
|
|
|
// trxEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
//trxEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
// }
|
|
|
//}
|
|
|
// catch(SonoException& e)
|
|
|
//catch(SonoException& e)
|
|
|
// {
|
|
|
//{
|
|
|
// qDebug() << e.what();
|
|
|
//qDebug() << e.what();
|
|
|
// }
|
|
|
//}
|
|
|
//}
|
|
|
//}
|
|
|
///*************************************************************************************************/
|
|
|
///*************************************************************************************************/
|
|
|
//void MainWindow::on_btn_trxRomInfoRead_clicked()
|
|
|
//void MainWindow::on_btn_trxRomInfoRead_clicked()
|
|
|
//{
|
|
|
//{
|
|
|
// try
|
|
|
//try
|
|
|
// {
|
|
|
//{
|
|
|
// QString receivingStr = _trx.trxInfo();
|
|
|
//QString receivingStr = _trx.trxInfo();
|
|
|
// ui->tb_trxRomInfo->setText(receivingStr);
|
|
|
//ui->tb_trxRomInfo->setText(receivingStr);
|
|
|
// }
|
|
|
//}
|
|
|
// catch(SonoException& e)
|
|
|
//catch(SonoException& e)
|
|
|
// {
|
|
|
//{
|
|
|
// qDebug() << e.what();
|
|
|
//qDebug() << e.what();
|
|
|
// }
|
|
|
//}
|
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
@ -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); |
|
@ -3603,55 +3625,70 @@ void MainWindow::on_btn_mpsRomSupCodeVersion_clicked() |
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_writeHeaderMpsRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_writeHeaderMpsRom_clicked(bool checked) |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
try |
|
|
{ |
|
|
{ |
|
|
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER); |
|
|
if(checked) |
|
|
mpsEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
{ |
|
|
|
|
|
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER); |
|
|
|
|
|
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) |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
try |
|
|
{ |
|
|
{ |
|
|
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE); |
|
|
if(checked) |
|
|
mpsEepromWrite(clearAll, 0, _bCtrl); |
|
|
{ |
|
|
|
|
|
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()
|
|
|
//void MainWindow::on_btn_mpsRomInfoWrite_clicked()
|
|
|
//{
|
|
|
//{
|
|
|
// QString infoStr = ui->tb_mpsRomInfo->toPlainText();
|
|
|
//QString infoStr = ui->tb_mpsRomInfo->toPlainText();
|
|
|
// try
|
|
|
//try
|
|
|
// {
|
|
|
//{
|
|
|
// QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
|
|
|
//QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
|
|
|
// mpsEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
//mpsEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
|
|
|
|
|
|
// QByteArray sendingArray = infoStr.toLatin1();
|
|
|
//QByteArray sendingArray = infoStr.toLatin1();
|
|
|
// mpsEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
//mpsEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
// }
|
|
|
//}
|
|
|
// catch(SonoException& e)
|
|
|
//catch(SonoException& e)
|
|
|
// {
|
|
|
//{
|
|
|
// qDebug() << e.what();
|
|
|
//qDebug() << e.what();
|
|
|
// }
|
|
|
//}
|
|
|
//}
|
|
|
//}
|
|
|
///*************************************************************************************************/
|
|
|
///*************************************************************************************************/
|
|
|
//void MainWindow::on_btn_mpsRomInfoRead_clicked()
|
|
|
//void MainWindow::on_btn_mpsRomInfoRead_clicked()
|
|
|
//{
|
|
|
//{
|
|
|
// try
|
|
|
//try
|
|
|
// {
|
|
|
//{
|
|
|
// QString receivingStr = _trx.mpsInfo();
|
|
|
//QString receivingStr = _trx.mpsInfo();
|
|
|
// ui->tb_mpsRomInfo->setText(receivingStr);
|
|
|
//ui->tb_mpsRomInfo->setText(receivingStr);
|
|
|
// }
|
|
|
//}
|
|
|
// catch(SonoException& e)
|
|
|
//catch(SonoException& e)
|
|
|
// {
|
|
|
//{
|
|
|
// qDebug() << e.what();
|
|
|
//qDebug() << e.what();
|
|
|
// }
|
|
|
//}
|
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
@ -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); |
|
@ -3797,55 +3835,70 @@ void MainWindow::on_btn_prbCntlRomSerialNumber_clicked() |
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|
void MainWindow::on_chk_writeHeaderPrbCtrlRom_clicked(bool checked) |
|
|
void MainWindow::on_chk_writeHeaderPrbCtrlRom_clicked(bool checked) |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
try |
|
|
{ |
|
|
{ |
|
|
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER); |
|
|
if(checked) |
|
|
prbCtrlEepromWrite(clearHeader, EEPROM_HEADER_BEGIN, _bCtrl); |
|
|
{ |
|
|
|
|
|
QByteArray clearHeader = e2promClear(EEPROM_HEADER_NUMBER); |
|
|
|
|
|
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) |
|
|
{ |
|
|
{ |
|
|
if(checked) |
|
|
try |
|
|
{ |
|
|
{ |
|
|
QByteArray clearAll = e2promClear(TRX_RLY_MPS_E2PROM_SIZE_BYTE); |
|
|
if(checked) |
|
|
prbCtrlEepromWrite(clearAll, 0, _bCtrl); |
|
|
{ |
|
|
|
|
|
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()
|
|
|
//void MainWindow::on_btn_prbCtrlRomInfoWrite_clicked()
|
|
|
//{
|
|
|
//{
|
|
|
// QString infoStr = ui->tb_prbCtrlRomInfo->toPlainText();
|
|
|
//QString infoStr = ui->tb_prbCtrlRomInfo->toPlainText();
|
|
|
// try
|
|
|
//try
|
|
|
// {
|
|
|
//{
|
|
|
// QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
|
|
|
//QByteArray clearInfo = e2promClear(EEPROM_INFO_NUMBER);
|
|
|
// prbCtrlEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
//prbCtrlEepromWrite(clearInfo, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
|
|
|
|
|
|
// QByteArray sendingArray = infoStr.toLatin1();
|
|
|
//QByteArray sendingArray = infoStr.toLatin1();
|
|
|
// prbCtrlEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
//prbCtrlEepromWrite(sendingArray, EEPROM_INFO_BEGIN, _bCtrl);
|
|
|
// }
|
|
|
//}
|
|
|
// catch(SonoException& e)
|
|
|
//catch(SonoException& e)
|
|
|
// {
|
|
|
//{
|
|
|
// qDebug() << e.what();
|
|
|
//qDebug() << e.what();
|
|
|
// }
|
|
|
//}
|
|
|
//}
|
|
|
//}
|
|
|
///*************************************************************************************************/
|
|
|
///*************************************************************************************************/
|
|
|
//void MainWindow::on_btn_prbCtrlRomInfoRead_clicked()
|
|
|
//void MainWindow::on_btn_prbCtrlRomInfoRead_clicked()
|
|
|
//{
|
|
|
//{
|
|
|
// try
|
|
|
//try
|
|
|
// {
|
|
|
//{
|
|
|
// QString receivingStr = _trx.prbCtrlInfo();
|
|
|
//QString receivingStr = _trx.prbCtrlInfo();
|
|
|
// ui->tb_prbCtrlRomInfo->setText(receivingStr);
|
|
|
//ui->tb_prbCtrlRomInfo->setText(receivingStr);
|
|
|
// }
|
|
|
//}
|
|
|
// catch(SonoException& e)
|
|
|
//catch(SonoException& e)
|
|
|
// {
|
|
|
//{
|
|
|
// qDebug() << e.what();
|
|
|
//qDebug() << e.what();
|
|
|
// }
|
|
|
//}
|
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
/*************************************************************************************************/ |
|
|