kopia lustrzana https://gitlab.com/eliggett/wfview
Added exit button and rig ID (was not useful)
rodzic
908e928838
commit
da4b526f81
|
@ -428,6 +428,7 @@ void rigCommander::parseData(QByteArray dataInput)
|
||||||
default:
|
default:
|
||||||
// could be for other equipment on the CIV network.
|
// could be for other equipment on the CIV network.
|
||||||
// just drop for now.
|
// just drop for now.
|
||||||
|
// relaySendOutData(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -473,6 +474,11 @@ void rigCommander::parseCommand()
|
||||||
// read levels
|
// read levels
|
||||||
parseLevels();
|
parseLevels();
|
||||||
break;
|
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':
|
case '\x27':
|
||||||
// scope data
|
// scope data
|
||||||
//qDebug() << "Have scope data";
|
//qDebug() << "Have scope data";
|
||||||
|
@ -929,6 +935,18 @@ void rigCommander::getATUStatus()
|
||||||
prepDataAndSend(payload);
|
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 rigCommander::stripData(const QByteArray &data, unsigned char cutPosition)
|
||||||
{
|
{
|
||||||
QByteArray rtndata;
|
QByteArray rtndata;
|
||||||
|
|
|
@ -49,6 +49,7 @@ public slots:
|
||||||
void startATU();
|
void startATU();
|
||||||
void setATU(bool enabled);
|
void setATU(bool enabled);
|
||||||
void getATUStatus();
|
void getATUStatus();
|
||||||
|
void getRigID();
|
||||||
void setCIVAddr(unsigned char civAddr);
|
void setCIVAddr(unsigned char civAddr);
|
||||||
void handleNewData(const QByteArray &data);
|
void handleNewData(const QByteArray &data);
|
||||||
void getDebug();
|
void getDebug();
|
||||||
|
|
15
wfmain.cpp
15
wfmain.cpp
|
@ -89,6 +89,7 @@ wfmain::wfmain(QWidget *parent) :
|
||||||
connect(rig, SIGNAL(haveSql(unsigned char)), this, SLOT(receiveSql(unsigned char)));
|
connect(rig, SIGNAL(haveSql(unsigned char)), this, SLOT(receiveSql(unsigned char)));
|
||||||
connect(this, SIGNAL(startATU()), rig, SLOT(startATU()));
|
connect(this, SIGNAL(startATU()), rig, SLOT(startATU()));
|
||||||
connect(this, SIGNAL(setATU(bool)), rig, SLOT(setATU(bool)));
|
connect(this, SIGNAL(setATU(bool)), rig, SLOT(setATU(bool)));
|
||||||
|
connect(this, SIGNAL(getRigID()), rig, SLOT(getRigID()));
|
||||||
|
|
||||||
|
|
||||||
// Plot user interaction
|
// Plot user interaction
|
||||||
|
@ -166,6 +167,8 @@ void wfmain::getInitialRigState()
|
||||||
// Freq, Mode, Scope cent/fixed, scope span, edge setting
|
// Freq, Mode, Scope cent/fixed, scope span, edge setting
|
||||||
// data mode (may be combined with scope mode)
|
// data mode (may be combined with scope mode)
|
||||||
|
|
||||||
|
cmdOutQue.append(cmdGetRigID);
|
||||||
|
|
||||||
cmdOutQue.append(cmdGetFreq);
|
cmdOutQue.append(cmdGetFreq);
|
||||||
cmdOutQue.append(cmdGetMode);
|
cmdOutQue.append(cmdGetMode);
|
||||||
|
|
||||||
|
@ -294,6 +297,12 @@ void wfmain::runDelayedCommand()
|
||||||
qdCmd = cmdOutQue.takeFirst();
|
qdCmd = cmdOutQue.takeFirst();
|
||||||
switch(qdCmd)
|
switch(qdCmd)
|
||||||
{
|
{
|
||||||
|
case cmdNone:
|
||||||
|
qDebug() << "NOOP";
|
||||||
|
break;
|
||||||
|
case cmdGetRigID:
|
||||||
|
emit getRigID();
|
||||||
|
break;
|
||||||
case cmdGetFreq:
|
case cmdGetFreq:
|
||||||
emit getFrequency();
|
emit getFrequency();
|
||||||
break;
|
break;
|
||||||
|
@ -1068,3 +1077,9 @@ void wfmain::on_tuneEnableChk_clicked(bool checked)
|
||||||
showStatusBarText("Turning off ATU");
|
showStatusBarText("Turning off ATU");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wfmain::on_exitBtn_clicked()
|
||||||
|
{
|
||||||
|
// Are you sure?
|
||||||
|
QApplication::exit();
|
||||||
|
}
|
||||||
|
|
5
wfmain.h
5
wfmain.h
|
@ -43,6 +43,7 @@ signals:
|
||||||
void setAfGain(unsigned char level);
|
void setAfGain(unsigned char level);
|
||||||
void startATU();
|
void startATU();
|
||||||
void setATU(bool atuEnabled);
|
void setATU(bool atuEnabled);
|
||||||
|
void getRigID();
|
||||||
void spectOutputEnable();
|
void spectOutputEnable();
|
||||||
void spectOutputDisable();
|
void spectOutputDisable();
|
||||||
void scopeDisplayEnable();
|
void scopeDisplayEnable();
|
||||||
|
@ -165,6 +166,8 @@ private slots:
|
||||||
|
|
||||||
void on_tuneEnableChk_clicked(bool checked);
|
void on_tuneEnableChk_clicked(bool checked);
|
||||||
|
|
||||||
|
void on_exitBtn_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::wfmain *ui;
|
Ui::wfmain *ui;
|
||||||
QCustomPlot *plot; // line plot
|
QCustomPlot *plot; // line plot
|
||||||
|
@ -207,7 +210,7 @@ private:
|
||||||
double oldUpperFreq;
|
double oldUpperFreq;
|
||||||
double freqMhz;
|
double freqMhz;
|
||||||
double knobFreqMhz;
|
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,
|
cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain,
|
||||||
cmdGetSql};
|
cmdGetSql};
|
||||||
cmds cmdOut;
|
cmds cmdOut;
|
||||||
|
|
11
wfmain.ui
11
wfmain.ui
|
@ -18,7 +18,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="mainTab">
|
<widget class="QWidget" name="mainTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -1242,6 +1242,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="exitBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Exit</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_5">
|
<spacer name="horizontalSpacer_5">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -1330,7 +1337,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>630</width>
|
<width>630</width>
|
||||||
<height>26</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
Ładowanie…
Reference in New Issue