1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Removed file recording function from device plugins

This commit is contained in:
f4exb
2020-08-08 11:53:56 +02:00
parent db7ae9a0cd
commit e6e7ece46c
241 changed files with 250 additions and 4140 deletions
@@ -24,13 +24,10 @@
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
#include "SWGDeviceActions.h"
#include "SWGHackRFInputActions.h"
#include "util/simpleserializer.h"
#include "dsp/dspcommands.h"
#include "dsp/dspengine.h"
#include "dsp/filerecord.h"
#include "device/deviceapi.h"
#include "hackrf/devicehackrfvalues.h"
#include "hackrf/devicehackrfshared.h"
@@ -40,7 +37,6 @@
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgConfigureHackRF, Message)
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgReportHackRF, Message)
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgFileRecord, Message)
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgStartStop, Message)
HackRFInput::HackRFInput(DeviceAPI *deviceAPI) :
@@ -53,10 +49,7 @@ HackRFInput::HackRFInput(DeviceAPI *deviceAPI) :
{
openDevice();
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
m_deviceAPI->setNbSourceStreams(1);
m_deviceAPI->addAncillarySink(m_fileSink);
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
m_networkManager = new QNetworkAccessManager();
@@ -72,8 +65,6 @@ HackRFInput::~HackRFInput()
stop();
}
m_deviceAPI->removeAncillarySink(m_fileSink);
delete m_fileSink;
closeDevice();
m_deviceAPI->setBuddySharedPtr(0);
}
@@ -269,28 +260,6 @@ bool HackRFInput::handleMessage(const Message& message)
return true;
}
else if (MsgFileRecord::match(message))
{
MsgFileRecord& conf = (MsgFileRecord&) message;
qDebug() << "HackRFInput::handleMessage: MsgFileRecord: " << conf.getStartStop();
if (conf.getStartStop())
{
if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName);
} else {
m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
}
m_fileSink->startRecording();
}
else
{
m_fileSink->stopRecording();
}
return true;
}
else if (MsgStartStop::match(message))
{
MsgStartStop& cmd = (MsgStartStop&) message;
@@ -337,7 +306,6 @@ bool HackRFInput::handleMessage(const Message& message)
m_settings.m_centerFrequency = settings.m_centerFrequency;
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim);
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency);
m_fileSink->handleMessage(*notif); // forward to file sink
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
return true;
@@ -571,7 +539,6 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
{
int sampleRate = settings.m_devSampleRate/(1<<settings.m_log2Decim);
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, settings.m_centerFrequency);
m_fileSink->handleMessage(*notif); // forward to file sink
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
}
@@ -684,9 +651,6 @@ void HackRFInput::webapiUpdateDeviceSettings(
if (deviceSettingsKeys.contains("iqCorrection")) {
settings.m_iqCorrection = response.getHackRfInputSettings()->getIqCorrection() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getHackRfInputSettings()->getFileRecordName();
}
if (deviceSettingsKeys.contains("transverterDeltaFrequency")) {
settings.m_transverterDeltaFrequency = response.getHackRfInputSettings()->getTransverterDeltaFrequency();
}
@@ -725,12 +689,6 @@ void HackRFInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res
response.getHackRfInputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getHackRfInputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
if (response.getHackRfInputSettings()->getFileRecordName()) {
*response.getHackRfInputSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getHackRfInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
response.getHackRfInputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getHackRfInputSettings()->getReverseApiAddress()) {
@@ -771,37 +729,6 @@ int HackRFInput::webapiRun(
return 200;
}
int HackRFInput::webapiActionsPost(
const QStringList& deviceActionsKeys,
SWGSDRangel::SWGDeviceActions& query,
QString& errorMessage)
{
SWGSDRangel::SWGHackRFInputActions *swgHackRFInputActions = query.getHackRfInputActions();
if (swgHackRFInputActions)
{
if (deviceActionsKeys.contains("record"))
{
bool record = swgHackRFInputActions->getRecord() != 0;
MsgFileRecord *msg = MsgFileRecord::create(record);
getInputMessageQueue()->push(msg);
if (getMessageQueueToGUI())
{
MsgFileRecord *msgToGUI = MsgFileRecord::create(record);
getMessageQueueToGUI()->push(msgToGUI);
}
}
return 202;
}
else
{
errorMessage = "Missing HackRFInputActions in query";
return 400;
}
}
void HackRFInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const HackRFInputSettings& settings, bool force)
{
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
@@ -852,9 +779,6 @@ void HackRFInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
if (deviceSettingsKeys.contains("iqCorrection") || force) {
swgHackRFInputSettings->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
}
if (deviceSettingsKeys.contains("fileRecordName") || force) {
swgHackRFInputSettings->setFileRecordName(new QString(settings.m_fileRecordName));
}
if (deviceSettingsKeys.contains("transverterDeltaFrequency") || force) {
swgHackRFInputSettings->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
}