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.
Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
StringRangeGUI Class Reference

#include <stringrangegui.h>

Inherits QWidget.

Signals

void valueChanged ()
 

Public Member Functions

 StringRangeGUI (QWidget *parent=0)
 
virtual ~StringRangeGUI ()
 
void setLabel (const QString &text)
 
void setUnits (const QString &units)
 
void addItem (const QString &itemStr, const std::string &itemValue)
 
const std::string & getCurrentValue ()
 
void setValue (const std::string &value)
 

Private Slots

void on_rangeCombo_currentIndexChanged (int index)
 

Private Attributes

Ui::DiscreteRangeGUI * ui
 
std::vector< std::string > itemValues
 

Detailed Description

Definition at line 29 of file stringrangegui.h.

Constructor & Destructor Documentation

◆ StringRangeGUI()

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

Definition at line 22 of file stringrangegui.cpp.

References ui.

22  :
23  QWidget(parent),
24  ui(new Ui::DiscreteRangeGUI)
25 {
26  ui->setupUi(this);
27 }
Ui::DiscreteRangeGUI * ui

◆ ~StringRangeGUI()

StringRangeGUI::~StringRangeGUI ( )
virtual

Definition at line 29 of file stringrangegui.cpp.

References ui.

30 {
31  delete ui;
32 }
Ui::DiscreteRangeGUI * ui

Member Function Documentation

◆ addItem()

void StringRangeGUI::addItem ( const QString &  itemStr,
const std::string &  itemValue 
)

Definition at line 44 of file stringrangegui.cpp.

References itemValues, and ui.

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

45 {
46  ui->rangeCombo->blockSignals(true);
47  ui->rangeCombo->addItem(itemStr);
48  itemValues.push_back(itemValue);
49  ui->rangeCombo->blockSignals(false);
50 }
std::vector< std::string > itemValues
Ui::DiscreteRangeGUI * ui
+ Here is the caller graph for this function:

◆ getCurrentValue()

const std::string & StringRangeGUI::getCurrentValue ( )

Definition at line 52 of file stringrangegui.cpp.

References itemValues, and ui.

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

53 {
54  return itemValues[ui->rangeCombo->currentIndex()];
55 }
std::vector< std::string > itemValues
Ui::DiscreteRangeGUI * ui
+ Here is the caller graph for this function:

◆ on_rangeCombo_currentIndexChanged

void StringRangeGUI::on_rangeCombo_currentIndexChanged ( int  index)
privateslot

Definition at line 75 of file stringrangegui.cpp.

References valueChanged().

76 {
77  (void) index;
78  emit valueChanged();
79 }
void valueChanged()

◆ setLabel()

void StringRangeGUI::setLabel ( const QString &  text)

Definition at line 34 of file stringrangegui.cpp.

References ui.

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

35 {
36  ui->rangeLabel->setText(text);
37 }
Ui::DiscreteRangeGUI * ui
+ Here is the caller graph for this function:

◆ setUnits()

void StringRangeGUI::setUnits ( const QString &  units)

Definition at line 39 of file stringrangegui.cpp.

References ui.

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

40 {
41  ui->rangeUnits->setText(units);
42 }
Ui::DiscreteRangeGUI * ui
+ Here is the caller graph for this function:

◆ setValue()

void StringRangeGUI::setValue ( const std::string &  value)

Definition at line 57 of file stringrangegui.cpp.

References itemValues, and ui.

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

58 {
59  int index = 0;
60 
61  for (const auto &it : itemValues)
62  {
63  if (it == value)
64  {
65  ui->rangeCombo->blockSignals(true);
66  ui->rangeCombo->setCurrentIndex(index);
67  ui->rangeCombo->blockSignals(false);
68  break;
69  }
70 
71  index++;
72  }
73 }
std::vector< std::string > itemValues
Ui::DiscreteRangeGUI * ui
+ Here is the caller graph for this function:

◆ valueChanged

void StringRangeGUI::valueChanged ( )
signal

Referenced by on_rangeCombo_currentIndexChanged().

+ Here is the caller graph for this function:

Member Data Documentation

◆ itemValues

std::vector<std::string> StringRangeGUI::itemValues
private

Definition at line 50 of file stringrangegui.h.

Referenced by addItem(), getCurrentValue(), and setValue().

◆ ui

Ui::DiscreteRangeGUI* StringRangeGUI::ui
private

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