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

#include <testmigui.h>

+ Inheritance diagram for TestMIGui:
+ Collaboration diagram for TestMIGui:

Public Member Functions

 TestMIGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~TestMIGui ()
 
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_streamIndex_currentIndexChanged (int index)
 
void on_spectrumSource_currentIndexChanged (int index)
 
void on_streamLock_toggled (bool checked)
 
void on_centerFrequency_changed (quint64 value)
 
void on_autoCorr_currentIndexChanged (int index)
 
void on_frequencyShift_changed (qint64 value)
 
void on_decimation_currentIndexChanged (int index)
 
void on_fcPos_currentIndexChanged (int index)
 
void on_sampleRate_changed (quint64 value)
 
void on_sampleSize_currentIndexChanged (int index)
 
void on_amplitudeCoarse_valueChanged (int value)
 
void on_amplitudeFine_valueChanged (int value)
 
void on_modulation_currentIndexChanged (int index)
 
void on_modulationFrequency_valueChanged (int value)
 
void on_amModulation_valueChanged (int value)
 
void on_fmDeviation_valueChanged (int value)
 
void on_dcBias_valueChanged (int value)
 
void on_iBias_valueChanged (int value)
 
void on_qBias_valueChanged (int value)
 
void on_phaseImbalance_valueChanged (int value)
 
void on_record_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 ()
 
void displayAmplitude ()
 
void updateAmpCoarseLimit ()
 
void updateAmpFineLimit ()
 
void updateFrequencyShiftLimit ()
 
void updateFileRecordStatus ()
 

Private Attributes

Ui::TestMIGui * ui
 
DeviceUISetm_deviceUISet
 
TestMISettings m_settings
 
int m_streamIndex
 Current stream index being dealt with. More...
 
int m_spectrumStreamIndex
 Index of the stream displayed on main spectrum. More...
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
bool m_doApplySettings
 
bool m_forceSettings
 
DeviceSampleMIMOm_sampleMIMO
 
std::size_t m_tickCount
 
std::vector< int > m_deviceSampleRates
 
std::vector< quint64 > m_deviceCenterFrequencies
 Center frequency in device. More...
 
int m_lastEngineState
 
MessageQueue m_inputMessageQueue
 

Detailed Description

Definition at line 36 of file testmigui.h.

Constructor & Destructor Documentation

◆ TestMIGui()

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

Definition at line 42 of file testmigui.cpp.

References arg(), displaySettings(), DeviceAPI::getSampleMIMO(), ColorMapper::GrayGold, ColorMapper::GrayGreenYellow, handleInputMessages(), DeviceUISet::m_deviceAPI, m_deviceCenterFrequencies, m_deviceSampleRates, m_deviceUISet, m_inputMessageQueue, m_sampleMIMO, m_settings, m_statusTimer, m_streamIndex, TestMISettings::m_streams, m_updateTimer, openDeviceSettingsDialog(), DeviceSampleMIMO::setMessageQueueToGUI(), ui, updateHardware(), and updateStatus().

42  :
43  QWidget(parent),
44  ui(new Ui::TestMIGui),
45  m_deviceUISet(deviceUISet),
46  m_settings(),
47  m_doApplySettings(true),
48  m_forceSettings(true),
49  m_sampleMIMO(nullptr),
50  m_tickCount(0),
52 {
53  qDebug("TestMIGui::TestMIGui");
55  m_streamIndex = 0;
56  m_deviceCenterFrequencies.push_back(m_settings.m_streams[0].m_centerFrequency);
57  m_deviceCenterFrequencies.push_back(m_settings.m_streams[1].m_centerFrequency);
58  m_deviceSampleRates.push_back(m_settings.m_streams[0].m_sampleRate / (1<<m_settings.m_streams[0].m_log2Decim));
59  m_deviceSampleRates.push_back(m_settings.m_streams[1].m_sampleRate / (1<<m_settings.m_streams[1].m_log2Decim));
60 
61  ui->setupUi(this);
62  ui->spectrumSource->addItem("0");
63  ui->spectrumSource->addItem("1");
64  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
65  ui->centerFrequency->setValueRange(7, 0, 9999999);
66  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
67  ui->sampleRate->setValueRange(7, 48000, 9999999);
68  ui->frequencyShift->setColorMapper(ColorMapper(ColorMapper::GrayGold));
69  ui->frequencyShift->setValueRange(false, 7, -9999999, 9999999);
70  ui->frequencyShiftLabel->setText(QString("%1").arg(QChar(0x94, 0x03)));
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 }
void updateStatus()
Definition: testmigui.cpp:493
void openDeviceSettingsDialog(const QPoint &p)
Definition: testmigui.cpp:588
Ui::TestMIGui * ui
Definition: testmigui.h:56
void handleInputMessages()
Definition: testmigui.cpp:548
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void updateHardware()
Definition: testmigui.cpp:482
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
engine is before initialization
Definition: deviceapi.h:53
bool m_forceSettings
Definition: testmigui.h:65
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
std::vector< int > m_deviceSampleRates
Definition: testmigui.h:68
void displaySettings()
Definition: testmigui.cpp:432
DeviceSampleMIMO * m_sampleMIMO
Definition: testmigui.h:66
bool m_doApplySettings
Definition: testmigui.h:64
QTimer m_updateTimer
Definition: testmigui.h:62
std::vector< TestMIStreamSettings > m_streams
std::size_t m_tickCount
Definition: testmigui.h:67
DeviceUISet * m_deviceUISet
Definition: testmigui.h:58
int m_lastEngineState
Definition: testmigui.h:70
TestMISettings m_settings
Definition: testmigui.h:59
MessageQueue m_inputMessageQueue
Definition: testmigui.h:71
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
std::vector< quint64 > m_deviceCenterFrequencies
Center frequency in device.
Definition: testmigui.h:69
QTimer m_statusTimer
Definition: testmigui.h:63
DeviceSampleMIMO * getSampleMIMO()
Return pointer to the device sample MIMO or nullptr.
Definition: deviceapi.cpp:231
+ Here is the call graph for this function:

