Skip to content

Commit 92a1333

Browse files
committed
ADC: added info icons
Signed-off-by: Andrei Popa <[email protected]>
1 parent a546249 commit 92a1333

File tree

12 files changed

+42
-5
lines changed

12 files changed

+42
-5
lines changed

gui/include/gui/widgets/menucombo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class SCOPY_GUI_EXPORT MenuCombo : public QWidget
4444
virtual ~MenuCombo();
4545

4646
QComboBox *combo();
47+
QLabel *label() const;
4748

4849
QString title() const;
4950
void setTitle(const QString &newTitle);

gui/include/gui/widgets/menuonoffswitch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class SCOPY_GUI_EXPORT MenuOnOffSwitch : public QWidget
4141
virtual ~MenuOnOffSwitch();
4242

4343
QAbstractButton *onOffswitch();
44+
QLabel *label() const;
4445

4546
private:
4647
QLabel *m_label;

gui/include/gui/widgets/menuspinbox.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class SCOPY_GUI_EXPORT MenuSpinbox : public QWidget
157157
QString unit() const;
158158
IncrementStrategy *incrementStrategy() const;
159159
QString name() const;
160+
QLabel *label() const;
160161

161162
void setScaleRange(double min, double max);
162163

gui/src/widgets/menucollapsesection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ MenuCollapseSection::MenuCollapseSection(QString title, MenuCollapseSection::Men
113113
m_contLayout = new QVBoxLayout(container);
114114
container->setLayout(m_contLayout);
115115
m_contLayout->setMargin(0);
116-
m_contLayout->setSpacing(0);
116+
m_contLayout->setSpacing(5);
117117

118118
connect(m_header, &QAbstractButton::toggled, container, &QWidget::setVisible);
119119
}

gui/src/widgets/menucombo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ MenuCombo::MenuCombo(QString title, QWidget *parent)
8585
MenuCombo::~MenuCombo() {}
8686
QComboBox *MenuCombo::combo() { return m_combo; }
8787

88+
QLabel *MenuCombo::label() const { return m_label; }
89+
8890
QString MenuCombo::title() const { return m_label->text(); }
8991

9092
void MenuCombo::setTitle(const QString &newTitle) { m_label->setText(newTitle); }

gui/src/widgets/menuonoffswitch.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ MenuOnOffSwitch::~MenuOnOffSwitch() {}
5454

5555
QAbstractButton *MenuOnOffSwitch::onOffswitch() { return m_switch; }
5656

57+
QLabel *MenuOnOffSwitch::label() const { return m_label; }
58+
5759
#include "moc_menuonoffswitch.cpp"

gui/src/widgets/menuspinbox.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ double MenuSpinbox::clamp(double val, double min, double max)
377377

378378
QString MenuSpinbox::name() const { return m_name; }
379379

