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 Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
AMModGUI Class Reference

#include <ammodgui.h>

+ Inheritance diagram for AMModGUI:
+ Collaboration diagram for AMModGUI:

Public Slots

void channelMarkerChangedByCursor ()
 

Public Member Functions

virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &message)
 
- Public Member Functions inherited from RollupWidget
 RollupWidget (QWidget *parent=NULL)
 
void setTitleColor (const QColor &c)
 
void setHighlighted (bool highlighted)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Static Public Member Functions

static AMModGUIcreate (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
 

Private Slots

void handleSourceMessages ()
 
void on_deltaFrequency_changed (qint64 value)
 
void on_rfBW_valueChanged (int value)
 
void on_modPercent_valueChanged (int value)
 
void on_volume_valueChanged (int value)
 
void on_channelMute_toggled (bool checked)
 
void on_tone_toggled (bool checked)
 
void on_toneFrequency_valueChanged (int value)
 
void on_mic_toggled (bool checked)
 
void on_play_toggled (bool checked)
 
void on_morseKeyer_toggled (bool checked)
 
void on_playLoop_toggled (bool checked)
 
void on_navTimeSlider_valueChanged (int value)
 
void on_showFileDialog_clicked (bool checked)
 
void on_feedbackEnable_toggled (bool checked)
 
void on_feedbackVolume_valueChanged (int value)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void configureFileName ()
 
void audioSelect ()
 
void audioFeedbackSelect ()
 
void tick ()
 

Private Member Functions

 AMModGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=0)
 
virtual ~AMModGUI ()
 
void blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void displaySettings ()
 
void updateWithStreamData ()
 
void updateWithStreamTime ()
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Private Attributes

Ui::AMModGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
AMModSettings m_settings
 
bool m_doApplySettings
 
AMModm_amMod
 
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
 
QString m_fileName
 
quint32 m_recordLength
 
int m_recordSampleRate
 
int m_samplesCount
 
std::size_t m_tickCount
 
bool m_enableNavTime
 
MessageQueue m_inputMessageQueue
 

Additional Inherited Members

- Signals inherited from RollupWidget
void widgetRolled (QWidget *widget, bool rollDown)
 
- Protected Types inherited from RollupWidget
enum  { VersionMarker = 0xff }
 
enum  ContextMenuType { ContextMenuNone, ContextMenuChannelSettings, ContextMenuStreamSettings }
 
- Protected Member Functions inherited from RollupWidget
int arrangeRollups ()
 
QByteArray saveState (int version=0) const
 
bool restoreState (const QByteArray &state, int version=0)
 
void paintEvent (QPaintEvent *)
 
int paintRollup (QWidget *rollup, int pos, QPainter *p, bool last, const QColor &frame)
 
void resizeEvent (QResizeEvent *size)
 
void mousePressEvent (QMouseEvent *event)
 
bool event (QEvent *event)
 
bool eventFilter (QObject *object, QEvent *event)
 
void resetContextMenuType ()
 
void setStreamIndicator (const QString &indicator)
 
- Protected Attributes inherited from RollupWidget
QColor m_titleColor
 
QColor m_titleTextColor
 
bool m_highlighted
 
ContextMenuType m_contextMenuType
 
QString m_streamIndicator
 

Detailed Description

Definition at line 40 of file ammodgui.h.

Constructor & Destructor Documentation

◆ AMModGUI()

AMModGUI::AMModGUI ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSource channelTx,
QWidget *  parent = 0 
)
explicitprivate

