mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-23 18:52:28 -04: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();
|
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()));
|
connect(m_deviceSampleSink->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSinkMessages()));
|
||||||
m_deviceAPI->setSink(m_deviceSampleSink);
|
m_deviceAPI->setSink(m_deviceSampleSink);
|
||||||
}
|
}
|
||||||
|
@ -35,16 +35,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -111,7 +102,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="ValueDial" name="centerFrequency" native="true">
|
<widget class="ValueDial" name="centerFrequency" native="true">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspengine.h"
|
||||||
#include "dsp/filerecord.h"
|
#include "dsp/filerecord.h"
|
||||||
|
|
||||||
|
#include "device/devicesinkapi.h"
|
||||||
|
|
||||||
#include "filesinkgui.h"
|
#include "filesinkgui.h"
|
||||||
#include "filesinkoutput.h"
|
#include "filesinkoutput.h"
|
||||||
#include "filesinkthread.h"
|
#include "filesinkthread.h"
|
||||||
@ -34,7 +36,8 @@ MESSAGE_CLASS_DEFINITION(FileSinkOutput::MsgConfigureFileSinkStreamTiming, Messa
|
|||||||
MESSAGE_CLASS_DEFINITION(FileSinkOutput::MsgReportFileSinkGeneration, Message)
|
MESSAGE_CLASS_DEFINITION(FileSinkOutput::MsgReportFileSinkGeneration, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FileSinkOutput::MsgReportFileSinkStreamTiming, 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_settings(),
|
||||||
m_fileSinkThread(0),
|
m_fileSinkThread(0),
|
||||||
m_deviceDescription(),
|
m_deviceDescription(),
|
||||||
@ -195,14 +198,24 @@ bool FileSinkOutput::handleMessage(const Message& message)
|
|||||||
void FileSinkOutput::applySettings(const FileSinkSettings& settings, bool force)
|
void FileSinkOutput::applySettings(const FileSinkSettings& settings, bool force)
|
||||||
{
|
{
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
bool forwardChange = false;
|
||||||
|
|
||||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency))
|
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency))
|
||||||
{
|
{
|
||||||
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))
|
if (force || (m_settings.m_sampleRate != settings.m_sampleRate))
|
||||||
{
|
{
|
||||||
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"
|
#include "filesinksettings.h"
|
||||||
|
|
||||||
class FileSinkThread;
|
class FileSinkThread;
|
||||||
|
class DeviceSinkAPI;
|
||||||
|
|
||||||
class FileSinkOutput : public DeviceSampleSink {
|
class FileSinkOutput : public DeviceSampleSink {
|
||||||
public:
|
public:
|
||||||
@ -147,7 +148,7 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
FileSinkOutput(const QTimer& masterTimer);
|
FileSinkOutput(DeviceSinkAPI *deviceAPI, const QTimer& masterTimer);
|
||||||
virtual ~FileSinkOutput();
|
virtual ~FileSinkOutput();
|
||||||
|
|
||||||
virtual bool init(const Message& message);
|
virtual bool init(const Message& message);
|
||||||
@ -162,6 +163,7 @@ public:
|
|||||||
virtual bool handleMessage(const Message& message);
|
virtual bool handleMessage(const Message& message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
DeviceSinkAPI *m_deviceAPI;
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
FileSinkSettings m_settings;
|
FileSinkSettings m_settings;
|
||||||
std::ofstream m_ofstream;
|
std::ofstream m_ofstream;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "rtlsdrinput.h"
|
#include "rtlsdrinput.h"
|
||||||
|
|
||||||
#include <device/devicesourceapi.h>
|
#include "device/devicesourceapi.h"
|
||||||
|
|
||||||
#include "rtlsdrthread.h"
|
#include "rtlsdrthread.h"
|
||||||
#include "rtlsdrgui.h"
|
#include "rtlsdrgui.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user