kopia lustrzana https://gitlab.com/eliggett/wfview
Fixed ATU status return.
rodzic
c6f73fee7a
commit
9e50b2e037
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
1
wfmain.h
1
wfmain.h
|
@ -46,6 +46,7 @@ signals:
|
|||
void setAfGain(unsigned char level);
|
||||
void startATU();
|
||||
void setATU(bool atuEnabled);
|
||||
void getATUStatus();
|
||||
void getRigID();
|
||||
void spectOutputEnable();
|
||||
void spectOutputDisable();
|
||||
|
|
Ładowanie…
Reference in New Issue