SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Slots | Private Attributes | List of all members
IntervalRangeGUI Class Reference

#include <intervalrangegui.h>

+ Inheritance diagram for IntervalRangeGUI:
+ Collaboration diagram for IntervalRangeGUI:

Public Member Functions

 IntervalRangeGUI (QWidget *parent=0)
 
virtual ~IntervalRangeGUI ()
 
void setLabel (const QString &text)
 
void setUnits (const QString &units)
 
void addInterval (double minimum, double maximum)
 
void reset ()
 
virtual double getCurrentValue ()
 
virtual void setValue (double value)
 
- Public Member Functions inherited from ItemSettingGUI
 ItemSettingGUI (QWidget *parent=0)
 
virtual ~ItemSettingGUI ()
 

Private Slots

void on_value_changed (qint64 value)
 
void on_rangeInterval_currentIndexChanged (int index)
 

Private Attributes

Ui::IntervalRangeGUI * ui
 
std::vector< double > m_minima
 
std::vector< double > m_maxima
 
int m_nbDigits
 

Additional Inherited Members

- Signals inherited from ItemSettingGUI
void valueChanged (double value)
 

Detailed Description

Definition at line 32 of file intervalrangegui.h.

Constructor & Destructor Documentation

◆ IntervalRangeGUI()

IntervalRangeGUI::IntervalRangeGUI ( QWidget *  parent = 0)
explicit

Definition at line 23 of file intervalrangegui.cpp.

References ColorMapper::GrayGreenYellow, and ui.

23  :
24  ItemSettingGUI(parent),
25  ui(new Ui::IntervalRangeGUI),
26  m_nbDigits(7)
27 {
28  ui->setupUi(this);
29  ui->value->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
30 }
Ui::IntervalRangeGUI * ui
ItemSettingGUI(QWidget *parent=0)

◆ ~IntervalRangeGUI()

IntervalRangeGUI::~IntervalRangeGUI ( )
virtual

Definition at line 32 of file intervalrangegui.cpp.

References ui.

33 {
34  delete ui;
35 }
Ui::IntervalRangeGUI * ui

Member Function Documentation

◆ addInterval()

void IntervalRangeGUI::addInterval ( double  minimum,
double  maximum 
)

Definition at line 47 of file intervalrangegui.cpp.

References arg(), m_maxima, m_minima, and ui.

Referenced by SoapySDRInputGui::createRangesControl(), and SoapySDROutputGui::createRangesControl().

48 {
49  ui->rangeInterval->blockSignals(true);
50  ui->rangeInterval->addItem(QString("%1").arg(m_minima.size()));
51  ui->rangeInterval->blockSignals(false);
52  m_minima.push_back(minimum);
53  m_maxima.push_back(maximum);
54 }
std::vector< double > m_maxima
std::vector< double > m_minima
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::IntervalRangeGUI * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentValue()

double IntervalRangeGUI::getCurrentValue ( )
virtual

Implements ItemSettingGUI.

Definition at line 82 of file intervalrangegui.cpp.

References ui.

83 {
84  return ui->value->getValueNew();
85 }
Ui::IntervalRangeGUI * ui

◆ on_rangeInterval_currentIndexChanged

void IntervalRangeGUI::on_rangeInterval_currentIndexChanged ( int  index)
privateslot

Definition at line 97 of file intervalrangegui.cpp.

References m_maxima, m_minima, m_nbDigits, ui, and ItemSettingGUI::valueChanged().

98 {
99  ui->value->setValueRange(m_minima[index] >= 0, m_nbDigits, m_minima[index], m_maxima[index]);
100  emit ItemSettingGUI::valueChanged(ui->value->getValueNew());
101 }
std::vector< double > m_maxima
void valueChanged(double value)
std::vector< double > m_minima
Ui::IntervalRangeGUI * ui

◆ on_value_changed

void IntervalRangeGUI::on_value_changed ( qint64  value)
privateslot

Definition at line 92 of file intervalrangegui.cpp.

References ItemSettingGUI::valueChanged().

93 {
94  emit ItemSettingGUI::valueChanged(value);
95 }
void valueChanged(double value)

◆ reset()

void IntervalRangeGUI::reset ( )

Definition at line 56 of file intervalrangegui.cpp.

References m_maxima, m_minima, m_nbDigits, and ui.

Referenced by SoapySDRInputGui::createRangesControl(), and SoapySDROutputGui::createRangesControl().

57 {
58  if (m_minima.size() > 0)
59  {
60  double maxLog = 0.0;
61 
62  for (const auto &it : m_maxima)
63  {
64  if (log10(it) > maxLog) {
65  maxLog = log10(it);
66  }
67  }
68 
69  m_nbDigits = maxLog;
70  m_nbDigits++;
71  ui->rangeInterval->blockSignals(true);
72  ui->rangeInterval->setCurrentIndex(0);
73  ui->rangeInterval->blockSignals(false);
74  ui->value->setValueRange(m_minima[0] >= 0, m_nbDigits, m_minima[0], m_maxima[0]);
75  }
76 
77  if (m_minima.size() == 1) {
78  ui->rangeInterval->setDisabled(true);
79  }
80 }
std::vector< double > m_maxima
std::vector< double > m_minima
Ui::IntervalRangeGUI * ui
+ Here is the caller graph for this function:

◆ setLabel()

void IntervalRangeGUI::setLabel ( const QString &  text)

Definition at line 37 of file intervalrangegui.cpp.

References ui.

Referenced by SoapySDRInputGui::createRangesControl(), and SoapySDROutputGui::createRangesControl().

38 {
39  ui->rangeLabel->setText(text);
40 }
Ui::IntervalRangeGUI * ui
+ Here is the caller graph for this function:

◆ setUnits()

void IntervalRangeGUI::setUnits ( const QString &  units)

Definition at line 42 of file intervalrangegui.cpp.

References ui.

Referenced by SoapySDRInputGui::createRangesControl(), and SoapySDROutputGui::createRangesControl().

43 {
44  ui->rangeUnits->setText(units);
45 }
Ui::IntervalRangeGUI * ui
+ Here is the caller graph for this function:

◆ setValue()

void IntervalRangeGUI::setValue ( double  value)
virtual

Implements ItemSettingGUI.

Definition at line 87 of file intervalrangegui.cpp.

References ui.

88 {
89  ui->value->setValue(value);
90 }
Ui::IntervalRangeGUI * ui

Member Data Documentation

◆ m_maxima

std::vector<double> IntervalRangeGUI::m_maxima
private

Definition at line 53 of file intervalrangegui.h.

Referenced by addInterval(), on_rangeInterval_currentIndexChanged(), and reset().

◆ m_minima

std::vector<double> IntervalRangeGUI::m_minima
private

Definition at line 52 of file intervalrangegui.h.

Referenced by addInterval(), on_rangeInterval_currentIndexChanged(), and reset().

◆ m_nbDigits

int IntervalRangeGUI::m_nbDigits
private

Definition at line 54 of file intervalrangegui.h.

Referenced by on_rangeInterval_currentIndexChanged(), and reset().

◆ ui

Ui::IntervalRangeGUI* IntervalRangeGUI::ui
private

The documentation for this class was generated from the following files: