mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-05 02:58:37 -04:00
DOA2: set scope timescale display as frequency in FFT (correlation) mode for X and XY displays
This commit is contained in:
parent
b48db22e84
commit
67d4e3d105
@ -333,6 +333,7 @@ void DOA2GUI::onMenuDialogCalled(const QPoint &p)
|
||||
void DOA2GUI::on_decimationFactor_currentIndexChanged(int index)
|
||||
{
|
||||
m_settings.m_log2Decim = index;
|
||||
updateScopeFScale();
|
||||
applyDecimation();
|
||||
}
|
||||
|
||||
@ -352,6 +353,7 @@ void DOA2GUI::on_phaseCorrection_valueChanged(int value)
|
||||
void DOA2GUI::on_correlationType_currentIndexChanged(int index)
|
||||
{
|
||||
m_settings.m_correlationType = (DOA2Settings::CorrelationType) index;
|
||||
updateScopeFScale();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -438,6 +440,19 @@ void DOA2GUI::updateAbsoluteCenterFrequency()
|
||||
setStatusFrequency(cf);
|
||||
m_hwl = 1.5e+8 / cf;
|
||||
ui->halfWLText->setText(tr("%1").arg(m_hwl*1000, 5, 'f', 0));
|
||||
updateScopeFScale();
|
||||
}
|
||||
|
||||
void DOA2GUI::updateScopeFScale()
|
||||
{
|
||||
if (m_settings.m_correlationType == DOA2Settings::CorrelationType::CorrelationFFT) {
|
||||
ui->glScope->setXScaleFreq(true);
|
||||
} else {
|
||||
ui->glScope->setXScaleFreq(false);
|
||||
}
|
||||
|
||||
ui->glScope->setXScaleCenterFrequency(m_centerFrequency);
|
||||
ui->glScope->setXScaleFrequencySpan(m_sampleRate / (1<<m_settings.m_log2Decim));
|
||||
}
|
||||
|
||||
void DOA2GUI::updateDOA()
|
||||
|
@ -90,6 +90,7 @@ private:
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void updateAbsoluteCenterFrequency();
|
||||
void updateScopeFScale();
|
||||
void updateDOA();
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
|
@ -884,6 +884,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -75,6 +75,9 @@ GLScope::GLScope(QWidget *parent) :
|
||||
m_x1Scale.setOrientation(Qt::Horizontal);
|
||||
m_x2Scale.setFont(font());
|
||||
m_x2Scale.setOrientation(Qt::Horizontal);
|
||||
m_xScaleFreq = false;
|
||||
m_xScaleCenterFrequency = 0;
|
||||
m_xScaleFrequencySpan = 48000;
|
||||
|
||||
m_channelOverlayFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
||||
m_channelOverlayFont.setBold(true);
|
||||
@ -1077,12 +1080,23 @@ void GLScope::applyConfig()
|
||||
|
||||
// scales
|
||||
|
||||
m_x1Scale.setRange(Unit::Time, t_start, t_start + t_len); // time scale
|
||||
|
||||
if (m_displayMode == DisplayPol) {
|
||||
setYScale(m_x2Scale, 0); // polar scale (X)
|
||||
if (m_xScaleFreq) {
|
||||
m_x1Scale.setRange(Unit::Frequency, m_xScaleCenterFrequency - (m_xScaleFrequencySpan/2), m_xScaleCenterFrequency + (m_xScaleFrequencySpan/2));
|
||||
} else {
|
||||
m_x2Scale.setRange(Unit::Time, t_start, t_start + t_len); // time scale
|
||||
m_x1Scale.setRange(Unit::Time, t_start, t_start + t_len); // time scale
|
||||
}
|
||||
|
||||
if (m_displayMode == DisplayPol)
|
||||
{
|
||||
setYScale(m_x2Scale, 0); // polar scale (X)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_xScaleFreq) {
|
||||
m_x2Scale.setRange(Unit::Time, t_start, t_start + t_len); // time scale
|
||||
} else {
|
||||
m_x2Scale.setRange(Unit::Frequency, m_xScaleCenterFrequency - (m_xScaleFrequencySpan/2), m_xScaleCenterFrequency + (m_xScaleFrequencySpan/2));
|
||||
}
|
||||
}
|
||||
|
||||
if (m_traces->size() > 0) {
|
||||
|
@ -86,6 +86,11 @@ public:
|
||||
virtual const QAtomicInt& getProcessingTraceIndex() const { return m_processingTraceIndex; }
|
||||
void setTraceModulo(int modulo) { m_traceModulo = modulo; }
|
||||
|
||||
void setXScaleFreq(bool set) { m_xScaleFreq = set; m_configChanged = true; }
|
||||
bool isXScaleFreq() const { return m_xScaleFreq; }
|
||||
void setXScaleCenterFrequency(qint64 cf) { m_xScaleCenterFrequency = cf; m_configChanged = true; }
|
||||
void setXScaleFrequencySpan(int span) { m_xScaleFrequencySpan = span; m_configChanged = true; }
|
||||
|
||||
signals:
|
||||
void sampleRateChanged(int);
|
||||
void traceSizeChanged(uint32_t);
|
||||
@ -187,6 +192,9 @@ private:
|
||||
ScaleEngine m_x2Scale; //!< Display #2 X scale. Time scale
|
||||
ScaleEngine m_y1Scale; //!< Display #1 Y scale. Always connected to trace #0 (X trace)
|
||||
ScaleEngine m_y2Scale; //!< Display #2 Y scale. Connected to highlighted Y trace (#1..n)
|
||||
bool m_xScaleFreq; //!< Force frequency display on time line for correlation modes
|
||||
qint64 m_xScaleCenterFrequency; //!< Frequency time line mode center frequency
|
||||
int m_xScaleFrequencySpan; //!< Frequency time line mode frequency span
|
||||
|
||||
QFont m_channelOverlayFont;
|
||||
QFont m_textOverlayFont;
|
||||
|
Loading…
Reference in New Issue
Block a user