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 Member Functions | Private Attributes | List of all members
BasicChannelSettingsDialog Class Reference

#include <basicchannelsettingsdialog.h>

Inherits QDialog.

+ Collaboration diagram for BasicChannelSettingsDialog:

Public Member Functions

 BasicChannelSettingsDialog (ChannelMarker *marker, QWidget *parent=0)
 
 ~BasicChannelSettingsDialog ()
 
bool hasChanged () const
 
bool useReverseAPI () const
 
const QString & getReverseAPIAddress () const
 
uint16_t getReverseAPIPort () const
 
uint16_t getReverseAPIDeviceIndex () const
 
uint16_t getReverseAPIChannelIndex () const
 
void setUseReverseAPI (bool useReverseAPI)
 
void setReverseAPIAddress (const QString &address)
 
void setReverseAPIPort (uint16_t port)
 
void setReverseAPIDeviceIndex (uint16_t deviceIndex)
 
void setReverseAPIChannelIndex (uint16_t channelIndex)
 

Private Slots

void on_colorBtn_clicked ()
 
void on_reverseAPI_toggled (bool checked)
 
void on_reverseAPIAddress_editingFinished ()
 
void on_reverseAPIPort_editingFinished ()
 
void on_reverseAPIDeviceIndex_editingFinished ()
 
void on_reverseAPIChannelIndex_editingFinished ()
 
void accept ()
 

Private Member Functions

void paintColor ()
 

Private Attributes

Ui::BasicChannelSettingsDialog * ui
 
ChannelMarkerm_channelMarker
 
QColor m_color
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
bool m_hasChanged
 

Detailed Description

Definition at line 14 of file basicchannelsettingsdialog.h.

Constructor & Destructor Documentation

◆ BasicChannelSettingsDialog()

BasicChannelSettingsDialog::BasicChannelSettingsDialog ( ChannelMarker marker,
QWidget *  parent = 0 
)
explicit

Definition at line 8 of file basicchannelsettingsdialog.cpp.

References ChannelMarker::getColor(), ChannelMarker::getFrequencyScaleDisplayType(), ChannelMarker::getTitle(), m_channelMarker, m_color, paintColor(), setReverseAPIAddress(), setReverseAPIChannelIndex(), setReverseAPIDeviceIndex(), setReverseAPIPort(), setUseReverseAPI(), and ui.

8  :
9  QDialog(parent),
10  ui(new Ui::BasicChannelSettingsDialog),
11  m_channelMarker(marker),
12  m_hasChanged(false)
13 {
14  ui->setupUi(this);
15  ui->title->setText(m_channelMarker->getTitle());
17  ui->fScaleDisplayType->setCurrentIndex((int) m_channelMarker->getFrequencyScaleDisplayType());
18  setUseReverseAPI(false);
19  setReverseAPIAddress("127.0.0.1");
20  setReverseAPIPort(8888);
23  paintColor();
24 }
frequencyScaleDisplay_t getFrequencyScaleDisplayType() const
Definition: channelmarker.h:70
void setReverseAPIChannelIndex(uint16_t channelIndex)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
Ui::BasicChannelSettingsDialog * ui
const QString & getTitle() const
Definition: channelmarker.h:38
void setReverseAPIAddress(const QString &address)
const QColor & getColor() const
Definition: channelmarker.h:64
void setUseReverseAPI(bool useReverseAPI)
+ Here is the call graph for this function:

◆ ~BasicChannelSettingsDialog()

BasicChannelSettingsDialog::~BasicChannelSettingsDialog ( )

Definition at line 26 of file basicchannelsettingsdialog.cpp.

References ui.

27 {
28  delete ui;
29 }
Ui::BasicChannelSettingsDialog * ui

Member Function Documentation

◆ accept

void BasicChannelSettingsDialog::accept ( )
privateslot

Definition at line 135 of file basicchannelsettingsdialog.cpp.

References m_channelMarker, m_color, m_hasChanged, ChannelMarker::setColor(), ChannelMarker::setFrequencyScaleDisplayType(), ChannelMarker::setTitle(), and ui.

136 {
137  m_channelMarker->blockSignals(true);
138  m_channelMarker->setTitle(ui->title->text());
139 
140  if(m_color.isValid()) {
142  }
143 
145  m_channelMarker->blockSignals(false);
146 
147  m_hasChanged = true;
148  QDialog::accept();
149 }
enum ChannelMarker::frequencyScaleDisplay_e frequencyScaleDisplay_t
void setFrequencyScaleDisplayType(frequencyScaleDisplay_t type)
Definition: channelmarker.h:69
Ui::BasicChannelSettingsDialog * ui
void setColor(const QColor &color)
void setTitle(const QString &title)
+ Here is the call graph for this function:

