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.
basicdevicesettingsdialog.cpp
Go to the documentation of this file.
2 #include "ui_basicdevicesettingsdialog.h"
3 
5  QDialog(parent),
7  m_hasChanged(false)
8 {
9  ui->setupUi(this);
10  setUseReverseAPI(false);
11  setReverseAPIAddress("127.0.0.1");
12  setReverseAPIPort(8888);
14 }
15 
17 {
18  delete ui;
19 }
20 
22 {
24  ui->reverseAPI->setChecked(m_useReverseAPI);
25 }
26 
28 {
29  m_reverseAPIAddress = address;
30  ui->reverseAPIAddress->setText(m_reverseAPIAddress);
31 }
32 
34 {
35  if (port < 1024) {
36  return;
37  } else {
38  m_reverseAPIPort = port;
39  }
40 
41  ui->reverseAPIPort->setText(tr("%1").arg(m_reverseAPIPort));
42 }
43 
45 {
46  m_reverseAPIDeviceIndex = deviceIndex > 99 ? 99 : deviceIndex;
47  ui->reverseAPIDeviceIndex->setText(tr("%1").arg(m_reverseAPIDeviceIndex));
48 }
49 
51 {
52  m_useReverseAPI = checked;
53 }
54 
56 {
57  m_reverseAPIAddress = ui->reverseAPIAddress->text();
58 }
59 
61 {
62  bool dataOk;
63  int reverseAPIPort = ui->reverseAPIPort->text().toInt(&dataOk);
64 
65  if((!dataOk) || (reverseAPIPort < 1024) || (reverseAPIPort > 65535)) {
66  return;
67  } else {
68  m_reverseAPIPort = reverseAPIPort;
69  }
70 }
71 
73 {
74  bool dataOk;
75  int reverseAPIDeviceIndex = ui->reverseAPIDeviceIndex->text().toInt(&dataOk);
76 
77  if ((!dataOk) || (reverseAPIDeviceIndex < 0)) {
78  return;
79  } else {
80  m_reverseAPIDeviceIndex = reverseAPIDeviceIndex;
81  }
82 }
83 
85 {
86  m_hasChanged = true;
87  QDialog::accept();
88 }
void setUseReverseAPI(bool useReverseAPI)
Ui::BasicDeviceSettingsDialog * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
unsigned short uint16_t
Definition: rtptypes_win.h:44
BasicDeviceSettingsDialog(QWidget *parent=0)
void setReverseAPIAddress(const QString &address)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)