Definition at line 324 of file ammodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), arg(), audioFeedbackSelect(), audioSelect(), channelMarkerChangedByCursor(), displaySettings(), AMMod::getCWKeyer(), getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleSourceMessages(), m_amMod, AMMod::m_channelIdURI, m_channelMarker, m_deviceUISet, m_settings, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerTxChannelInstance(), ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), AMModSettings::setChannelMarker(), ChannelMarker::setColor(), AMModSettings::setCWKeyerGUI(), BasebandSampleSource::setMessageQueueToGUI(), ChannelMarker::setSourceOrSinkStream(), ChannelMarker::setTitle(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

324  :
325  RollupWidget(parent),
326  ui(new Ui::AMModGUI),
327  m_pluginAPI(pluginAPI),
328  m_deviceUISet(deviceUISet),
329  m_channelMarker(this),
330  m_doApplySettings(true),
331  m_recordLength(0),
332  m_recordSampleRate(48000),
333  m_samplesCount(0),
334  m_tickCount(0),
335  m_enableNavTime(false)
336 {
337  ui->setupUi(this);
338  setAttribute(Qt::WA_DeleteOnClose, true);
339  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
340  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
341 
342  m_amMod = (AMMod*) channelTx; //new AMMod(m_deviceUISet->m_deviceSinkAPI);
344 
345  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
346 
347  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->mic);
348  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
349 
350  CRightClickEnabler *feedbackRightClickEnabler = new CRightClickEnabler(ui->feedbackEnable);
351  connect(feedbackRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioFeedbackSelect()));
352 
353  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
354  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
355  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
356 
357  m_channelMarker.blockSignals(true);
358  m_channelMarker.setColor(Qt::yellow);
361  m_channelMarker.setTitle("AM Modulator");
363  m_channelMarker.blockSignals(false);
364  m_channelMarker.setVisible(true); // activate signal on the last setting only
365 
367  m_settings.setCWKeyerGUI(ui->cwKeyerGUI);
368 
372 
373  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
374 
375  ui->play->setEnabled(false);
376  ui->play->setChecked(false);
377  ui->tone->setChecked(false);
378  ui->morseKeyer->setChecked(false);
379  ui->mic->setChecked(false);
380 
381  ui->cwKeyerGUI->setCWKeyer(m_amMod->getCWKeyer());
382 
383  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
384  connect(m_amMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
385 
386  displaySettings();
387  applySettings(true);
388 }
int m_samplesCount
Definition: ammodgui.h:75
static MainWindow * getInstance()
Definition: mainwindow.h:73
Definition: ammod.h:47
static const QString m_channelIdURI
Definition: ammod.h:249
void channelMarkerChangedByCursor()
Definition: ammodgui.cpp:132
void registerTxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:88
void handleSourceMessages()
Definition: ammodgui.cpp:139
virtual MessageQueue * getInputMessageQueue()
Definition: ammodgui.h:55
CWKeyer * getCWKeyer()
Definition: ammod.h:247
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
Ui::AMModGUI * ui
Definition: ammodgui.h:62
bool m_enableNavTime
Definition: ammodgui.h:77
PluginAPI * m_pluginAPI
Definition: ammodgui.h:63
void audioSelect()
Definition: ammodgui.cpp:476
int m_recordSampleRate
Definition: ammodgui.h:74
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
DeviceUISet * m_deviceUISet
Definition: ammodgui.h:64
quint32 m_recordLength
Definition: ammodgui.h:73
void audioFeedbackSelect()
Definition: ammodgui.cpp:489
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
void onWidgetRolled(QWidget *widget, bool rollDown)
Definition: ammodgui.cpp:287
void setChannelMarker(Serializable *channelMarker)
Definition: ammodsettings.h:61
void setSourceOrSinkStream(bool sourceOrSinkStream)
Definition: channelmarker.h:75
std::size_t m_tickCount
Definition: ammodgui.h:76
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
virtual void setMessageQueueToGUI(MessageQueue *queue)
void displaySettings()
Definition: ammodgui.cpp:417
bool m_doApplySettings
Definition: ammodgui.h:67
void onMenuDialogCalled(const QPoint &p)
Definition: ammodgui.cpp:293
void tick()
Definition: ammodgui.cpp:502
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
void setCWKeyerGUI(Serializable *cwKeyerGUI)
Definition: ammodsettings.h:62
AMMod * m_amMod
Definition: ammodgui.h:69
void setColor(const QColor &color)
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
void setVisible(bool visible)
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
void widgetRolled(QWidget *widget, bool rollDown)
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~AMModGUI()

AMModGUI::~AMModGUI ( )
privatevirtual

Definition at line 390 of file ammodgui.cpp.

References m_amMod, m_deviceUISet, DeviceUISet::removeTxChannelInstance(), and ui.

391 {
393  delete m_amMod; // TODO: check this: when the GUI closes it has to delete the modulator
394  delete ui;
395 }
void removeTxChannelInstance(PluginInstanceGUI *pluginGUI)
Ui::AMModGUI * ui
Definition: ammodgui.h:62
DeviceUISet * m_deviceUISet
Definition: ammodgui.h:64
AMMod * m_amMod
Definition: ammodgui.h:69
+ Here is the call graph for this function:

Member Function Documentation

◆ applySettings()

void AMModGUI::applySettings ( bool  force = false)
private

Definition at line 402 of file ammodgui.cpp.

References AMMod::MsgConfigureAMMod::create(), AMMod::MsgConfigureChannelizer::create(), ChannelMarker::getCenterFrequency(), ChannelMarker::getColor(), BasebandSampleSource::getInputMessageQueue(), m_amMod, m_channelMarker, m_doApplySettings, m_settings, MessageQueue::push(), and RollupWidget::setTitleColor().

Referenced by AMModGUI(), audioFeedbackSelect(), audioSelect(), channelMarkerChangedByCursor(), deserialize(), on_channelMute_toggled(), on_deltaFrequency_changed(), on_feedbackEnable_toggled(), on_feedbackVolume_valueChanged(), on_mic_toggled(), on_modPercent_valueChanged(), on_morseKeyer_toggled(), on_play_toggled(), on_playLoop_toggled(), on_rfBW_valueChanged(), on_tone_toggled(), on_toneFrequency_valueChanged(), on_volume_valueChanged(), onMenuDialogCalled(), resetToDefaults(), and setCenterFrequency().

