mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-22 12:08:43 -04:00
More cleanup of Wide Graph GUI.
This commit is contained in:
parent
1dba0e1602
commit
0e416e5d1f
@ -42,14 +42,6 @@ WideGraph::WideGraph (QString const& settings_filename, QWidget * parent)
|
||||
ui->widePlot->setBinsPerPixel(nbpp);
|
||||
m_waterfallAvg = settings.value("WaterfallAvg",10).toInt();
|
||||
ui->waterfallAvgSpinBox->setValue(m_waterfallAvg);
|
||||
ui->freqOffsetSpinBox->setValue(settings.value("FreqOffset",0).toInt());
|
||||
m_bForceCenterFreq=settings.value("ForceCenterFreqBool",false).toBool();
|
||||
m_dForceCenterFreq=settings.value("ForceCenterFreqMHz",144.125).toDouble();
|
||||
ui->cbFcenter->setChecked(m_bForceCenterFreq);
|
||||
ui->cbLockTxRx->setChecked(m_bLockTxRx);
|
||||
ui->fCenterLineEdit->setText(QString::number(m_dForceCenterFreq));
|
||||
m_bLockTxRx=settings.value("LockTxRx",false).toBool();
|
||||
ui->cbLockTxRx->setChecked(m_bLockTxRx);
|
||||
}
|
||||
|
||||
WideGraph::~WideGraph()
|
||||
@ -80,10 +72,6 @@ void WideGraph::saveSettings()
|
||||
settings.setValue("PlotWidth",ui->widePlot->plotWidth());
|
||||
settings.setValue("FreqSpan",ui->freqSpanSpinBox->value());
|
||||
settings.setValue("WaterfallAvg",ui->waterfallAvgSpinBox->value());
|
||||
settings.setValue("FreqOffset",ui->widePlot->freqOffset());
|
||||
settings.setValue("ForceCenterFreqBool",m_bForceCenterFreq);
|
||||
settings.setValue("ForceCenterFreqMHz",m_dForceCenterFreq);
|
||||
settings.setValue("LockTxRx",m_bLockTxRx);
|
||||
}
|
||||
|
||||
void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata,
|
||||
@ -122,7 +110,7 @@ void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata,
|
||||
n=0;
|
||||
|
||||
int w=ui->widePlot->plotWidth();
|
||||
qint64 sf = nkhz + ui->widePlot->freqOffset() - 0.5*w*nbpp*df/1000.0;
|
||||
qint64 sf = nkhz - 0.5*w*nbpp*df/1000.0;
|
||||
if(sf != ui->widePlot->startFreq()) ui->widePlot->SetStartFreq(sf);
|
||||
int i0=16384.0+(ui->widePlot->startFreq()-nkhz+1.27046+0.001*m_fCal) *
|
||||
1000.0/df + 0.5;
|
||||
@ -154,22 +142,6 @@ void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata,
|
||||
}
|
||||
}
|
||||
|
||||
void WideGraph::on_freqOffsetSpinBox_valueChanged(int f)
|
||||
{
|
||||
ui->widePlot->SetFreqOffset(f);
|
||||
}
|
||||
|
||||
void WideGraph::on_freqSpanSpinBox_valueChanged(int n)
|
||||
{
|
||||
ui->widePlot->setNSpan(n);
|
||||
int w = ui->widePlot->plotWidth();
|
||||
int nbpp = n * 32768.0/(w*96.0) + 0.5;
|
||||
if(nbpp < 1) nbpp=1;
|
||||
if(w > 0) {
|
||||
ui->widePlot->setBinsPerPixel(nbpp);
|
||||
}
|
||||
}
|
||||
|
||||
void WideGraph::on_waterfallAvgSpinBox_valueChanged(int n)
|
||||
{
|
||||
m_waterfallAvg = n;
|
||||
@ -282,23 +254,6 @@ void WideGraph::setMode65(int n)
|
||||
ui->widePlot->setMode65(n);
|
||||
}
|
||||
|
||||
void WideGraph::on_cbFcenter_stateChanged(int n)
|
||||
{
|
||||
m_bForceCenterFreq = (n!=0);
|
||||
if(m_bForceCenterFreq) {
|
||||
ui->fCenterLineEdit->setEnabled(true);
|
||||
ui->pbSetRxHardware->setEnabled(true);
|
||||
} else {
|
||||
ui->fCenterLineEdit->setDisabled(true);
|
||||
ui->pbSetRxHardware->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void WideGraph::on_fCenterLineEdit_editingFinished()
|
||||
{
|
||||
m_dForceCenterFreq=ui->fCenterLineEdit->text().toDouble();
|
||||
}
|
||||
|
||||
void WideGraph::on_cbSpec2d_toggled(bool b)
|
||||
{
|
||||
ui->widePlot->set2Dspec(b);
|
||||
@ -314,20 +269,9 @@ void WideGraph::setPeriod(int n)
|
||||
m_TRperiod=n;
|
||||
}
|
||||
|
||||
void WideGraph::on_cbLockTxRx_stateChanged(int n)
|
||||
{
|
||||
m_bLockTxRx = (n!=0);
|
||||
ui->widePlot->setLockTxRx(m_bLockTxRx);
|
||||
}
|
||||
|
||||
void WideGraph::updateFreqLabel()
|
||||
{
|
||||
auto rxFreq = QString {"%1"}.arg (ui->widePlot->rxFreq (), 10, 'f', 6);
|
||||
rxFreq.insert (rxFreq.size () - 3, '.');
|
||||
ui->labFreq->setText (QString {"Rx: %1"}.arg (rxFreq));
|
||||
}
|
||||
|
||||
void WideGraph::enableSetRxHardware(bool b)
|
||||
{
|
||||
ui->pbSetRxHardware->setEnabled(b);
|
||||
ui->labFreq->setText (QString {"Center freq: %1"}.arg (rxFreq));
|
||||
}
|
||||
|
@ -51,15 +51,10 @@ protected:
|
||||
|
||||
private slots:
|
||||
void on_waterfallAvgSpinBox_valueChanged(int arg1);
|
||||
void on_freqSpanSpinBox_valueChanged(int arg1);
|
||||
void on_freqOffsetSpinBox_valueChanged(int arg1);
|
||||
void on_zeroSpinBox_valueChanged(int arg1);
|
||||
void on_gainSpinBox_valueChanged(int arg1);
|
||||
void on_autoZeroPushButton_clicked();
|
||||
void on_cbFcenter_stateChanged(int arg1);
|
||||
void on_fCenterLineEdit_editingFinished();
|
||||
void on_cbSpec2d_toggled(bool checked);
|
||||
void on_cbLockTxRx_stateChanged(int arg1);
|
||||
|
||||
private:
|
||||
Ui::WideGraph * ui;
|
||||
|
@ -40,33 +40,6 @@
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QLabel" name="labFreq">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>940</x>
|
||||
<y>250</y>
|
||||
<width>211</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
color: yellow;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rx: 1296.065.200</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -74,7 +47,7 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@ -86,46 +59,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="freqOffsetSpinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> kHz</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Offset </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-24</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>24</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="freqSpanSpinBox">
|
||||
<property name="sizePolicy">
|
||||
@ -166,6 +99,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="waterfallAvgSpinBox">
|
||||
<property name="sizePolicy">
|
||||
@ -197,6 +146,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="gainSpinBox">
|
||||
<property name="sizePolicy">
|
||||
@ -222,6 +187,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="zeroSpinBox">
|
||||
<property name="sizePolicy">
|
||||
@ -247,6 +228,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="autoZeroPushButton">
|
||||
<property name="text">
|
||||
@ -254,6 +251,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbSpec2d">
|
||||
<property name="text">
|
||||
@ -261,6 +274,29 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labFreq">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Center freq: 1296.065.000</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
@ -274,52 +310,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbLockTxRx">
|
||||
<property name="text">
|
||||
<string>Lock Tx=Rx Freq</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbFcenter">
|
||||
<property name="text">
|
||||
<string>Force Center Freq (MHz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="fCenterLineEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>65</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1296.065</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbSetRxHardware">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set Rx Freq</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user