19 #include <QDockWidget> 20 #include <QMainWindow> 29 #include "ui_atvdemodgui.h" 53 setObjectName(strName);
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);
90 ui->decimatorEnable->setChecked(
false);
91 ui->rfFiltering->setChecked(
false);
92 ui->rfBW->setValue(10);
93 ui->rfOppBW->setValue(10);
95 ui->fmDeviation->setValue(250);
113 s.
writeS32(7,
ui->modulation->currentIndex());
158 ui->synchLevel->setValue(tmp);
160 ui->blackLevel->setValue(tmp);
162 ui->lineTime->setValue(tmp);
164 ui->topTime->setValue(tmp);
166 ui->modulation->setCurrentIndex(tmp);
168 ui->fps->setCurrentIndex(tmp);
170 ui->hSync->setChecked(booltmp);
172 ui->vSync->setChecked(booltmp);
174 ui->halfImage->setChecked(booltmp);
176 ui->rfBW->setValue(tmp);
178 ui->rfOppBW->setValue(tmp);
180 ui->bfo->setValue(tmp);
182 ui->invertVideo->setChecked(booltmp);
184 ui->nbLines->setCurrentIndex(tmp);
186 ui->fmDeviation->setValue(tmp);
188 ui->standard->setCurrentIndex(tmp);
212 ui->channelSampleRateText->setText(tr(
"%1k").
arg(sampleRate/1000.0f, 0,
'f', 2));
213 ui->nbPointsPerLineText->setText(tr(
"%1p").
arg(nbPointsPerLine));
226 qDebug(
"ATVDemodGUI::handleMessage: MsgReportChannelSampleRateChanged: %d",
m_inputSampleRate);
241 qDebug(
"ATVDemodGUI::channelMarkerChangedByCursor");
283 ui->screenTV->setColor(
false);
284 setAttribute(Qt::WA_DeleteOnClose,
true);
296 ui->deltaFrequencyLabel->setText(QString(
"%1f").
arg(QChar(0x94, 0x03)));
298 ui->deltaFrequency->setValueRange(
false, 7, -9999999, 9999999);
317 ui->scopeGUI->setPreTrigger(1);
319 traceData.
m_amp = 2.0;
321 traceData.
m_ofs = 0.5;
323 ui->scopeGUI->changeTrace(0, traceData);
324 ui->scopeGUI->focusOnTrace(0);
329 ui->scopeGUI->changeTrigger(0, triggerData);
330 ui->scopeGUI->focusOnTrigger(0);
336 QChar delta = QChar(0x94, 0x03);
337 ui->fmDeviationLabel->setText(delta);
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());
375 qDebug() <<
"ATVDemodGUI::applySettings:" 390 ui->rfFiltering->isChecked(),
391 ui->decimatorEnable->isChecked(),
393 ui->fmDeviation->value() / 500.0f);
402 if (
ui->rfFiltering->isChecked())
417 if (
ui->decimatorEnable->isChecked()) {
434 int scaleFactor = (int) std::log10(sampleRate/2);
441 if (
ui->rfFiltering->isChecked())
478 ui->channePowerText->setText(tr(
"%1 dB").
arg(magSqDB, 0,
'f', 1));
481 ui->bfoLockedLabel->setStyleSheet(
"QLabel { background-color : green; }");
483 ui->bfoLockedLabel->setStyleSheet(
"QLabel { background:rgb(79,79,79); }");
496 ui->synchLevelText->setText(QString(
"%1 mV").
arg(value));
502 ui->blackLevelText->setText(QString(
"%1 mV").
arg(value));
507 ui->lineTime->setToolTip(QString(
"Line length adjustment (%1)").
arg(value));
514 ui->topTime->setToolTip(QString(
"Horizontal sync pulse length adjustment (%1)").
arg(value));
612 ui->bfoText->setText(QString(
"%1").
arg(value * 1.0, 0,
'f', 0));
618 ui->fmDeviationText->setText(QString(
"%1").
arg(value / 10.0, 0,
'f', 1));
631 int lineTimeScaleFactor = (int) std::log10(nominalLineTime);
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));
650 ui->lineTimeText->setText(tr(
"%1 s").
arg(lineTime * 1.0, 0,
'f', 2));
655 float nominalTopTime =
getNominalLineTime(
ui->nbLines->currentIndex(),
ui->fps->currentIndex()) * (4.7f / 64.0f);
656 int topTimeScaleFactor = (int) std::log10(nominalTopTime);
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));
675 ui->topTimeText->setText(tr(
"%1 s").
arg(topTime * 1.0, 0,
'f', 2));
718 float fps =
getFps(fpsIndex);
721 return 1.0f / (nbLines * fps);
static MainWindow * getInstance()
void on_halfImage_clicked()
bool m_triggerPositiveEdge
Trigger on the positive edge (else negative)
void on_lineTime_valueChanged(int value)
DeviceUISet * m_deviceUISet
void on_standard_currentIndexChanged(int index)
AM with vestigial lower side band (main signal is in the upper side)
int getCenterFrequency() const
void push(Message *message, bool emitSignal=true)
Push message onto queue.
virtual bool handleMessage(const Message &objMessage)
void channelMarkerChangedByCursor()
static double dbPower(double magsq, double floor=1e-12)
void on_blackLevel_valueChanged(int value)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
static const QString m_channelIdURI
void channelMarkerHighlightedByCursor()
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)
void configureRF(MessageQueue *objMessageQueue, int64_t frequencyOffset, ATVModulation enmModulation, float fltRFBandwidth, float fltRFOppBandwidth, bool blnFFTFiltering, bool blndecimatorEnable, float fltBFOFrequency, float fmDeviation)
int getEffectiveSampleRate()
bool deserialize(const QByteArray &arrData)
static float getNominalLineTime(int nbLinesIndex, int fpsIndex)
int getSampleRate() const
void setOppositeBandwidth(int bandwidth)
void on_screenTabWidget_currentChanged(int index)
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
void onWidgetRolled(QWidget *widget, bool rollDown)
void enterEvent(QEvent *)
void leaveEvent(QEvent *)
void on_nbLines_currentIndexChanged(int index)
void setLiveRate(int sampleRate)
static ATVDemodGUI * create(PluginAPI *objPluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
bool readBool(quint32 id, bool *result, bool def=false) const
void on_synchLevel_valueChanged(int value)
void on_topTime_valueChanged(int value)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
void on_rfBW_valueChanged(int value)
void setChannelMarkerBandwidth()
void setName(const QString &strName)
void on_rfFiltering_toggled(bool checked)
bool readS32(quint32 id, qint32 *result, qint32 def=0) const
virtual void setMessageQueueToGUI(MessageQueue *queue)
virtual MessageQueue * getInputMessageQueue()
float m_fltLineTimeMultiplier
void setHighlighted(bool highlighted)
QByteArray serialize() const
ATVDemodGUI(PluginAPI *objPluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *objParent=0)
static float getFps(int fpsIndex)
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
void on_invertVideo_clicked()
static bool match(const Message *message)
Real m_triggerLevel
Level in real units.
bool getHighlighted() const
void on_fmDeviation_valueChanged(int value)
MovingAverageUtil< double, double, 4 > m_objMagSqAverage
void writeS32(quint32 id, qint32 value)
void blockApplySettings(bool blnBlock)
float m_fltTopTimeMultiplier
quint32 getVersion() const
void on_rfOppBW_valueChanged(int value)
float m_amp
Amplification factor.
ChannelMarker m_channelMarker
void writeU32(quint32 id, quint32 value)
void on_reset_clicked(bool checked)
void on_modulation_currentIndexChanged(int index)
void setColor(const QColor &color)
void on_deltaFrequency_changed(qint64 value)
void on_decimatorEnable_toggled(bool checked)
void handleSourceMessages()
void on_bfo_valueChanged(int value)
void writeBool(quint32 id, bool value)
void setVisible(bool visible)
void setScopeSink(BasebandSampleSink *scopeSink)
void setBandwidth(int bandwidth)
void setTVScreen(TVScreen *objScreen)
set by the GUI
const QColor & getColor() const
virtual void setCenterFrequency(qint64 intCenterFrequency)
double getMagSq() const
Beware this is scaled to 2^30.
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
virtual qint64 getCenterFrequency() const
uint32_t m_ampIndex
Index in list of amplification factors.
void on_fps_currentIndexChanged(int index)
const QByteArray & final()
bool m_blnDoApplySettings
static int getNumberOfLines(int nbLinesIndex)
void setRFFiltersSlidersRange(int sampleRate)
float m_ofs
Offset factor.
AM with vestigial upper side band (main signal is in the lower side)
int m_ofsCoarse
Coarse offset slider value.