mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 04:11:16 -05:00
Red/Orange indicator between "Band" spinner and Dial Frequency readout
is now a button. It is enabled only when Orange, which means CAT control is essentially Program to Radio only. Clicking the button causes a one-time read of the radio's dial frequency. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3256 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
3c7ce2f4e1
commit
754aab7db4
@ -180,6 +180,7 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) :
|
||||
m_secBandChanged=0;
|
||||
m_bMultipleOK=false;
|
||||
m_dontReadFreq=false;
|
||||
ui->readFreq->setEnabled(false);
|
||||
decodeBusy(false);
|
||||
|
||||
ui->xThermo->setFillBrush(Qt::green);
|
||||
@ -642,7 +643,8 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
|
||||
|
||||
if(m_bRigOpen) {
|
||||
rig->close();
|
||||
ui->labRigOpen->setStyleSheet("");
|
||||
ui->readFreq->setStyleSheet("");
|
||||
ui->readFreq->setEnabled(false);
|
||||
delete rig;
|
||||
m_bRigOpen=false;
|
||||
m_catEnabled=false;
|
||||
@ -1720,7 +1722,6 @@ void MainWindow::guiUpdate()
|
||||
msgBox(rt);
|
||||
m_catEnabled=false;
|
||||
}
|
||||
|
||||
int ndiff=1000000.0*(fMHz-m_dialFreq);
|
||||
if(ndiff!=0) dialFreqChanged2(fMHz);
|
||||
}
|
||||
@ -2783,16 +2784,18 @@ void MainWindow::rigOpen()
|
||||
ret=rig->open();
|
||||
if(ret==RIG_OK) {
|
||||
m_bRigOpen=true;
|
||||
if(m_poll==0) ui->readFreq->setEnabled(true);
|
||||
} else {
|
||||
t="Open rig failed";
|
||||
msgBox(t);
|
||||
}
|
||||
|
||||
if(m_poll>0) {
|
||||
ui->labRigOpen->setStyleSheet("QLabel{background-color: red}");
|
||||
ui->readFreq->setStyleSheet("QPushButton{background-color: #00ff00}");
|
||||
ui->readFreq->setStyleSheet("QPushButton{background-color: red; \
|
||||
border-width: 0px; border-radius: 5px;}");
|
||||
} else {
|
||||
ui->labRigOpen->setStyleSheet("QLabel{background-color: orange}");
|
||||
ui->readFreq->setStyleSheet("QPushButton{background-color: orange; \
|
||||
border-width: 0px; border-radius: 5px;}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2812,3 +2815,22 @@ void MainWindow::on_pbT2R_clicked()
|
||||
g_pWideGraph->setQSOfreq(m_txFreq);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_readFreq_clicked()
|
||||
{
|
||||
if(m_dontReadFreq) {
|
||||
m_dontReadFreq=false;
|
||||
} else {
|
||||
double fMHz=rig->getFreq(RIG_VFO_CURR)/1000000.0;
|
||||
if(fMHz<0.0) {
|
||||
QString rt;
|
||||
rt.sprintf("Rig control error %d\nFailed to read frequency.",
|
||||
int(1000000.0*fMHz));
|
||||
msgBox(rt);
|
||||
m_catEnabled=false;
|
||||
}
|
||||
int ndiff=1000000.0*(fMHz-m_dialFreq);
|
||||
if(ndiff!=0) dialFreqChanged2(fMHz);
|
||||
qDebug() << "A" << fMHz << ndiff;
|
||||
}
|
||||
}
|
||||
|
@ -155,6 +155,8 @@ private slots:
|
||||
void acceptQSO2(bool accepted);
|
||||
void on_bandComboBox_activated(int index);
|
||||
|
||||
void on_readFreq_clicked();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
|
@ -2020,31 +2020,6 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="labRigOpen">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>20</horstretch>
|
||||
<verstretch>20</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
@ -2209,7 +2184,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="readFreq">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
|
Loading…
Reference in New Issue
Block a user