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
KiwiSDRGui Class Reference

#include <kiwisdrgui.h>

+ Inheritance diagram for KiwiSDRGui:
+ Collaboration diagram for KiwiSDRGui:

Public Member Functions

 KiwiSDRGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~KiwiSDRGui ()
 
virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
void resetToDefaults ()
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &message)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Private Slots

void handleInputMessages ()
 
void on_startStop_toggled (bool checked)
 
void on_centerFrequency_changed (quint64 value)
 
void on_record_toggled (bool checked)
 
void on_gain_valueChanged (int value)
 
void on_agc_toggled (bool checked)
 
void on_serverAddress_returnPressed ()
 
void on_serverAddressApplyButton_clicked ()
 
void on_dcBlock_toggled (bool checked)
 
void openDeviceSettingsDialog (const QPoint &p)
 
void updateStatus ()
 
void updateHardware ()
 

Private Member Functions

void blockApplySettings (bool block)
 
void displaySettings ()
 
void sendSettings ()
 
void updateSampleRateAndFrequency ()
 

Private Attributes

Ui::KiwiSDRGui * ui
 
DeviceUISetm_deviceUISet
 
KiwiSDRSettings m_settings
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
bool m_doApplySettings
 
bool m_forceSettings
 
DeviceSampleSourcem_sampleSource
 
std::size_t m_tickCount
 
int m_deviceSampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
int m_lastEngineState
 
MessageQueue m_inputMessageQueue
 
std::vector< QString > m_statusColors
 
std::vector< QString > m_statusTooltips
 

Detailed Description

Definition at line 37 of file kiwisdrgui.h.

Constructor & Destructor Documentation

◆ KiwiSDRGui()

KiwiSDRGui::KiwiSDRGui ( DeviceUISet deviceUISet,
QWidget *  parent = 0 
)
explicit

Definition at line 42 of file kiwisdrgui.cpp.

References displaySettings(), DeviceAPI::getSampleSource(), ColorMapper::GrayGold, handleInputMessages(), DeviceUISet::m_deviceAPI, m_deviceUISet, m_inputMessageQueue, m_sampleSource, m_statusColors, m_statusTimer, m_statusTooltips, m_updateTimer, openDeviceSettingsDialog(), DeviceSampleSource::setMessageQueueToGUI(), ui, updateHardware(), and updateStatus().

42  :
43  QWidget(parent),
44  ui(new Ui::KiwiSDRGui),
45  m_deviceUISet(deviceUISet),
46  m_settings(),
47  m_doApplySettings(true),
48  m_forceSettings(true),
49  m_sampleSource(0),
50  m_tickCount(0),
52 {
53  qDebug("KiwiSDRGui::KiwiSDRGui");
55 
56  m_statusTooltips.push_back("Idle"); // 0
57  m_statusTooltips.push_back("Connecting..."); // 1
58  m_statusTooltips.push_back("Connected"); // 2
59  m_statusTooltips.push_back("Error"); // 3
60  m_statusTooltips.push_back("Disconnected"); // 4
61 
62  m_statusColors.push_back("gray"); // Idle
63  m_statusColors.push_back("rgb(232, 212, 35)"); // Connecting (yellow)
64  m_statusColors.push_back("rgb(35, 138, 35)"); // Connected (green)
65  m_statusColors.push_back("rgb(232, 85, 85)"); // Error (red)
66  m_statusColors.push_back("rgb(232, 85, 232)"); // Disconnected (magenta)
67 
68  ui->setupUi(this);
69  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
70  ui->centerFrequency->setValueRange(7, 0, 9999999);
71 
73 
74  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
75  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
76  m_statusTimer.start(500);
77 
78  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
80 
81  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
82  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
83 }
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
QTimer m_statusTimer
Definition: kiwisdrgui.h:62
void displaySettings()
Definition: kiwisdrgui.cpp:199
std::size_t m_tickCount
Definition: kiwisdrgui.h:66
std::vector< QString > m_statusTooltips
Definition: kiwisdrgui.h:72
bool m_doApplySettings
Definition: kiwisdrgui.h:63
engine is before initialization
Definition: deviceapi.h:53
bool m_forceSettings
Definition: kiwisdrgui.h:64
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
DeviceUISet * m_deviceUISet
Definition: kiwisdrgui.h:59
QTimer m_updateTimer
Definition: kiwisdrgui.h:61
DeviceSampleSource * m_sampleSource
Definition: kiwisdrgui.h:65
void handleInputMessages()
Definition: kiwisdrgui.cpp:296
std::vector< QString > m_statusColors
Definition: kiwisdrgui.h:71
int m_lastEngineState
Definition: kiwisdrgui.h:69
void updateStatus()
Definition: kiwisdrgui.cpp:231
void updateHardware()
Definition: kiwisdrgui.cpp:220
void openDeviceSettingsDialog(const QPoint &p)
Definition: kiwisdrgui.cpp:331
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
MessageQueue m_inputMessageQueue
Definition: kiwisdrgui.h:70
+ Here is the call graph for this function:

