mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
Tx ph.1: Enable center frequecy UI in FileSinkGUI
This commit is contained in:
parent
5b707b771b
commit
987c23004c
@ -64,7 +64,7 @@ FileSinkGui::FileSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_deviceSampleSink = new FileSinkOutput(m_deviceAPI->getMainWindow()->getMasterTimer());
|
||||
m_deviceSampleSink = new FileSinkOutput(m_deviceAPI, m_deviceAPI->getMainWindow()->getMasterTimer());
|
||||
connect(m_deviceSampleSink->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSinkMessages()));
|
||||
m_deviceAPI->setSink(m_deviceSampleSink);
|
||||
}
|
||||
|
@ -35,16 +35,7 @@
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -111,7 +102,7 @@
|
||||
<item>
|
||||
<widget class="ValueDial" name="centerFrequency" native="true">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
#include "device/devicesinkapi.h"
|
||||
|
||||
#include "filesinkgui.h"
|
||||
#include "filesinkoutput.h"
|
||||
#include "filesinkthread.h"
|
||||
@ -34,7 +36,8 @@ MESSAGE_CLASS_DEFINITION(FileSinkOutput::MsgConfigureFileSinkStreamTiming, Messa
|
||||
MESSAGE_CLASS_DEFINITION(FileSinkOutput::MsgReportFileSinkGeneration, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSinkOutput::MsgReportFileSinkStreamTiming, Message)
|
||||
|
||||
FileSinkOutput::FileSinkOutput(const QTimer& masterTimer) :
|
||||
FileSinkOutput::FileSinkOutput(DeviceSinkAPI *deviceAPI, const QTimer& masterTimer) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_fileSinkThread(0),
|
||||
m_deviceDescription(),
|
||||
@ -195,14 +198,24 @@ bool FileSinkOutput::handleMessage(const Message& message)
|
||||
void FileSinkOutput::applySettings(const FileSinkSettings& settings, bool force)
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
bool forwardChange = false;
|
||||
|
||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency))
|
||||
{
|
||||
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
||||
forwardChange = true;
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_sampleRate != settings.m_sampleRate))
|
||||
{
|
||||
m_settings.m_sampleRate = settings.m_sampleRate;
|
||||
forwardChange = true;
|
||||
}
|
||||
|
||||
if (forwardChange)
|
||||
{
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(m_settings.m_sampleRate, m_settings.m_centerFrequency);
|
||||
m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "filesinksettings.h"
|
||||
|
||||
class FileSinkThread;
|
||||
class DeviceSinkAPI;
|
||||
|
||||
class FileSinkOutput : public DeviceSampleSink {
|
||||
public:
|
||||
@ -147,7 +148,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
FileSinkOutput(const QTimer& masterTimer);
|
||||
FileSinkOutput(DeviceSinkAPI *deviceAPI, const QTimer& masterTimer);
|
||||
virtual ~FileSinkOutput();
|
||||
|
||||
virtual bool init(const Message& message);
|
||||
@ -162,6 +163,7 @@ public:
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
private:
|
||||
DeviceSinkAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
FileSinkSettings m_settings;
|
||||
std::ofstream m_ofstream;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <errno.h>
|
||||
#include "rtlsdrinput.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/devicesourceapi.h"
|
||||
|
||||
#include "rtlsdrthread.h"
|
||||
#include "rtlsdrgui.h"
|
||||
|
Loading…
Reference in New Issue
Block a user