1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

ATV Demod: applied new channel marker signal handling and fixed frequency shift handling

This commit is contained in:
f4exb 2017-11-14 01:06:19 +01:00
parent be170c455f
commit 4896b1bf40
4 changed files with 51 additions and 38 deletions

View File

@ -141,6 +141,7 @@ void ATVDemod::configure(
void ATVDemod::configureRF(
MessageQueue* objMessageQueue,
int64_t frequencyOffset,
ATVModulation enmModulation,
float fltRFBandwidth,
float fltRFOppBandwidth,
@ -150,6 +151,7 @@ void ATVDemod::configureRF(
float fmDeviation)
{
Message* msgCmd = MsgConfigureRFATVDemod::create(
frequencyOffset,
enmModulation,
fltRFBandwidth,
fltRFOppBandwidth,
@ -506,6 +508,7 @@ bool ATVDemod::handleMessage(const Message& cmd)
m_rfConfig = objCfg.m_objMsgConfig;
qDebug() << "ATVDemod::handleMessage: MsgConfigureRFATVDemod:"
<< " m_intFrequencyOffset:" << m_rfConfig.m_intFrequencyOffset
<< " m_enmModulation:" << m_rfConfig.m_enmModulation
<< " m_fltRFBandwidth:" << m_rfConfig.m_fltRFBandwidth
<< " m_fltRFOppBandwidth:" << m_rfConfig.m_fltRFOppBandwidth

View File

@ -208,6 +208,7 @@ public:
int intVideoTabIndex);
void configureRF(MessageQueue* objMessageQueue,
int64_t frequencyOffset,
ATVModulation enmModulation,
float fltRFBandwidth,
float fltRFOppBandwidth,
@ -317,6 +318,7 @@ private:
public:
static MsgConfigureRFATVDemod* create(
int64_t frequencyOffset,
ATVModulation enmModulation,
float fltRFBandwidth,
float fltRFOppBandwidth,
@ -326,6 +328,7 @@ private:
float fmDeviation)
{
return new MsgConfigureRFATVDemod(
frequencyOffset,
enmModulation,
fltRFBandwidth,
fltRFOppBandwidth,
@ -339,6 +342,7 @@ private:
private:
MsgConfigureRFATVDemod(
int64_t frequencyOffset,
ATVModulation enmModulation,
float fltRFBandwidth,
float fltRFOppBandwidth,
@ -348,6 +352,7 @@ private:
float fmDeviation) :
Message()
{
m_objMsgConfig.m_intFrequencyOffset = frequencyOffset;
m_objMsgConfig.m_enmModulation = enmModulation;
m_objMsgConfig.m_fltRFBandwidth = fltRFBandwidth;
m_objMsgConfig.m_fltRFOppBandwidth = fltRFOppBandwidth;

View File

@ -189,6 +189,7 @@ bool ATVDemodGUI::deserialize(const QByteArray& arrData)
blockApplySettings(false);
m_channelMarker.blockSignals(false);
m_channelMarker.emitChangedByAPI();
lineTimeUpdate();
topTimeUpdate();
@ -235,9 +236,11 @@ bool ATVDemodGUI::handleMessage(const Message& objMessage)
}
}
void ATVDemodGUI::viewChanged()
void ATVDemodGUI::channelMarkerChangedByCursor()
{
qDebug("ATVDemodGUI::viewChanged");
qDebug("ATVDemodGUI::channelMarkerChangedByCursor");
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
applySettings();
applyRFSettings();
}
@ -287,14 +290,14 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
m_channelMarker.blockSignals(true);
m_channelMarker.setColor(Qt::white);
m_channelMarker.setMovable(false);
m_channelMarker.setBandwidth(6000000);
m_channelMarker.setCenterFrequency(0);
m_channelMarker.setVisible(true);
setTitleColor(m_channelMarker.getColor());
m_channelMarker.blockSignals(false);
m_channelMarker.setVisible(true); // activate signal on the last setting only
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
setTitleColor(m_channelMarker.getColor());
m_deviceUISet->registerRxChannelInstance(ATVDemod::m_channelID, this);
m_deviceUISet->addChannelMarker(&m_channelMarker);
@ -321,6 +324,7 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
ui->scopeGUI->changeTrigger(0, triggerData);
ui->scopeGUI->focusOnTrigger(0); // re-focus to take changes into account in the GUI
connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
QChar delta = QChar(0x94, 0x03);
@ -344,8 +348,6 @@ void ATVDemodGUI::applySettings()
{
if (m_blnDoApplySettings)
{
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ATVDemod::MsgConfigureChannelizer *msgChan = ATVDemod::MsgConfigureChannelizer::create(
m_channelMarker.getCenterFrequency());
m_atvDemod->getInputMessageQueue()->push(msgChan);
@ -375,6 +377,7 @@ void ATVDemodGUI::applyRFSettings()
if (m_blnDoApplySettings)
{
m_atvDemod->configureRF(m_atvDemod->getInputMessageQueue(),
m_channelMarker.getCenterFrequency(),
(ATVDemod::ATVModulation) ui->modulation->currentIndex(),
ui->rfBW->value() * m_rfSliderDivisor * 1.0f,
ui->rfOppBW->value() * m_rfSliderDivisor * 1.0f,
@ -388,6 +391,7 @@ void ATVDemodGUI::applyRFSettings()
void ATVDemodGUI::setChannelMarkerBandwidth()
{
m_blnDoApplySettings = false; // avoid infinite recursion
m_channelMarker.blockSignals(true);
if (ui->rfFiltering->isChecked()) // FFT filter
{
@ -413,6 +417,8 @@ void ATVDemodGUI::setChannelMarkerBandwidth()
m_channelMarker.setSidebands(ChannelMarker::dsb);
}
m_channelMarker.blockSignals(false);
m_channelMarker.emitChangedByAPI();
m_blnDoApplySettings = true;
}
@ -443,16 +449,12 @@ void ATVDemodGUI::setRFFiltersSlidersRange(int sampleRate)
void ATVDemodGUI::leaveEvent(QEvent*)
{
blockApplySettings(true);
m_channelMarker.setHighlighted(false);
blockApplySettings(false);
}
void ATVDemodGUI::enterEvent(QEvent*)
{
blockApplySettings(true);
m_channelMarker.setHighlighted(true);
blockApplySettings(false);
}
void ATVDemodGUI::tick()
@ -589,6 +591,7 @@ void ATVDemodGUI::on_decimatorEnable_toggled(bool checked __attribute__((unused)
void ATVDemodGUI::on_deltaFrequency_changed(qint64 value)
{
m_channelMarker.setCenterFrequency(value);
applyRFSettings();
}
void ATVDemodGUI::on_bfo_valueChanged(int value)

View File

@ -54,32 +54,8 @@ public:
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual bool handleMessage(const Message& objMessage);
private slots:
void viewChanged();
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);
public slots:
void channelMarkerChangedByCursor();
private:
Ui::ATVDemodGUI* ui;
@ -117,6 +93,32 @@ private:
void leaveEvent(QEvent*);
void enterEvent(QEvent*);
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);
};
#endif // INCLUDE_ATVDEMODGUI_H