@@ -145,7 +145,7 @@ QWidget *FFTPlotManagerSettings::createXAxisMenu(QWidget *parent)
145145 connect (xcb, qOverload<int >(&QComboBox::currentIndexChanged), this , [=](int idx) {
146146 for (PlotComponent *plt : m_plotManager->plots ()) {
147147 auto p = dynamic_cast <FFTPlotComponent *>(plt);
148- updateXMode (idx, p->fftPlot ()->xAxis ());
148+ updateXMode (idx, p->fftPlot ()->xAxis (), p-> waterfallPlot ()-> xAxis () );
149149 }
150150 });
151151
@@ -186,7 +186,7 @@ QWidget *FFTPlotManagerSettings::createXAxisMenu(QWidget *parent)
186186 return section;
187187}
188188
189- void FFTPlotManagerSettings::updateXMode (int mode, PlotAxis *axis )
189+ void FFTPlotManagerSettings::updateXMode (int mode, PlotAxis *fftAxis, PlotAxis *waterfallAxis )
190190{
191191 QComboBox *xcb = m_xModeCb->combo ();
192192 m_sampleRateSpin->setVisible (false );
@@ -198,10 +198,11 @@ void FFTPlotManagerSettings::updateXMode(int mode, PlotAxis *axis)
198198 m_plotManager->setXUnit (" samples" );
199199 m_sampleRateSpin->setValue (m_samplingInfo.bufferSize );
200200
201- axis->scaleDraw ()->setUnitType (" " );
202- axis->scaleDraw ()->setFloatPrecision (3 );
203- axis->scaleDraw ()->setUnitsEnabled (false );
204- axis->getFormatter ()->setTwoDecimalMode (false );
201+ fftAxis->scaleDraw ()->setUnitType (" " );
202+ fftAxis->scaleDraw ()->setFloatPrecision (3 );
203+ fftAxis->scaleDraw ()->setUnitsEnabled (false );
204+ fftAxis->getFormatter ()->setTwoDecimalMode (false );
205+ waterfallAxis->setUnits (" samples" );
205206 }
206207
207208 if (xcb->itemData (mode) == XMODE_TIME) {
@@ -214,10 +215,11 @@ void FFTPlotManagerSettings::updateXMode(int mode, PlotAxis *axis)
214215 m_freqOffsetSpin->setVisible (true );
215216 m_freqOffsetSpin->setEnabled (true );
216217
217- axis->scaleDraw ()->setUnitType (" Hz" );
218- axis->scaleDraw ()->setUnitsEnabled (true );
219- axis->scaleDraw ()->setFloatPrecision (3 );
220- axis->getFormatter ()->setTwoDecimalMode (false );
218+ fftAxis->scaleDraw ()->setUnitType (" Hz" );
219+ fftAxis->scaleDraw ()->setUnitsEnabled (true );
220+ fftAxis->scaleDraw ()->setFloatPrecision (3 );
221+ fftAxis->getFormatter ()->setTwoDecimalMode (false );
222+ waterfallAxis->setUnits (" Hz" );
221223 }
222224 if (xcb->itemData (mode) == XMODE_OVERRIDE) {
223225 m_xmin->setUnit (" Hz" );
@@ -229,10 +231,11 @@ void FFTPlotManagerSettings::updateXMode(int mode, PlotAxis *axis)
229231 m_freqOffsetSpin->setVisible (true );
230232 m_freqOffsetSpin->setEnabled (true );
231233
232- axis->scaleDraw ()->setUnitType (" Hz" );
233- axis->scaleDraw ()->setUnitsEnabled (true );
234- axis->scaleDraw ()->setFloatPrecision (3 );
235- axis->getFormatter ()->setTwoDecimalMode (false );
234+ fftAxis->scaleDraw ()->setUnitType (" Hz" );
235+ fftAxis->scaleDraw ()->setUnitsEnabled (true );
236+ fftAxis->scaleDraw ()->setFloatPrecision (3 );
237+ fftAxis->getFormatter ()->setTwoDecimalMode (false );
238+ waterfallAxis->setUnits (" Hz" );
236239 }
237240 updateXAxis ();
238241 m_plotManager->updateAxisScales ();
@@ -326,7 +329,7 @@ void FFTPlotManagerSettings::addPlot(FFTPlotComponent *p)
326329 // Set initial complex mode state
327330 p->plotMenu ()->setComplexMode (m_samplingInfo.complexMode );
328331
329- updateXMode (m_xModeCb->combo ()->currentIndex (), p->fftPlot ()->xAxis ());
332+ updateXMode (m_xModeCb->combo ()->currentIndex (), p->fftPlot ()->xAxis (), p-> waterfallPlot ()-> xAxis () );
330333}
331334
332335void FFTPlotManagerSettings::setPlotComboVisible ()
0 commit comments