1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -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
@@ -26,12 +26,9 @@
#include "SWGDeviceState.h"
#include "SWGDeviceReport.h"
#include "SWGBladeRF2InputReport.h"
#include "SWGDeviceActions.h"
#include "SWGBladeRF2InputActions.h"
#include "device/deviceapi.h"
#include "dsp/dspcommands.h"
#include "dsp/filerecord.h"
#include "dsp/dspengine.h"
#include "bladerf2/devicebladerf2shared.h"
@@ -41,7 +38,6 @@
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgConfigureBladeRF2, Message)
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgFileRecord, Message)
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgStartStop, Message)
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgReportGainRange, Message)
@@ -67,9 +63,7 @@ BladeRF2Input::BladeRF2Input(DeviceAPI *deviceAPI) :
}
}
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
m_deviceAPI->setNbSourceStreams(1);
m_deviceAPI->addAncillarySink(m_fileSink);
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
}
@@ -83,8 +77,6 @@ BladeRF2Input::~BladeRF2Input()
stop();
}
m_deviceAPI->removeAncillarySink(m_fileSink);
delete m_fileSink;
closeDevice();
}
@@ -701,7 +693,6 @@ bool BladeRF2Input::handleMessage(const Message& message)
{
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);
}
@@ -717,28 +708,6 @@ bool BladeRF2Input::handleMessage(const Message& message)
return true;
}
else if (MsgFileRecord::match(message))
{
MsgFileRecord& conf = (MsgFileRecord&) message;
qDebug() << "BladeRF2Input::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;
@@ -975,7 +944,6 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
{
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);
}
@@ -1126,9 +1094,6 @@ void BladeRF2Input::webapiUpdateDeviceSettings(
if (deviceSettingsKeys.contains("transverterMode")) {
settings.m_transverterMode = response.getBladeRf2InputSettings()->getTransverterMode() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getBladeRf2InputSettings()->getFileRecordName();
}
if (deviceSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getBladeRf2InputSettings()->getUseReverseApi() != 0;
}
@@ -1169,12 +1134,6 @@ void BladeRF2Input::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
response.getBladeRf2InputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getBladeRf2InputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
if (response.getBladeRf2InputSettings()->getFileRecordName()) {
*response.getBladeRf2InputSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getBladeRf2InputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
response.getBladeRf2InputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getBladeRf2InputSettings()->getReverseApiAddress()) {
@@ -1266,37 +1225,6 @@ int BladeRF2Input::webapiRun(
return 200;
}
int BladeRF2Input::webapiActionsPost(
const QStringList& deviceActionsKeys,
SWGSDRangel::SWGDeviceActions& query,
QString& errorMessage)
{
SWGSDRangel::SWGBladeRF2InputActions *swgBladeRF2InputActions = query.getBladeRf2InputActions();
if (swgBladeRF2InputActions)
{
if (deviceActionsKeys.contains("record"))
{
bool record = swgBladeRF2InputActions->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 BladeRF2InputActions in query";
return 400;
}
}
void BladeRF2Input::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const BladeRF2InputSettings& settings, bool force)
{
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
@@ -1335,9 +1263,6 @@ void BladeRF2Input::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys
if (deviceSettingsKeys.contains("transverterMode") || force) {
swgBladeRF2Settings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
}
if (deviceSettingsKeys.contains("fileRecordName") || force) {
swgBladeRF2Settings->setFileRecordName(new QString(settings.m_fileRecordName));
}
if (deviceSettingsKeys.contains("devSampleRate")) {
swgBladeRF2Settings->setDevSampleRate(settings.m_devSampleRate);
}