403 {
404  if (m_doApplySettings)
405  {
407 
410  m_amMod->getInputMessageQueue()->push(msgConfigure);
411 
413  m_amMod->getInputMessageQueue()->push(message);
414  }
415 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void setTitleColor(const QColor &c)
bool m_doApplySettings
Definition: ammodgui.h:67
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
AMMod * m_amMod
Definition: ammodgui.h:69
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: ammod.h:81
const QColor & getColor() const
Definition: channelmarker.h:64
AMModSettings m_settings
Definition: ammodgui.h:66
static MsgConfigureAMMod * create(const AMModSettings &settings, bool force)
Definition: ammod.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioFeedbackSelect

void AMModGUI::audioFeedbackSelect ( )
privateslot

Definition at line 489 of file ammodgui.cpp.

References applySettings(), audioSelect(), DSPEngine::instance(), AudioSelectDialog::m_audioDeviceName, AMModSettings::m_audioDeviceName, AMModSettings::m_feedbackAudioDeviceName, AudioSelectDialog::m_selected, and m_settings.

Referenced by AMModGUI().

490 {
491  qDebug("AMModGUI::audioFeedbackSelect");
492  AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
493  audioSelect.exec();
494 
495  if (audioSelect.m_selected)
496  {
498  applySettings();
499  }
500 }
void audioSelect()
Definition: ammodgui.cpp:476
static DSPEngine * instance()
Definition: dspengine.cpp:51
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
Definition: ammodsettings.h:47
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void AMModGUI::audioSelect ( )
privateslot

Definition at line 476 of file ammodgui.cpp.

References applySettings(), DSPEngine::instance(), AudioSelectDialog::m_audioDeviceName, AMModSettings::m_audioDeviceName, AudioSelectDialog::m_selected, and m_settings.

Referenced by AMModGUI(), and audioFeedbackSelect().

477 {
478  qDebug("AMModGUI::audioSelect");
479  AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
480  audioSelect.exec();
481 
482  if (audioSelect.m_selected)
483  {
484  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
485  applySettings();
486  }
487 }
void audioSelect()
Definition: ammodgui.cpp:476
static DSPEngine * instance()
Definition: dspengine.cpp:51
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void AMModGUI::blockApplySettings ( bool  block)
private

Definition at line 397 of file ammodgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

398 {
399  m_doApplySettings = !block;
400 }
bool m_doApplySettings
Definition: ammodgui.h:67
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void AMModGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 132 of file ammodgui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, AMModSettings::m_inputFrequencyOffset, m_settings, and ui.

Referenced by AMModGUI().

133 {
134  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
136  applySettings();
137 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::AMModGUI * ui
Definition: ammodgui.h:62
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ configureFileName

void AMModGUI::configureFileName ( )
privateslot

Definition at line 280 of file ammodgui.cpp.

References AMMod::MsgConfigureFileSourceName::create(), BasebandSampleSource::getInputMessageQueue(), m_amMod, m_fileName, and MessageQueue::push().

Referenced by on_showFileDialog_clicked().

281 {
282  qDebug() << "FileSourceGui::configureFileName: " << m_fileName.toStdString().c_str();
284  m_amMod->getInputMessageQueue()->push(message);
285 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
QString m_fileName
Definition: ammodgui.h:72
static MsgConfigureFileSourceName * create(const QString &fileName)
Definition: ammod.h:104
AMMod * m_amMod
Definition: ammodgui.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

AMModGUI * AMModGUI::create ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSource channelTx 
)
static

Definition at line 39 of file ammodgui.cpp.

References AMModGUI().

Referenced by AMModPlugin::createTxChannelGUI().

40 {
41  AMModGUI* gui = new AMModGUI(pluginAPI, deviceUISet, channelTx);
42  return gui;
43 }
AMModGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=0)
Definition: ammodgui.cpp:324
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 82 of file ammodgui.cpp.

References applySettings(), AMModSettings::deserialize(), displaySettings(), m_settings, and resetToDefaults().

83 {
84  if(m_settings.deserialize(data)) {
86  applySettings(true);
87  return true;
88  } else {
90  return false;
91  }
92 }
bool deserialize(const QByteArray &data)
void resetToDefaults()
Definition: ammodgui.cpp:70
void displaySettings()
Definition: ammodgui.cpp:417
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ destroy()

void AMModGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 45 of file ammodgui.cpp.

46 {
47  delete this;
48 }

◆ displaySettings()

void AMModGUI::displaySettings ( )
private

Definition at line 417 of file ammodgui.cpp.

References arg(), blockApplySettings(), ChannelMarker::getCenterFrequency(), ChannelMarker::getTitle(), m_channelMarker, AMModSettings::m_channelMute, AMModSettings::m_feedbackAudioEnable, AMModSettings::m_feedbackVolumeFactor, AMModSettings::m_inputFrequencyOffset, AMModSettings::m_modAFInput, AMModSettings::m_modFactor, AMModSettings::m_playLoop, AMModSettings::m_rfBandwidth, AMModSettings::m_rgbColor, m_settings, AMModSettings::m_title, AMModSettings::m_toneFrequency, AMModSettings::m_volumeFactor, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), and ui.

