mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-04 15:04:38 -04:00
Removed file recording function from device plugins
This commit is contained in:
@@ -62,11 +62,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 to stop, plug back in, check the source on the sampling devices control panel 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: ADC sample rate</h4>
|
||||
|
||||
This is the sample rate at which the ADC runs in kS/s (k) or MS/s (M) before hardware decimation (3). Thus this is the device to host sample rate (5) multiplied by the hardware decimation factor (3).
|
||||
|
||||
@@ -28,13 +28,10 @@
|
||||
#include "SWGXtrxInputSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGXtrxInputReport.h"
|
||||
#include "SWGXtrxInputActions.h"
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "xtrxinput.h"
|
||||
#include "xtrxinputthread.h"
|
||||
#include "xtrx/devicextrxparam.h"
|
||||
@@ -46,7 +43,6 @@ MESSAGE_CLASS_DEFINITION(XTRXInput::MsgGetStreamInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(XTRXInput::MsgGetDeviceInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(XTRXInput::MsgReportClockGenChange, Message)
|
||||
MESSAGE_CLASS_DEFINITION(XTRXInput::MsgReportStreamInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(XTRXInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(XTRXInput::MsgStartStop, Message)
|
||||
|
||||
XTRXInput::XTRXInput(DeviceAPI *deviceAPI) :
|
||||
@@ -58,10 +54,7 @@ XTRXInput::XTRXInput(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_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
@@ -75,8 +68,6 @@ XTRXInput::~XTRXInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
@@ -731,19 +722,6 @@ bool XTRXInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "XTRXInput::handleMessage: MsgFileRecord: " << conf.getStartStop();
|
||||
|
||||
if (conf.getStartStop()) {
|
||||
m_fileSink->startRecording();
|
||||
} else {
|
||||
m_fileSink->stopRecording();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -1280,7 +1258,6 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
||||
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
|
||||
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(getSampleRate(), m_settings.m_centerFrequency + ncoShift);
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
|
||||
if (getMessageQueueToGUI())
|
||||
@@ -1414,9 +1391,6 @@ void XTRXInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("pwrmode")) {
|
||||
settings.m_pwrmode = response.getXtrxInputSettings()->getPwrmode();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getXtrxInputSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getXtrxInputSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -1453,12 +1427,6 @@ void XTRXInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& respo
|
||||
response.getXtrxInputSettings()->setExtClockFreq(settings.m_extClockFreq);
|
||||
response.getXtrxInputSettings()->setPwrmode(settings.m_pwrmode);
|
||||
|
||||
if (response.getXtrxInputSettings()->getFileRecordName()) {
|
||||
*response.getXtrxInputSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getXtrxInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getXtrxInputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getXtrxInputSettings()->getReverseApiAddress()) {
|
||||
@@ -1510,37 +1478,6 @@ int XTRXInput::webapiRun(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int XTRXInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGXtrxInputActions *swgXtrxInputActions = query.getXtrxInputActions();
|
||||
|
||||
if (swgXtrxInputActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgXtrxInputActions->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 XtrxInputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void XTRXInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
|
||||
{
|
||||
int ret;
|
||||
@@ -1634,9 +1571,6 @@ void XTRXInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, co
|
||||
if (deviceSettingsKeys.contains("pwrmode") || force) {
|
||||
swgXtrxInputSettings->setPwrmode(settings.m_pwrmode);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgXtrxInputSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
@@ -33,7 +33,6 @@ class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class XTRXInputThread;
|
||||
struct DeviceXTRXParams;
|
||||
class FileRecord;
|
||||
|
||||
class XTRXInput : public DeviceSampleSource
|
||||
{
|
||||
@@ -171,25 +170,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)
|
||||
{ }
|
||||
};
|
||||
|
||||
XTRXInput(DeviceAPI *deviceAPI);
|
||||
virtual ~XTRXInput();
|
||||
virtual void destroy();
|
||||
@@ -238,11 +218,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 XTRXInputSettings& settings);
|
||||
@@ -273,8 +248,6 @@ private:
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
|
||||
bool openDevice();
|
||||
void closeDevice();
|
||||
XTRXInputThread *findThread();
|
||||
|
||||
@@ -76,9 +76,6 @@ XTRXInputGUI::XTRXInputGUI(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();
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
@@ -232,23 +229,7 @@ bool XTRXInputGUI::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (XTRXInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const XTRXInput::MsgFileRecord& notif = (const XTRXInput::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;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -513,18 +494,6 @@ void XTRXInputGUI::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void XTRXInputGUI::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
XTRXInput::MsgFileRecord* message = XTRXInput::MsgFileRecord::create(checked);
|
||||
m_XTRXInput->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void XTRXInputGUI::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
setCenterFrequencySetting(value);
|
||||
@@ -700,29 +669,3 @@ void XTRXInputGUI::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void XTRXInputGUI::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ private:
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_centerFrequency_changed(quint64 value);
|
||||
void on_ncoFrequency_changed(qint64 value);
|
||||
void on_ncoEnable_toggled(bool checked);
|
||||
@@ -106,7 +105,6 @@ private slots:
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif /* PLUGINS_SAMPLESOURCE_XTRXINPUT_XTRXINPUTGUI_H_ */
|
||||
|
||||
@@ -71,21 +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>
|
||||
<normalon>:/record_on.png</normalon>:/record_off.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
const PluginDescriptor XTRXInputPlugin::m_pluginDescriptor = {
|
||||
QString("XTRX"),
|
||||
QString("XTRX Input"),
|
||||
QString("4.14.4"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -44,7 +44,6 @@ void XTRXInputSettings::resetToDefaults()
|
||||
m_extClockFreq = 0; // Auto
|
||||
m_pwrmode = 1;
|
||||
m_iqOrder = true;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
@@ -72,7 +71,6 @@ QByteArray XTRXInputSettings::serialize() const
|
||||
s.writeBool(18, m_extClock);
|
||||
s.writeU32(19, m_extClockFreq);
|
||||
s.writeU32(20, m_pwrmode);
|
||||
s.writeString(21, m_fileRecordName);
|
||||
s.writeBool(22, m_useReverseAPI);
|
||||
s.writeString(23, m_reverseAPIAddress);
|
||||
s.writeU32(24, m_reverseAPIPort);
|
||||
@@ -116,7 +114,6 @@ bool XTRXInputSettings::deserialize(const QByteArray& data)
|
||||
d.readBool(18, &m_extClock, false);
|
||||
d.readU32(19, &m_extClockFreq, 0);
|
||||
d.readU32(20, &m_pwrmode, 2);
|
||||
d.readString(21, &m_fileRecordName, "");
|
||||
d.readBool(22, &m_useReverseAPI, false);
|
||||
d.readString(23, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(24, &uintval, 0);
|
||||
|
||||
@@ -57,7 +57,6 @@ struct XTRXInputSettings
|
||||
uint32_t m_extClockFreq; //!< Frequency (Hz) of external clock source
|
||||
uint32_t m_pwrmode;
|
||||
bool m_iqOrder;
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
Reference in New Issue
Block a user