kopia lustrzana https://gitlab.com/eliggett/wfview
Changed front panel UI to contain more of the core features. PTT button
was interesting, now has function of Transmit on click, but if already transmitting, sets to receive.merge-requests/2/head
rodzic
73218c8a33
commit
32f407020b
57
wfmain.cpp
57
wfmain.cpp
|
@ -264,6 +264,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
|
|||
connect(this, SIGNAL(getBandStackReg(char,char)), rig, SLOT(getBandStackReg(char,char)));
|
||||
connect(rig, SIGNAL(havePTTStatus(bool)), this, SLOT(receivePTTstatus(bool)));
|
||||
connect(this, SIGNAL(setPTT(bool)), rig, SLOT(setPTT(bool)));
|
||||
connect(this, SIGNAL(getPTT()), rig, SLOT(getPTT()));
|
||||
connect(rig, SIGNAL(haveBandStackReg(float,char,bool)), this, SLOT(receiveBandStackReg(float,char,bool)));
|
||||
connect(this, SIGNAL(getDebug()), rig, SLOT(getDebug()));
|
||||
|
||||
|
@ -358,6 +359,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
|
|||
pttTimer->setInterval(180*1000); // 3 minute max transmit time in ms
|
||||
pttTimer->setSingleShot(true);
|
||||
connect(pttTimer, SIGNAL(timeout()), this, SLOT(handlePttLimit()));
|
||||
amTransmitting = false;
|
||||
|
||||
// Not needed since we automate this now.
|
||||
/*
|
||||
|
@ -1348,6 +1350,9 @@ void wfmain::runDelayedCommand()
|
|||
case cmdScopeFixedMode:
|
||||
emit setScopeCenterMode(false);
|
||||
break;
|
||||
case cmdGetPTT:
|
||||
emit getPTT();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1363,6 +1368,12 @@ void wfmain::runDelayedCommand()
|
|||
}
|
||||
}
|
||||
|
||||
void wfmain::issueDelayedCommand(cmds cmd)
|
||||
{
|
||||
cmdOutQue.append(cmd);
|
||||
delayedCommand->start();
|
||||
}
|
||||
|
||||
|
||||
void wfmain::receiveRigID(rigCapabilities rigCaps)
|
||||
{
|
||||
|
@ -1423,10 +1434,23 @@ void wfmain::receiveFreq(double freqMhz)
|
|||
|
||||
void wfmain::receivePTTstatus(bool pttOn)
|
||||
{
|
||||
// NOTE: This will only show up if we actually receive a PTT status
|
||||
// This is the only place where amTransmitting and the transmit button text should be changed:
|
||||
qDebug() << "PTT status: " << pttOn;
|
||||
amTransmitting = pttOn;
|
||||
changeTxBtn();
|
||||
}
|
||||
|
||||
void wfmain::changeTxBtn()
|
||||
{
|
||||
if(amTransmitting)
|
||||
{
|
||||
ui->transmitBtn->setText("Receive");
|
||||
} else {
|
||||
ui->transmitBtn->setText("Transmit");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double endFreq)
|
||||
{
|
||||
if(!haveRigCaps)
|
||||
|
@ -2245,6 +2269,7 @@ void wfmain::on_pttOnBtn_clicked()
|
|||
// Are we already PTT? Not a big deal, just send again anyway.
|
||||
showStatusBarText("Sending PTT ON command. Use Control-R to receive.");
|
||||
emit setPTT(true);
|
||||
amTransmitting = true;
|
||||
// send PTT
|
||||
// Start 3 minute timer
|
||||
pttTimer->start();
|
||||
|
@ -2258,7 +2283,8 @@ void wfmain::on_pttOffBtn_clicked()
|
|||
|
||||
// Stop the 3 min timer
|
||||
pttTimer->stop();
|
||||
|
||||
cmdOutQue.append(cmdGetPTT);
|
||||
delayedCommand->start();
|
||||
}
|
||||
|
||||
void wfmain::handlePttLimit()
|
||||
|
@ -2465,3 +2491,30 @@ void wfmain::on_debugBtn_clicked()
|
|||
//emit getMode();
|
||||
sat->show();
|
||||
}
|
||||
|
||||
void wfmain::on_transmitBtn_clicked()
|
||||
{
|
||||
if(!amTransmitting)
|
||||
{
|
||||
// Currently receiving
|
||||
if(!ui->pttEnableChk->isChecked())
|
||||
{
|
||||
showStatusBarText("PTT is disabled, not sending command. Change under Settings tab.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Are we already PTT? Not a big deal, just send again anyway.
|
||||
showStatusBarText("Sending PTT ON command. Use Control-R to receive.");
|
||||
emit setPTT(true);
|
||||
// send PTT
|
||||
// Start 3 minute timer
|
||||
pttTimer->start();
|
||||
issueDelayedCommand(cmdGetPTT);
|
||||
//changeTxBtn();
|
||||
|
||||
} else {
|
||||
// Currently transmitting
|
||||
emit setPTT(false);
|
||||
issueDelayedCommand(cmdGetPTT);
|
||||
}
|
||||
}
|
||||
|
|
8
wfmain.h
8
wfmain.h
|
@ -290,6 +290,8 @@ private slots:
|
|||
|
||||
void on_udpServerSetupBtn_clicked();
|
||||
|
||||
void on_transmitBtn_clicked();
|
||||
|
||||
private:
|
||||
Ui::wfmain *ui;
|
||||
QSettings settings;
|
||||
|
@ -380,7 +382,7 @@ private:
|
|||
double knobFreqMhz;
|
||||
enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdGetMode, cmdGetDataMode, cmdSetDataModeOn, cmdSetDataModeOff,
|
||||
cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain,
|
||||
cmdGetSql, cmdGetATUStatus, cmdScopeCenterMode, cmdScopeFixedMode};
|
||||
cmdGetSql, cmdGetATUStatus, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT};
|
||||
cmds cmdOut;
|
||||
QVector <cmds> cmdOutQue;
|
||||
freqMemory mem;
|
||||
|
@ -441,10 +443,14 @@ private:
|
|||
void useColors(); // set the plot up
|
||||
void setDefPrefs(); // populate default values to default prefs
|
||||
|
||||
void changeTxBtn();
|
||||
void issueDelayedCommand(cmds cmd);
|
||||
|
||||
int oldFreqDialVal;
|
||||
|
||||
rigCapabilities rigCaps;
|
||||
bool haveRigCaps;
|
||||
bool amTransmitting;
|
||||
|
||||
calibrationWindow *cal;
|
||||
satelliteSetup *sat;
|
||||
|
|
305
wfmain.ui
305
wfmain.ui
|
@ -18,7 +18,7 @@
|
|||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mainTab">
|
||||
<attribute name="title">
|
||||
|
@ -120,80 +120,83 @@
|
|||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="freqLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>145</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>20</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0000.000000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>20</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MHz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<property name="rightMargin">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="modeSelectCombo"/>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_20">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="freqLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>145</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>20</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0000.000000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>20</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MHz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="dataModeBtn">
|
||||
<property name="text">
|
||||
<string>Data</string>
|
||||
<widget class="QProgressBar" name="levelIndicator">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -253,6 +256,29 @@
|
|||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="modeSelectCombo"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="dataModeBtn">
|
||||
<property name="text">
|
||||
<string>Data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
|
@ -400,6 +426,143 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSlider" name="verticalSlider">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>15</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TX</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSlider" name="verticalSlider_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>15</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mic</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSlider" name="verticalSlider_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>15</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ref</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_19">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="transmitBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Transmit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
|
@ -1619,7 +1782,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>810</width>
|
||||
<height>21</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
Ładowanie…
Reference in New Issue