Referenced by AMModGUI(), deserialize(), handleMessage(), and resetToDefaults().

418 {
419  m_channelMarker.blockSignals(true);
423  m_channelMarker.blockSignals(false);
424  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
425 
427  setWindowTitle(m_channelMarker.getTitle());
428 
429  blockApplySettings(true);
430 
431  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
432 
433  ui->rfBW->setValue(roundf(m_settings.m_rfBandwidth / 100.0));
434  ui->rfBWText->setText(QString("%1 kHz").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1));
435 
436  int modPercent = roundf(m_settings.m_modFactor * 100.0);
437  ui->modPercent->setValue(modPercent);
438  ui->modPercentText->setText(QString("%1").arg(modPercent));
439 
440  ui->toneFrequency->setValue(roundf(m_settings.m_toneFrequency / 10.0));
441  ui->toneFrequencyText->setText(QString("%1k").arg(m_settings.m_toneFrequency / 1000.0, 0, 'f', 2));
442 
443  ui->volume->setValue(roundf(m_settings.m_volumeFactor * 10.0));
444  ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
445 
446  ui->channelMute->setChecked(m_settings.m_channelMute);
447  ui->playLoop->setChecked(m_settings.m_playLoop);
448 
449  ui->tone->setEnabled((m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputTone) || (m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputNone));
450  ui->mic->setEnabled((m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputAudio) || (m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputNone));
451  ui->play->setEnabled((m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputFile) || (m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputNone));
452  ui->morseKeyer->setEnabled((m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputCWTone) || (m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputNone));
453 
454  ui->tone->setChecked(m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputTone);
455  ui->mic->setChecked(m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputAudio);
456  ui->play->setChecked(m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputFile);
457  ui->morseKeyer->setChecked(m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputCWTone);
458 
459  ui->feedbackEnable->setChecked(m_settings.m_feedbackAudioEnable);
460  ui->feedbackVolume->setValue(roundf(m_settings.m_feedbackVolumeFactor * 100.0));
461  ui->feedbackVolumeText->setText(QString("%1").arg(m_settings.m_feedbackVolumeFactor, 0, 'f', 2));
462 
463  blockApplySettings(false);
464 }
void blockApplySettings(bool block)
Definition: ammodgui.cpp:397
float m_feedbackVolumeFactor
Definition: ammodsettings.h:48
int getCenterFrequency() const
Definition: channelmarker.h:42
bool m_feedbackAudioEnable
Definition: ammodsettings.h:49
Ui::AMModGUI * ui
Definition: ammodgui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float m_volumeFactor
Definition: ammodsettings.h:40
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
quint32 m_rgbColor
Definition: ammodsettings.h:43
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
void setColor(const QColor &color)
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
float m_toneFrequency
Definition: ammodsettings.h:39
void setCenterFrequency(int centerFrequency)
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void AMModGUI::enterEvent ( QEvent *  )
private

Definition at line 471 of file ammodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

