mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-08-14 15:33:34 -04:00
Removed file recording function from device plugins
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
#include "ui_perseusgui.h"
|
||||
#include "gui/colormapper.h"
|
||||
@@ -55,9 +54,6 @@ PerseusGui::PerseusGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
|
||||
connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
|
||||
|
||||
CRightClickEnabler *fileRecordRightClickEnabler = new CRightClickEnabler(ui->record);
|
||||
connect(fileRecordRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openFileRecordDialog(const QPoint &)));
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_rates = m_sampleSource->getSampleRates();
|
||||
@@ -146,23 +142,6 @@ bool PerseusGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (PerseusInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const PerseusInput::MsgFileRecord& notif = (const PerseusInput::MsgFileRecord&) message;
|
||||
bool record = notif.getStartStop();
|
||||
|
||||
ui->record->blockSignals(true);
|
||||
ui->record->setChecked(record);
|
||||
|
||||
if (record) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
ui->record->blockSignals(false);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@@ -320,18 +299,6 @@ void PerseusGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void PerseusGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
PerseusInput::MsgFileRecord* message = PerseusInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void PerseusGui::on_transverter_clicked()
|
||||
{
|
||||
m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
|
||||
@@ -445,29 +412,3 @@ void PerseusGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void PerseusGui::openFileRecordDialog(const QPoint& p)
|
||||
{
|
||||
QFileDialog fileDialog(
|
||||
this,
|
||||
tr("Save I/Q record file"),
|
||||
m_settings.m_fileRecordName,
|
||||
tr("SDR I/Q Files (*.sdriq)")
|
||||
);
|
||||
|
||||
fileDialog.setOptions(QFileDialog::DontUseNativeDialog);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
fileDialog.move(p);
|
||||
QStringList fileNames;
|
||||
|
||||
if (fileDialog.exec())
|
||||
{
|
||||
fileNames = fileDialog.selectedFiles();
|
||||
|
||||
if (fileNames.size() > 0)
|
||||
{
|
||||
m_settings.m_fileRecordName = fileNames.at(0);
|
||||
sendSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,6 @@ private slots:
|
||||
void on_wideband_toggled(bool checked);
|
||||
void on_decim_currentIndexChanged(int index);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_transverter_clicked();
|
||||
void on_attenuator_currentIndexChanged(int index);
|
||||
void on_adcDither_toggled(bool checked);
|
||||
@@ -93,7 +92,6 @@ private slots:
|
||||
void updateStatus();
|
||||
void handleInputMessages();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif /* PLUGINS_SAMPLESOURCE_PERSEUS_PERSEUSGUI_H_ */
|
||||
|
||||
@@ -71,20 +71,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ButtonSwitch" name="record">
|
||||
<property name="toolTip">
|
||||
<string>Left: toggle record I/Q samples from device - Right: select output file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrgui/resources/res.qrc">
|
||||
<normaloff>:/record_off.png</normaloff>:/record_off.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -22,11 +22,8 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGPerseusReport.h"
|
||||
#include "SWGPerseusActions.h"
|
||||
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/deviceapi.h"
|
||||
@@ -36,12 +33,10 @@
|
||||
#include "perseusworker.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(PerseusInput::MsgConfigurePerseus, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PerseusInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PerseusInput::MsgStartStop, Message)
|
||||
|
||||
PerseusInput::PerseusInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_deviceDescription("PerseusInput"),
|
||||
m_running(false),
|
||||
m_perseusWorker(nullptr),
|
||||
@@ -58,13 +53,6 @@ PerseusInput::~PerseusInput()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
}
|
||||
|
||||
void PerseusInput::destroy()
|
||||
@@ -222,38 +210,6 @@ bool PerseusInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "PerseusInput::handleMessage: MsgFileRecord: " << conf.getStartStop();
|
||||
|
||||
if (conf.getStartStop())
|
||||
{
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
if (m_settings.m_fileRecordName.size() != 0) {
|
||||
m_fileSink = new FileRecord(m_settings.m_fileRecordName);
|
||||
} else {
|
||||
m_fileSink = new FileRecord(FileRecordInterface::genUniqueFileName(m_deviceAPI->getDeviceUID()));
|
||||
}
|
||||
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
m_fileSink->startRecording();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fileSink->stopRecording();
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
m_fileSink = nullptr;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@@ -458,11 +414,6 @@ bool PerseusInput::applySettings(const PerseusSettings& settings, bool force)
|
||||
{
|
||||
int sampleRate = m_sampleRates[sampleRateIndex]/(1<<settings.m_log2Decim);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, settings.m_centerFrequency);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -555,37 +506,6 @@ int PerseusInput::webapiSettingsPutPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int PerseusInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGPerseusActions *swgPerseusActions = query.getPerseusActions();
|
||||
|
||||
if (swgPerseusActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgPerseusActions->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 PerseusActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void PerseusInput::webapiUpdateDeviceSettings(
|
||||
PerseusSettings& settings,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
@@ -626,9 +546,6 @@ void PerseusInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("transverterMode")) {
|
||||
settings.m_transverterMode = response.getPerseusSettings()->getTransverterMode() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getPerseusSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getPerseusSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -668,12 +585,6 @@ void PerseusInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
|
||||
response.getPerseusSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
|
||||
response.getPerseusSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
|
||||
if (response.getPerseusSettings()->getFileRecordName()) {
|
||||
*response.getPerseusSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getPerseusSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getPerseusSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getPerseusSettings()->getReverseApiAddress()) {
|
||||
@@ -741,9 +652,6 @@ void PerseusInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
|
||||
if (deviceSettingsKeys.contains("transverterMode") || force) {
|
||||
swgPerseusSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgPerseusSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class FileRecord;
|
||||
class PerseusWorker;
|
||||
|
||||
class PerseusInput : public DeviceSampleSource {
|
||||
@@ -60,25 +59,6 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgFileRecord : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
bool getStartStop() const { return m_startStop; }
|
||||
|
||||
static MsgFileRecord* create(bool startStop) {
|
||||
return new MsgFileRecord(startStop);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_startStop;
|
||||
|
||||
MsgFileRecord(bool startStop) :
|
||||
Message(),
|
||||
m_startStop(startStop)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgStartStop : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
@@ -141,11 +121,6 @@ public:
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& actions,
|
||||
QString& errorMessage);
|
||||
|
||||
static void webapiFormatDeviceSettings(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
const PerseusSettings& settings);
|
||||
@@ -159,7 +134,6 @@ public:
|
||||
|
||||
private:
|
||||
DeviceAPI *m_deviceAPI;
|
||||
FileRecord *m_fileSink;
|
||||
QString m_deviceDescription;
|
||||
PerseusSettings m_settings;
|
||||
bool m_running;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
const PluginDescriptor PerseusPlugin::m_pluginDescriptor = {
|
||||
QString("Perseus"),
|
||||
QString("Perseus Input"),
|
||||
QString("4.12.3"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -37,7 +37,6 @@ void PerseusSettings::resetToDefaults()
|
||||
m_adcPreamp = false;
|
||||
m_wideBand = false;
|
||||
m_attenuator = Attenuator_None;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -43,7 +43,6 @@ struct PerseusSettings
|
||||
bool m_adcPreamp;
|
||||
bool m_wideBand;
|
||||
Attenuator m_attenuator;
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
@@ -41,11 +41,6 @@ Device start / stop button.
|
||||
- Green square icon: device is running and can be stopped
|
||||
- Magenta (or pink) square icon: an error occurred. In the case the device was accidentally disconnected you may click on the icon, plug back in and start again.
|
||||
|
||||
<h4>1.3: Record</h4>
|
||||
|
||||
- Left click: record baseband I/Q stream toggle button
|
||||
- Right click: choose record file
|
||||
|
||||
<h4>1.4: Stream sample rate</h4>
|
||||
|
||||
Baseband I/Q sample rate in kS/s. This is the device to host sample rate (4) divided by the software decimation factor (6).
|
||||
|
||||
Reference in New Issue
Block a user