1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

HackRF: implemented link Tx frequency to Rx frequency option

This commit is contained in:
f4exb 2017-07-21 00:44:30 +02:00
parent 9c1c9cf850
commit 361e8b0cd6
3 changed files with 20 additions and 0 deletions

View File

@ -21,6 +21,7 @@
class DeviceHackRFShared
{
public:
class MsgConfigureFrequencyDelta : public Message
{
MESSAGE_CLASS_DECLARATION

View File

@ -28,6 +28,7 @@
#include "device/devicesinkapi.h"
#include "device/devicesourceapi.h"
#include "hackrf/devicehackrfvalues.h"
#include "hackrf/devicehackrfshared.h"
#include "ui_hackrfoutputgui.h"
@ -148,6 +149,13 @@ void HackRFOutputGui::handleDSPMessages()
qDebug("HackRFOutputGui::handleDSPMessages: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
updateSampleRateAndFrequency();
delete message;
}
else if (DeviceHackRFShared::MsgConfigureFrequencyDelta::match(*message))
{
DeviceHackRFShared::MsgConfigureFrequencyDelta* deltaMsg = (DeviceHackRFShared::MsgConfigureFrequencyDelta *) message;
ui->centerFrequency->setValue(ui->centerFrequency->getValue() + (deltaMsg->getFrequencyDelta()/1000));
delete message;
}
}

View File

@ -26,6 +26,7 @@
#include "device/devicesourceapi.h"
#include "device/devicesinkapi.h"
#include "hackrf/devicehackrfvalues.h"
#include "hackrf/devicehackrfshared.h"
#include "hackrfinputgui.h"
#include "hackrfinputthread.h"
@ -278,6 +279,16 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
qint64 f_img = deviceCenterFrequency;
quint32 devSampleRate =m_settings.m_devSampleRate;
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)) // forward delta to buddy if necessary
{
if (m_settings.m_linkTxFrequency && (m_deviceAPI->getSinkBuddies().size() > 0))
{
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
DeviceHackRFShared::MsgConfigureFrequencyDelta *deltaMsg = DeviceHackRFShared::MsgConfigureFrequencyDelta::create(settings.m_centerFrequency - m_settings.m_centerFrequency);
buddy->getDeviceOutputMessageQueue()->push(deltaMsg);
}
}
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency) ||
(m_settings.m_LOppmTenths != settings.m_LOppmTenths) ||
(m_settings.m_fcPos != settings.m_fcPos))