Refspec is conditional

This commit is contained in:
Jordan Sherer 2019-11-06 14:16:46 -05:00
parent 9858403a95
commit 6472314329
3 changed files with 11 additions and 8 deletions

View File

@ -82,8 +82,10 @@ public:
void setTol(int n);
void setRxBand(QString band);
void setTurbo(bool turbo);
#if JS8_USE_REFSPEC
void setReference(bool b) {m_bReference = b;}
bool Reference() const {return m_bReference;}
#endif
void drawRed(int ia, int ib, float swide[]);
void setVHF(bool bVHF);
void setRedFile(QString fRed);

View File

@ -79,11 +79,13 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
ui->widePlot->setCurrent(m_settings->value("Current",false).toBool());
ui->widePlot->setCumulative(m_settings->value("Cumulative",true).toBool());
ui->widePlot->setLinearAvg(m_settings->value("LinearAvg",false).toBool());
ui->widePlot->setReference(m_settings->value("Reference",false).toBool());
if(ui->widePlot->current()) ui->spec2dComboBox->setCurrentIndex(0);
if(ui->widePlot->cumulative()) ui->spec2dComboBox->setCurrentIndex(1);
if(ui->widePlot->linearAvg()) ui->spec2dComboBox->setCurrentIndex(2);
#if JS8_USE_REFSPEC
ui->widePlot->setReference(m_settings->value("Reference",false).toBool());
if(ui->widePlot->Reference()) ui->spec2dComboBox->setCurrentIndex(3);
#endif
int nbpp=m_settings->value("BinsPerPixel", 2).toInt();
ui->widePlot->setBinsPerPixel(nbpp);
ui->sbPercent2dPlot->setValue(m_Percent2DScreen);
@ -141,7 +143,9 @@ void WideGraph::saveSettings() //saveS
m_settings->setValue ("Current", ui->widePlot->current());
m_settings->setValue ("Cumulative", ui->widePlot->cumulative());
m_settings->setValue ("LinearAvg", ui->widePlot->linearAvg());
#if JS8_USE_REFSPEC
m_settings->setValue ("Reference", ui->widePlot->Reference());
#endif
m_settings->setValue ("BinsPerPixel", ui->widePlot->binsPerPixel ());
m_settings->setValue ("StartFreq", ui->widePlot->startFreq ());
m_settings->setValue ("WaterfallPalette", m_waterfallPalette);
@ -354,7 +358,6 @@ void WideGraph::on_spec2dComboBox_currentIndexChanged(const QString &arg1)
ui->widePlot->setCurrent(false);
ui->widePlot->setCumulative(false);
ui->widePlot->setLinearAvg(false);
ui->widePlot->setReference(false);
ui->smoSpinBox->setEnabled(false);
if(arg1=="Current") ui->widePlot->setCurrent(true);
if(arg1=="Cumulative") ui->widePlot->setCumulative(true);
@ -362,9 +365,12 @@ void WideGraph::on_spec2dComboBox_currentIndexChanged(const QString &arg1)
ui->widePlot->setLinearAvg(true);
ui->smoSpinBox->setEnabled(true);
}
#if JS8_USE_REFSPEC
ui->widePlot->setReference(false);
if(arg1=="Reference") {
ui->widePlot->setReference(true);
}
#endif
replot();
}

View File

@ -188,11 +188,6 @@
<string>Linear Avg</string>
</property>
</item>
<item>
<property name="text">
<string>Reference</string>
</property>
</item>
</widget>
</item>
<item row="0" column="8">
@ -210,7 +205,7 @@
<item>
<widget class="QCheckBox" name="cbRef">
<property name="visible">
<bool>false</bool>
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Compute and save a reference spectrum. (Not yet fully implemented.)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>