mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-07 08:24:43 -04:00
Removed file recording function from device plugins
This commit is contained in:
@@ -150,9 +150,6 @@ FCDProGui::FCDProGui(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);
|
||||
@@ -239,23 +236,6 @@ bool FCDProGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (FCDProInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const FCDProInput::MsgFileRecord& notif = (const FCDProInput::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;
|
||||
@@ -526,18 +506,6 @@ void FCDProGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void FCDProGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
FCDProInput::MsgFileRecord* message = FCDProInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void FCDProGui::on_transverter_clicked()
|
||||
{
|
||||
m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
|
||||
@@ -604,29 +572,3 @@ void FCDProGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void FCDProGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,12 +101,10 @@ private slots:
|
||||
void on_fcPos_currentIndexChanged(int index);
|
||||
void on_setDefaults_clicked(bool checked);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_transverter_clicked();
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FCDPROGUI_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>
|
||||
|
||||
@@ -24,12 +24,9 @@
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGFCDProActions.h"
|
||||
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "fcdproinput.h"
|
||||
@@ -39,12 +36,10 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(FCDProInput::MsgConfigureFCDPro, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProInput::MsgFileRecord, Message)
|
||||
|
||||
FCDProInput::FCDProInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_dev(0),
|
||||
m_dev(nullptr),
|
||||
m_settings(),
|
||||
m_FCDThread(nullptr),
|
||||
m_deviceDescription(fcd_traits<Pro>::displayedName),
|
||||
@@ -66,12 +61,6 @@ FCDProInput::~FCDProInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
@@ -299,38 +288,6 @@ bool FCDProInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "FCDProInput::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;
|
||||
@@ -588,11 +545,6 @@ void FCDProInput::applySettings(const FCDProSettings& settings, bool force)
|
||||
if (forwardChange)
|
||||
{
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(fcd_traits<Pro>::sampleRate/(1<<m_settings.m_log2Decim), m_settings.m_centerFrequency);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
}
|
||||
@@ -886,37 +838,6 @@ int FCDProInput::webapiRun(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int FCDProInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGFCDProActions *swgFCDProActions = query.getFcdProActions();
|
||||
|
||||
if (swgFCDProActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgFCDProActions->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 AirspyActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
int FCDProInput::webapiSettingsGet(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
QString& errorMessage)
|
||||
@@ -1031,9 +952,6 @@ void FCDProInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("transverterMode")) {
|
||||
settings.m_transverterMode = response.getFcdProSettings()->getTransverterMode() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getFcdProSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getFcdProSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -1076,12 +994,6 @@ void FCDProInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res
|
||||
response.getFcdProSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
|
||||
response.getFcdProSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
|
||||
if (response.getFcdProSettings()->getFileRecordName()) {
|
||||
*response.getFcdProSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getFcdProSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getFcdProSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getFcdProSettings()->getReverseApiAddress()) {
|
||||
@@ -1180,9 +1092,6 @@ void FCDProInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
|
||||
if (deviceSettingsKeys.contains("transverterMode") || force) {
|
||||
swgFCDProSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgFCDProSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
@@ -40,7 +40,6 @@ class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class FCDProThread;
|
||||
class FileRecord;
|
||||
|
||||
class FCDProInput : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -68,25 +67,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
|
||||
|
||||
@@ -145,11 +125,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 FCDProSettings& settings);
|
||||
@@ -188,7 +163,6 @@ private:
|
||||
FCDProThread* m_FCDThread;
|
||||
QString m_deviceDescription;
|
||||
bool m_running;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ void FCDProSettings::resetToDefaults()
|
||||
m_transverterMode = false;
|
||||
m_transverterDeltaFrequency = 0;
|
||||
m_iqOrder = true;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -52,7 +52,6 @@ struct FCDProSettings {
|
||||
bool m_transverterMode;
|
||||
qint64 m_transverterDeltaFrequency;
|
||||
bool m_iqOrder;
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
@@ -24,11 +24,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 sample rate (4) divided by the decimation factor (6).
|
||||
|
||||
Reference in New Issue
Block a user