mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 13:11:20 -05:00 
			
		
		
		
	NFM Demod: applied new channel marker signal handling
This commit is contained in:
		
							parent
							
								
									04c495d876
								
							
						
					
					
						commit
						1370c65830
					
				@ -126,9 +126,10 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
 | 
				
			|||||||
	ui->glSpectrum->setDisplayWaterfall(true);
 | 
						ui->glSpectrum->setDisplayWaterfall(true);
 | 
				
			||||||
	ui->glSpectrum->setDisplayMaxHold(true);
 | 
						ui->glSpectrum->setDisplayMaxHold(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						m_channelMarker.setMovable(false);
 | 
				
			||||||
	m_channelMarker.setVisible(true);
 | 
						m_channelMarker.setVisible(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
 | 
						connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(viewChanged()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	m_deviceUISet->registerRxChannelInstance(LoRaDemod::m_channelID, this);
 | 
						m_deviceUISet->registerRxChannelInstance(LoRaDemod::m_channelID, this);
 | 
				
			||||||
	m_deviceUISet->addChannelMarker(&m_channelMarker);
 | 
						m_deviceUISet->addChannelMarker(&m_channelMarker);
 | 
				
			||||||
 | 
				
			|||||||
@ -98,14 +98,10 @@ void NFMDemodGUI::handleInputMessages()
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NFMDemodGUI::channelMarkerChanged()
 | 
					void NFMDemodGUI::channelMarkerChangedByCursor()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    setWindowTitle(m_channelMarker.getTitle());
 | 
					    ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
 | 
				
			||||||
    m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
 | 
					    m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
 | 
				
			||||||
    m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
 | 
					 | 
				
			||||||
    m_settings.m_udpPort =  m_channelMarker.getUDPSendPort(),
 | 
					 | 
				
			||||||
    m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
 | 
					 | 
				
			||||||
    displayUDPAddress();
 | 
					 | 
				
			||||||
    applySettings();
 | 
					    applySettings();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -218,6 +214,17 @@ void NFMDemodGUI::onMenuDialogCalled(const QPoint &p)
 | 
				
			|||||||
    BasicChannelSettingsDialog dialog(&m_channelMarker, this);
 | 
					    BasicChannelSettingsDialog dialog(&m_channelMarker, this);
 | 
				
			||||||
    dialog.move(p);
 | 
					    dialog.move(p);
 | 
				
			||||||
    dialog.exec();
 | 
					    dialog.exec();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
 | 
				
			||||||
 | 
					    m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
 | 
				
			||||||
 | 
					    m_settings.m_udpPort =  m_channelMarker.getUDPSendPort(),
 | 
				
			||||||
 | 
					    m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    setWindowTitle(m_channelMarker.getTitle());
 | 
				
			||||||
 | 
					    setTitleColor(m_settings.m_rgbColor);
 | 
				
			||||||
 | 
					    displayUDPAddress();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    applySettings();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
 | 
					NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
 | 
				
			||||||
@ -269,16 +276,24 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
 | 
				
			|||||||
	ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
 | 
						ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
 | 
				
			||||||
    ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
 | 
					    ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	m_channelMarker.setVisible(true);
 | 
					    m_channelMarker.blockSignals(true);
 | 
				
			||||||
 | 
					    m_channelMarker.setColor(Qt::red);
 | 
				
			||||||
 | 
					    m_channelMarker.setBandwidth(5000);
 | 
				
			||||||
 | 
					    m_channelMarker.setCenterFrequency(0);
 | 
				
			||||||
    m_channelMarker.setTitle("NFM Demodulator");
 | 
					    m_channelMarker.setTitle("NFM Demodulator");
 | 
				
			||||||
    m_settings.setChannelMarker(&m_channelMarker);
 | 
					    m_channelMarker.setUDPAddress("127.0.0.1");
 | 
				
			||||||
 | 
					    m_channelMarker.setUDPSendPort(9999);
 | 
				
			||||||
 | 
					    m_channelMarker.blockSignals(false);
 | 
				
			||||||
 | 
					    m_channelMarker.setVisible(true); // activate signal on the last setting only
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
 | 
					    m_settings.setChannelMarker(&m_channelMarker);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    m_deviceUISet->registerRxChannelInstance(NFMDemod::m_channelID, this);
 | 
					    m_deviceUISet->registerRxChannelInstance(NFMDemod::m_channelID, this);
 | 
				
			||||||
	m_deviceUISet->addChannelMarker(&m_channelMarker);
 | 
						m_deviceUISet->addChannelMarker(&m_channelMarker);
 | 
				
			||||||
	m_deviceUISet->addRollupWidget(this);
 | 
						m_deviceUISet->addRollupWidget(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QChar delta = QChar(0x94, 0x03);
 | 
						QChar delta = QChar(0x94, 0x03);
 | 
				
			||||||
	ui->deltaSquelch->setText(delta);
 | 
						ui->deltaSquelch->setText(delta);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -301,14 +316,10 @@ void NFMDemodGUI::applySettings(bool force)
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		qDebug() << "NFMDemodGUI::applySettings";
 | 
							qDebug() << "NFMDemodGUI::applySettings";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		setTitleColor(m_channelMarker.getColor());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        NFMDemod::MsgConfigureChannelizer* channelConfigMsg = NFMDemod::MsgConfigureChannelizer::create(
 | 
					        NFMDemod::MsgConfigureChannelizer* channelConfigMsg = NFMDemod::MsgConfigureChannelizer::create(
 | 
				
			||||||
                48000, m_channelMarker.getCenterFrequency());
 | 
					                48000, m_channelMarker.getCenterFrequency());
 | 
				
			||||||
        m_nfmDemod->getInputMessageQueue()->push(channelConfigMsg);
 | 
					        m_nfmDemod->getInputMessageQueue()->push(channelConfigMsg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        NFMDemod::MsgConfigureNFMDemod* message = NFMDemod::MsgConfigureNFMDemod::create( m_settings, force);
 | 
					        NFMDemod::MsgConfigureNFMDemod* message = NFMDemod::MsgConfigureNFMDemod::create( m_settings, force);
 | 
				
			||||||
        m_nfmDemod->getInputMessageQueue()->push(message);
 | 
					        m_nfmDemod->getInputMessageQueue()->push(message);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -319,14 +330,17 @@ void NFMDemodGUI::displaySettings()
 | 
				
			|||||||
    m_channelMarker.blockSignals(true);
 | 
					    m_channelMarker.blockSignals(true);
 | 
				
			||||||
    m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
 | 
					    m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
 | 
				
			||||||
    m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
 | 
					    m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
 | 
				
			||||||
    m_channelMarker.setColor(m_settings.m_rgbColor);
 | 
					 | 
				
			||||||
    setTitleColor(m_settings.m_rgbColor);
 | 
					 | 
				
			||||||
    m_channelMarker.blockSignals(false);
 | 
					    m_channelMarker.blockSignals(false);
 | 
				
			||||||
 | 
					    m_channelMarker.setColor(m_settings.m_rgbColor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    setTitleColor(m_settings.m_rgbColor);
 | 
				
			||||||
    setWindowTitle(m_channelMarker.getTitle());
 | 
					    setWindowTitle(m_channelMarker.getTitle());
 | 
				
			||||||
 | 
					    displayUDPAddress();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    blockApplySettings(true);
 | 
					    blockApplySettings(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ui->rfBW->setCurrentIndex(NFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth));
 | 
					    ui->rfBW->setCurrentIndex(NFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ui->afBWText->setText(QString("%1 k").arg(m_settings.m_afBandwidth / 1000.0));
 | 
					    ui->afBWText->setText(QString("%1 k").arg(m_settings.m_afBandwidth / 1000.0));
 | 
				
			||||||
@ -365,21 +379,17 @@ void NFMDemodGUI::displaySettings()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void NFMDemodGUI::displayUDPAddress()
 | 
					void NFMDemodGUI::displayUDPAddress()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()));
 | 
					    ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_settings.m_udpAddress).arg(m_settings.m_udpPort));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NFMDemodGUI::leaveEvent(QEvent*)
 | 
					void NFMDemodGUI::leaveEvent(QEvent*)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	blockApplySettings(true);
 | 
					 | 
				
			||||||
	m_channelMarker.setHighlighted(false);
 | 
						m_channelMarker.setHighlighted(false);
 | 
				
			||||||
	blockApplySettings(false);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NFMDemodGUI::enterEvent(QEvent*)
 | 
					void NFMDemodGUI::enterEvent(QEvent*)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	blockApplySettings(true);
 | 
					 | 
				
			||||||
	m_channelMarker.setHighlighted(true);
 | 
						m_channelMarker.setHighlighted(true);
 | 
				
			||||||
	blockApplySettings(false);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NFMDemodGUI::setCtcssFreq(Real ctcssFreq)
 | 
					void NFMDemodGUI::setCtcssFreq(Real ctcssFreq)
 | 
				
			||||||
 | 
				
			|||||||
@ -38,23 +38,8 @@ public:
 | 
				
			|||||||
	virtual bool handleMessage(const Message& message);
 | 
						virtual bool handleMessage(const Message& message);
 | 
				
			||||||
	void setCtcssFreq(Real ctcssFreq);
 | 
						void setCtcssFreq(Real ctcssFreq);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private slots:
 | 
					public slots:
 | 
				
			||||||
	void channelMarkerChanged();
 | 
						void channelMarkerChangedByCursor();
 | 
				
			||||||
	void on_deltaFrequency_changed(qint64 value);
 | 
					 | 
				
			||||||
	void on_rfBW_currentIndexChanged(int index);
 | 
					 | 
				
			||||||
	void on_afBW_valueChanged(int value);
 | 
					 | 
				
			||||||
	void on_volume_valueChanged(int value);
 | 
					 | 
				
			||||||
	void on_squelchGate_valueChanged(int value);
 | 
					 | 
				
			||||||
	void on_deltaSquelch_toggled(bool checked);
 | 
					 | 
				
			||||||
	void on_squelch_valueChanged(int value);
 | 
					 | 
				
			||||||
	void on_ctcss_currentIndexChanged(int index);
 | 
					 | 
				
			||||||
	void on_ctcssOn_toggled(bool checked);
 | 
					 | 
				
			||||||
	void on_audioMute_toggled(bool checked);
 | 
					 | 
				
			||||||
    void on_copyAudioToUDP_toggled(bool checked);
 | 
					 | 
				
			||||||
	void onWidgetRolled(QWidget* widget, bool rollDown);
 | 
					 | 
				
			||||||
	void onMenuDialogCalled(const QPoint& p);
 | 
					 | 
				
			||||||
    void handleInputMessages();
 | 
					 | 
				
			||||||
	void tick();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
	Ui::NFMDemodGUI* ui;
 | 
						Ui::NFMDemodGUI* ui;
 | 
				
			||||||
@ -80,6 +65,23 @@ private:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	void leaveEvent(QEvent*);
 | 
						void leaveEvent(QEvent*);
 | 
				
			||||||
	void enterEvent(QEvent*);
 | 
						void enterEvent(QEvent*);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private slots:
 | 
				
			||||||
 | 
						void on_deltaFrequency_changed(qint64 value);
 | 
				
			||||||
 | 
						void on_rfBW_currentIndexChanged(int index);
 | 
				
			||||||
 | 
						void on_afBW_valueChanged(int value);
 | 
				
			||||||
 | 
						void on_volume_valueChanged(int value);
 | 
				
			||||||
 | 
						void on_squelchGate_valueChanged(int value);
 | 
				
			||||||
 | 
						void on_deltaSquelch_toggled(bool checked);
 | 
				
			||||||
 | 
						void on_squelch_valueChanged(int value);
 | 
				
			||||||
 | 
						void on_ctcss_currentIndexChanged(int index);
 | 
				
			||||||
 | 
						void on_ctcssOn_toggled(bool checked);
 | 
				
			||||||
 | 
						void on_audioMute_toggled(bool checked);
 | 
				
			||||||
 | 
					    void on_copyAudioToUDP_toggled(bool checked);
 | 
				
			||||||
 | 
						void onWidgetRolled(QWidget* widget, bool rollDown);
 | 
				
			||||||
 | 
						void onMenuDialogCalled(const QPoint& p);
 | 
				
			||||||
 | 
					    void handleInputMessages();
 | 
				
			||||||
 | 
						void tick();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // INCLUDE_NFMDEMODGUI_H
 | 
					#endif // INCLUDE_NFMDEMODGUI_H
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user