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

#include <atvdemodgui.h>

+ Inheritance diagram for ATVDemodGUI:
+ Collaboration diagram for ATVDemodGUI:

Public Slots

void channelMarkerChangedByCursor ()
 
void channelMarkerHighlightedByCursor ()
 

Public Member Functions

virtual void destroy ()
 
void setName (const QString &strName)
 
QString getName () const
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 intCenterFrequency)
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &arrData)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &objMessage)
 
- 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 ATVDemodGUIcreate (PluginAPI *objPluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
 

Private Slots

void handleSourceMessages ()
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void tick ()
 
void on_synchLevel_valueChanged (int value)
 
void on_blackLevel_valueChanged (int value)
 
void on_lineTime_valueChanged (int value)
 
void on_topTime_valueChanged (int value)
 
void on_hSync_clicked ()
 
void on_vSync_clicked ()
 
void on_invertVideo_clicked ()
 
void on_halfImage_clicked ()
 
void on_modulation_currentIndexChanged (int index)
 
void on_nbLines_currentIndexChanged (int index)
 
void on_fps_currentIndexChanged (int index)
 
void on_standard_currentIndexChanged (int index)
 
void on_reset_clicked (bool checked)
 
void on_rfBW_valueChanged (int value)
 
void on_rfOppBW_valueChanged (int value)
 
void on_rfFiltering_toggled (bool checked)
 
void on_decimatorEnable_toggled (bool checked)
 
void on_deltaFrequency_changed (qint64 value)
 
void on_bfo_valueChanged (int value)
 
void on_fmDeviation_valueChanged (int value)
 
void on_screenTabWidget_currentChanged (int index)
 

Private Member Functions

 ATVDemodGUI (PluginAPI *objPluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *objParent=0)
 
virtual ~ATVDemodGUI ()
 
void blockApplySettings (bool blnBlock)
 
void applySettings ()
 
void applyRFSettings ()
 
void setChannelMarkerBandwidth ()
 
void setRFFiltersSlidersRange (int sampleRate)
 
void lineTimeUpdate ()
 
void topTimeUpdate ()
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Static Private Member Functions

static float getFps (int fpsIndex)
 
static float getNominalLineTime (int nbLinesIndex, int fpsIndex)
 
static int getNumberOfLines (int nbLinesIndex)
 

Private Attributes

Ui::ATVDemodGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
ATVDemodm_atvDemod
 
bool m_blnDoApplySettings
 
MovingAverageUtil< double, double, 4 > m_objMagSqAverage
 
int m_intTickCount
 
ScopeVism_scopeVis
 
float m_fltLineTimeMultiplier
 
float m_fltTopTimeMultiplier
 
int m_rfSliderDivisor
 
int m_inputSampleRate
 
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 39 of file atvdemodgui.h.

Constructor & Destructor Documentation

◆ ATVDemodGUI()

ATVDemodGUI::ATVDemodGUI ( PluginAPI objPluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSink rxChannel,
QWidget *  objParent = 0 
)
explicitprivate

Definition at line 272 of file atvdemodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), arg(), channelMarkerChangedByCursor(), channelMarkerHighlightedByCursor(), ChannelMarker::getColor(), getInputMessageQueue(), BasebandSampleSink::getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleSourceMessages(), ScopeVis::TraceData::m_amp, ScopeVis::TraceData::m_ampIndex, m_atvDemod, ATVDemod::m_channelIdURI, m_channelMarker, m_deviceUISet, ScopeVis::TraceData::m_ofs, ScopeVis::TraceData::m_ofsCoarse, m_scopeVis, ScopeVis::TriggerData::m_triggerLevel, ScopeVis::TriggerData::m_triggerLevelCoarse, ScopeVis::TriggerData::m_triggerPositiveEdge, onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), resetToDefaults(), ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), BasebandSampleSink::setMessageQueueToGUI(), ATVDemod::setScopeSink(), RollupWidget::setTitleColor(), ATVDemod::setTVScreen(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

272  :
273  RollupWidget(objParent),
274  ui(new Ui::ATVDemodGUI),
275  m_pluginAPI(objPluginAPI),
276  m_deviceUISet(deviceUISet),
277  m_channelMarker(this),
278  m_blnDoApplySettings(true),
279  m_intTickCount(0),
280  m_inputSampleRate(48000)
281 {
282  ui->setupUi(this);
283  ui->screenTV->setColor(false);
284  setAttribute(Qt::WA_DeleteOnClose, true);
285  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
286 
287  m_scopeVis = new ScopeVis(ui->glScope);
288  m_atvDemod = (ATVDemod*) rxChannel; //new ATVDemod(m_deviceUISet->m_deviceSourceAPI);
291  m_atvDemod->setTVScreen(ui->screenTV);
292 
293  ui->glScope->connectTimer(MainWindow::getInstance()->getMasterTimer());
294  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
295 
296  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
297  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
298  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
299 
300  m_channelMarker.blockSignals(true);
301  m_channelMarker.setColor(Qt::white);
302  m_channelMarker.setBandwidth(6000000);
304  m_channelMarker.blockSignals(false);
305  m_channelMarker.setVisible(true); // activate signal on the last setting only
306 
308 
312 
313  ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
314 
315  resetToDefaults(); // does applySettings()
316 
317  ui->scopeGUI->setPreTrigger(1);
318  ScopeVis::TraceData traceData;
319  traceData.m_amp = 2.0; // amplification factor
320  traceData.m_ampIndex = 1; // this is second step
321  traceData.m_ofs = 0.5; // direct offset
322  traceData.m_ofsCoarse = 50; // this is 50 coarse steps
323  ui->scopeGUI->changeTrace(0, traceData);
324  ui->scopeGUI->focusOnTrace(0); // re-focus to take changes into account in the GUI
325  ScopeVis::TriggerData triggerData;
326  triggerData.m_triggerLevel = 0.1;
327  triggerData.m_triggerLevelCoarse = 10;
328  triggerData.m_triggerPositiveEdge = false;
329  ui->scopeGUI->changeTrigger(0, triggerData);
330  ui->scopeGUI->focusOnTrigger(0); // re-focus to take changes into account in the GUI
331 
332  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
333  connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
334  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
335 
336  QChar delta = QChar(0x94, 0x03);
337  ui->fmDeviationLabel->setText(delta);
338 }
static MainWindow * getInstance()
Definition: mainwindow.h:73
bool m_triggerPositiveEdge
Trigger on the positive edge (else negative)
Definition: scopevis.h:107
DeviceUISet * m_deviceUISet
Definition: atvdemodgui.h:65
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
void channelMarkerChangedByCursor()
PluginAPI * m_pluginAPI
Definition: atvdemodgui.h:64
int m_inputSampleRate
Definition: atvdemodgui.h:79
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
static const QString m_channelIdURI
Definition: atvdemod.h:252
void channelMarkerHighlightedByCursor()
int m_intTickCount
Definition: atvdemodgui.h:72
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
void onWidgetRolled(QWidget *widget, bool rollDown)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
virtual void setMessageQueueToGUI(MessageQueue *queue)
virtual MessageQueue * getInputMessageQueue()
Definition: atvdemodgui.h:55
void setTitleColor(const QColor &c)
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:82
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
Real m_triggerLevel
Level in real units.
Definition: scopevis.h:104
ScopeVis * m_scopeVis
Definition: atvdemodgui.h:74
float m_amp
Amplification factor.
Definition: scopevis.h:52
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
void setColor(const QColor &color)
void handleSourceMessages()
void setVisible(bool visible)
void setScopeSink(BasebandSampleSink *scopeSink)
Definition: atvdemod.h:198
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
void setBandwidth(int bandwidth)
void setTVScreen(TVScreen *objScreen)
set by the GUI
Definition: atvdemod.cpp:109
const QColor & getColor() const
Definition: channelmarker.h:64
void setCenterFrequency(int centerFrequency)
void resetToDefaults()
Definition: atvdemodgui.cpp:72
uint32_t m_ampIndex
Index in list of amplification factors.
Definition: scopevis.h:53
void widgetRolled(QWidget *widget, bool rollDown)
bool m_blnDoApplySettings
Definition: atvdemodgui.h:69
float m_ofs
Offset factor.
Definition: scopevis.h:54
int m_ofsCoarse
Coarse offset slider value.
Definition: scopevis.h:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~ATVDemodGUI()

ATVDemodGUI::~ATVDemodGUI ( )
privatevirtual

Definition at line 340 of file atvdemodgui.cpp.

References m_atvDemod, m_deviceUISet, m_scopeVis, DeviceUISet::removeRxChannelInstance(), and ui.

341 {
343  delete m_atvDemod; // TODO: check this: when the GUI closes it has to delete the demodulator
344  delete m_scopeVis;
345  delete ui;
346 }
DeviceUISet * m_deviceUISet
Definition: atvdemodgui.h:65
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
ScopeVis * m_scopeVis
Definition: atvdemodgui.h:74
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
+ Here is the call graph for this function:

Member Function Documentation

◆ applyRFSettings()

void ATVDemodGUI::applyRFSettings ( )
private

Definition at line 381 of file atvdemodgui.cpp.

References ATVDemod::configureRF(), ChannelMarker::getCenterFrequency(), BasebandSampleSink::getInputMessageQueue(), m_atvDemod, m_blnDoApplySettings, m_channelMarker, m_rfSliderDivisor, and ui.

Referenced by channelMarkerChangedByCursor(), handleMessage(), on_bfo_valueChanged(), on_decimatorEnable_toggled(), on_deltaFrequency_changed(), on_fmDeviation_valueChanged(), on_modulation_currentIndexChanged(), on_rfBW_valueChanged(), on_rfFiltering_toggled(), and on_rfOppBW_valueChanged().

382 {
384  {
387  (ATVDemod::ATVModulation) ui->modulation->currentIndex(),
388  ui->rfBW->value() * m_rfSliderDivisor * 1.0f,
389  ui->rfOppBW->value() * m_rfSliderDivisor * 1.0f,
390  ui->rfFiltering->isChecked(),
391  ui->decimatorEnable->isChecked(),
392  ui->bfo->value(),
393  ui->fmDeviation->value() / 500.0f);
394  }
395 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void configureRF(MessageQueue *objMessageQueue, int64_t frequencyOffset, ATVModulation enmModulation, float fltRFBandwidth, float fltRFOppBandwidth, bool blnFFTFiltering, bool blndecimatorEnable, float fltBFOFrequency, float fmDeviation)
Definition: atvdemod.cpp:145
ATVModulation
Definition: atvdemod.h:63
int m_rfSliderDivisor
Definition: atvdemodgui.h:78
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
bool m_blnDoApplySettings
Definition: atvdemodgui.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

void ATVDemodGUI::applySettings ( )
private

Definition at line 353 of file atvdemodgui.cpp.

References ATVDemod::configure(), ATVDemod::MsgConfigureChannelizer::create(), ChannelMarker::getCenterFrequency(), getFps(), BasebandSampleSink::getInputMessageQueue(), getNominalLineTime(), getNumberOfLines(), ATVDemod::getSampleRate(), m_atvDemod, m_blnDoApplySettings, m_channelMarker, m_fltLineTimeMultiplier, m_fltTopTimeMultiplier, m_inputSampleRate, MessageQueue::push(), and ui.

Referenced by channelMarkerChangedByCursor(), deserialize(), handleMessage(), on_blackLevel_valueChanged(), on_fps_currentIndexChanged(), on_halfImage_clicked(), on_hSync_clicked(), on_invertVideo_clicked(), on_lineTime_valueChanged(), on_nbLines_currentIndexChanged(), on_screenTabWidget_currentChanged(), on_standard_currentIndexChanged(), on_synchLevel_valueChanged(), on_topTime_valueChanged(), on_vSync_clicked(), resetToDefaults(), and setCenterFrequency().

354 {
356  {
359  m_atvDemod->getInputMessageQueue()->push(msgChan);
360 
362  getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex()) + ui->lineTime->value() * m_fltLineTimeMultiplier,
363  getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex()) * (4.7f / 64.0f) + ui->topTime->value() * m_fltTopTimeMultiplier,
364  getFps(ui->fps->currentIndex()),
365  (ATVDemod::ATVStd) ui->standard->currentIndex(),
366  getNumberOfLines(ui->nbLines->currentIndex()),
367  (ui->halfImage->checkState() == Qt::Checked) ? 0.5f : 1.0f,
368  ui->synchLevel->value() / 1000.0f,
369  ui->blackLevel->value() / 1000.0f,
370  ui->hSync->isChecked(),
371  ui->vSync->isChecked(),
372  ui->invertVideo->isChecked(),
373  ui->screenTabWidget->currentIndex());
374 
375  qDebug() << "ATVDemodGUI::applySettings:"
376  << " m_objChannelizer.inputSampleRate: " << m_inputSampleRate
377  << " m_objATVDemod.sampleRate: " << m_atvDemod->getSampleRate();
378  }
379 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
void push(Message *message, bool emitSignal=true)
Push message onto queue.
int m_inputSampleRate
Definition: atvdemodgui.h:79
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void configure(MessageQueue *objMessageQueue, float fltLineDurationUs, float fltTopDurationUs, float fltFramePerS, ATVStd enmATVStandard, int intNumberOfLines, float fltRatioOfRowsToDisplay, float fltVoltLevelSynchroTop, float fltVoltLevelSynchroBlack, bool blnHSync, bool blnVSync, bool blnInvertVideo, int intVideoTabIndex)
Definition: atvdemod.cpp:114
static float getNominalLineTime(int nbLinesIndex, int fpsIndex)
int getSampleRate()
Definition: atvdemod.cpp:736
float m_fltLineTimeMultiplier
Definition: atvdemodgui.h:76
static float getFps(int fpsIndex)
float m_fltTopTimeMultiplier
Definition: atvdemodgui.h:77
static MsgConfigureChannelizer * create(int centerFrequency)
Definition: atvdemod.h:137
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
bool m_blnDoApplySettings
Definition: atvdemodgui.h:69
static int getNumberOfLines(int nbLinesIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void ATVDemodGUI::blockApplySettings ( bool  blnBlock)
private

Definition at line 348 of file atvdemodgui.cpp.

References m_blnDoApplySettings.

Referenced by deserialize(), and resetToDefaults().

349 {
350  m_blnDoApplySettings = !blnBlock;
351 }
bool m_blnDoApplySettings
Definition: atvdemodgui.h:69
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void ATVDemodGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 239 of file atvdemodgui.cpp.

References applyRFSettings(), applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, and ui.

Referenced by ATVDemodGUI().

240 {
241  qDebug("ATVDemodGUI::channelMarkerChangedByCursor");
242  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
243 
244  applySettings();
245  applyRFSettings();
246 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
void applyRFSettings()
void applySettings()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerHighlightedByCursor

void ATVDemodGUI::channelMarkerHighlightedByCursor ( )
slot

Definition at line 248 of file atvdemodgui.cpp.

References ChannelMarker::getHighlighted(), m_channelMarker, and RollupWidget::setHighlighted().

Referenced by ATVDemodGUI().

249 {
251 }
bool getHighlighted() const
Definition: channelmarker.h:61
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ATVDemodGUI * ATVDemodGUI::create ( PluginAPI objPluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSink rxChannel 
)
static

Definition at line 38 of file atvdemodgui.cpp.

References ATVDemodGUI().

Referenced by ATVDemodPlugin::createRxChannelGUI().

41 {
42  ATVDemodGUI* gui = new ATVDemodGUI(objPluginAPI, deviceUISet, rxChannel);
43  return gui;
44 }
ATVDemodGUI(PluginAPI *objPluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *objParent=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

bool ATVDemodGUI::deserialize ( const QByteArray &  arrData)
virtual

Implements PluginInstanceGUI.

Definition at line 129 of file atvdemodgui.cpp.

References applySettings(), blockApplySettings(), ChannelMarker::emitChangedByAPI(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), lineTimeUpdate(), m_channelMarker, SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), resetToDefaults(), ChannelMarker::setCenterFrequency(), topTimeUpdate(), and ui.

130 {
131  SimpleDeserializer d(arrData);
132 
133  if (!d.isValid())
134  {
135  resetToDefaults();
136  return false;
137  }
138 
139  if (d.getVersion() == 1)
140  {
141  QByteArray bytetmp;
142  int tmp;
143  bool booltmp;
144 
145  blockApplySettings(true);
146  m_channelMarker.blockSignals(true);
147 
148  d.readS32(1, &tmp, 0);
150 
151 // if (d.readU32(2, &u32tmp)) {
152 // m_objChannelMarker.setColor(u32tmp);
153 // } else {
154 // m_objChannelMarker.setColor(Qt::white);
155 // }
156 
157  d.readS32(3, &tmp, 100);
158  ui->synchLevel->setValue(tmp);
159  d.readS32(4, &tmp, 310);
160  ui->blackLevel->setValue(tmp);
161  d.readS32(5, &tmp, 0);
162  ui->lineTime->setValue(tmp);
163  d.readS32(6, &tmp, 3);
164  ui->topTime->setValue(tmp);
165  d.readS32(7, &tmp, 0);
166  ui->modulation->setCurrentIndex(tmp);
167  d.readS32(8, &tmp, 0);
168  ui->fps->setCurrentIndex(tmp);
169  d.readBool(9, &booltmp, true);
170  ui->hSync->setChecked(booltmp);
171  d.readBool(10, &booltmp, true);
172  ui->vSync->setChecked(booltmp);
173  d.readBool(11, &booltmp, false);
174  ui->halfImage->setChecked(booltmp);
175  d.readS32(12, &tmp, 10);
176  ui->rfBW->setValue(tmp);
177  d.readS32(13, &tmp, 10);
178  ui->rfOppBW->setValue(tmp);
179  d.readS32(14, &tmp, 10);
180  ui->bfo->setValue(tmp);
181  d.readBool(15, &booltmp, true);
182  ui->invertVideo->setChecked(booltmp);
183  d.readS32(16, &tmp, 0);
184  ui->nbLines->setCurrentIndex(tmp);
185  d.readS32(17, &tmp, 250);
186  ui->fmDeviation->setValue(tmp);
187  d.readS32(18, &tmp, 1);
188  ui->standard->setCurrentIndex(tmp);
189 
190  blockApplySettings(false);
191  m_channelMarker.blockSignals(false);
193 
194  lineTimeUpdate();
195  topTimeUpdate();
196  applySettings();
197  return true;
198  }
199  else
200  {
201  resetToDefaults();
202  return false;
203  }
204 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
void emitChangedByAPI()
void blockApplySettings(bool blnBlock)
void topTimeUpdate()
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
void applySettings()
void lineTimeUpdate()
void setCenterFrequency(int centerFrequency)
void resetToDefaults()
Definition: atvdemodgui.cpp:72
+ Here is the call graph for this function:

◆ destroy()

void ATVDemodGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 46 of file atvdemodgui.cpp.

47 {
48  delete this;
49 }

◆ enterEvent()

void ATVDemodGUI::enterEvent ( QEvent *  )
private

Definition at line 461 of file atvdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

462 {
464 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 ATVDemodGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 61 of file atvdemodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

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

◆ getFps()

float ATVDemodGUI::getFps ( int  fpsIndex)
staticprivate

Definition at line 678 of file atvdemodgui.cpp.

Referenced by applySettings(), and getNominalLineTime().

679 {
680  switch(fpsIndex)
681  {
682  case 0:
683  return 30.0f;
684  break;
685  case 2:
686  return 20.0f;
687  break;
688  case 3:
689  return 16.0f;
690  break;
691  case 4:
692  return 12.0f;
693  break;
694  case 5:
695  return 10.0f;
696  break;
697  case 6:
698  return 8.0f;
699  break;
700  case 7:
701  return 5.0f;
702  break;
703  case 8:
704  return 2.0f;
705  break;
706  case 9:
707  return 1.0f;
708  break;
709  case 1:
710  default:
711  return 25.0f;
712  break;
713  }
714 }
+ Here is the caller graph for this function:

◆ getInputMessageQueue()

virtual MessageQueue* ATVDemodGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 55 of file atvdemodgui.h.

Referenced by ATVDemodGUI(), and handleSourceMessages().

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

◆ getName()

QString ATVDemodGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 56 of file atvdemodgui.cpp.

57 {
58  return objectName();
59 }

◆ getNominalLineTime()

float ATVDemodGUI::getNominalLineTime ( int  nbLinesIndex,
int  fpsIndex 
)
staticprivate

Definition at line 716 of file atvdemodgui.cpp.

References getFps(), and getNumberOfLines().

Referenced by applySettings(), lineTimeUpdate(), and topTimeUpdate().

717 {
718  float fps = getFps(fpsIndex);
719  int nbLines = getNumberOfLines(nbLinesIndex);
720 
721  return 1.0f / (nbLines * fps);
722 }
static float getFps(int fpsIndex)
static int getNumberOfLines(int nbLinesIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNumberOfLines()

int ATVDemodGUI::getNumberOfLines ( int  nbLinesIndex)
staticprivate

Definition at line 724 of file atvdemodgui.cpp.

Referenced by applySettings(), and getNominalLineTime().

725 {
726  switch(nbLinesIndex)
727  {
728  case 0:
729  return 640;
730  break;
731  case 2:
732  return 525;
733  break;
734  case 3:
735  return 480;
736  break;
737  case 4:
738  return 405;
739  break;
740  case 5:
741  return 360;
742  break;
743  case 6:
744  return 343;
745  break;
746  case 7:
747  return 240;
748  break;
749  case 8:
750  return 180;
751  break;
752  case 9:
753  return 120;
754  break;
755  case 10:
756  return 90;
757  break;
758  case 11:
759  return 60;
760  break;
761  case 12:
762  return 32;
763  break;
764  case 1:
765  default:
766  return 625;
767  break;
768  }
769 }
+ Here is the caller graph for this function:

◆ handleMessage()

bool ATVDemodGUI::handleMessage ( const Message objMessage)
virtual

Implements PluginInstanceGUI.

Definition at line 206 of file atvdemodgui.cpp.

References applyRFSettings(), applySettings(), arg(), ATVDemod::MsgReportChannelSampleRateChanged::getSampleRate(), lineTimeUpdate(), m_inputSampleRate, m_scopeVis, Message::match(), ScopeVis::setLiveRate(), setRFFiltersSlidersRange(), topTimeUpdate(), and ui.

Referenced by handleSourceMessages().

207 {
209  {
210  int sampleRate = ((ATVDemod::MsgReportEffectiveSampleRate&)objMessage).getSampleRate();
211  int nbPointsPerLine = ((ATVDemod::MsgReportEffectiveSampleRate&)objMessage).getNbPointsPerLine();
212  ui->channelSampleRateText->setText(tr("%1k").arg(sampleRate/1000.0f, 0, 'f', 2));
213  ui->nbPointsPerLineText->setText(tr("%1p").arg(nbPointsPerLine));
214  m_scopeVis->setLiveRate(sampleRate);
215  setRFFiltersSlidersRange(sampleRate);
216  lineTimeUpdate();
217  topTimeUpdate();
218 
219  return true;
220  }
222  {
224  m_inputSampleRate = report.getSampleRate();
225 
226  qDebug("ATVDemodGUI::handleMessage: MsgReportChannelSampleRateChanged: %d", m_inputSampleRate);
227 
228  applySettings();
229  applyRFSettings();
230 
231  return true;
232  }
233  else
234  {
235  return false;
236  }
237 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
int m_inputSampleRate
Definition: atvdemodgui.h:79
void setLiveRate(int sampleRate)
Definition: scopevis.cpp:83
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
static bool match(const Message *message)
Definition: message.cpp:45
ScopeVis * m_scopeVis
Definition: atvdemodgui.h:74
void topTimeUpdate()
void applyRFSettings()
void applySettings()
void lineTimeUpdate()
void setRFFiltersSlidersRange(int sampleRate)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleSourceMessages

void ATVDemodGUI::handleSourceMessages ( )
privateslot

Definition at line 253 of file atvdemodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by ATVDemodGUI().

254 {
255  Message* message;
256 
257  while ((message = getInputMessageQueue()->pop()) != 0)
258  {
259  if (handleMessage(*message))
260  {
261  delete message;
262  }
263  }
264 }
virtual bool handleMessage(const Message &objMessage)
virtual MessageQueue * getInputMessageQueue()
Definition: atvdemodgui.h:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void ATVDemodGUI::leaveEvent ( QEvent *  )
private

Definition at line 456 of file atvdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

457 {
459 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
+ Here is the call graph for this function:

◆ lineTimeUpdate()

void ATVDemodGUI::lineTimeUpdate ( )
private

Definition at line 628 of file atvdemodgui.cpp.

References arg(), ATVDemod::getEffectiveSampleRate(), getNominalLineTime(), m_atvDemod, m_fltLineTimeMultiplier, and ui.

Referenced by deserialize(), handleMessage(), on_fps_currentIndexChanged(), on_lineTime_valueChanged(), on_nbLines_currentIndexChanged(), and resetToDefaults().

629 {
630  float nominalLineTime = getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex());
631  int lineTimeScaleFactor = (int) std::log10(nominalLineTime);
632 
633  if (m_atvDemod->getEffectiveSampleRate() == 0) {
634  m_fltLineTimeMultiplier = std::pow(10.0, lineTimeScaleFactor-3);
635  } else {
637  }
638 
639  float lineTime = nominalLineTime + m_fltLineTimeMultiplier * ui->lineTime->value();
640 
641  if (lineTime < 0.0)
642  ui->lineTimeText->setText("invalid");
643  else if(lineTime < 0.000001)
644  ui->lineTimeText->setText(tr("%1 ns").arg(lineTime * 1000000000.0, 0, 'f', 2));
645  else if(lineTime < 0.001)
646  ui->lineTimeText->setText(tr("%1 µs").arg(lineTime * 1000000.0, 0, 'f', 2));
647  else if(lineTime < 1.0)
648  ui->lineTimeText->setText(tr("%1 ms").arg(lineTime * 1000.0, 0, 'f', 2));
649  else
650  ui->lineTimeText->setText(tr("%1 s").arg(lineTime * 1.0, 0, 'f', 2));
651 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
int getEffectiveSampleRate()
Definition: atvdemod.cpp:741
static float getNominalLineTime(int nbLinesIndex, int fpsIndex)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float m_fltLineTimeMultiplier
Definition: atvdemodgui.h:76
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_bfo_valueChanged

void ATVDemodGUI::on_bfo_valueChanged ( int  value)
privateslot

Definition at line 610 of file atvdemodgui.cpp.

References applyRFSettings(), arg(), and ui.

611 {
612  ui->bfoText->setText(QString("%1").arg(value * 1.0, 0, 'f', 0));
613  applyRFSettings();
614 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applyRFSettings()
+ Here is the call graph for this function:

◆ on_blackLevel_valueChanged

void ATVDemodGUI::on_blackLevel_valueChanged ( int  value)
privateslot

Definition at line 499 of file atvdemodgui.cpp.

References applySettings(), arg(), and ui.

500 {
501  applySettings();
502  ui->blackLevelText->setText(QString("%1 mV").arg(value));
503 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings()
+ Here is the call graph for this function:

◆ on_decimatorEnable_toggled

void ATVDemodGUI::on_decimatorEnable_toggled ( bool  checked)
privateslot

Definition at line 597 of file atvdemodgui.cpp.

References applyRFSettings(), and setChannelMarkerBandwidth().

598 {
599  (void) checked;
601  applyRFSettings();
602 }
void setChannelMarkerBandwidth()
void applyRFSettings()
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void ATVDemodGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 604 of file atvdemodgui.cpp.

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

605 {
607  applyRFSettings();
608 }
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
void applyRFSettings()
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ on_fmDeviation_valueChanged

void ATVDemodGUI::on_fmDeviation_valueChanged ( int  value)
privateslot

Definition at line 616 of file atvdemodgui.cpp.

References applyRFSettings(), arg(), and ui.

617 {
618  ui->fmDeviationText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
619  applyRFSettings();
620 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applyRFSettings()
+ Here is the call graph for this function:

◆ on_fps_currentIndexChanged

void ATVDemodGUI::on_fps_currentIndexChanged ( int  index)
privateslot

Definition at line 547 of file atvdemodgui.cpp.

References applySettings(), lineTimeUpdate(), and topTimeUpdate().

548 {
549  (void) index;
550  lineTimeUpdate();
551  topTimeUpdate();
552  applySettings();
553 }
void topTimeUpdate()
void applySettings()
void lineTimeUpdate()
+ Here is the call graph for this function:

◆ on_halfImage_clicked

void ATVDemodGUI::on_halfImage_clicked ( )
privateslot

Definition at line 534 of file atvdemodgui.cpp.

References applySettings().

535 {
536  applySettings();
537 }
void applySettings()
+ Here is the call graph for this function:

◆ on_hSync_clicked

void ATVDemodGUI::on_hSync_clicked ( )
privateslot

Definition at line 519 of file atvdemodgui.cpp.

References applySettings().

520 {
521  applySettings();
522 }
void applySettings()
+ Here is the call graph for this function:

◆ on_invertVideo_clicked

void ATVDemodGUI::on_invertVideo_clicked ( )
privateslot

Definition at line 529 of file atvdemodgui.cpp.

References applySettings().

530 {
531  applySettings();
532 }
void applySettings()
+ Here is the call graph for this function:

◆ on_lineTime_valueChanged

void ATVDemodGUI::on_lineTime_valueChanged ( int  value)
privateslot

Definition at line 505 of file atvdemodgui.cpp.

References applySettings(), arg(), lineTimeUpdate(), and ui.

506 {
507  ui->lineTime->setToolTip(QString("Line length adjustment (%1)").arg(value));
508  lineTimeUpdate();
509  applySettings();
510 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings()
void lineTimeUpdate()
+ Here is the call graph for this function:

◆ on_modulation_currentIndexChanged

void ATVDemodGUI::on_modulation_currentIndexChanged ( int  index)
privateslot

Definition at line 567 of file atvdemodgui.cpp.

References applyRFSettings(), ATVDemod::getEffectiveSampleRate(), m_atvDemod, setChannelMarkerBandwidth(), and setRFFiltersSlidersRange().

568 {
569  (void) index;
572  applyRFSettings();
573 }
int getEffectiveSampleRate()
Definition: atvdemod.cpp:741
void setChannelMarkerBandwidth()
void applyRFSettings()
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
void setRFFiltersSlidersRange(int sampleRate)
+ Here is the call graph for this function:

◆ on_nbLines_currentIndexChanged

void ATVDemodGUI::on_nbLines_currentIndexChanged ( int  index)
privateslot

Definition at line 539 of file atvdemodgui.cpp.

References applySettings(), lineTimeUpdate(), and topTimeUpdate().

540 {
541  (void) index;
542  lineTimeUpdate();
543  topTimeUpdate();
544  applySettings();
545 }
void topTimeUpdate()
void applySettings()
void lineTimeUpdate()
+ Here is the call graph for this function:

◆ on_reset_clicked

void ATVDemodGUI::on_reset_clicked ( bool  checked)
privateslot

Definition at line 561 of file atvdemodgui.cpp.

References resetToDefaults().

562 {
563  (void) checked;
564  resetToDefaults();
565 }
void resetToDefaults()
Definition: atvdemodgui.cpp:72
+ Here is the call graph for this function:

◆ on_rfBW_valueChanged

void ATVDemodGUI::on_rfBW_valueChanged ( int  value)
privateslot

Definition at line 575 of file atvdemodgui.cpp.

References applyRFSettings(), arg(), m_rfSliderDivisor, setChannelMarkerBandwidth(), and ui.

576 {
577  ui->rfBWText->setText(QString("%1k").arg((value * m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
579  applyRFSettings();
580 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setChannelMarkerBandwidth()
int m_rfSliderDivisor
Definition: atvdemodgui.h:78
void applyRFSettings()
+ Here is the call graph for this function:

◆ on_rfFiltering_toggled

void ATVDemodGUI::on_rfFiltering_toggled ( bool  checked)
privateslot

Definition at line 589 of file atvdemodgui.cpp.

References applyRFSettings(), ATVDemod::getEffectiveSampleRate(), m_atvDemod, setChannelMarkerBandwidth(), and setRFFiltersSlidersRange().

590 {
591  (void) checked;
594  applyRFSettings();
595 }
int getEffectiveSampleRate()
Definition: atvdemod.cpp:741
void setChannelMarkerBandwidth()
void applyRFSettings()
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
void setRFFiltersSlidersRange(int sampleRate)
+ Here is the call graph for this function:

◆ on_rfOppBW_valueChanged

void ATVDemodGUI::on_rfOppBW_valueChanged ( int  value)
privateslot

Definition at line 582 of file atvdemodgui.cpp.

References applyRFSettings(), arg(), m_rfSliderDivisor, setChannelMarkerBandwidth(), and ui.

583 {
584  ui->rfOppBWText->setText(QString("%1k").arg((value * m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
586  applyRFSettings();
587 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setChannelMarkerBandwidth()
int m_rfSliderDivisor
Definition: atvdemodgui.h:78
void applyRFSettings()
+ Here is the call graph for this function:

◆ on_screenTabWidget_currentChanged

void ATVDemodGUI::on_screenTabWidget_currentChanged ( int  index)
privateslot

Definition at line 622 of file atvdemodgui.cpp.

References applySettings().

623 {
624  (void) index;
625  applySettings();
626 }
void applySettings()
+ Here is the call graph for this function:

◆ on_standard_currentIndexChanged

void ATVDemodGUI::on_standard_currentIndexChanged ( int  index)
privateslot

Definition at line 555 of file atvdemodgui.cpp.

References applySettings().

556 {
557  (void) index;
558  applySettings();
559 }
void applySettings()
+ Here is the call graph for this function:

◆ on_synchLevel_valueChanged

void ATVDemodGUI::on_synchLevel_valueChanged ( int  value)
privateslot

Definition at line 493 of file atvdemodgui.cpp.

References applySettings(), arg(), and ui.

494 {
495  applySettings();
496  ui->synchLevelText->setText(QString("%1 mV").arg(value));
497 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings()
+ Here is the call graph for this function:

◆ on_topTime_valueChanged

void ATVDemodGUI::on_topTime_valueChanged ( int  value)
privateslot

Definition at line 512 of file atvdemodgui.cpp.

References applySettings(), arg(), topTimeUpdate(), and ui.

513 {
514  ui->topTime->setToolTip(QString("Horizontal sync pulse length adjustment (%1)").arg(value));
515  topTimeUpdate();
516  applySettings();
517 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void topTimeUpdate()
void applySettings()
+ Here is the call graph for this function:

◆ on_vSync_clicked

void ATVDemodGUI::on_vSync_clicked ( )
privateslot

Definition at line 524 of file atvdemodgui.cpp.

References applySettings().

525 {
526  applySettings();
527 }
void applySettings()
+ Here is the call graph for this function:

◆ onWidgetRolled

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

Definition at line 266 of file atvdemodgui.cpp.

Referenced by ATVDemodGUI().

267 {
268  (void) widget;
269  (void) rollDown;
270 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void ATVDemodGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 72 of file atvdemodgui.cpp.

References applySettings(), blockApplySettings(), lineTimeUpdate(), topTimeUpdate(), and ui.

Referenced by ATVDemodGUI(), deserialize(), and on_reset_clicked().

73 {
74  blockApplySettings(true);
75 
76  //********** ATV Default values **********
77  ui->synchLevel->setValue(100);
78  ui->blackLevel->setValue(310);
79  ui->lineTime->setValue(0);
80  ui->topTime->setValue(3);
81  ui->modulation->setCurrentIndex(0);
82  ui->fps->setCurrentIndex(0);
83  ui->hSync->setChecked(true);
84  ui->vSync->setChecked(true);
85  ui->halfImage->setChecked(false);
86  ui->invertVideo->setChecked(false);
87  ui->standard->setCurrentIndex(1);
88 
89  //********** RF Default values **********
90  ui->decimatorEnable->setChecked(false);
91  ui->rfFiltering->setChecked(false);
92  ui->rfBW->setValue(10);
93  ui->rfOppBW->setValue(10);
94  ui->bfo->setValue(0);
95  ui->fmDeviation->setValue(250);
96 
97  blockApplySettings(false);
99  topTimeUpdate();
100  applySettings();
101 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
void blockApplySettings(bool blnBlock)
void topTimeUpdate()
void applySettings()
void lineTimeUpdate()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray ATVDemodGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 103 of file atvdemodgui.cpp.

References SimpleSerializer::final(), ChannelMarker::getCenterFrequency(), ChannelMarker::getColor(), m_channelMarker, ui, SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), and SimpleSerializer::writeU32().

104 {
105  SimpleSerializer s(1);
106 
107  s.writeS32(1, m_channelMarker.getCenterFrequency());
108  s.writeU32(2, m_channelMarker.getColor().rgb());
109  s.writeS32(3, ui->synchLevel->value());
110  s.writeS32(4, ui->blackLevel->value());
111  s.writeS32(5, ui->lineTime->value());
112  s.writeS32(6, ui->topTime->value());
113  s.writeS32(7, ui->modulation->currentIndex());
114  s.writeS32(8, ui->fps->currentIndex());
115  s.writeBool(9, ui->hSync->isChecked());
116  s.writeBool(10, ui->vSync->isChecked());
117  s.writeBool(11, ui->halfImage->isChecked());
118  s.writeS32(12, ui->rfBW->value());
119  s.writeS32(13, ui->rfOppBW->value());
120  s.writeS32(14, ui->bfo->value());
121  s.writeBool(15, ui->invertVideo->isChecked());
122  s.writeS32(16, ui->nbLines->currentIndex());
123  s.writeS32(17, ui->fmDeviation->value());
124  s.writeS32(18, ui->standard->currentIndex());
125 
126  return s.final();
127 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
const QColor & getColor() const
Definition: channelmarker.h:64
+ Here is the call graph for this function:

◆ setCenterFrequency()

void ATVDemodGUI::setCenterFrequency ( qint64  intCenterFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 66 of file atvdemodgui.cpp.

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

67 {
68  m_channelMarker.setCenterFrequency(intCenterFrequency);
69  applySettings();
70 }
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
void applySettings()
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setChannelMarkerBandwidth()

void ATVDemodGUI::setChannelMarkerBandwidth ( )
private

Definition at line 397 of file atvdemodgui.cpp.

References ATVDemod::ATV_LSB, ATVDemod::ATV_USB, ChannelMarker::dsb, ChannelMarker::emitChangedByAPI(), m_blnDoApplySettings, m_channelMarker, m_inputSampleRate, m_rfSliderDivisor, ChannelMarker::setBandwidth(), ChannelMarker::setOppositeBandwidth(), ChannelMarker::setSidebands(), ui, ChannelMarker::vlsb, and ChannelMarker::vusb.

Referenced by on_decimatorEnable_toggled(), on_modulation_currentIndexChanged(), on_rfBW_valueChanged(), on_rfFiltering_toggled(), and on_rfOppBW_valueChanged().

398 {
399  m_blnDoApplySettings = false; // avoid infinite recursion
400  m_channelMarker.blockSignals(true);
401 
402  if (ui->rfFiltering->isChecked()) // FFT filter
403  {
406 
407  if (ui->modulation->currentIndex() == (int) ATVDemod::ATV_LSB) {
409  } else if (ui->modulation->currentIndex() == (int) ATVDemod::ATV_USB) {
411  } else {
413  }
414  }
415  else
416  {
417  if (ui->decimatorEnable->isChecked()) {
419  } else {
421  }
422 
424  }
425 
426  m_channelMarker.blockSignals(false);
428  m_blnDoApplySettings = true;
429 }
AM with vestigial lower side band (main signal is in the upper side)
Definition: atvdemod.h:68
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
int m_inputSampleRate
Definition: atvdemodgui.h:79
void emitChangedByAPI()
void setOppositeBandwidth(int bandwidth)
int m_rfSliderDivisor
Definition: atvdemodgui.h:78
LSB with vestigial USB.
Definition: channelmarker.h:21
USB with vestigial LSB.
Definition: channelmarker.h:20
ChannelMarker m_channelMarker
Definition: atvdemodgui.h:66
void setBandwidth(int bandwidth)
void setSidebands(sidebands_t sidebands)
bool m_blnDoApplySettings
Definition: atvdemodgui.h:69
AM with vestigial upper side band (main signal is in the lower side)
Definition: atvdemod.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setName()

void ATVDemodGUI::setName ( const QString &  strName)
virtual

Implements PluginInstanceGUI.

Definition at line 51 of file atvdemodgui.cpp.

52 {
53  setObjectName(strName);
54 }

◆ setRFFiltersSlidersRange()

void ATVDemodGUI::setRFFiltersSlidersRange ( int  sampleRate)
private

Definition at line 431 of file atvdemodgui.cpp.

References arg(), m_rfSliderDivisor, and ui.

Referenced by handleMessage(), on_modulation_currentIndexChanged(), and on_rfFiltering_toggled().

432 {
433  // RF filters sliders range
434  int scaleFactor = (int) std::log10(sampleRate/2);
435  m_rfSliderDivisor = std::pow(10.0, scaleFactor-1);
436 
437  if (sampleRate/m_rfSliderDivisor < 50) {
438  m_rfSliderDivisor /= 10;
439  }
440 
441  if (ui->rfFiltering->isChecked())
442  {
443  ui->rfBW->setMaximum((sampleRate) / (2*m_rfSliderDivisor));
444  ui->rfOppBW->setMaximum((sampleRate) / (2*m_rfSliderDivisor));
445  }
446  else
447  {
448  ui->rfBW->setMaximum((sampleRate) / m_rfSliderDivisor);
449  ui->rfOppBW->setMaximum((sampleRate) / m_rfSliderDivisor);
450  }
451 
452  ui->rfBWText->setText(QString("%1k").arg((ui->rfBW->value() * m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
453  ui->rfOppBWText->setText(QString("%1k").arg((ui->rfOppBW->value() * m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
454 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int m_rfSliderDivisor
Definition: atvdemodgui.h:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tick

void ATVDemodGUI::tick ( )
privateslot

Definition at line 466 of file atvdemodgui.cpp.

References arg(), CalcDb::dbPower(), ATVDemod::getBFOLocked(), ATVDemod::getMagSq(), m_atvDemod, m_intTickCount, m_objMagSqAverage, SDR_RX_SCALED, and ui.

Referenced by ATVDemodGUI().

467 {
468  if (m_intTickCount < 4) // ~200 ms
469  {
470  m_intTickCount++;
471  }
472  else
473  {
474  if (m_atvDemod)
475  {
478  ui->channePowerText->setText(tr("%1 dB").arg(magSqDB, 0, 'f', 1));
479 
480  if (m_atvDemod->getBFOLocked()) {
481  ui->bfoLockedLabel->setStyleSheet("QLabel { background-color : green; }");
482  } else {
483  ui->bfoLockedLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
484  }
485  }
486 
487  m_intTickCount = 0;
488  }
489 
490  return;
491 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
int m_intTickCount
Definition: atvdemodgui.h:72
bool getBFOLocked()
Definition: atvdemod.cpp:746
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
MovingAverageUtil< double, double, 4 > m_objMagSqAverage
Definition: atvdemodgui.h:71
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
double getMagSq() const
Beware this is scaled to 2^30.
Definition: atvdemod.h:249
#define SDR_RX_SCALED
Definition: dsptypes.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ topTimeUpdate()

void ATVDemodGUI::topTimeUpdate ( )
private

Definition at line 653 of file atvdemodgui.cpp.

References arg(), ATVDemod::getEffectiveSampleRate(), getNominalLineTime(), m_atvDemod, m_fltTopTimeMultiplier, and ui.

Referenced by deserialize(), handleMessage(), on_fps_currentIndexChanged(), on_nbLines_currentIndexChanged(), on_topTime_valueChanged(), and resetToDefaults().

654 {
655  float nominalTopTime = getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex()) * (4.7f / 64.0f);
656  int topTimeScaleFactor = (int) std::log10(nominalTopTime);
657 
658  if (m_atvDemod->getEffectiveSampleRate() == 0) {
659  m_fltTopTimeMultiplier = std::pow(10.0, topTimeScaleFactor-3);
660  } else {
662  }
663 
664  float topTime = nominalTopTime + m_fltTopTimeMultiplier * ui->topTime->value();
665 
666  if (topTime < 0.0)
667  ui->topTimeText->setText("invalid");
668  else if (topTime < 0.000001)
669  ui->topTimeText->setText(tr("%1 ns").arg(topTime * 1000000000.0, 0, 'f', 2));
670  else if(topTime < 0.001)
671  ui->topTimeText->setText(tr("%1 µs").arg(topTime * 1000000.0, 0, 'f', 2));
672  else if(topTime < 1.0)
673  ui->topTimeText->setText(tr("%1 ms").arg(topTime * 1000.0, 0, 'f', 2));
674  else
675  ui->topTimeText->setText(tr("%1 s").arg(topTime * 1.0, 0, 'f', 2));
676 }
Ui::ATVDemodGUI * ui
Definition: atvdemodgui.h:63
int getEffectiveSampleRate()
Definition: atvdemod.cpp:741
static float getNominalLineTime(int nbLinesIndex, int fpsIndex)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float m_fltTopTimeMultiplier
Definition: atvdemodgui.h:77
ATVDemod * m_atvDemod
Definition: atvdemodgui.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_atvDemod

ATVDemod* ATVDemodGUI::m_atvDemod
private

◆ m_blnDoApplySettings

bool ATVDemodGUI::m_blnDoApplySettings
private

◆ m_channelMarker

ChannelMarker ATVDemodGUI::m_channelMarker
private

◆ m_deviceUISet

DeviceUISet* ATVDemodGUI::m_deviceUISet
private

Definition at line 65 of file atvdemodgui.h.

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

◆ m_fltLineTimeMultiplier

float ATVDemodGUI::m_fltLineTimeMultiplier
private

Definition at line 76 of file atvdemodgui.h.

Referenced by applySettings(), and lineTimeUpdate().

◆ m_fltTopTimeMultiplier

float ATVDemodGUI::m_fltTopTimeMultiplier
private

Definition at line 77 of file atvdemodgui.h.

Referenced by applySettings(), and topTimeUpdate().

◆ m_inputMessageQueue

MessageQueue ATVDemodGUI::m_inputMessageQueue
private

Definition at line 80 of file atvdemodgui.h.

◆ m_inputSampleRate

int ATVDemodGUI::m_inputSampleRate
private

Definition at line 79 of file atvdemodgui.h.

Referenced by applySettings(), handleMessage(), and setChannelMarkerBandwidth().

◆ m_intTickCount

int ATVDemodGUI::m_intTickCount
private

Definition at line 72 of file atvdemodgui.h.

Referenced by tick().

◆ m_objMagSqAverage

MovingAverageUtil<double, double, 4> ATVDemodGUI::m_objMagSqAverage
private

Definition at line 71 of file atvdemodgui.h.

Referenced by tick().

◆ m_pluginAPI

PluginAPI* ATVDemodGUI::m_pluginAPI
private

Definition at line 64 of file atvdemodgui.h.

◆ m_rfSliderDivisor

int ATVDemodGUI::m_rfSliderDivisor
private

◆ m_scopeVis

ScopeVis* ATVDemodGUI::m_scopeVis
private

Definition at line 74 of file atvdemodgui.h.

Referenced by ATVDemodGUI(), handleMessage(), and ~ATVDemodGUI().

◆ ui

Ui::ATVDemodGUI* ATVDemodGUI::ui
private

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