472 {
474 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 AMModGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 60 of file ammodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

60  {
62 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
+ Here is the call graph for this function:

◆ getInputMessageQueue()

virtual MessageQueue* AMModGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 55 of file ammodgui.h.

Referenced by AMModGUI(), and handleSourceMessages().

55 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: ammodgui.h:78
+ Here is the caller graph for this function:

◆ getName()

QString AMModGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 55 of file ammodgui.cpp.

56 {
57  return objectName();
58 }

◆ handleMessage()

bool AMModGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 94 of file ammodgui.cpp.

References blockApplySettings(), displaySettings(), AMMod::MsgConfigureAMMod::getSettings(), CWKeyer::MsgConfigureCWKeyer::getSettings(), m_recordLength, m_recordSampleRate, m_samplesCount, m_settings, Message::match(), ui, updateWithStreamData(), and updateWithStreamTime().

Referenced by handleSourceMessages().

95 {
97  {
98  m_recordSampleRate = ((AMMod::MsgReportFileSourceStreamData&)message).getSampleRate();
99  m_recordLength = ((AMMod::MsgReportFileSourceStreamData&)message).getRecordLength();
100  m_samplesCount = 0;
102  return true;
103  }
105  {
106  m_samplesCount = ((AMMod::MsgReportFileSourceStreamTiming&)message).getSamplesCount();
108  return true;
109  }
110  else if (AMMod::MsgConfigureAMMod::match(message))
111  {
112  const AMMod::MsgConfigureAMMod& cfg = (AMMod::MsgConfigureAMMod&) message;
113  m_settings = cfg.getSettings();
114  blockApplySettings(true);
115  displaySettings();
116  blockApplySettings(false);
117  return true;
118  }
119  else if (CWKeyer::MsgConfigureCWKeyer::match(message))
120  {
122  ui->cwKeyerGUI->setSettings(cfg.getSettings());
123  ui->cwKeyerGUI->displaySettings();
124  return true;
125  }
126  else
127  {
128  return false;
129  }
130 }
int m_samplesCount
Definition: ammodgui.h:75
void blockApplySettings(bool block)
Definition: ammodgui.cpp:397
const AMModSettings & getSettings() const
Definition: ammod.h:55
void updateWithStreamData()
Definition: ammodgui.cpp:515
void updateWithStreamTime()
Definition: ammodgui.cpp:524
Ui::AMModGUI * ui
Definition: ammodgui.h:62
int m_recordSampleRate
Definition: ammodgui.h:74
quint32 m_recordLength
Definition: ammodgui.h:73
void displaySettings()
Definition: ammodgui.cpp:417
static bool match(const Message *message)
Definition: message.cpp:45
AMModSettings m_settings
Definition: ammodgui.h:66
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleSourceMessages

void AMModGUI::handleSourceMessages ( )
privateslot

Definition at line 139 of file ammodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by AMModGUI().

140 {
141  Message* message;
142 
143  while ((message = getInputMessageQueue()->pop()) != 0)
144  {
145  if (handleMessage(*message))
146  {
147  delete message;
148  }
149  }
150 }
virtual MessageQueue * getInputMessageQueue()
Definition: ammodgui.h:55
virtual bool handleMessage(const Message &message)
Definition: ammodgui.cpp:94
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void AMModGUI::leaveEvent ( QEvent *  )
private

Definition at line 466 of file ammodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

467 {
469 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
+ Here is the call graph for this function:

◆ on_channelMute_toggled

void AMModGUI::on_channelMute_toggled ( bool  checked)
privateslot

Definition at line 189 of file ammodgui.cpp.

References applySettings(), AMModSettings::m_channelMute, and m_settings.

190 {
191  m_settings.m_channelMute = checked;
192  applySettings();
193 }
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void AMModGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 152 of file ammodgui.cpp.

References applySettings(), m_channelMarker, AMModSettings::m_inputFrequencyOffset, m_settings, and ChannelMarker::setCenterFrequency().

153 {
156  applySettings();
157 }
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
void setCenterFrequency(int centerFrequency)
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_feedbackEnable_toggled

void AMModGUI::on_feedbackEnable_toggled ( bool  checked)
privateslot

Definition at line 239 of file ammodgui.cpp.

References applySettings(), AMModSettings::m_feedbackAudioEnable, and m_settings.

240 {
242  applySettings();
243 }
bool m_feedbackAudioEnable
Definition: ammodsettings.h:49
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_feedbackVolume_valueChanged

void AMModGUI::on_feedbackVolume_valueChanged ( int  value)
privateslot

Definition at line 245 of file ammodgui.cpp.

References applySettings(), arg(), AMModSettings::m_feedbackVolumeFactor, m_settings, and ui.

246 {
247  ui->feedbackVolumeText->setText(QString("%1").arg(value / 100.0, 0, 'f', 2));
248  m_settings.m_feedbackVolumeFactor = value / 100.0;
249  applySettings();
250 }
float m_feedbackVolumeFactor
Definition: ammodsettings.h:48
Ui::AMModGUI * ui
Definition: ammodgui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_mic_toggled

void AMModGUI::on_mic_toggled ( bool  checked)
privateslot

Definition at line 230 of file ammodgui.cpp.

References AMModSettings::AMModInputAudio, AMModSettings::AMModInputNone, applySettings(), AMModSettings::m_modAFInput, m_settings, and ui.

231 {
232  ui->play->setEnabled(!checked); // release other source inputs
233  ui->morseKeyer->setEnabled(!checked);
234  ui->tone->setEnabled(!checked); // release other source inputs
236  applySettings();
237 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_modPercent_valueChanged

void AMModGUI::on_modPercent_valueChanged ( int  value)
privateslot

Definition at line 167 of file ammodgui.cpp.

References applySettings(), arg(), AMModSettings::m_modFactor, m_settings, and ui.

168 {
169  ui->modPercentText->setText(QString("%1").arg(value));
170  m_settings.m_modFactor = value / 100.0;
171  applySettings();
172 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_morseKeyer_toggled

void AMModGUI::on_morseKeyer_toggled ( bool  checked)
privateslot

Definition at line 221 of file ammodgui.cpp.

References AMModSettings::AMModInputCWTone, AMModSettings::AMModInputNone, applySettings(), AMModSettings::m_modAFInput, m_settings, and ui.

222 {
223  ui->play->setEnabled(!checked); // release other source inputs
224  ui->tone->setEnabled(!checked); // release other source inputs
225  ui->mic->setEnabled(!checked);
227  applySettings();
228 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_navTimeSlider_valueChanged

void AMModGUI::on_navTimeSlider_valueChanged ( int  value)
privateslot

Definition at line 252 of file ammodgui.cpp.

References AMMod::MsgConfigureFileSourceSeek::create(), BasebandSampleSource::getInputMessageQueue(), m_amMod, m_enableNavTime, m_recordLength, and MessageQueue::push().

253 {
254  if (m_enableNavTime && ((value >= 0) && (value <= 100)))
255  {
256  int t_sec = (m_recordLength * value) / 100;
257  QTime t(0, 0, 0, 0);
258  t = t.addSecs(t_sec);
259 
261  m_amMod->getInputMessageQueue()->push(message);
262  }
263 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
bool m_enableNavTime
Definition: ammodgui.h:77
quint32 m_recordLength
Definition: ammodgui.h:73
AMMod * m_amMod
Definition: ammodgui.h:69
static MsgConfigureFileSourceSeek * create(int seekPercentage)
Definition: ammod.h:125
+ Here is the call graph for this function:

◆ on_play_toggled

void AMModGUI::on_play_toggled ( bool  checked)
privateslot

Definition at line 201 of file ammodgui.cpp.

References AMModSettings::AMModInputFile, AMModSettings::AMModInputNone, applySettings(), m_enableNavTime, AMModSettings::m_modAFInput, m_settings, and ui.

202 {
203  ui->tone->setEnabled(!checked); // release other source inputs
204  ui->morseKeyer->setEnabled(!checked);
205  ui->mic->setEnabled(!checked);
207  applySettings();
208  ui->navTimeSlider->setEnabled(!checked);
209  m_enableNavTime = !checked;
210 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
bool m_enableNavTime
Definition: ammodgui.h:77
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_playLoop_toggled

void AMModGUI::on_playLoop_toggled ( bool  checked)
privateslot

Definition at line 195 of file ammodgui.cpp.

References applySettings(), AMModSettings::m_playLoop, and m_settings.

196 {
197  m_settings.m_playLoop = checked;
198  applySettings();
199 }
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_rfBW_valueChanged

void AMModGUI::on_rfBW_valueChanged ( int  value)
privateslot

Definition at line 159 of file ammodgui.cpp.

References applySettings(), arg(), m_channelMarker, AMModSettings::m_rfBandwidth, m_settings, ChannelMarker::setBandwidth(), and ui.

160 {
161  ui->rfBWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
162  m_settings.m_rfBandwidth = value * 100.0;
163  m_channelMarker.setBandwidth(value * 100);
164  applySettings();
165 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
void setBandwidth(int bandwidth)
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_showFileDialog_clicked

void AMModGUI::on_showFileDialog_clicked ( bool  checked)
privateslot

Definition at line 265 of file ammodgui.cpp.

References configureFileName(), m_fileName, and ui.

266 {
267  (void) checked;
268  QString fileName = QFileDialog::getOpenFileName(this,
269  tr("Open raw audio file"), ".", tr("Raw audio Files (*.raw)"), 0, QFileDialog::DontUseNativeDialog);
270 
271  if (fileName != "")
272  {
273  m_fileName = fileName;
274  ui->recordFileText->setText(m_fileName);
275  ui->play->setEnabled(true);
277  }
278 }
void configureFileName()
Definition: ammodgui.cpp:280
Ui::AMModGUI * ui
Definition: ammodgui.h:62
QString m_fileName
Definition: ammodgui.h:72
+ Here is the call graph for this function:

◆ on_tone_toggled

void AMModGUI::on_tone_toggled ( bool  checked)
privateslot

Definition at line 212 of file ammodgui.cpp.

References AMModSettings::AMModInputNone, AMModSettings::AMModInputTone, applySettings(), AMModSettings::m_modAFInput, m_settings, and ui.

213 {
214  ui->play->setEnabled(!checked); // release other source inputs
215  ui->morseKeyer->setEnabled(!checked);
216  ui->mic->setEnabled(!checked);
218  applySettings();
219 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_toneFrequency_valueChanged

void AMModGUI::on_toneFrequency_valueChanged ( int  value)
privateslot

Definition at line 181 of file ammodgui.cpp.

References applySettings(), arg(), m_settings, AMModSettings::m_toneFrequency, and ui.

182 {
183  ui->toneFrequencyText->setText(QString("%1k").arg(value / 100.0, 0, 'f', 2));
184  m_settings.m_toneFrequency = value * 10.0;
185  applySettings();
186 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
float m_toneFrequency
Definition: ammodsettings.h:39
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void AMModGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 174 of file ammodgui.cpp.

References applySettings(), arg(), m_settings, AMModSettings::m_volumeFactor, and ui.

175 {
176  ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
177  m_settings.m_volumeFactor = value / 10.0;
178  applySettings();
179 }
Ui::AMModGUI * ui
Definition: ammodgui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float m_volumeFactor
Definition: ammodsettings.h:40
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ onMenuDialogCalled

void AMModGUI::onMenuDialogCalled ( const QPoint &  p)
privateslot

Definition at line 293 of file ammodgui.cpp.

References applySettings(), RollupWidget::ContextMenuChannelSettings, ChannelMarker::getCenterFrequency(), ChannelMarker::getColor(), BasicChannelSettingsDialog::getReverseAPIAddress(), BasicChannelSettingsDialog::getReverseAPIChannelIndex(), BasicChannelSettingsDialog::getReverseAPIDeviceIndex(), BasicChannelSettingsDialog::getReverseAPIPort(), ChannelMarker::getTitle(), m_channelMarker, RollupWidget::m_contextMenuType, AMModSettings::m_inputFrequencyOffset, AMModSettings::m_reverseAPIAddress, AMModSettings::m_reverseAPIChannelIndex, AMModSettings::m_reverseAPIDeviceIndex, AMModSettings::m_reverseAPIPort, AMModSettings::m_rgbColor, m_settings, AMModSettings::m_title, AMModSettings::m_useReverseAPI, RollupWidget::resetContextMenuType(), BasicChannelSettingsDialog::setReverseAPIAddress(), BasicChannelSettingsDialog::setReverseAPIChannelIndex(), BasicChannelSettingsDialog::setReverseAPIDeviceIndex(), BasicChannelSettingsDialog::setReverseAPIPort(), RollupWidget::setTitleColor(), BasicChannelSettingsDialog::setUseReverseAPI(), and BasicChannelSettingsDialog::useReverseAPI().

Referenced by AMModGUI().

294 {
296  {
298  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
299  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
300  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
301  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
302  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
303  dialog.move(p);
304  dialog.exec();
305 
309  m_settings.m_useReverseAPI = dialog.useReverseAPI();
310  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
311  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
312  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
313  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
314 
315  setWindowTitle(m_settings.m_title);
317 
318  applySettings();
319  }
320 
322 }
int getCenterFrequency() const
Definition: channelmarker.h:42
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
void resetContextMenuType()
Definition: rollupwidget.h:50
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
quint32 m_rgbColor
Definition: ammodsettings.h:43
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
bool m_useReverseAPI
Definition: ammodsettings.h:50
const QColor & getColor() const
Definition: channelmarker.h:64
AMModSettings m_settings
Definition: ammodgui.h:66
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

void AMModGUI::onWidgetRolled ( QWidget *  widget,
bool  rollDown 
)
privateslot

Definition at line 287 of file ammodgui.cpp.

Referenced by AMModGUI().

288 {
289  (void) widget;
290  (void) rollDown;
291 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void AMModGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 70 of file ammodgui.cpp.

References applySettings(), displaySettings(), m_settings, and AMModSettings::resetToDefaults().

Referenced by deserialize().

71 {
74  applySettings(true);
75 }
void resetToDefaults()
void displaySettings()
Definition: ammodgui.cpp:417
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray AMModGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 77 of file ammodgui.cpp.

References m_settings, and AMModSettings::serialize().

78 {
79  return m_settings.serialize();
80 }
QByteArray serialize() const
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:

◆ setCenterFrequency()

void AMModGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 64 of file ammodgui.cpp.

References applySettings(), m_channelMarker, and ChannelMarker::setCenterFrequency().

65 {
66  m_channelMarker.setCenterFrequency(centerFrequency);
67  applySettings();
68 }
ChannelMarker m_channelMarker
Definition: ammodgui.h:65
void applySettings(bool force=false)
Definition: ammodgui.cpp:402
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 50 of file ammodgui.cpp.

51 {
52  setObjectName(name);
53 }

◆ tick

void AMModGUI::tick ( )
privateslot

Definition at line 502 of file ammodgui.cpp.

References AMModSettings::AMModInputFile, arg(), AMMod::MsgConfigureFileSourceStreamTiming::create(), CalcDb::dbPower(), BasebandSampleSource::getInputMessageQueue(), AMMod::getMagSq(), m_amMod, m_channelPowerDbAvg, AMModSettings::m_modAFInput, m_settings, m_tickCount, MessageQueue::push(), and ui.

Referenced by AMModGUI().

503 {
504  double powDb = CalcDb::dbPower(m_amMod->getMagSq());
505  m_channelPowerDbAvg(powDb);
506  ui->channelPower->setText(tr("%1 dB").arg(m_channelPowerDbAvg.asDouble(), 0, 'f', 1));
507 
509  {
511  m_amMod->getInputMessageQueue()->push(message);
512  }
513 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
Ui::AMModGUI * ui
Definition: ammodgui.h:62
static MsgConfigureFileSourceStreamTiming * create()
Definition: ammod.h:144
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
Definition: ammodgui.h:70
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
double getMagSq() const
Definition: ammod.h:245
std::size_t m_tickCount
Definition: ammodgui.h:76
AMMod * m_amMod
Definition: ammodgui.h:69
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
double asDouble() const
Definition: movingaverage.h:57
AMModSettings m_settings
Definition: ammodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateWithStreamData()

void AMModGUI::updateWithStreamData ( )
private

Definition at line 515 of file ammodgui.cpp.

References m_recordLength, ui, and updateWithStreamTime().

Referenced by handleMessage().

516 {
517  QTime recordLength(0, 0, 0, 0);
518  recordLength = recordLength.addSecs(m_recordLength);
519  QString s_time = recordLength.toString("HH:mm:ss");
520  ui->recordLengthText->setText(s_time);
522 }
void updateWithStreamTime()
Definition: ammodgui.cpp:524
Ui::AMModGUI * ui
Definition: ammodgui.h:62
quint32 m_recordLength
Definition: ammodgui.h:73
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateWithStreamTime()

void AMModGUI::updateWithStreamTime ( )
private

Definition at line 524 of file ammodgui.cpp.

References m_enableNavTime, m_recordLength, m_recordSampleRate, m_samplesCount, and ui.

Referenced by handleMessage(), and updateWithStreamData().

525 {
526  int t_sec = 0;
527  int t_msec = 0;
528 
529  if (m_recordSampleRate > 0)
530  {
531  t_msec = ((m_samplesCount * 1000) / m_recordSampleRate) % 1000;
533  }
534 
535  QTime t(0, 0, 0, 0);
536  t = t.addSecs(t_sec);
537  t = t.addMSecs(t_msec);
538  QString s_timems = t.toString("HH:mm:ss.zzz");
539  QString s_time = t.toString("HH:mm:ss");
540  ui->relTimeText->setText(s_timems);
541 
542  if (!m_enableNavTime)
543  {
544  float posRatio = (float) t_sec / (float) m_recordLength;
545  ui->navTimeSlider->setValue((int) (posRatio * 100.0));
546  }
547 }
int m_samplesCount
Definition: ammodgui.h:75
Ui::AMModGUI * ui
Definition: ammodgui.h:62
bool m_enableNavTime
Definition: ammodgui.h:77
int m_recordSampleRate
Definition: ammodgui.h:74
quint32 m_recordLength
Definition: ammodgui.h:73
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_amMod

AMMod* AMModGUI::m_amMod
private

◆ m_channelMarker

ChannelMarker AMModGUI::m_channelMarker
private

◆ m_channelPowerDbAvg

MovingAverageUtil<double, double, 20> AMModGUI::m_channelPowerDbAvg
private

Definition at line 70 of file ammodgui.h.

Referenced by tick().

◆ m_deviceUISet

DeviceUISet* AMModGUI::m_deviceUISet
private

Definition at line 64 of file ammodgui.h.

Referenced by AMModGUI(), and ~AMModGUI().

◆ m_doApplySettings

bool AMModGUI::m_doApplySettings
private

Definition at line 67 of file ammodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_enableNavTime

bool AMModGUI::m_enableNavTime
private

Definition at line 77 of file ammodgui.h.

Referenced by on_navTimeSlider_valueChanged(), on_play_toggled(), and updateWithStreamTime().

◆ m_fileName

QString AMModGUI::m_fileName
private

Definition at line 72 of file ammodgui.h.

Referenced by configureFileName(), and on_showFileDialog_clicked().

◆ m_inputMessageQueue

MessageQueue AMModGUI::m_inputMessageQueue
private

Definition at line 78 of file ammodgui.h.

◆ m_pluginAPI

PluginAPI* AMModGUI::m_pluginAPI
private

Definition at line 63 of file ammodgui.h.

◆ m_recordLength

quint32 AMModGUI::m_recordLength
private

◆ m_recordSampleRate

int AMModGUI::m_recordSampleRate
private

Definition at line 74 of file ammodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_samplesCount

int AMModGUI::m_samplesCount
private

Definition at line 75 of file ammodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_settings

AMModSettings AMModGUI::m_settings
private

◆ m_tickCount

std::size_t AMModGUI::m_tickCount
private

Definition at line 76 of file ammodgui.h.

Referenced by tick().

◆ ui

Ui::AMModGUI* AMModGUI::ui
private

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