◆ ~KiwiSDRGui()

KiwiSDRGui::~KiwiSDRGui ( )
virtual

Definition at line 85 of file kiwisdrgui.cpp.

References ui.

86 {
87  delete ui;
88 }
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57

Member Function Documentation

◆ blockApplySettings()

void KiwiSDRGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 74 of file kiwisdrgui.h.

Referenced by displaySettings(), and handleMessage().

74 { m_doApplySettings = !block; }
bool m_doApplySettings
Definition: kiwisdrgui.h:63
+ Here is the caller graph for this function:

◆ deserialize()

bool KiwiSDRGui::deserialize ( const QByteArray &  data)
virtual

Implements PluginInstanceGUI.

Definition at line 129 of file kiwisdrgui.cpp.

References KiwiSDRSettings::deserialize(), displaySettings(), m_forceSettings, m_settings, resetToDefaults(), and sendSettings().

130 {
131  if(m_settings.deserialize(data)) {
132  displaySettings();
133  m_forceSettings = true;
134  sendSettings();
135  return true;
136  } else {
137  resetToDefaults();
138  return false;
139  }
140 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
void displaySettings()
Definition: kiwisdrgui.cpp:199
bool m_forceSettings
Definition: kiwisdrgui.h:64
void resetToDefaults()
Definition: kiwisdrgui.cpp:105
bool deserialize(const QByteArray &data)
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:

◆ destroy()

void KiwiSDRGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 90 of file kiwisdrgui.cpp.

91 {
92  delete this;
93 }

◆ displaySettings()

void KiwiSDRGui::displaySettings ( )
private

Definition at line 199 of file kiwisdrgui.cpp.

References blockApplySettings(), KiwiSDRSettings::m_centerFrequency, KiwiSDRSettings::m_dcBlock, KiwiSDRSettings::m_gain, KiwiSDRSettings::m_serverAddress, m_settings, KiwiSDRSettings::m_useAGC, and ui.

Referenced by deserialize(), handleMessage(), KiwiSDRGui(), resetToDefaults(), and setCenterFrequency().

200 {
201  blockApplySettings(true);
202 
203  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
204  ui->serverAddress->setText(m_settings.m_serverAddress);
205  ui->gain->setValue(m_settings.m_gain);
206  ui->gainText->setText(QString::number(m_settings.m_gain) + " dB");
207  ui->agc->setChecked(m_settings.m_useAGC);
208  ui->dcBlock->setChecked(m_settings.m_dcBlock);
209 
210  blockApplySettings(false);
211 }
QString m_serverAddress
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
void blockApplySettings(bool block)
Definition: kiwisdrgui.h:74
quint64 m_centerFrequency
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 KiwiSDRGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 112 of file kiwisdrgui.cpp.

References KiwiSDRSettings::m_centerFrequency, and m_settings.

113 {
115 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
quint64 m_centerFrequency

◆ getInputMessageQueue()

virtual MessageQueue* KiwiSDRGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 53 of file kiwisdrgui.h.

53 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: kiwisdrgui.h:70

◆ getName()

QString KiwiSDRGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 100 of file kiwisdrgui.cpp.

101 {
102  return objectName();
103 }

◆ handleInputMessages

void KiwiSDRGui::handleInputMessages ( )
privateslot

Definition at line 296 of file kiwisdrgui.cpp.

References DSPSignalNotification::getCenterFrequency(), DSPSignalNotification::getSampleRate(), handleMessage(), m_deviceCenterFrequency, m_deviceSampleRate, m_inputMessageQueue, Message::match(), MessageQueue::pop(), and updateSampleRateAndFrequency().

Referenced by KiwiSDRGui().

297 {
298  Message* message;
299 
300  while ((message = m_inputMessageQueue.pop()) != 0)
301  {
302  if (DSPSignalNotification::match(*message))
303  {
304  DSPSignalNotification* notif = (DSPSignalNotification*) message;
307  qDebug("KiwiSDRGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu",
308  notif->getSampleRate(),
309  notif->getCenterFrequency());
311 
312  delete message;
313  }
314  else
315  {
316  if (handleMessage(*message))
317  {
318  delete message;
319  }
320  }
321  }
322 }
Message * pop()
Pop message from queue.
void updateSampleRateAndFrequency()
Definition: kiwisdrgui.cpp:324
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
virtual bool handleMessage(const Message &message)
Definition: kiwisdrgui.cpp:260
static bool match(const Message *message)
Definition: message.cpp:45
int m_deviceSampleRate
Definition: kiwisdrgui.h:67
int getSampleRate() const
Definition: dspcommands.h:328
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: kiwisdrgui.h:68
MessageQueue m_inputMessageQueue
Definition: kiwisdrgui.h:70
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool KiwiSDRGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 260 of file kiwisdrgui.cpp.

References blockApplySettings(), displaySettings(), KiwiSDRInput::MsgConfigureKiwiSDR::getSettings(), KiwiSDRInput::MsgStartStop::getStartStop(), KiwiSDRInput::MsgSetStatus::getStatus(), m_settings, m_statusColors, m_statusTooltips, Message::match(), and ui.

Referenced by handleInputMessages().

261 {
263  {
264  qDebug("KiwiSDRGui::handleMessage: MsgConfigureKiwiSDR");
266  m_settings = cfg.getSettings();
267  displaySettings();
268  return true;
269  }
270  else if (KiwiSDRInput::MsgStartStop::match(message))
271  {
272  qDebug("KiwiSDRGui::handleMessage: MsgStartStop");
274  blockApplySettings(true);
275  ui->startStop->setChecked(notif.getStartStop());
276  blockApplySettings(false);
277 
278  return true;
279  }
280  else if (KiwiSDRInput::MsgSetStatus::match(message))
281  {
282  qDebug("KiwiSDRGui::handleMessage: MsgSetStatus");
284  int status = notif.getStatus();
285  ui->statusIndicator->setToolTip(m_statusTooltips[status]);
286  ui->statusIndicator->setStyleSheet("QLabel { background-color: " +
287  m_statusColors[status] + "; border-radius: 7px; }");
288  return true;
289  }
290  else
291  {
292  return false;
293  }
294 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
void displaySettings()
Definition: kiwisdrgui.cpp:199
std::vector< QString > m_statusTooltips
Definition: kiwisdrgui.h:72
void blockApplySettings(bool block)
Definition: kiwisdrgui.h:74
static bool match(const Message *message)
Definition: message.cpp:45
std::vector< QString > m_statusColors
Definition: kiwisdrgui.h:71
const KiwiSDRSettings & getSettings() const
Definition: kiwisdrinput.h:44
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_agc_toggled

void KiwiSDRGui::on_agc_toggled ( bool  checked)
privateslot

Definition at line 186 of file kiwisdrgui.cpp.

References m_settings, KiwiSDRSettings::m_useAGC, and sendSettings().

187 {
188  m_settings.m_useAGC = checked;
189  sendSettings();
190 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void KiwiSDRGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 151 of file kiwisdrgui.cpp.

References KiwiSDRSettings::m_centerFrequency, m_settings, and sendSettings().

152 {
153  m_settings.m_centerFrequency = value * 1000;
154  sendSettings();
155 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
quint64 m_centerFrequency
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:

◆ on_dcBlock_toggled

void KiwiSDRGui::on_dcBlock_toggled ( bool  checked)
privateslot

Definition at line 168 of file kiwisdrgui.cpp.

References KiwiSDRSettings::m_dcBlock, m_settings, and sendSettings().

169 {
170  m_settings.m_dcBlock = checked;
171  sendSettings();
172 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:

◆ on_gain_valueChanged

void KiwiSDRGui::on_gain_valueChanged ( int  value)
privateslot

Definition at line 192 of file kiwisdrgui.cpp.

References KiwiSDRSettings::m_gain, m_settings, sendSettings(), and ui.

193 {
194  m_settings.m_gain = value;
195  ui->gainText->setText(QString::number(m_settings.m_gain) + " dB");
196  sendSettings();
197 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:

◆ on_record_toggled

void KiwiSDRGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 174 of file kiwisdrgui.cpp.

References KiwiSDRInput::MsgFileRecord::create(), DeviceSampleSource::getInputMessageQueue(), m_sampleSource, MessageQueue::push(), and ui.

175 {
176  if (checked) {
177  ui->record->setStyleSheet("QToolButton { background-color : red; }");
178  } else {
179  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
180  }
181 
184 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleSource * m_sampleSource
Definition: kiwisdrgui.h:65
static MsgFileRecord * create(bool startStop)
Definition: kiwisdrinput.h:69
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
+ Here is the call graph for this function:

◆ on_serverAddress_returnPressed

void KiwiSDRGui::on_serverAddress_returnPressed ( )
privateslot

Definition at line 157 of file kiwisdrgui.cpp.

References on_serverAddressApplyButton_clicked().

158 {
160 }
void on_serverAddressApplyButton_clicked()
Definition: kiwisdrgui.cpp:162
+ Here is the call graph for this function:

◆ on_serverAddressApplyButton_clicked

void KiwiSDRGui::on_serverAddressApplyButton_clicked ( )
privateslot

Definition at line 162 of file kiwisdrgui.cpp.

References KiwiSDRSettings::m_serverAddress, m_settings, sendSettings(), and ui.

Referenced by on_serverAddress_returnPressed().

163 {
164  m_settings.m_serverAddress = ui->serverAddress->text();
165  sendSettings();
166 }
QString m_serverAddress
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_startStop_toggled

void KiwiSDRGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 142 of file kiwisdrgui.cpp.

References KiwiSDRInput::MsgStartStop::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_sampleSource, and MessageQueue::push().

143 {
144  if (m_doApplySettings)
145  {
148  }
149 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
bool m_doApplySettings
Definition: kiwisdrgui.h:63
DeviceSampleSource * m_sampleSource
Definition: kiwisdrgui.h:65
static MsgStartStop * create(bool startStop)
Definition: kiwisdrinput.h:88
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

void KiwiSDRGui::openDeviceSettingsDialog ( const QPoint &  p)
privateslot

Definition at line 331 of file kiwisdrgui.cpp.

References BasicDeviceSettingsDialog::getReverseAPIAddress(), BasicDeviceSettingsDialog::getReverseAPIDeviceIndex(), BasicDeviceSettingsDialog::getReverseAPIPort(), KiwiSDRSettings::m_reverseAPIAddress, KiwiSDRSettings::m_reverseAPIDeviceIndex, KiwiSDRSettings::m_reverseAPIPort, m_settings, KiwiSDRSettings::m_useReverseAPI, sendSettings(), BasicDeviceSettingsDialog::setReverseAPIAddress(), BasicDeviceSettingsDialog::setReverseAPIDeviceIndex(), BasicDeviceSettingsDialog::setReverseAPIPort(), BasicDeviceSettingsDialog::setUseReverseAPI(), and BasicDeviceSettingsDialog::useReverseAPI().

Referenced by KiwiSDRGui().

332 {
333  BasicDeviceSettingsDialog dialog(this);
334  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
335  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
336  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
337  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
338 
339  dialog.move(p);
340  dialog.exec();
341 
342  m_settings.m_useReverseAPI = dialog.useReverseAPI();
343  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
344  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
345  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
346 
347  sendSettings();
348 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
QString m_reverseAPIAddress
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIPort
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void KiwiSDRGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 105 of file kiwisdrgui.cpp.

References displaySettings(), m_settings, KiwiSDRSettings::resetToDefaults(), and sendSettings().

Referenced by deserialize().

106 {
108  displaySettings();
109  sendSettings();
110 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
void displaySettings()
Definition: kiwisdrgui.cpp:199
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void KiwiSDRGui::sendSettings ( )
private

Definition at line 213 of file kiwisdrgui.cpp.

References m_updateTimer.

Referenced by deserialize(), on_agc_toggled(), on_centerFrequency_changed(), on_dcBlock_toggled(), on_gain_valueChanged(), on_serverAddressApplyButton_clicked(), openDeviceSettingsDialog(), resetToDefaults(), and setCenterFrequency().

214 {
215  if (!m_updateTimer.isActive()) {
216  m_updateTimer.start(100);
217  }
218 }
QTimer m_updateTimer
Definition: kiwisdrgui.h:61
+ Here is the caller graph for this function:

◆ serialize()

QByteArray KiwiSDRGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 124 of file kiwisdrgui.cpp.

References m_settings, and KiwiSDRSettings::serialize().

125 {
126  return m_settings.serialize();
127 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void KiwiSDRGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 117 of file kiwisdrgui.cpp.

References displaySettings(), KiwiSDRSettings::m_centerFrequency, m_settings, and sendSettings().

118 {
119  m_settings.m_centerFrequency = centerFrequency;
120  displaySettings();
121  sendSettings();
122 }
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
void displaySettings()
Definition: kiwisdrgui.cpp:199
quint64 m_centerFrequency
void sendSettings()
Definition: kiwisdrgui.cpp:213
+ Here is the call graph for this function:

◆ setName()

void KiwiSDRGui::setName ( const QString &  name)
virtual

Implements PluginInstanceGUI.

Definition at line 95 of file kiwisdrgui.cpp.

96 {
97  setObjectName(name);
98 }

◆ updateHardware

void KiwiSDRGui::updateHardware ( )
privateslot

Definition at line 220 of file kiwisdrgui.cpp.

References KiwiSDRInput::MsgConfigureKiwiSDR::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_forceSettings, m_sampleSource, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by KiwiSDRGui().

221 {
222  if (m_doApplySettings)
223  {
226  m_forceSettings = false;
227  m_updateTimer.stop();
228  }
229 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
MessageQueue * getInputMessageQueue()
bool m_doApplySettings
Definition: kiwisdrgui.h:63
bool m_forceSettings
Definition: kiwisdrgui.h:64
static MsgConfigureKiwiSDR * create(const KiwiSDRSettings &settings, bool force)
Definition: kiwisdrinput.h:47
QTimer m_updateTimer
Definition: kiwisdrgui.h:61
DeviceSampleSource * m_sampleSource
Definition: kiwisdrgui.h:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void KiwiSDRGui::updateSampleRateAndFrequency ( )
private

Definition at line 324 of file kiwisdrgui.cpp.

References arg(), DeviceUISet::getSpectrum(), m_deviceCenterFrequency, m_deviceSampleRate, m_deviceUISet, GLSpectrum::setCenterFrequency(), GLSpectrum::setSampleRate(), and ui.

Referenced by handleInputMessages().

325 {
328  ui->deviceRateText->setText(tr("%1k").arg((float)m_deviceSampleRate / 1000));
329 }
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
GLSpectrum * getSpectrum()
Direct spectrum getter.
Definition: deviceuiset.h:57
DeviceUISet * m_deviceUISet
Definition: kiwisdrgui.h:59
int m_deviceSampleRate
Definition: kiwisdrgui.h:67
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: kiwisdrgui.h:68
void setCenterFrequency(qint64 frequency)
Definition: glspectrum.cpp:175
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus

void KiwiSDRGui::updateStatus ( )
privateslot

Definition at line 231 of file kiwisdrgui.cpp.

References DeviceAPI::errorMessage(), DeviceUISet::m_deviceAPI, m_deviceUISet, m_lastEngineState, DeviceAPI::state(), DeviceAPI::StError, DeviceAPI::StIdle, DeviceAPI::StNotStarted, DeviceAPI::StRunning, and ui.

Referenced by KiwiSDRGui().

232 {
233  int state = m_deviceUISet->m_deviceAPI->state();
234 
235  if (m_lastEngineState != state)
236  {
237  switch (state)
238  {
240  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
241  break;
242  case DeviceAPI::StIdle:
243  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
244  break;
246  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
247  break;
248  case DeviceAPI::StError:
249  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
250  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
251  break;
252  default:
253  break;
254  }
255 
256  m_lastEngineState = state;
257  }
258 }
QString errorMessage()
Last error message from the device engine.
Definition: deviceapi.cpp:290
engine is before initialization
Definition: deviceapi.h:53
EngineState state() const
Return the state of the device engine corresponding to the stream type.
Definition: deviceapi.cpp:277
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
engine is idle
Definition: deviceapi.h:54
DeviceUISet * m_deviceUISet
Definition: kiwisdrgui.h:59
int m_lastEngineState
Definition: kiwisdrgui.h:69
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
engine is running
Definition: deviceapi.h:56
engine is in error
Definition: deviceapi.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceCenterFrequency

quint64 KiwiSDRGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 68 of file kiwisdrgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceSampleRate

int KiwiSDRGui::m_deviceSampleRate
private

Definition at line 67 of file kiwisdrgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* KiwiSDRGui::m_deviceUISet
private

Definition at line 59 of file kiwisdrgui.h.

Referenced by KiwiSDRGui(), updateSampleRateAndFrequency(), and updateStatus().

◆ m_doApplySettings

bool KiwiSDRGui::m_doApplySettings
private

Definition at line 63 of file kiwisdrgui.h.

Referenced by on_startStop_toggled(), and updateHardware().

◆ m_forceSettings

bool KiwiSDRGui::m_forceSettings
private

Definition at line 64 of file kiwisdrgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue KiwiSDRGui::m_inputMessageQueue
private

Definition at line 70 of file kiwisdrgui.h.

Referenced by handleInputMessages(), and KiwiSDRGui().

◆ m_lastEngineState

int KiwiSDRGui::m_lastEngineState
private

Definition at line 69 of file kiwisdrgui.h.

Referenced by updateStatus().

◆ m_sampleSource

DeviceSampleSource* KiwiSDRGui::m_sampleSource
private

Definition at line 65 of file kiwisdrgui.h.

Referenced by KiwiSDRGui(), on_record_toggled(), on_startStop_toggled(), and updateHardware().

◆ m_settings

KiwiSDRSettings KiwiSDRGui::m_settings
private

◆ m_statusColors

std::vector<QString> KiwiSDRGui::m_statusColors
private

Definition at line 71 of file kiwisdrgui.h.

Referenced by handleMessage(), and KiwiSDRGui().

◆ m_statusTimer

QTimer KiwiSDRGui::m_statusTimer
private

Definition at line 62 of file kiwisdrgui.h.

Referenced by KiwiSDRGui().

◆ m_statusTooltips

std::vector<QString> KiwiSDRGui::m_statusTooltips
private

Definition at line 72 of file kiwisdrgui.h.

Referenced by handleMessage(), and KiwiSDRGui().

◆ m_tickCount

std::size_t KiwiSDRGui::m_tickCount
private

Definition at line 66 of file kiwisdrgui.h.

◆ m_updateTimer

QTimer KiwiSDRGui::m_updateTimer
private

Definition at line 61 of file kiwisdrgui.h.

Referenced by KiwiSDRGui(), sendSettings(), and updateHardware().

◆ ui

Ui::KiwiSDRGui* KiwiSDRGui::ui
private

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