Added exit button and rig ID (was not useful)

merge-requests/1/merge
Elliott Liggett 2018-11-19 23:42:34 -08:00
rodzic 908e928838
commit da4b526f81
5 zmienionych plików z 47 dodań i 3 usunięć

Wyświetl plik

@ -428,6 +428,7 @@ void rigCommander::parseData(QByteArray dataInput)
default:
// could be for other equipment on the CIV network.
// just drop for now.
// relaySendOutData(data);
break;
}
}
@ -473,6 +474,11 @@ void rigCommander::parseCommand()
// read levels
parseLevels();
break;
case '\x19':
// qDebug() << "Have rig ID: " << (int)payloadIn[2];
// printHex(payloadIn, false, true);
// This returns the CIV address of the radio. (94 by default)
break;
case '\x27':
// scope data
//qDebug() << "Have scope data";
@ -929,6 +935,18 @@ void rigCommander::getATUStatus()
prepDataAndSend(payload);
}
void rigCommander::getRigID()
{
QByteArray payload;
payload.setRawData("\x19\x00", 2);
prepDataAndSend(payload);
}
// Other:
QByteArray rigCommander::stripData(const QByteArray &data, unsigned char cutPosition)
{
QByteArray rtndata;

Wyświetl plik

@ -49,6 +49,7 @@ public slots:
void startATU();
void setATU(bool enabled);
void getATUStatus();
void getRigID();
void setCIVAddr(unsigned char civAddr);
void handleNewData(const QByteArray &data);
void getDebug();

Wyświetl plik

@ -89,6 +89,7 @@ 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(getRigID()), rig, SLOT(getRigID()));
// Plot user interaction
@ -166,6 +167,8 @@ void wfmain::getInitialRigState()
// Freq, Mode, Scope cent/fixed, scope span, edge setting
// data mode (may be combined with scope mode)
cmdOutQue.append(cmdGetRigID);
cmdOutQue.append(cmdGetFreq);
cmdOutQue.append(cmdGetMode);
@ -294,6 +297,12 @@ void wfmain::runDelayedCommand()
qdCmd = cmdOutQue.takeFirst();
switch(qdCmd)
{
case cmdNone:
qDebug() << "NOOP";
break;
case cmdGetRigID:
emit getRigID();
break;
case cmdGetFreq:
emit getFrequency();
break;
@ -1068,3 +1077,9 @@ void wfmain::on_tuneEnableChk_clicked(bool checked)
showStatusBarText("Turning off ATU");
}
}
void wfmain::on_exitBtn_clicked()
{
// Are you sure?
QApplication::exit();
}

Wyświetl plik

@ -43,6 +43,7 @@ signals:
void setAfGain(unsigned char level);
void startATU();
void setATU(bool atuEnabled);
void getRigID();
void spectOutputEnable();
void spectOutputDisable();
void scopeDisplayEnable();
@ -165,6 +166,8 @@ private slots:
void on_tuneEnableChk_clicked(bool checked);
void on_exitBtn_clicked();
private:
Ui::wfmain *ui;
QCustomPlot *plot; // line plot
@ -207,7 +210,7 @@ private:
double oldUpperFreq;
double freqMhz;
double knobFreqMhz;
enum cmds {cmdNone, cmdGetFreq, cmdGetMode, cmdGetDataMode, cmdSetDataModeOn, cmdSetDataModeOff,
enum cmds {cmdNone, cmdGetRigID, cmdGetFreq, cmdGetMode, cmdGetDataMode, cmdSetDataModeOn, cmdSetDataModeOff,
cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain,
cmdGetSql};
cmds cmdOut;

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -1242,6 +1242,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="exitBtn">
<property name="text">
<string>Exit</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
@ -1330,7 +1337,7 @@
<x>0</x>
<y>0</y>
<width>630</width>
<height>26</height>
<height>20</height>
</rect>
</property>
</widget>