◆ ~TestMIGui()

TestMIGui::~TestMIGui ( )
virtual

Definition at line 85 of file testmigui.cpp.

References ui.

86 {
87  delete ui;
88 }
Ui::TestMIGui * ui
Definition: testmigui.h:56

Member Function Documentation

◆ blockApplySettings()

void TestMIGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 73 of file testmigui.h.

Referenced by displaySettings(), and handleMessage().

73 { m_doApplySettings = !block; }
bool m_doApplySettings
Definition: testmigui.h:64
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 129 of file testmigui.cpp.

References TestMISettings::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 }
void resetToDefaults()
Definition: testmigui.cpp:105
void sendSettings()
Definition: testmigui.cpp:475
bool m_forceSettings
Definition: testmigui.h:65
void displaySettings()
Definition: testmigui.cpp:432
bool deserialize(const QByteArray &data)
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ destroy()

void TestMIGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 90 of file testmigui.cpp.

91 {
92  delete this;
93 }

◆ displayAmplitude()

void TestMIGui::displayAmplitude ( )
private

Definition at line 346 of file testmigui.cpp.

References arg(), CalcDb::dbPower(), and ui.

Referenced by displaySettings(), on_amplitudeCoarse_valueChanged(), on_amplitudeFine_valueChanged(), and on_sampleSize_currentIndexChanged().

