Fixed ATU status return.

merge-requests/1/merge
Elliott Liggett 2018-12-20 10:56:54 -08:00
rodzic c6f73fee7a
commit 9e50b2e037
3 zmienionych plików z 17 dodań i 6 usunięć

Wyświetl plik

@ -654,7 +654,7 @@ void rigCommander::parseRegisters1C()
// PTT lives here
// Not sure if 02 is the right place to switch.
// TODO: test this function
switch(payloadIn[02])
switch(payloadIn[01])
{
case '\x00':
parsePTT();
@ -670,12 +670,12 @@ void rigCommander::parseRegisters1C()
void rigCommander::parseATU()
{
// qDebug() << "Have ATU status from radio. Emitting.";
// Expect:
// [0]:
// [1]: 0x1c
// [2]: 0x01
// [3]: 0 = off, 0x01 = on, 0x02 = tuning in-progress
emit haveATUStatus((unsigned char) payloadIn[3]);
// [0]: 0x1c
// [1]: 0x01
// [2]: 0 = off, 0x01 = on, 0x02 = tuning in-progress
emit haveATUStatus((unsigned char) payloadIn[2]);
}
void rigCommander::parsePTT()
@ -1040,6 +1040,7 @@ void rigCommander::setATU(bool enabled)
void rigCommander::getATUStatus()
{
qDebug() << "Sending out for ATU status in RC.";
QByteArray payload("\x1C\x01");
prepDataAndSend(payload);
}

Wyświetl plik

@ -150,7 +150,9 @@ wfmain::wfmain(QWidget *parent) :
connect(rig, SIGNAL(haveSql(unsigned char)), this, SLOT(receiveSql(unsigned char)));
connect(this, SIGNAL(startATU()), rig, SLOT(startATU()));
connect(this, SIGNAL(setATU(bool)), rig, SLOT(setATU(bool)));
connect(this, SIGNAL(getATUStatus()), rig, SLOT(getATUStatus()));
connect(this, SIGNAL(getRigID()), rig, SLOT(getRigID()));
connect(rig, SIGNAL(haveATUStatus(unsigned char)), this, SLOT(receiveATUStatus(unsigned char)));
// Plot user interaction
@ -655,6 +657,9 @@ void wfmain::runDelayedCommand()
case cmdGetSql:
emit getSql();
break;
case cmdGetATUStatus:
emit getATUStatus();
break;
default:
break;
}
@ -1491,6 +1496,7 @@ void wfmain::on_saveSettingsBtn_clicked()
void wfmain::receiveATUStatus(unsigned char atustatus)
{
qDebug() << "Received ATU status update: " << (unsigned int) atustatus;
switch(atustatus)
{
case 0x00:
@ -1510,10 +1516,13 @@ void wfmain::receiveATUStatus(unsigned char atustatus)
case 0x02:
// ATU tuning in-progress.
// Add command queue to check again and update status bar
qDebug() << "Received ATU status update that *tuning* is taking place";
showStatusBarText("Tuning...");
cmdOutQue.append(cmdGetATUStatus);
delayedCommand->start();
break;
default:
qDebug() << "Did not understand ATU status: " << (unsigned int) atustatus;
}
}

Wyświetl plik

@ -46,6 +46,7 @@ signals:
void setAfGain(unsigned char level);
void startATU();
void setATU(bool atuEnabled);
void getATUStatus();
void getRigID();
void spectOutputEnable();
void spectOutputDisable();