◆ getReverseAPIAddress()

const QString& BasicChannelSettingsDialog::getReverseAPIAddress ( ) const
inline

◆ getReverseAPIChannelIndex()

uint16_t BasicChannelSettingsDialog::getReverseAPIChannelIndex ( ) const
inline

◆ getReverseAPIDeviceIndex()

uint16_t BasicChannelSettingsDialog::getReverseAPIDeviceIndex ( ) const
inline

◆ getReverseAPIPort()

uint16_t BasicChannelSettingsDialog::getReverseAPIPort ( ) const
inline

◆ hasChanged()

bool BasicChannelSettingsDialog::hasChanged ( ) const
inline

Definition at line 21 of file basicchannelsettingsdialog.h.

◆ on_colorBtn_clicked

void BasicChannelSettingsDialog::on_colorBtn_clicked ( )
privateslot

Definition at line 77 of file basicchannelsettingsdialog.cpp.

References m_color, and paintColor().

78 {
79  QColor c = m_color;
80  c = QColorDialog::getColor(c, this, tr("Select Color for Channel"), QColorDialog::DontUseNativeDialog);
81 
82  if (c.isValid())
83  {
84  m_color = c;
85  paintColor();
86  }
87 }
+ Here is the call graph for this function:

◆ on_reverseAPI_toggled

void BasicChannelSettingsDialog::on_reverseAPI_toggled ( bool  checked)
privateslot

Definition at line 89 of file basicchannelsettingsdialog.cpp.

References m_useReverseAPI.

90 {
91  m_useReverseAPI = checked;
92 }

◆ on_reverseAPIAddress_editingFinished

void BasicChannelSettingsDialog::on_reverseAPIAddress_editingFinished ( )
privateslot

Definition at line 94 of file basicchannelsettingsdialog.cpp.

References m_reverseAPIAddress, and ui.

95 {
96  m_reverseAPIAddress = ui->reverseAPIAddress->text();
97 }
Ui::BasicChannelSettingsDialog * ui

◆ on_reverseAPIChannelIndex_editingFinished

void BasicChannelSettingsDialog::on_reverseAPIChannelIndex_editingFinished ( )
privateslot

Definition at line 123 of file basicchannelsettingsdialog.cpp.

References m_reverseAPIChannelIndex, and ui.

124 {
125  bool dataOk;
126  int reverseAPIChannelIndex = ui->reverseAPIChannelIndex->text().toInt(&dataOk);
127 
128  if ((!dataOk) || (reverseAPIChannelIndex < 0)) {
129  return;
130  } else {
131  m_reverseAPIChannelIndex = reverseAPIChannelIndex;
132  }
133 }
Ui::BasicChannelSettingsDialog * ui

◆ on_reverseAPIDeviceIndex_editingFinished

void BasicChannelSettingsDialog::on_reverseAPIDeviceIndex_editingFinished ( )
privateslot

Definition at line 111 of file basicchannelsettingsdialog.cpp.

References m_reverseAPIDeviceIndex, and ui.

112 {
113  bool dataOk;
114  int reverseAPIDeviceIndex = ui->reverseAPIDeviceIndex->text().toInt(&dataOk);
115 
116  if ((!dataOk) || (reverseAPIDeviceIndex < 0)) {
117  return;
118  } else {
119  m_reverseAPIDeviceIndex = reverseAPIDeviceIndex;
120  }
121 }
Ui::BasicChannelSettingsDialog * ui

◆ on_reverseAPIPort_editingFinished

void BasicChannelSettingsDialog::on_reverseAPIPort_editingFinished ( )
privateslot

Definition at line 99 of file basicchannelsettingsdialog.cpp.

References m_reverseAPIPort, and ui.

100 {
101  bool dataOk;
102  int reverseAPIPort = ui->reverseAPIPort->text().toInt(&dataOk);
103 
104  if((!dataOk) || (reverseAPIPort < 1024) || (reverseAPIPort > 65535)) {
105  return;
106  } else {
107  m_reverseAPIPort = reverseAPIPort;
108  }
109 }
Ui::BasicChannelSettingsDialog * ui

◆ paintColor()