347 {
348  int amplitudeInt = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
349  double power;
350 
351  switch (ui->sampleSize->currentIndex())
352  {
353  case 0: // 8 bits: 128
354  power = (double) amplitudeInt*amplitudeInt / (double) (1<<14);
355  break;
356  case 1: // 12 bits 2048
357  power = (double) amplitudeInt*amplitudeInt / (double) (1<<22);
358  break;
359  case 2: // 16 bits 32768
360  default:
361  power = (double) amplitudeInt*amplitudeInt / (double) (1<<30);
362  break;
363  }
364 
365  ui->amplitudeBits->setText(QString(tr("%1 b").arg(amplitudeInt)));
366  double powerDb = CalcDb::dbPower(power);
367  ui->power->setText(QString(tr("%1 dB").arg(QString::number(powerDb, 'f', 1))));
368 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void TestMIGui::displaySettings ( )
private

Definition at line 432 of file testmigui.cpp.

References arg(), blockApplySettings(), displayAmplitude(), m_settings, m_streamIndex, TestMISettings::m_streams, ui, updateAmpCoarseLimit(), updateAmpFineLimit(), and updateFrequencyShiftLimit().

Referenced by deserialize(), handleMessage(), on_spectrumSource_currentIndexChanged(), on_streamIndex_currentIndexChanged(), resetToDefaults(), setCenterFrequency(), and TestMIGui().

433 {
434  blockApplySettings(true);
435  ui->sampleSize->blockSignals(true);
436 
437  ui->streamIndex->setCurrentIndex(m_streamIndex);
438  ui->centerFrequency->setValue(m_settings.m_streams[m_streamIndex].m_centerFrequency / 1000);
439  ui->decimation->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_log2Decim);
440  ui->fcPos->setCurrentIndex((int) m_settings.m_streams[m_streamIndex].m_fcPos);
441  ui->sampleRate->setValue(m_settings.m_streams[m_streamIndex].m_sampleRate);
443  ui->frequencyShift->setValue(m_settings.m_streams[m_streamIndex].m_frequencyShift);
444  ui->sampleSize->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_sampleSizeIndex);
446  int amplitudeBits = m_settings.m_streams[m_streamIndex].m_amplitudeBits;
447  ui->amplitudeCoarse->setValue(amplitudeBits/100);
449  ui->amplitudeFine->setValue(amplitudeBits%100);
451  int dcBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_dcFactor * 100.0f);
452  ui->dcBias->setValue((int) dcBiasPercent);
453  ui->dcBiasText->setText(QString(tr("%1 %").arg(dcBiasPercent)));
454  int iBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_iFactor * 100.0f);
455  ui->iBias->setValue((int) iBiasPercent);
456  ui->iBiasText->setText(QString(tr("%1 %").arg(iBiasPercent)));
457  int qBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_qFactor * 100.0f);
458  ui->qBias->setValue((int) qBiasPercent);
459  ui->qBiasText->setText(QString(tr("%1 %").arg(qBiasPercent)));
460  int phaseImbalancePercent = roundf(m_settings.m_streams[m_streamIndex].m_phaseImbalance * 100.0f);
461  ui->phaseImbalance->setValue((int) phaseImbalancePercent);
462  ui->phaseImbalanceText->setText(QString(tr("%1 %").arg(phaseImbalancePercent)));
463  ui->autoCorr->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_autoCorrOptions);
464  ui->sampleSize->blockSignals(false);
465  ui->modulation->setCurrentIndex((int) m_settings.m_streams[m_streamIndex].m_modulation);
466  ui->modulationFrequency->setValue(m_settings.m_streams[m_streamIndex].m_modulationTone);
467  ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_modulationTone / 100.0, 0, 'f', 2));
468  ui->amModulation->setValue(m_settings.m_streams[m_streamIndex].m_amModulation);
469  ui->amModulationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_amModulation));
470  ui->fmDeviation->setValue(m_settings.m_streams[m_streamIndex].m_fmDeviation);
471  ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_fmDeviation / 10.0, 0, 'f', 1));
472  blockApplySettings(false);
473 }
void updateAmpFineLimit()
Definition: testmigui.cpp:387
Ui::TestMIGui * ui
Definition: testmigui.h:56
void updateAmpCoarseLimit()
Definition: testmigui.cpp:370
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void blockApplySettings(bool block)
Definition: testmigui.h:73
std::vector< TestMIStreamSettings > m_streams
void updateFrequencyShiftLimit()
Definition: testmigui.cpp:416
TestMISettings m_settings
Definition: testmigui.h:59
void displayAmplitude()
Definition: testmigui.cpp:346
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 TestMIGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 112 of file testmigui.cpp.

References m_settings, m_streamIndex, and TestMISettings::m_streams.