380+
QLabel *MenuSpinbox::label() const { return m_label; }
381+
380382
void MenuSpinbox::setName(const QString &newName)
381383
{
382384
if(m_name == newName)

plugins/adc/src/freq/fftplotcomponentsettings.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ FFTPlotComponentSettings::FFTPlotComponentSettings(FFTPlotComponent *plt, QWidge
9797
m_plotComponent->fftPlot()->yAxis()->getFormatter()->setTwoDecimalMode(false);
9898

9999
m_yPwrOffset = new MenuSpinbox("Power Offset", 0, "dB", -300, 300, true, false, yaxis);
100+
InfoIconWidget::addHoveringInfoToWidget(m_yPwrOffset->label(),
101+
"Offsets all channels' Y axis by set a amout units", m_yPwrOffset);
100102
m_yPwrOffset->setScaleRange(1, 1);
101103
m_yPwrOffset->setIncrementMode(MenuSpinbox::IS_FIXED);
102104

103105
m_windowCb = new MenuCombo("Window", yaxis);
106+
InfoIconWidget::addHoveringInfoToWidget(m_windowCb->label(), "Set applied FFT window function", m_windowCb);
104107

105108
m_windowCb->combo()->addItem("Hann", gr::fft::window::WIN_HANN);
106109
m_windowCb->combo()->addItem("Hanning", gr::fft::window::WIN_HANNING);

plugins/adc/src/freq/fftplotmanagersettings.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ QWidget *FFTPlotManagerSettings::createXAxisMenu(QWidget *parent)
107107
MenuSectionCollapseWidget *section = new MenuSectionCollapseWidget("X-AXIS", MenuCollapseSection::MHCW_NONE,
108108
MenuCollapseSection::MHW_BASEWIDGET, parent);
109109

110-
m_bufferSizeSpin = new MenuSpinbox("Buffer Size", 16, "samples", 0, 4000000, true, false, section);
110+
m_bufferSizeSpin = new MenuSpinbox("FFT Size", 16, "samples", 0, 4000000, true, false, section);
111111
m_bufferSizeSpin->setScaleRange(1, 1e6);
112112
connect(m_bufferSizeSpin, &MenuSpinbox::valueChanged, this, [=](double val) { setBufferSize((uint32_t)val); });
113113

@@ -131,7 +131,9 @@ QWidget *FFTPlotManagerSettings::createXAxisMenu(QWidget *parent)
131131
xMinMaxLayout->addWidget(m_xmin);
132132
xMinMaxLayout->addWidget(m_xmax);
133133

134-
m_xModeCb = new MenuCombo("XMode", section);
134+
m_xModeCb = new MenuCombo("XMODE", section);
135+
InfoIconWidget::addHoveringInfoToWidget(m_xModeCb->label(),
136+
"Set X axis scaling mode\nThis does not affect the data", m_xModeCb);
135137
auto xcb = m_xModeCb->combo();
136138

137139
xcb->addItem("Samples", XMODE_SAMPLES);
@@ -197,12 +199,17 @@ QWidget *FFTPlotManagerSettings::createXAxisMenu(QWidget *parent)
197199
m_sampleRateSpin = new MenuSpinbox("Sample Rate", 1, "Hz", 1, DBL_MAX, true, false, section);
198200
m_sampleRateSpin->setIncrementMode(MenuSpinbox::IS_125);
199201
InfoIconWidget::addHoveringInfoToWidget(
202+
m_sampleRateSpin->label(),
203+
"Controls how the X-axis is scaled when in Time XMode\nThis only affects the x scale, not the data",
204+
section);
200205

201206
m_sampleRateSpin->setValue(10);
202207
m_sampleRateSpin->setEnabled(false);
203208
connect(m_sampleRateSpin, &MenuSpinbox::valueChanged, this, [=](double val) { setSampleRate(val); });
204209

205210
m_freqOffsetSpin = new MenuSpinbox("Frequency Offset", 1, "Hz", 0, DBL_MAX, true, false, section);
211+
InfoIconWidget::addHoveringInfoToWidget(m_freqOffsetSpin->label(),
212+
"Offsets all channels' X axis by set amout of Hz", m_freqOffsetSpin);
206213
m_freqOffsetSpin->setIncrementMode(MenuSpinbox::IS_125);
207214

208215
m_freqOffsetSpin->setValue(0);

plugins/adc/src/time/grtimechannelcomponent.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ QWidget *GRTimeChannelComponent::createYAxisMenu(QWidget *parent)
8686

8787
// Y-MODE
8888
m_ymodeCb = new MenuCombo("YMODE", m_yaxisMenu);
89+
InfoIconWidget::addHoveringInfoToWidget(m_ymodeCb->label(),
90+
"Set Y axis scaling mode\nThis does not affect the data", m_ymodeCb);
8991
auto cb = m_ymodeCb->combo();
9092
cb->addItem("ADC Counts", YMODE_COUNT);
9193
cb->addItem("% Full Scale", YMODE_FS);

0 commit comments

Comments
 (0)