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.
samplingdevicecontrol.cpp
Go to the documentation of this file.
1 // Copyright (C) 2015-2017 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #include "samplingdevicecontrol.h"
19 #include "samplingdevicedialog.h"
20 #include "plugin/pluginmanager.h"
22 #include "ui_samplingdevicecontrol.h"
23 
24 
25 SamplingDeviceControl::SamplingDeviceControl(int tabIndex, int deviceType, QWidget* parent) :
26  QWidget(parent),
27  ui(new Ui::SamplingDeviceControl),
28  m_pluginManager(0),
29  m_deviceTabIndex(tabIndex),
30  m_deviceType(deviceType),
31  m_selectedDeviceIndex(-1)
32 {
33  ui->setupUi(this);
34  ui->deviceSelectedText->setText("None");
35 }
36 
38 {
39  delete ui;
40 }
41 
43 {
45  dialog.exec();
46 
47  if (dialog.getSelectedDeviceIndex() >= 0)
48  {
51  emit changed();
52  }
53 }
54 
56 {
57  if (m_selectedDeviceIndex >= 0) {
58  emit changed();
59  }
60 }
61 
63 {
64  if (m_deviceType == 0) // Single Rx
65  {
68  ui->deviceSelectedText->setText(samplingDevice->displayedName);
69  }
70  else if (m_deviceType == 1) // Single Tx
71  {
74  ui->deviceSelectedText->setText(samplingDevice->displayedName);
75  }
76  else if (m_deviceType == 2) // MIMO
77  {
80  ui->deviceSelectedText->setText(samplingDevice->displayedName);
81  }
82 
83  m_selectedDeviceIndex = index;
84 }
85 
87 {
88  if (m_deviceType == 0) // Single Rx
89  {
91  ui->deviceSelectedText->setText("None");
92  }
93  else if (m_deviceType == 1) // Single Tx
94  {
96  ui->deviceSelectedText->setText("None");
97  }
98 
100 }
101 
103 {
104  return ui->channelSelect;
105 }
106 
108 {
109  return ui->addChannel;
110 }
void changeMIMOSelection(int tabIndex, int deviceIndex)
QString displayedName
The human readable name.
SamplingDeviceControl(int tabIndex, int deviceType, QWidget *parent=0)
int getSelectedDeviceIndex() const
void changeTxSelection(int tabIndex, int deviceIndex)
void removeRxSelection(int tabIndex)
const PluginInterface::SamplingDevice * getMIMOSamplingDevice(int deviceIndex) const
void changeRxSelection(int tabIndex, int deviceIndex)
void removeTxSelection(int tabIndex)
Ui::SamplingDeviceControl * ui
const PluginInterface::SamplingDevice * getTxSamplingDevice(int deviceIndex) const
const PluginInterface::SamplingDevice * getRxSamplingDevice(int deviceIndex) const
void setSelectedDeviceIndex(int index)
static DeviceEnumerator * instance()