113 {
114  return m_settings.m_streams[m_streamIndex].m_centerFrequency;
115 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59

◆ getInputMessageQueue()

virtual MessageQueue* TestMIGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 52 of file testmigui.h.

52 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: testmigui.h:71

◆ getName()

QString TestMIGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 100 of file testmigui.cpp.

101 {
102  return objectName();
103 }

◆ handleInputMessages

void TestMIGui::handleInputMessages ( )
privateslot

Definition at line 548 of file testmigui.cpp.

References DSPMIMOSignalNotification::getCenterFrequency(), DSPMIMOSignalNotification::getIndex(), DSPMIMOSignalNotification::getSampleRate(), DSPMIMOSignalNotification::getSourceOrSink(), handleMessage(), m_deviceCenterFrequencies, m_deviceSampleRates, m_inputMessageQueue, Message::match(), MessageQueue::pop(), and updateSampleRateAndFrequency().

Referenced by TestMIGui().

549 {
550  Message* message;
551 
552  while ((message = m_inputMessageQueue.pop()) != 0)
553  {
554  if (DSPMIMOSignalNotification::match(*message))
555  {
557  int istream = notif->getIndex();
558  bool sourceOrSink = notif->getSourceOrSink();
559  m_deviceSampleRates[istream] = notif->getSampleRate();
560  m_deviceCenterFrequencies[istream] = notif->getCenterFrequency();
561  // Do not consider multiple sources at this time
562  qDebug("TestMIGui::handleInputMessages: DSPMIMOSignalNotification: %s stream: %d SampleRate:%d, CenterFrequency:%llu",
563  sourceOrSink ? "source" : "sink",
564  istream,
565  notif->getSampleRate(),
566  notif->getCenterFrequency());
568 
569  delete message;
570  }
571  else
572  {
573  if (handleMessage(*message))
574  {
575  delete message;
576  }
577  }
578  }
579 }
Message * pop()
Pop message from queue.
qint64 getCenterFrequency() const
Definition: dspcommands.h:347
bool getSourceOrSink() const
Definition: dspcommands.h:348
std::vector< int > m_deviceSampleRates
Definition: testmigui.h:68
void updateSampleRateAndFrequency()
Definition: testmigui.cpp:581
static bool match(const Message *message)
Definition: message.cpp:45
MessageQueue m_inputMessageQueue
Definition: testmigui.h:71
virtual bool handleMessage(const Message &message)
Definition: testmigui.cpp:522
std::vector< quint64 > m_deviceCenterFrequencies
Center frequency in device.
Definition: testmigui.h:69
unsigned int getIndex() const
Definition: dspcommands.h:349
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool TestMIGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 522 of file testmigui.cpp.

References blockApplySettings(), displaySettings(), TestMI::MsgConfigureTestSource::getSettings(), TestMI::MsgStartStop::getStartStop(), m_settings, Message::match(), and ui.

Referenced by handleInputMessages().

523 {
525  {
526  qDebug("TestMIGui::handleMessage: MsgConfigureTestSource");
528  m_settings = cfg.getSettings();
529  displaySettings();
530  return true;
531  }
532  else if (TestMI::MsgStartStop::match(message))
533  {
534  qDebug("TestMIGui::handleMessage: MsgStartStop");
535  TestMI::MsgStartStop& notif = (TestMI::MsgStartStop&) message;
536  blockApplySettings(true);
537  ui->startStop->setChecked(notif.getStartStop());
538  blockApplySettings(false);
539 
540  return true;
541  }
542  else
543  {
544  return false;
545  }
546 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
void displaySettings()
Definition: testmigui.cpp:432
void blockApplySettings(bool block)
Definition: testmigui.h:73
static bool match(const Message *message)
Definition: message.cpp:45
bool getStartStop() const
Definition: testmi.h:87
TestMISettings m_settings
Definition: testmigui.h:59
const TestMISettings & getSettings() const
Definition: testmi.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_amModulation_valueChanged

void TestMIGui::on_amModulation_valueChanged ( int  value)
privateslot

Definition at line 292 of file testmigui.cpp.

References arg(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

293 {
294  m_settings.m_streams[m_streamIndex].m_amModulation = value;
295  ui->amModulationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_amModulation));
296  sendSettings();
297 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_amplitudeCoarse_valueChanged

void TestMIGui::on_amplitudeCoarse_valueChanged ( int  value)
privateslot

Definition at line 258 of file testmigui.cpp.

References displayAmplitude(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), ui, and updateAmpFineLimit().

259 {
260  (void) value;
263  m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
264  sendSettings();
265 }
void updateAmpFineLimit()
Definition: testmigui.cpp:387
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
void displayAmplitude()
Definition: testmigui.cpp:346
+ Here is the call graph for this function:

◆ on_amplitudeFine_valueChanged

void TestMIGui::on_amplitudeFine_valueChanged ( int  value)
privateslot

Definition at line 267 of file testmigui.cpp.

References displayAmplitude(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

268 {
269  (void) value;
271  m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
272  sendSettings();
273 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
void displayAmplitude()
Definition: testmigui.cpp:346
+ Here is the call graph for this function:

◆ on_autoCorr_currentIndexChanged

void TestMIGui::on_autoCorr_currentIndexChanged ( int  index)
privateslot

Definition at line 200 of file testmigui.cpp.

References TestMIStreamSettings::AutoCorrLast, m_settings, m_streamIndex, TestMISettings::m_streams, and sendSettings().

201 {
202  if ((index < 0) || (index > TestMIStreamSettings::AutoCorrLast)) {
203  return;
204  }
205 
207  sendSettings();
208 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void TestMIGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 194 of file testmigui.cpp.

References m_settings, m_streamIndex, TestMISettings::m_streams, and sendSettings().

195 {
196  m_settings.m_streams[m_streamIndex].m_centerFrequency = value * 1000;
197  sendSettings();
198 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_dcBias_valueChanged

void TestMIGui::on_dcBias_valueChanged ( int  value)
privateslot

Definition at line 306 of file testmigui.cpp.

References arg(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

307 {
308  ui->dcBiasText->setText(QString(tr("%1 %").arg(value)));
309  m_settings.m_streams[m_streamIndex].m_dcFactor = value / 100.0f;
310  sendSettings();
311 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_decimation_currentIndexChanged

void TestMIGui::on_decimation_currentIndexChanged ( int  index)
privateslot

Definition at line 216 of file testmigui.cpp.

References m_settings, m_streamIndex, TestMISettings::m_streams, and sendSettings().

217 {
218  if ((index < 0) || (index > 6)) {
219  return;
220  }
221 
222  m_settings.m_streams[m_streamIndex].m_log2Decim = index;
223  sendSettings();
224 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_fcPos_currentIndexChanged

void TestMIGui::on_fcPos_currentIndexChanged ( int  index)
privateslot

Definition at line 226 of file testmigui.cpp.

References m_settings, m_streamIndex, TestMISettings::m_streams, and sendSettings().

227 {
228  if ((index < 0) || (index > 2)) {
229  return;
230  }
231 
233  sendSettings();
234 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_fmDeviation_valueChanged

void TestMIGui::on_fmDeviation_valueChanged ( int  value)
privateslot

Definition at line 299 of file testmigui.cpp.

References arg(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

300 {
301  m_settings.m_streams[m_streamIndex].m_fmDeviation = value;
302  ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_fmDeviation / 10.0, 0, 'f', 1));
303  sendSettings();
304 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_frequencyShift_changed

void TestMIGui::on_frequencyShift_changed ( qint64  value)
privateslot

Definition at line 210 of file testmigui.cpp.

References m_settings, m_streamIndex, TestMISettings::m_streams, and sendSettings().

211 {
212  m_settings.m_streams[m_streamIndex].m_frequencyShift = value;
213  sendSettings();
214 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_iBias_valueChanged

void TestMIGui::on_iBias_valueChanged ( int  value)
privateslot

Definition at line 313 of file testmigui.cpp.

References arg(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

314 {
315  ui->iBiasText->setText(QString(tr("%1 %").arg(value)));
316  m_settings.m_streams[m_streamIndex].m_iFactor = value / 100.0f;
317  sendSettings();
318 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_modulation_currentIndexChanged

void TestMIGui::on_modulation_currentIndexChanged ( int  index)
privateslot

Definition at line 275 of file testmigui.cpp.

References m_settings, m_streamIndex, TestMISettings::m_streams, TestMIStreamSettings::ModulationLast, and sendSettings().

276 {
277  if ((index < 0) || (index > TestMIStreamSettings::ModulationLast)) {
278  return;
279  }
280 
282  sendSettings();
283 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_modulationFrequency_valueChanged

void TestMIGui::on_modulationFrequency_valueChanged ( int  value)
privateslot

Definition at line 285 of file testmigui.cpp.

References arg(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

286 {
287  m_settings.m_streams[m_streamIndex].m_modulationTone = value;
288  ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_modulationTone / 100.0, 0, 'f', 2));
289  sendSettings();
290 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_phaseImbalance_valueChanged

void TestMIGui::on_phaseImbalance_valueChanged ( int  value)
privateslot

Definition at line 327 of file testmigui.cpp.

References arg(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

328 {
329  ui->phaseImbalanceText->setText(QString(tr("%1 %").arg(value)));
330  m_settings.m_streams[m_streamIndex].m_phaseImbalance = value / 100.0f;
331  sendSettings();
332 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_qBias_valueChanged

void TestMIGui::on_qBias_valueChanged ( int  value)
privateslot

Definition at line 320 of file testmigui.cpp.

References arg(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), and ui.

321 {
322  ui->qBiasText->setText(QString(tr("%1 %").arg(value)));
323  m_settings.m_streams[m_streamIndex].m_qFactor = value / 100.0f;
324  sendSettings();
325 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_record_toggled

void TestMIGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 334 of file testmigui.cpp.

References TestMI::MsgFileRecord::create(), DeviceSampleMIMO::getInputMessageQueue(), m_sampleMIMO, m_streamIndex, MessageQueue::push(), and ui.

335 {
336  if (checked) {
337  ui->record->setStyleSheet("QToolButton { background-color : red; }");
338  } else {
339  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
340  }
341 
344 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
Ui::TestMIGui * ui
Definition: testmigui.h:56
MessageQueue * getInputMessageQueue()
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
static MsgFileRecord * create(bool startStop, int streamIndex)
Definition: testmi.h:68
DeviceSampleMIMO * m_sampleMIMO
Definition: testmigui.h:66
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void TestMIGui::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 236 of file testmigui.cpp.

References m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), ui, and updateFrequencyShiftLimit().

237 {
239  m_settings.m_streams[m_streamIndex].m_frequencyShift = ui->frequencyShift->getValueNew();
240  m_settings.m_streams[m_streamIndex].m_sampleRate = value;
241  sendSettings();
242 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
void updateFrequencyShiftLimit()
Definition: testmigui.cpp:416
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ on_sampleSize_currentIndexChanged

void TestMIGui::on_sampleSize_currentIndexChanged ( int  index)
privateslot

Definition at line 244 of file testmigui.cpp.

References displayAmplitude(), m_settings, m_streamIndex, TestMISettings::m_streams, sendSettings(), ui, updateAmpCoarseLimit(), and updateAmpFineLimit().

245 {
246  if ((index < 0) || (index > 2)) {
247  return;
248  }
249 
253  m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
254  m_settings.m_streams[m_streamIndex].m_sampleSizeIndex = index;
255  sendSettings();
256 }
void updateAmpFineLimit()
Definition: testmigui.cpp:387
Ui::TestMIGui * ui
Definition: testmigui.h:56
void updateAmpCoarseLimit()
Definition: testmigui.cpp:370
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
void displayAmplitude()
Definition: testmigui.cpp:346
+ Here is the call graph for this function:

◆ on_spectrumSource_currentIndexChanged

void TestMIGui::on_spectrumSource_currentIndexChanged ( int  index)
privateslot

Definition at line 169 of file testmigui.cpp.

References displaySettings(), DeviceUISet::m_deviceAPI, m_deviceUISet, DeviceUISet::m_spectrum, m_spectrumStreamIndex, m_streamIndex, GLSpectrum::setDisplayedStream(), DeviceAPI::setSpectrumSinkInput(), ui, updateFileRecordStatus(), and updateSampleRateAndFrequency().

170 {
171  m_spectrumStreamIndex = index;
175 
176  if (ui->streamLock->isChecked())
177  {
178  ui->streamIndex->blockSignals(true);
179  ui->streamIndex->setCurrentIndex(index);
180  ui->streamIndex->blockSignals(false);
181  m_streamIndex = index;
183  displaySettings();
184  }
185 }
int m_spectrumStreamIndex
Index of the stream displayed on main spectrum.
Definition: testmigui.h:61
GLSpectrum * m_spectrum
Definition: deviceuiset.h:44
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void setSpectrumSinkInput(bool sourceElseSink=true, unsigned int index=0)
Used in the MIMO case to select which stream is used as input to main spectrum.
Definition: deviceapi.cpp:111
void setDisplayedStream(bool sourceOrSink, int streamIndex)
Definition: glspectrum.h:99
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
void displaySettings()
Definition: testmigui.cpp:432
void updateSampleRateAndFrequency()
Definition: testmigui.cpp:581
DeviceUISet * m_deviceUISet
Definition: testmigui.h:58
void updateFileRecordStatus()
Definition: testmigui.cpp:423
+ Here is the call graph for this function:

◆ on_startStop_toggled

void TestMIGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 142 of file testmigui.cpp.

References TestMI::MsgStartStop::create(), DeviceSampleMIMO::getInputMessageQueue(), m_doApplySettings, m_sampleMIMO, and MessageQueue::push().

143 {
144  if (m_doApplySettings)
145  {
148  }
149 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleMIMO * m_sampleMIMO
Definition: testmigui.h:66
bool m_doApplySettings
Definition: testmigui.h:64
static MsgStartStop * create(bool startStop)
Definition: testmi.h:89
+ Here is the call graph for this function:

◆ on_streamIndex_currentIndexChanged

void TestMIGui::on_streamIndex_currentIndexChanged ( int  index)
privateslot

Definition at line 151 of file testmigui.cpp.

References displaySettings(), DeviceUISet::m_deviceAPI, m_deviceUISet, DeviceUISet::m_spectrum, m_spectrumStreamIndex, m_streamIndex, GLSpectrum::setDisplayedStream(), DeviceAPI::setSpectrumSinkInput(), ui, updateFileRecordStatus(), and updateSampleRateAndFrequency().

152 {
153  if (ui->streamLock->isChecked())
154  {
155  m_spectrumStreamIndex = index;
158  ui->spectrumSource->blockSignals(true);
159  ui->spectrumSource->setCurrentIndex(index);
160  ui->spectrumSource->blockSignals(false);
161  }
162 
163  m_streamIndex = index;
166  displaySettings();
167 }
int m_spectrumStreamIndex
Index of the stream displayed on main spectrum.
Definition: testmigui.h:61
GLSpectrum * m_spectrum
Definition: deviceuiset.h:44
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void setSpectrumSinkInput(bool sourceElseSink=true, unsigned int index=0)
Used in the MIMO case to select which stream is used as input to main spectrum.
Definition: deviceapi.cpp:111
void setDisplayedStream(bool sourceOrSink, int streamIndex)
Definition: glspectrum.h:99
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
void displaySettings()
Definition: testmigui.cpp:432
void updateSampleRateAndFrequency()
Definition: testmigui.cpp:581
DeviceUISet * m_deviceUISet
Definition: testmigui.h:58
void updateFileRecordStatus()
Definition: testmigui.cpp:423
+ Here is the call graph for this function:

◆ on_streamLock_toggled

void TestMIGui::on_streamLock_toggled ( bool  checked)
privateslot

Definition at line 187 of file testmigui.cpp.

References ui.

188 {
189  if (checked && (ui->streamIndex->currentIndex() != ui->spectrumSource->currentIndex())) {
190  ui->spectrumSource->setCurrentIndex(ui->streamIndex->currentIndex());
191  }
192 }
Ui::TestMIGui * ui
Definition: testmigui.h:56

◆ openDeviceSettingsDialog

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

Definition at line 588 of file testmigui.cpp.

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

Referenced by TestMIGui().

589 {
590  BasicDeviceSettingsDialog dialog(this);
591  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
592  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
593  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
594  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
595 
596  dialog.move(p);
597  dialog.exec();
598 
599  m_settings.m_useReverseAPI = dialog.useReverseAPI();
600  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
601  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
602  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
603 
604  sendSettings();
605 }
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
void sendSettings()
Definition: testmigui.cpp:475
uint16_t m_reverseAPIDeviceIndex
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void TestMIGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 105 of file testmigui.cpp.

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

Referenced by deserialize().

106 {
108  displaySettings();
109  sendSettings();
110 }
void sendSettings()
Definition: testmigui.cpp:475
void displaySettings()
Definition: testmigui.cpp:432
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void TestMIGui::sendSettings ( )
private

◆ serialize()

QByteArray TestMIGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 124 of file testmigui.cpp.

References m_settings, and TestMISettings::serialize().

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

◆ setCenterFrequency()

void TestMIGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 117 of file testmigui.cpp.

References displaySettings(), m_settings, m_streamIndex, TestMISettings::m_streams, and sendSettings().

118 {
119  m_settings.m_streams[m_streamIndex].m_centerFrequency = centerFrequency;
120  displaySettings();
121  sendSettings();
122 }
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
void sendSettings()
Definition: testmigui.cpp:475
void displaySettings()
Definition: testmigui.cpp:432
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 95 of file testmigui.cpp.

96 {
97  setObjectName(name);
98 }

◆ updateAmpCoarseLimit()

void TestMIGui::updateAmpCoarseLimit ( )
private

Definition at line 370 of file testmigui.cpp.

References ui.

Referenced by displaySettings(), and on_sampleSize_currentIndexChanged().

371 {
372  switch (ui->sampleSize->currentIndex())
373  {
374  case 0: // 8 bits: 128
375  ui->amplitudeCoarse->setMaximum(1);
376  break;
377  case 1: // 12 bits 2048
378  ui->amplitudeCoarse->setMaximum(20);
379  break;
380  case 2: // 16 bits 32768
381  default:
382  ui->amplitudeCoarse->setMaximum(327);
383  break;
384  }
385 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
+ Here is the caller graph for this function:

◆ updateAmpFineLimit()

void TestMIGui::updateAmpFineLimit ( )
private

Definition at line 387 of file testmigui.cpp.

References ui.

Referenced by displaySettings(), on_amplitudeCoarse_valueChanged(), and on_sampleSize_currentIndexChanged().

388 {
389  switch (ui->sampleSize->currentIndex())
390  {
391  case 0: // 8 bits: 128
392  if (ui->amplitudeCoarse->value() == 1) {
393  ui->amplitudeFine->setMaximum(27);
394  } else {
395  ui->amplitudeFine->setMaximum(99);
396  }
397  break;
398  case 1: // 12 bits 2048
399  if (ui->amplitudeCoarse->value() == 20) {
400  ui->amplitudeFine->setMaximum(47);
401  } else {
402  ui->amplitudeFine->setMaximum(99);
403  }
404  break;
405  case 2: // 16 bits 32768
406  default:
407  if (ui->amplitudeCoarse->value() == 327) {
408  ui->amplitudeFine->setMaximum(67);
409  } else {
410  ui->amplitudeFine->setMaximum(99);
411  }
412  break;
413  }
414 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
+ Here is the caller graph for this function:

◆ updateFileRecordStatus()

void TestMIGui::updateFileRecordStatus ( )
private

Definition at line 423 of file testmigui.cpp.

References m_sampleMIMO, m_streamIndex, and ui.

Referenced by on_spectrumSource_currentIndexChanged(), and on_streamIndex_currentIndexChanged().

424 {
425  if (((TestMI*) m_sampleMIMO)->isRecording(m_streamIndex)) {
426  ui->record->setStyleSheet("QToolButton { background-color : red; }");
427  } else {
428  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
429  }
430 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
Definition: testmi.h:35
DeviceSampleMIMO * m_sampleMIMO
Definition: testmigui.h:66
+ Here is the caller graph for this function:

◆ updateFrequencyShiftLimit()

void TestMIGui::updateFrequencyShiftLimit ( )
private

Definition at line 416 of file testmigui.cpp.

References m_settings, m_streamIndex, TestMISettings::m_streams, and ui.

Referenced by displaySettings(), and on_sampleRate_changed().

417 {
418  qint64 sampleRate = ui->sampleRate->getValueNew();
419  ui->frequencyShift->setValueRange(false, 7, -sampleRate, sampleRate);
420  ui->frequencyShift->setValue(m_settings.m_streams[m_streamIndex].m_frequencyShift);
421 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
std::vector< TestMIStreamSettings > m_streams
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the caller graph for this function:

◆ updateHardware

void TestMIGui::updateHardware ( )
privateslot

Definition at line 482 of file testmigui.cpp.

References TestMI::MsgConfigureTestSource::create(), DeviceSampleMIMO::getInputMessageQueue(), m_doApplySettings, m_forceSettings, m_sampleMIMO, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by TestMIGui().

483 {
484  if (m_doApplySettings)
485  {
488  m_forceSettings = false;
489  m_updateTimer.stop();
490  }
491 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgConfigureTestSource * create(const TestMISettings &settings, bool force)
Definition: testmi.h:45
bool m_forceSettings
Definition: testmigui.h:65
DeviceSampleMIMO * m_sampleMIMO
Definition: testmigui.h:66
bool m_doApplySettings
Definition: testmigui.h:64
QTimer m_updateTimer
Definition: testmigui.h:62
TestMISettings m_settings
Definition: testmigui.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void TestMIGui::updateSampleRateAndFrequency ( )
private

Definition at line 581 of file testmigui.cpp.

References arg(), DeviceUISet::getSpectrum(), m_deviceCenterFrequencies, m_deviceSampleRates, m_deviceUISet, m_spectrumStreamIndex, m_streamIndex, GLSpectrum::setCenterFrequency(), GLSpectrum::setSampleRate(), and ui.

Referenced by handleInputMessages(), on_spectrumSource_currentIndexChanged(), and on_streamIndex_currentIndexChanged().

582 {
585  ui->deviceRateText->setText(tr("%1k").arg((float) m_deviceSampleRates[m_streamIndex] / 1000));
586 }
int m_spectrumStreamIndex
Index of the stream displayed on main spectrum.
Definition: testmigui.h:61
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
Ui::TestMIGui * ui
Definition: testmigui.h:56
int m_streamIndex
Current stream index being dealt with.
Definition: testmigui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
GLSpectrum * getSpectrum()
Direct spectrum getter.
Definition: deviceuiset.h:57
std::vector< int > m_deviceSampleRates
Definition: testmigui.h:68
DeviceUISet * m_deviceUISet
Definition: testmigui.h:58
void setCenterFrequency(qint64 frequency)
Definition: glspectrum.cpp:175
std::vector< quint64 > m_deviceCenterFrequencies
Center frequency in device.
Definition: testmigui.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus

void TestMIGui::updateStatus ( )
privateslot

Definition at line 493 of file testmigui.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 TestMIGui().

494 {
495  int state = m_deviceUISet->m_deviceAPI->state();
496 
497  if(m_lastEngineState != state)
498  {
499  switch(state)
500  {
502  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
503  break;
504  case DeviceAPI::StIdle:
505  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
506  break;
508  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
509  break;
510  case DeviceAPI::StError:
511  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
512  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
513  break;
514  default:
515  break;
516  }
517 
518  m_lastEngineState = state;
519  }
520 }
Ui::TestMIGui * ui
Definition: testmigui.h:56
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: testmigui.h:58
int m_lastEngineState
Definition: testmigui.h:70
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_deviceCenterFrequencies

std::vector<quint64> TestMIGui::m_deviceCenterFrequencies
private

Center frequency in device.

Definition at line 69 of file testmigui.h.

Referenced by handleInputMessages(), TestMIGui(), and updateSampleRateAndFrequency().

◆ m_deviceSampleRates

std::vector<int> TestMIGui::m_deviceSampleRates
private

Definition at line 68 of file testmigui.h.

Referenced by handleInputMessages(), TestMIGui(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* TestMIGui::m_deviceUISet
private

◆ m_doApplySettings

bool TestMIGui::m_doApplySettings
private

Definition at line 64 of file testmigui.h.

Referenced by on_startStop_toggled(), and updateHardware().

◆ m_forceSettings

bool TestMIGui::m_forceSettings
private

Definition at line 65 of file testmigui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue TestMIGui::m_inputMessageQueue
private

Definition at line 71 of file testmigui.h.

Referenced by handleInputMessages(), and TestMIGui().

◆ m_lastEngineState

int TestMIGui::m_lastEngineState
private

Definition at line 70 of file testmigui.h.

Referenced by updateStatus().

◆ m_sampleMIMO

DeviceSampleMIMO* TestMIGui::m_sampleMIMO
private

◆ m_settings

TestMISettings TestMIGui::m_settings
private

◆ m_spectrumStreamIndex

int TestMIGui::m_spectrumStreamIndex
private

Index of the stream displayed on main spectrum.

Definition at line 61 of file testmigui.h.

Referenced by on_spectrumSource_currentIndexChanged(), on_streamIndex_currentIndexChanged(), and updateSampleRateAndFrequency().

◆ m_statusTimer

QTimer TestMIGui::m_statusTimer
private

Definition at line 63 of file testmigui.h.

Referenced by TestMIGui().

◆ m_streamIndex

int TestMIGui::m_streamIndex
private

◆ m_tickCount

std::size_t TestMIGui::m_tickCount
private

Definition at line 67 of file testmigui.h.

◆ m_updateTimer

QTimer TestMIGui::m_updateTimer
private

Definition at line 62 of file testmigui.h.

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

◆ ui

Ui::TestMIGui* TestMIGui::ui
private

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