void BasicChannelSettingsDialog::paintColor ( )
private

Definition at line 66 of file basicchannelsettingsdialog.cpp.

References arg(), m_color, and ui.

Referenced by BasicChannelSettingsDialog(), and on_colorBtn_clicked().

67 {
68  QPixmap pm(24, 24);
69  pm.fill(m_color);
70  ui->colorBtn->setIcon(pm);
71  ui->colorText->setText(tr("#%1%2%3")
72  .arg(m_color.red(), 2, 16, QChar('0'))
73  .arg(m_color.green(), 2, 16, QChar('0'))
74  .arg(m_color.blue(), 2, 16, QChar('0')));
75 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::BasicChannelSettingsDialog * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReverseAPIAddress()

void BasicChannelSettingsDialog::setReverseAPIAddress ( const QString &  address)

◆ setReverseAPIChannelIndex()

void BasicChannelSettingsDialog::setReverseAPIChannelIndex ( uint16_t  channelIndex)

Definition at line 60 of file basicchannelsettingsdialog.cpp.

References arg(), m_reverseAPIChannelIndex, and ui.

Referenced by BasicChannelSettingsDialog(), WFMDemodGUI::onMenuDialogCalled(), NFMDemodGUI::onMenuDialogCalled(), AMDemodGUI::onMenuDialogCalled(), FreqTrackerGUI::onMenuDialogCalled(), LocalSinkGUI::onMenuDialogCalled(), LocalSourceGUI::onMenuDialogCalled(), SSBDemodGUI::onMenuDialogCalled(), RemoteSourceGUI::onMenuDialogCalled(), RemoteSinkGUI::onMenuDialogCalled(), UDPSourceGUI::onMenuDialogCalled(), FileSourceGUI::onMenuDialogCalled(), FreeDVDemodGUI::onMenuDialogCalled(), BFMDemodGUI::onMenuDialogCalled(), UDPSinkGUI::onMenuDialogCalled(), AMModGUI::onMenuDialogCalled(), NFMModGUI::onMenuDialogCalled(), FreeDVModGUI::onMenuDialogCalled(), WFMModGUI::onMenuDialogCalled(), SSBModGUI::onMenuDialogCalled(), ATVModGUI::onMenuDialogCalled(), and DSDDemodGUI::onMenuDialogCalled().

61 {
62  m_reverseAPIChannelIndex = channelIndex > 99 ? 99 : channelIndex;
63  ui->reverseAPIChannelIndex->setText(tr("%1").arg(m_reverseAPIChannelIndex));
64 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::BasicChannelSettingsDialog * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReverseAPIDeviceIndex()

void BasicChannelSettingsDialog::setReverseAPIDeviceIndex ( uint16_t  deviceIndex)

◆ setReverseAPIPort()

void BasicChannelSettingsDialog::setReverseAPIPort ( uint16_t  port)

◆ setUseReverseAPI()

void BasicChannelSettingsDialog::setUseReverseAPI ( bool  useReverseAPI)

◆ useReverseAPI()

bool BasicChannelSettingsDialog::useReverseAPI ( ) const
inline

Member Data Documentation

◆ m_channelMarker

ChannelMarker* BasicChannelSettingsDialog::m_channelMarker
private

Definition at line 44 of file basicchannelsettingsdialog.h.

Referenced by accept(), and BasicChannelSettingsDialog().

◆ m_color

QColor BasicChannelSettingsDialog::m_color
private

◆ m_hasChanged

bool BasicChannelSettingsDialog::m_hasChanged
private

Definition at line 51 of file basicchannelsettingsdialog.h.

Referenced by accept().

◆ m_reverseAPIAddress

QString BasicChannelSettingsDialog::m_reverseAPIAddress
private

◆ m_reverseAPIChannelIndex

uint16_t BasicChannelSettingsDialog::m_reverseAPIChannelIndex
private

◆ m_reverseAPIDeviceIndex

uint16_t BasicChannelSettingsDialog::m_reverseAPIDeviceIndex
private

◆ m_reverseAPIPort

uint16_t BasicChannelSettingsDialog::m_reverseAPIPort
private

◆ m_useReverseAPI

bool BasicChannelSettingsDialog::m_useReverseAPI
private

Definition at line 46 of file basicchannelsettingsdialog.h.

Referenced by on_reverseAPI_toggled(), and setUseReverseAPI().

◆ ui

Ui::BasicChannelSettingsDialog* BasicChannelSettingsDialog::ui
private

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