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:
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include <dsp/filerecord.h>
|
||||
|
||||
#include "ui_airspygui.h"
|
||||
#include "gui/colormapper.h"
|
||||
@@ -58,9 +57,6 @@ AirspyGui::AirspyGui(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 = ((AirspyInput*) m_sampleSource)->getSampleRates();
|
||||
@@ -148,23 +144,6 @@ bool AirspyGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (AirspyInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const AirspyInput::MsgFileRecord& notif = (const AirspyInput::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;
|
||||
@@ -398,18 +377,6 @@ void AirspyGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void AirspyGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
AirspyInput::MsgFileRecord* message = AirspyInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void AirspyGui::on_transverter_clicked()
|
||||
{
|
||||
m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
|
||||
@@ -502,29 +469,3 @@ void AirspyGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void AirspyGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,13 +91,11 @@ private slots:
|
||||
void on_lnaAGC_stateChanged(int state);
|
||||
void on_mixAGC_stateChanged(int state);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_transverter_clicked();
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void handleInputMessages();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_AIRSPYGUI_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>
|
||||
|
||||
@@ -26,15 +26,12 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGAirspyReport.h"
|
||||
#include "SWGAirspyActions.h"
|
||||
|
||||
#include "airspyinput.h"
|
||||
#include "airspyplugin.h"
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "airspysettings.h"
|
||||
@@ -42,14 +39,12 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(AirspyInput::MsgConfigureAirspy, Message)
|
||||
MESSAGE_CLASS_DEFINITION(AirspyInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(AirspyInput::MsgFileRecord, Message)
|
||||
|
||||
const qint64 AirspyInput::loLowLimitFreq = 24000000L;
|
||||
const qint64 AirspyInput::loHighLimitFreq = 1900000000L;
|
||||
|
||||
AirspyInput::AirspyInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_dev(nullptr),
|
||||
m_airspyWorker(nullptr),
|
||||
@@ -71,12 +66,6 @@ AirspyInput::~AirspyInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
@@ -349,38 +338,6 @@ bool AirspyInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "AirspyInput::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;
|
||||
@@ -626,11 +583,6 @@ bool AirspyInput::applySettings(const AirspySettings& settings, bool force)
|
||||
{
|
||||
int sampleRate = m_sampleRates[m_settings.m_devSampleRateIndex]/(1<<m_settings.m_log2Decim);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -780,9 +732,6 @@ void AirspyInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("transverterMode")) {
|
||||
settings.m_transverterMode = response.getAirspySettings()->getTransverterMode() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getAirspySettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getAirspySettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -808,37 +757,6 @@ int AirspyInput::webapiReportGet(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int AirspyInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGAirspyActions *swgAirspyActions = query.getAirspyActions();
|
||||
|
||||
if (swgAirspyActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgAirspyActions->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;
|
||||
}
|
||||
}
|
||||
|
||||
void AirspyInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const AirspySettings& settings)
|
||||
{
|
||||
response.getAirspySettings()->setCenterFrequency(settings.m_centerFrequency);
|
||||
@@ -858,12 +776,6 @@ void AirspyInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res
|
||||
response.getAirspySettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
|
||||
response.getAirspySettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
|
||||
if (response.getAirspySettings()->getFileRecordName()) {
|
||||
*response.getAirspySettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getAirspySettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getAirspySettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getAirspySettings()->getReverseApiAddress()) {
|
||||
@@ -946,9 +858,6 @@ void AirspyInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
|
||||
if (deviceSettingsKeys.contains("transverterMode") || force) {
|
||||
swgAirspySettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgAirspySettings->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 AirspyWorker;
|
||||
class FileRecord;
|
||||
|
||||
class AirspyInput : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -59,25 +58,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::SWGDeviceReport& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& actions,
|
||||
QString& errorMessage);
|
||||
|
||||
static void webapiFormatDeviceSettings(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
const AirspySettings& settings);
|
||||
@@ -168,7 +143,6 @@ private:
|
||||
QString m_deviceDescription;
|
||||
std::vector<uint32_t> m_sampleRates;
|
||||
bool m_running;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ const int AirspyPlugin::m_maxDevices = 32;
|
||||
const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
|
||||
QString("Airspy"),
|
||||
QString("Airspy Input"),
|
||||
QString("4.12.3"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -42,7 +42,6 @@ void AirspySettings::resetToDefaults()
|
||||
m_transverterMode = false;
|
||||
m_transverterDeltaFrequency = 0;
|
||||
m_iqOrder = true;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -43,7 +43,6 @@ struct AirspySettings {
|
||||
bool m_transverterMode;
|
||||
qint64 m_transverterDeltaFrequency;
|
||||
bool m_iqOrder;
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <device/deviceapi.h>
|
||||
#include "device/deviceuiset.h"
|
||||
#include <dsp/filerecord.h>
|
||||
|
||||
#include "ui_airspyhfgui.h"
|
||||
#include "gui/colormapper.h"
|
||||
@@ -57,9 +56,6 @@ AirspyHFGui::AirspyHFGui(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 = ((AirspyHFInput*) m_sampleSource)->getSampleRates();
|
||||
@@ -147,23 +143,6 @@ bool AirspyHFGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (AirspyHFInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const AirspyHFInput::MsgFileRecord& notif = (const AirspyHFInput::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;
|
||||
@@ -350,18 +329,6 @@ void AirspyHFGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void AirspyHFGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
AirspyHFInput::MsgFileRecord* message = AirspyHFInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void AirspyHFGui::on_transverter_clicked()
|
||||
{
|
||||
m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
|
||||
@@ -521,29 +488,3 @@ void AirspyHFGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void AirspyHFGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ private slots:
|
||||
void on_sampleRate_currentIndexChanged(int index);
|
||||
void on_decim_currentIndexChanged(int index);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_transverter_clicked();
|
||||
void on_band_currentIndexChanged(int index);
|
||||
void on_dsp_toggled(bool checked);
|
||||
@@ -98,7 +97,6 @@ private slots:
|
||||
void updateStatus();
|
||||
void handleInputMessages();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_AIRSPYHFGUI_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>
|
||||
|
||||
@@ -25,12 +25,9 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGAirspyHFReport.h"
|
||||
#include "SWGAirspyHFActions.h"
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
|
||||
@@ -42,7 +39,6 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(AirspyHFInput::MsgConfigureAirspyHF, Message)
|
||||
MESSAGE_CLASS_DEFINITION(AirspyHFInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(AirspyHFInput::MsgFileRecord, Message)
|
||||
|
||||
const qint64 AirspyHFInput::loLowLimitFreqHF = 9000L;
|
||||
const qint64 AirspyHFInput::loHighLimitFreqHF = 31000000L;
|
||||
@@ -51,7 +47,6 @@ const qint64 AirspyHFInput::loHighLimitFreqVHF = 260000000L;
|
||||
|
||||
AirspyHFInput::AirspyHFInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
m_airspyHFWorker(nullptr),
|
||||
@@ -59,9 +54,7 @@ AirspyHFInput::AirspyHFInput(DeviceAPI *deviceAPI) :
|
||||
m_running(false)
|
||||
{
|
||||
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,12 +68,6 @@ AirspyHFInput::~AirspyHFInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
@@ -363,38 +350,6 @@ bool AirspyHFInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "AirspyHFInput::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;
|
||||
@@ -433,7 +388,6 @@ bool AirspyHFInput::applySettings(const AirspyHFSettings& settings, bool force)
|
||||
<< " m_bandIndex: " << settings.m_bandIndex
|
||||
<< " m_transverterDeltaFrequency: " << settings.m_transverterDeltaFrequency
|
||||
<< " m_transverterMode: " << settings.m_transverterMode
|
||||
<< " m_fileRecordName: " << settings.m_fileRecordName
|
||||
<< " m_useDSP: " << settings.m_useDSP
|
||||
<< " m_useAGC: " << settings.m_useAGC
|
||||
<< " m_agcHigh: " << settings.m_agcHigh
|
||||
@@ -654,11 +608,6 @@ bool AirspyHFInput::applySettings(const AirspyHFSettings& 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);
|
||||
}
|
||||
|
||||
@@ -763,9 +712,6 @@ void AirspyHFInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("bandIndex")) {
|
||||
settings.m_bandIndex = response.getAirspyHfSettings()->getBandIndex();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getAirspyHfSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getAirspyHfSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -812,12 +758,6 @@ void AirspyHFInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
|
||||
response.getAirspyHfSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
response.getAirspyHfSettings()->setBandIndex(settings.m_bandIndex ? 1 : 0);
|
||||
|
||||
if (response.getAirspyHfSettings()->getFileRecordName()) {
|
||||
*response.getAirspyHfSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getAirspyHfSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getAirspyHfSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getAirspyHfSettings()->getReverseApiAddress()) {
|
||||
@@ -859,37 +799,6 @@ int AirspyHFInput::webapiReportGet(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int AirspyHFInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGAirspyHFActions *swgAirspyHFActions = query.getAirspyHfActions();
|
||||
|
||||
if (swgAirspyHFActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgAirspyHFActions->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 AirspyHFActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
int AirspyHFInput::webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage)
|
||||
@@ -953,9 +862,6 @@ void AirspyHFInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys
|
||||
if (deviceSettingsKeys.contains("bandIndex") || force) {
|
||||
swgAirspyHFSettings->setBandIndex(settings.m_bandIndex);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgAirspyHFSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useAGC")) {
|
||||
swgAirspyHFSettings->setUseAgc(settings.m_useAGC ? 1 : 0);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class AirspyHFWorker;
|
||||
class FileRecord;
|
||||
|
||||
class AirspyHFInput : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -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
|
||||
|
||||
@@ -133,11 +113,6 @@ public:
|
||||
SWGSDRangel::SWGDeviceReport& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& actions,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage);
|
||||
@@ -171,7 +146,6 @@ private:
|
||||
QString m_deviceDescription;
|
||||
std::vector<uint32_t> m_sampleRates;
|
||||
bool m_running;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
const PluginDescriptor AirspyHFPlugin::m_pluginDescriptor = {
|
||||
QString("AirspyHF"),
|
||||
QString("AirspyHF Input"),
|
||||
QString("4.12.3"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -35,7 +35,6 @@ void AirspyHFSettings::resetToDefaults()
|
||||
m_transverterDeltaFrequency = 0;
|
||||
m_iqOrder = true;
|
||||
m_bandIndex = 0;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -30,7 +30,6 @@ struct AirspyHFSettings
|
||||
qint64 m_transverterDeltaFrequency;
|
||||
bool m_iqOrder;
|
||||
quint32 m_bandIndex;
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
@@ -34,11 +34,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 (3) divided by the decimation factor (4).
|
||||
|
||||
@@ -17,7 +17,7 @@ set(bladerf1input_HEADERS
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||
${CMAKE_SOURCE_DIR}/devices
|
||||
${LIBBLADERF_INCLUDE_DIRS}
|
||||
)
|
||||
@@ -26,7 +26,6 @@ if(NOT SERVER_MODE)
|
||||
set(bladerf1input_SOURCES
|
||||
${bladerf1input_SOURCES}
|
||||
bladerf1inputgui.cpp
|
||||
|
||||
bladerf1inputgui.ui
|
||||
)
|
||||
set(bladerf1input_HEADERS
|
||||
@@ -54,13 +53,13 @@ if(ENABLE_EXTERNAL_LIBRARIES)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
Qt5::Core
|
||||
${TARGET_LIB}
|
||||
Qt5::Core
|
||||
${TARGET_LIB}
|
||||
sdrbase
|
||||
${TARGET_LIB_GUI}
|
||||
swagger
|
||||
${LIBBLADERF_LIBRARIES}
|
||||
bladerf1device
|
||||
swagger
|
||||
${LIBBLADERF_LIBRARIES}
|
||||
bladerf1device
|
||||
)
|
||||
|
||||
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})
|
||||
|
||||
@@ -24,15 +24,12 @@
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGBladeRF1InputActions.h"
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspdevicesourceengine.h"
|
||||
#include "dsp/dspdevicesinkengine.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "bladerf1input.h"
|
||||
@@ -40,11 +37,9 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(Bladerf1Input::MsgConfigureBladerf1, Message)
|
||||
MESSAGE_CLASS_DEFINITION(Bladerf1Input::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(Bladerf1Input::MsgFileRecord, Message)
|
||||
|
||||
Bladerf1Input::Bladerf1Input(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
m_bladerfThread(nullptr),
|
||||
@@ -52,10 +47,7 @@ Bladerf1Input::Bladerf1Input(DeviceAPI *deviceAPI) :
|
||||
m_running(false)
|
||||
{
|
||||
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();
|
||||
@@ -71,12 +63,6 @@ Bladerf1Input::~Bladerf1Input()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
closeDevice();
|
||||
m_deviceAPI->setBuddySharedPtr(0);
|
||||
}
|
||||
@@ -294,38 +280,6 @@ bool Bladerf1Input::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "BladerfInput::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 if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -592,11 +546,6 @@ bool Bladerf1Input::applySettings(const BladeRF1InputSettings& settings, bool fo
|
||||
{
|
||||
int sampleRate = settings.m_devSampleRate/(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);
|
||||
}
|
||||
|
||||
@@ -674,12 +623,6 @@ void Bladerf1Input::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
|
||||
response.getBladeRf1InputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
|
||||
response.getBladeRf1InputSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
|
||||
|
||||
if (response.getBladeRf1InputSettings()->getFileRecordName()) {
|
||||
*response.getBladeRf1InputSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getBladeRf1InputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getBladeRf1InputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getBladeRf1InputSettings()->getReverseApiAddress()) {
|
||||
@@ -762,9 +705,6 @@ void Bladerf1Input::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("iqCorrection")) {
|
||||
settings.m_iqCorrection = response.getBladeRf1InputSettings()->getIqCorrection() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getBladeRf1InputSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getBladeRf1InputSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -807,37 +747,6 @@ int Bladerf1Input::webapiRun(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int Bladerf1Input::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGBladeRF1InputActions *swgBladeRF1InputActions = query.getBladeRf1InputActions();
|
||||
|
||||
if (swgBladeRF1InputActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgBladeRF1InputActions->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 BladeRF1InputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void Bladerf1Input::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const BladeRF1InputSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
|
||||
@@ -891,9 +800,6 @@ void Bladerf1Input::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys
|
||||
if (deviceSettingsKeys.contains("iqCorrection") || force) {
|
||||
swgBladeRF1Settings->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgBladeRF1Settings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
@@ -25,15 +25,14 @@
|
||||
#include <libbladeRF.h>
|
||||
#include <dsp/devicesamplesource.h>
|
||||
|
||||
#include "../../../devices/bladerf1/devicebladerf1.h"
|
||||
#include "../../../devices/bladerf1/devicebladerf1param.h"
|
||||
#include "bladerf1/devicebladerf1.h"
|
||||
#include "bladerf1/devicebladerf1param.h"
|
||||
#include "bladerf1inputsettings.h"
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class Bladerf1InputThread;
|
||||
class FileRecord;
|
||||
|
||||
class Bladerf1Input : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -61,25 +60,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
|
||||
|
||||
@@ -138,11 +118,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 BladeRF1InputSettings& settings);
|
||||
@@ -161,7 +136,6 @@ private:
|
||||
QString m_deviceDescription;
|
||||
DeviceBladeRF1Params m_sharedParams;
|
||||
bool m_running;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -68,9 +68,6 @@ Bladerf1InputGui::Bladerf1InputGui(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);
|
||||
@@ -156,23 +153,6 @@ bool Bladerf1InputGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (Bladerf1Input::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const Bladerf1Input::MsgFileRecord& notif = (const Bladerf1Input::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;
|
||||
@@ -455,18 +435,6 @@ void Bladerf1InputGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void Bladerf1InputGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
Bladerf1Input::MsgFileRecord* message = Bladerf1Input::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void Bladerf1InputGui::on_sampleRateMode_toggled(bool checked)
|
||||
{
|
||||
m_sampleRateMode = checked;
|
||||
@@ -579,29 +547,3 @@ void Bladerf1InputGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void Bladerf1InputGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,12 +90,10 @@ private slots:
|
||||
void on_xb200_currentIndexChanged(int index);
|
||||
void on_fcPos_currentIndexChanged(int index);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_sampleRateMode_toggled(bool checked);
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_BLADERFINPUTGUI_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>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
const PluginDescriptor Blderf1InputPlugin::m_pluginDescriptor = {
|
||||
QString("BladeRF1"),
|
||||
QString("BladeRF1 Input"),
|
||||
QString("4.12.3"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -37,11 +37,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>
|
||||
|
||||
In device to host sample rate input mode (4A) this is the baseband I/Q sample rate in kS/s. This is the device to host sample rate (4) divided by the decimation factor (5).
|
||||
|
||||
@@ -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,13 +38,11 @@
|
||||
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgConfigureBladeRF2, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgReportGainRange, Message)
|
||||
|
||||
BladeRF2Input::BladeRF2Input(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_deviceDescription("BladeRF2Input"),
|
||||
m_running(false),
|
||||
@@ -82,12 +77,6 @@ BladeRF2Input::~BladeRF2Input()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
@@ -704,11 +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);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -724,38 +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_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 if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -992,11 +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);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -1147,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;
|
||||
}
|
||||
@@ -1190,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()) {
|
||||
@@ -1287,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();
|
||||
@@ -1356,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);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class BladeRF2InputThread;
|
||||
class FileRecord;
|
||||
struct bladerf_gain_modes;
|
||||
struct bladerf;
|
||||
|
||||
@@ -62,25 +61,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
|
||||
|
||||
@@ -182,11 +162,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 BladeRF2InputSettings& settings);
|
||||
@@ -204,7 +179,6 @@ private:
|
||||
bool m_running;
|
||||
DeviceBladeRF2Shared m_deviceShared;
|
||||
BladeRF2InputThread *m_thread;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
std::vector<GainMode> m_gainModes;
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
@@ -89,9 +89,6 @@ BladeRF2InputGui::BladeRF2InputGui(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);
|
||||
@@ -220,23 +217,6 @@ bool BladeRF2InputGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (BladeRF2Input::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const BladeRF2Input::MsgFileRecord& notif = (const BladeRF2Input::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;
|
||||
@@ -491,18 +471,6 @@ void BladeRF2InputGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2InputGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
BladeRF2Input::MsgFileRecord* message = BladeRF2Input::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void BladeRF2InputGui::on_sampleRateMode_toggled(bool checked)
|
||||
{
|
||||
m_sampleRateMode = checked;
|
||||
@@ -573,29 +541,3 @@ void BladeRF2InputGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2InputGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,12 +92,10 @@ private slots:
|
||||
void on_gain_valueChanged(int value);
|
||||
void on_transverter_clicked();
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_sampleRateMode_toggled(bool checked);
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif /* PLUGINS_SAMPLESOURCE_BLADERF2INPUT_BLADERF2INPUTGUI_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>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
const PluginDescriptor Blderf2InputPlugin::m_pluginDescriptor = {
|
||||
QString("BladeRF2"),
|
||||
QString("BladeRF2 Input"),
|
||||
QString("4.14.5"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -40,7 +40,6 @@ void BladeRF2InputSettings::resetToDefaults()
|
||||
m_transverterMode = false;
|
||||
m_transverterDeltaFrequency = 0;
|
||||
m_iqOrder = true;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -42,7 +42,6 @@ struct BladeRF2InputSettings {
|
||||
bool m_transverterMode;
|
||||
qint64 m_transverterDeltaFrequency;
|
||||
bool m_iqOrder;
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
@@ -37,11 +37,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>
|
||||
|
||||
In device to host sample rate input mode (6A) this is the baseband I/Q sample rate in kS/s. This is the device to host sample rate (6) divided by the decimation factor (8).
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -68,9 +68,6 @@ FCDProPlusGui::FCDProPlusGui(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);
|
||||
@@ -157,23 +154,6 @@ bool FCDProPlusGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (FCDProPlusInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const FCDProPlusInput::MsgFileRecord& notif = (const FCDProPlusInput::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;
|
||||
@@ -385,18 +365,6 @@ void FCDProPlusGui::on_startStop_toggled(bool checked)
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void FCDProPlusGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
FCDProPlusInput::MsgFileRecord* message = FCDProPlusInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void FCDProPlusGui::on_transverter_clicked()
|
||||
{
|
||||
m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
|
||||
@@ -426,29 +394,3 @@ void FCDProPlusGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void FCDProPlusGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,12 +88,10 @@ private slots:
|
||||
void on_filterIF_currentIndexChanged(int index);
|
||||
void on_ppm_valueChanged(int value);
|
||||
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_FCDGUI_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 "SWGFCDProPlusActions.h"
|
||||
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "fcdproplusinput.h"
|
||||
@@ -39,12 +36,10 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgConfigureFCDProPlus, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgFileRecord, Message)
|
||||
|
||||
FCDProPlusInput::FCDProPlusInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_dev(0),
|
||||
m_dev(nullptr),
|
||||
m_settings(),
|
||||
m_FCDThread(nullptr),
|
||||
m_deviceDescription(fcd_traits<ProPlus>::displayedName),
|
||||
@@ -66,12 +61,6 @@ FCDProPlusInput::~FCDProPlusInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
@@ -301,38 +290,6 @@ bool FCDProPlusInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "FCDProPlusInput::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;
|
||||
@@ -499,11 +456,6 @@ void FCDProPlusInput::applySettings(const FCDProPlusSettings& settings, bool for
|
||||
if (forwardChange)
|
||||
{
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(fcd_traits<ProPlus>::sampleRate/(1<<settings.m_log2Decim), m_settings.m_centerFrequency);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
}
|
||||
@@ -647,37 +599,6 @@ int FCDProPlusInput::webapiSettingsPutPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int FCDProPlusInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGFCDProPlusActions *swgFCDProPlusActions = query.getFcdProPlusActions();
|
||||
|
||||
if (swgFCDProPlusActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgFCDProPlusActions->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 FCDProPlusActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void FCDProPlusInput::webapiUpdateDeviceSettings(
|
||||
FCDProPlusSettings& settings,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
@@ -731,9 +652,6 @@ void FCDProPlusInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("transverterMode")) {
|
||||
settings.m_transverterMode = response.getFcdProPlusSettings()->getTransverterMode() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getFcdProPlusSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getFcdProPlusSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -767,12 +685,6 @@ void FCDProPlusInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings&
|
||||
response.getFcdProPlusSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
|
||||
response.getFcdProPlusSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
|
||||
if (response.getFcdProPlusSettings()->getFileRecordName()) {
|
||||
*response.getFcdProPlusSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getFcdProPlusSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getFcdProPlusSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getFcdProPlusSettings()->getReverseApiAddress()) {
|
||||
@@ -844,9 +756,6 @@ void FCDProPlusInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKe
|
||||
if (deviceSettingsKeys.contains("transverterMode") || force) {
|
||||
swgFCDProPlusSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgFCDProPlusSettings->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 FCDProPlusThread;
|
||||
class FileRecord;
|
||||
|
||||
class FCDProPlusInput : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -87,25 +86,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)
|
||||
{ }
|
||||
};
|
||||
|
||||
FCDProPlusInput(DeviceAPI *deviceAPI);
|
||||
virtual ~FCDProPlusInput();
|
||||
virtual void destroy();
|
||||
@@ -145,11 +125,6 @@ public:
|
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& actions,
|
||||
QString& errorMessage);
|
||||
|
||||
static void webapiFormatDeviceSettings(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
const FCDProPlusSettings& settings);
|
||||
@@ -177,7 +152,6 @@ private:
|
||||
FCDProPlusThread* 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;
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ void FCDProPlusSettings::resetToDefaults()
|
||||
m_transverterMode = false;
|
||||
m_transverterDeltaFrequency = 0;
|
||||
m_iqOrder = true;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -43,7 +43,6 @@ struct FCDProPlusSettings {
|
||||
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).
|
||||
|
||||
@@ -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,12 +37,10 @@
|
||||
|
||||
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) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_dev(nullptr),
|
||||
m_hackRFThread(nullptr),
|
||||
@@ -70,12 +65,6 @@ HackRFInput::~HackRFInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
closeDevice();
|
||||
m_deviceAPI->setBuddySharedPtr(0);
|
||||
}
|
||||
@@ -271,38 +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_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 if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -349,11 +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);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
|
||||
return true;
|
||||
@@ -587,11 +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);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -704,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();
|
||||
}
|
||||
@@ -745,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()) {
|
||||
@@ -791,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();
|
||||
@@ -872,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);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class HackRFInputThread;
|
||||
class FileRecord;
|
||||
|
||||
class HackRFInput : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -97,25 +96,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)
|
||||
{ }
|
||||
};
|
||||
|
||||
HackRFInput(DeviceAPI *deviceAPI);
|
||||
virtual ~HackRFInput();
|
||||
virtual void destroy();
|
||||
@@ -155,11 +135,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 HackRFInputSettings& settings);
|
||||
@@ -178,7 +153,6 @@ private:
|
||||
QString m_deviceDescription;
|
||||
DeviceHackRFParams m_sharedParams;
|
||||
bool m_running;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -62,9 +62,6 @@ HackRFInputGui::HackRFInputGui(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();
|
||||
displayBandwidths();
|
||||
|
||||
@@ -159,23 +156,6 @@ bool HackRFInputGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (HackRFInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const HackRFInput::MsgFileRecord& notif = (const HackRFInput::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;
|
||||
@@ -445,18 +425,6 @@ void HackRFInputGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void HackRFInputGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
HackRFInput::MsgFileRecord* message = HackRFInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void HackRFInputGui::on_sampleRateMode_toggled(bool checked)
|
||||
{
|
||||
m_sampleRateMode = checked;
|
||||
@@ -539,29 +507,3 @@ void HackRFInputGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void HackRFInputGui::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,13 +101,11 @@ private slots:
|
||||
void on_bbFilter_currentIndexChanged(int index);
|
||||
void on_vga_valueChanged(int value);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_sampleRateMode_toggled(bool checked);
|
||||
void on_transverter_clicked();
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_HACKRFINPUTGUI_H
|
||||
|
||||
@@ -77,20 +77,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>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
const PluginDescriptor HackRFInputPlugin::m_pluginDescriptor = {
|
||||
QString("HackRF"),
|
||||
QString("HackRF Input"),
|
||||
QString("4.14.5"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -40,7 +40,6 @@ void HackRFInputSettings::resetToDefaults()
|
||||
m_dcBlock = false;
|
||||
m_iqCorrection = false;
|
||||
m_devSampleRate = 2400000;
|
||||
m_fileRecordName = "";
|
||||
m_transverterMode = false;
|
||||
m_transverterDeltaFrequency = 0;
|
||||
m_iqOrder = true;
|
||||
|
||||
@@ -40,7 +40,6 @@ struct HackRFInputSettings {
|
||||
bool m_lnaExt;
|
||||
bool m_dcBlock;
|
||||
bool m_iqCorrection;
|
||||
QString m_fileRecordName;
|
||||
bool m_transverterMode;
|
||||
qint64 m_transverterDeltaFrequency;
|
||||
bool m_iqOrder;
|
||||
|
||||
@@ -28,11 +28,6 @@ If you have the Tx open in another tab and it is running then it will be stopped
|
||||
|
||||
The settings on Rx or Tx tab are reapplied on start so these settings can be considered independent.
|
||||
|
||||
<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>
|
||||
|
||||
In device to host sample rate input mode (6A) this is the baseband I/Q sample rate in kS/s. This is the device to host sample rate (6) divided by the decimation factor (7).
|
||||
|
||||
@@ -79,9 +79,6 @@ KiwiSDRGui::KiwiSDRGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
|
||||
CRightClickEnabler *fileRecordRightClickEnabler = new CRightClickEnabler(ui->record);
|
||||
connect(fileRecordRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openFileRecordDialog(const QPoint &)));
|
||||
|
||||
CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
|
||||
connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
|
||||
}
|
||||
@@ -175,18 +172,6 @@ void KiwiSDRGui::on_dcBlock_toggled(bool checked)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void KiwiSDRGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
KiwiSDRInput::MsgFileRecord* message = KiwiSDRInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void KiwiSDRGui::on_agc_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_useAGC = checked;
|
||||
@@ -291,23 +276,6 @@ bool KiwiSDRGui::handleMessage(const Message& message)
|
||||
m_statusColors[status] + "; border-radius: 7px; }");
|
||||
return true;
|
||||
}
|
||||
else if (KiwiSDRInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const KiwiSDRInput::MsgFileRecord& notif = (const KiwiSDRInput::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;
|
||||
@@ -367,29 +335,3 @@ void KiwiSDRGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void KiwiSDRGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,14 +80,12 @@ private slots:
|
||||
void handleInputMessages();
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_centerFrequency_changed(quint64 value);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_gain_valueChanged(int value);
|
||||
void on_agc_toggled(bool checked);
|
||||
void on_serverAddress_returnPressed();
|
||||
void on_serverAddressApplyButton_clicked();
|
||||
void on_dcBlock_toggled(bool checked);
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
void updateStatus();
|
||||
void updateHardware();
|
||||
};
|
||||
|
||||
@@ -74,20 +74,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>
|
||||
|
||||
@@ -27,26 +27,21 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGKiwiSDRReport.h"
|
||||
#include "SWGKiwiSDRActions.h"
|
||||
|
||||
#include "kiwisdrinput.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "kiwisdrworker.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(KiwiSDRInput::MsgConfigureKiwiSDR, Message)
|
||||
MESSAGE_CLASS_DEFINITION(KiwiSDRInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(KiwiSDRInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(KiwiSDRInput::MsgSetStatus, Message)
|
||||
|
||||
|
||||
KiwiSDRInput::KiwiSDRInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_kiwiSDRWorker(nullptr),
|
||||
m_deviceDescription(),
|
||||
@@ -76,12 +71,6 @@ KiwiSDRInput::~KiwiSDRInput()
|
||||
|
||||
m_kiwiSDRWorkerThread.quit();
|
||||
m_kiwiSDRWorkerThread.wait();
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
}
|
||||
|
||||
void KiwiSDRInput::destroy()
|
||||
@@ -211,38 +200,6 @@ bool KiwiSDRInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "KiwiSDRInput::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 if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -288,7 +245,6 @@ bool KiwiSDRInput::applySettings(const KiwiSDRSettings& settings, bool force)
|
||||
<< " m_centerFrequency: " << settings.m_centerFrequency
|
||||
<< " m_gain: " << settings.m_gain
|
||||
<< " m_useAGC: " << settings.m_useAGC
|
||||
<< " m_fileRecordName: " << settings.m_fileRecordName
|
||||
<< " m_useAGC: " << settings.m_useAGC
|
||||
<< " m_useReverseAPI: " << settings.m_useReverseAPI
|
||||
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
|
||||
@@ -330,11 +286,6 @@ bool KiwiSDRInput::applySettings(const KiwiSDRSettings& settings, bool force)
|
||||
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(
|
||||
getSampleRate(), settings.m_centerFrequency);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -434,9 +385,6 @@ void KiwiSDRInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("serverAddress")) {
|
||||
settings.m_serverAddress = *response.getKiwiSdrSettings()->getServerAddress();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getKiwiSdrSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getKiwiSdrSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -462,37 +410,6 @@ int KiwiSDRInput::webapiReportGet(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int KiwiSDRInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGKiwiSDRActions *swgKiwiSDRActions = query.getKiwiSdrActions();
|
||||
|
||||
if (swgKiwiSDRActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgKiwiSDRActions->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 KiwiSDRInputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void KiwiSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const KiwiSDRSettings& settings)
|
||||
{
|
||||
response.getKiwiSdrSettings()->setGain(settings.m_gain);
|
||||
@@ -506,12 +423,6 @@ void KiwiSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
|
||||
response.getKiwiSdrSettings()->setServerAddress(new QString(settings.m_serverAddress));
|
||||
}
|
||||
|
||||
if (response.getKiwiSdrSettings()->getFileRecordName()) {
|
||||
*response.getKiwiSdrSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getKiwiSdrSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getKiwiSdrSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getKiwiSdrSettings()->getReverseApiAddress()) {
|
||||
@@ -555,9 +466,6 @@ void KiwiSDRInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
|
||||
if (deviceSettingsKeys.contains("serverAddress") || force) {
|
||||
swgKiwiSDRSettings->setServerAddress(new QString(settings.m_serverAddress));
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgKiwiSDRSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
class DeviceAPI;
|
||||
class KiwiSDRWorker;
|
||||
class FileRecord;
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -160,11 +140,6 @@ public:
|
||||
SWGSDRangel::SWGDeviceReport& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& actions,
|
||||
QString& errorMessage);
|
||||
|
||||
static void webapiFormatDeviceSettings(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
const KiwiSDRSettings& settings);
|
||||
@@ -176,7 +151,6 @@ public:
|
||||
|
||||
private:
|
||||
DeviceAPI *m_deviceAPI;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QMutex m_mutex;
|
||||
KiwiSDRSettings m_settings;
|
||||
KiwiSDRWorker* m_kiwiSDRWorker;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
const PluginDescriptor KiwiSDRPlugin::m_pluginDescriptor = {
|
||||
QString("KiwiSDR"),
|
||||
QString("KiwiSDR input"),
|
||||
QString("4.12.3"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Vort (c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -34,7 +34,6 @@ void KiwiSDRSettings::resetToDefaults()
|
||||
|
||||
m_serverAddress = "127.0.0.1:8073";
|
||||
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -29,7 +29,6 @@ struct KiwiSDRSettings {
|
||||
|
||||
quint64 m_centerFrequency;
|
||||
QString m_serverAddress;
|
||||
QString m_fileRecordName;
|
||||
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
|
||||
@@ -15,11 +15,6 @@ This button is used to start the "device" i.e connect to the remote and start st
|
||||
- Blue triangle icon: device is ready and can be started
|
||||
- Green square icon: device is running and can be stopped
|
||||
|
||||
<h3>2: Record</h3>
|
||||
|
||||
- Left click: record baseband I/Q stream toggle button
|
||||
- Right click: choose record file
|
||||
|
||||
<h3>3: Frequency</h3>
|
||||
|
||||
This is the center frequency of reception in kHz.
|
||||
|
||||
@@ -29,13 +29,10 @@
|
||||
#include "SWGLimeSdrInputSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGLimeSdrInputReport.h"
|
||||
#include "SWGLimeSdrInputActions.h"
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "limesdrinput.h"
|
||||
#include "limesdrinputthread.h"
|
||||
@@ -47,12 +44,10 @@ MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgConfigureLimeSDR, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgGetStreamInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgGetDeviceInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgReportStreamInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgStartStop, Message)
|
||||
|
||||
LimeSDRInput::LimeSDRInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_limeSDRInputThread(nullptr),
|
||||
m_deviceDescription("LimeSDRInput"),
|
||||
@@ -81,12 +76,6 @@ LimeSDRInput::~LimeSDRInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
suspendRxBuddies();
|
||||
suspendTxBuddies();
|
||||
closeDevice();
|
||||
@@ -748,38 +737,6 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "LimeSDRInput::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 if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -1361,11 +1318,6 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
|
||||
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim);
|
||||
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + ncoShift);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -1555,9 +1507,6 @@ void LimeSDRInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("transverterMode")) {
|
||||
settings.m_transverterMode = response.getLimeSdrInputSettings()->getTransverterMode() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getLimeSdrInputSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("gpioDir")) {
|
||||
settings.m_gpioDir = response.getLimeSdrInputSettings()->getGpioDir() & 0xFF;
|
||||
}
|
||||
@@ -1602,13 +1551,6 @@ void LimeSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
|
||||
response.getLimeSdrInputSettings()->setTiaGain(settings.m_tiaGain);
|
||||
response.getLimeSdrInputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
|
||||
response.getLimeSdrInputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
|
||||
if (response.getLimeSdrInputSettings()->getFileRecordName()) {
|
||||
*response.getLimeSdrInputSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getLimeSdrInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getLimeSdrInputSettings()->setGpioDir(settings.m_gpioDir);
|
||||
response.getLimeSdrInputSettings()->setGpioPins(settings.m_gpioPins);
|
||||
response.getLimeSdrInputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
@@ -1662,37 +1604,6 @@ int LimeSDRInput::webapiRun(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int LimeSDRInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGLimeSdrInputActions *swgLimeSdrInputActions = query.getLimeSdrInputActions();
|
||||
|
||||
if (swgLimeSdrInputActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgLimeSdrInputActions->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 LimeSdrInputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void LimeSDRInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
|
||||
{
|
||||
bool success = false;
|
||||
@@ -1810,9 +1721,6 @@ void LimeSDRInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
|
||||
if (deviceSettingsKeys.contains("transverterMode") || force) {
|
||||
swgLimeSdrInputSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgLimeSdrInputSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
if (deviceSettingsKeys.contains("gpioDir") || force) {
|
||||
swgLimeSdrInputSettings->setGpioDir(settings.m_gpioDir & 0xFF);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
class DeviceAPI;
|
||||
class LimeSDRInputThread;
|
||||
class FileRecord;
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
|
||||
@@ -166,25 +165,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
|
||||
|
||||
@@ -247,11 +227,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 LimeSDRInputSettings& settings);
|
||||
@@ -278,7 +253,6 @@ private:
|
||||
DeviceLimeSDRShared m_deviceShared;
|
||||
bool m_channelAcquired;
|
||||
lms_stream_t m_streamId;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -97,9 +97,6 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_limeSDRInput->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
|
||||
CRightClickEnabler *fileRecordRightClickEnabler = new CRightClickEnabler(ui->record);
|
||||
connect(fileRecordRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openFileRecordDialog(const QPoint &)));
|
||||
|
||||
CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
|
||||
connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
|
||||
}
|
||||
@@ -263,23 +260,6 @@ bool LimeSDRInputGUI::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (LimeSDRInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const LimeSDRInput::MsgFileRecord& notif = (const LimeSDRInput::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;
|
||||
@@ -571,18 +551,6 @@ void LimeSDRInputGUI::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void LimeSDRInputGUI::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
LimeSDRInput::MsgFileRecord* message = LimeSDRInput::MsgFileRecord::create(checked);
|
||||
m_limeSDRInput->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
setCenterFrequencySetting(value);
|
||||
@@ -772,29 +740,3 @@ void LimeSDRInputGUI::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void LimeSDRInputGUI::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);
|
||||
@@ -105,7 +104,6 @@ private slots:
|
||||
void on_transverter_clicked();
|
||||
void on_sampleRateMode_toggled(bool checked);
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const PluginDescriptor LimeSDRInputPlugin::m_pluginDescriptor = {
|
||||
QString("LimeSDR"),
|
||||
QString("LimeSDR Input"),
|
||||
QString("4.14.5"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -47,7 +47,6 @@ void LimeSDRInputSettings::resetToDefaults()
|
||||
m_transverterMode = false;
|
||||
m_transverterDeltaFrequency = 0;
|
||||
m_iqOrder = true;
|
||||
m_fileRecordName = "";
|
||||
m_gpioDir = 0;
|
||||
m_gpioPins = 0;
|
||||
m_useReverseAPI = false;
|
||||
|
||||
@@ -67,7 +67,6 @@ struct LimeSDRInputSettings
|
||||
bool m_transverterMode;
|
||||
qint64 m_transverterDeltaFrequency;
|
||||
bool m_iqOrder;
|
||||
QString m_fileRecordName;
|
||||
uint8_t m_gpioDir; //!< GPIO pin direction LSB first; 0 input, 1 output
|
||||
uint8_t m_gpioPins; //!< GPIO pins to write; LSB first
|
||||
bool m_useReverseAPI;
|
||||
|
||||
@@ -30,11 +30,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 (8). Thus this is the device to host sample rate (5) multiplied by the hardware decimation factor (3).
|
||||
|
||||
@@ -25,26 +25,21 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGLocalInputReport.h"
|
||||
#include "SWGLocalInputActions.h"
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
#include "localinput.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(LocalInput::MsgConfigureLocalInput, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LocalInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LocalInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LocalInput::MsgReportSampleRateAndFrequency, Message)
|
||||
|
||||
LocalInput::LocalInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_settings(),
|
||||
m_centerFrequency(0),
|
||||
m_deviceDescription("LocalInput")
|
||||
@@ -62,12 +57,6 @@ LocalInput::~LocalInput()
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
stop();
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
}
|
||||
|
||||
void LocalInput::destroy()
|
||||
@@ -168,49 +157,7 @@ void LocalInput::setCenterFrequency(qint64 centerFrequency)
|
||||
|
||||
bool LocalInput::handleMessage(const Message& message)
|
||||
{
|
||||
if (DSPSignalNotification::match(message))
|
||||
{
|
||||
DSPSignalNotification& notif = (DSPSignalNotification&) message;
|
||||
|
||||
if (m_fileSink) {
|
||||
return m_fileSink->handleMessage(notif); // forward to file sink
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "LocalInput::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 if (MsgStartStop::match(message))
|
||||
if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
qDebug() << "LocalInput::handleMessage: MsgStartStop: " << (cmd.getStartStop() ? "start" : "stop");
|
||||
@@ -259,9 +206,6 @@ void LocalInput::applySettings(const LocalInputSettings& settings, bool force)
|
||||
if ((m_settings.m_iqCorrection != settings.m_iqCorrection) || force) {
|
||||
reverseAPIKeys.append("iqCorrection");
|
||||
}
|
||||
if ((m_settings.m_fileRecordName != settings.m_fileRecordName) || force) {
|
||||
reverseAPIKeys.append("fileRecordName");
|
||||
}
|
||||
|
||||
if ((m_settings.m_dcBlock != settings.m_dcBlock) || (m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
|
||||
{
|
||||
@@ -288,7 +232,6 @@ void LocalInput::applySettings(const LocalInputSettings& settings, bool force)
|
||||
qDebug() << "LocalInput::applySettings: "
|
||||
<< " m_dcBlock: " << m_settings.m_dcBlock
|
||||
<< " m_iqCorrection: " << m_settings.m_iqCorrection
|
||||
<< " m_fileRecordName: " << m_settings.m_fileRecordName
|
||||
<< " m_remoteAddress: " << m_remoteAddress;
|
||||
}
|
||||
|
||||
@@ -354,37 +297,6 @@ int LocalInput::webapiSettingsPutPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int LocalInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGLocalInputActions *swgLocalInputActions = query.getLocalInputActions();
|
||||
|
||||
if (swgLocalInputActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgLocalInputActions->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 LocalInputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void LocalInput::webapiUpdateDeviceSettings(
|
||||
LocalInputSettings& settings,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
@@ -396,9 +308,6 @@ void LocalInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("iqCorrection")) {
|
||||
settings.m_iqCorrection = response.getLocalInputSettings()->getIqCorrection() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getLocalInputSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getLocalInputSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -418,12 +327,6 @@ void LocalInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& resp
|
||||
response.getLocalInputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
|
||||
response.getLocalInputSettings()->setIqCorrection(settings.m_iqCorrection);
|
||||
|
||||
if (response.getLocalInputSettings()->getFileRecordName()) {
|
||||
*response.getLocalInputSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getLocalInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getLocalInputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getLocalInputSettings()->getReverseApiAddress()) {
|
||||
@@ -470,9 +373,6 @@ void LocalInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, c
|
||||
if (deviceSettingsKeys.contains("iqCorrection") || force) {
|
||||
swgLocalInputSettings->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgLocalInputSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class FileRecord;
|
||||
|
||||
class LocalInput : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -62,25 +61,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
|
||||
|
||||
@@ -165,11 +145,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 LocalInputSettings& settings);
|
||||
@@ -187,7 +162,6 @@ private:
|
||||
int m_sampleRate;
|
||||
QString m_remoteAddress;
|
||||
QString m_deviceDescription;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -87,9 +87,6 @@ LocalInputGui::LocalInputGui(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_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
@@ -205,23 +202,6 @@ bool LocalInputGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (LocalInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const LocalInput::MsgFileRecord& notif = (const LocalInput::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;
|
||||
@@ -316,18 +296,6 @@ void LocalInputGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void LocalInputGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
LocalInput::MsgFileRecord* message = LocalInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void LocalInputGui::updateHardware()
|
||||
{
|
||||
if (m_doApplySettings)
|
||||
@@ -388,29 +356,3 @@ void LocalInputGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void LocalInputGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,11 +117,9 @@ private slots:
|
||||
void on_dcOffset_toggled(bool checked);
|
||||
void on_iqImbalance_toggled(bool checked);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_LOCALINPUTGUI_H
|
||||
|
||||
@@ -65,20 +65,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>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
const PluginDescriptor LocalInputPlugin::m_pluginDescriptor = {
|
||||
QString("LocalInput"),
|
||||
QString("Local device input"),
|
||||
QString("4.12.3"),
|
||||
QString("4.15.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
||||
@@ -27,7 +27,6 @@ void LocalInputSettings::resetToDefaults()
|
||||
{
|
||||
m_dcBlock = false;
|
||||
m_iqCorrection = false;
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
struct LocalInputSettings {
|
||||
bool m_dcBlock;
|
||||
bool m_iqCorrection;
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
@@ -15,11 +15,6 @@ Device start / stop button.
|
||||
- Blue triangle icon: device is ready and can be started
|
||||
- Green square icon: device is running and can be stopped
|
||||
|
||||
<h3>2: Record</h3>
|
||||
|
||||
- Left click: record baseband I/Q stream toggle button
|
||||
- Right click: choose record file
|
||||
|
||||
<h3>3: Frequency</h3>
|
||||
|
||||
This is the center frequency in Hz sent from the Local Sink channel instance and corresponds to the center frequency of reception. The sub kHz value (000 to 999 Hz) is represented in smaller digits on the right.
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -22,11 +22,8 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGPlutoSdrInputReport.h"
|
||||
#include "SWGPlutoSdrInputActions.h"
|
||||
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/deviceapi.h"
|
||||
@@ -39,12 +36,10 @@
|
||||
#define PLUTOSDR_BLOCKSIZE_SAMPLES (16*1024) //complex samples per buffer (must be multiple of 64)
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(PlutoSDRInput::MsgConfigurePlutoSDR, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PlutoSDRInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PlutoSDRInput::MsgStartStop, Message)
|
||||
|
||||
PlutoSDRInput::PlutoSDRInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(nullptr),
|
||||
m_deviceDescription("PlutoSDRInput"),
|
||||
m_running(false),
|
||||
m_plutoRxBuffer(0),
|
||||
@@ -77,12 +72,6 @@ PlutoSDRInput::~PlutoSDRInput()
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
|
||||
if (m_fileSink)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
suspendBuddies();
|
||||
closeDevice();
|
||||
resumeBuddies();
|
||||
@@ -210,38 +199,6 @@ bool PlutoSDRInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "PlutoSDRInput::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 if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -519,9 +476,6 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
||||
if ((m_settings.m_transverterDeltaFrequency != settings.m_transverterDeltaFrequency) || force) {
|
||||
reverseAPIKeys.append("transverterDeltaFrequency");
|
||||
}
|
||||
if ((m_settings.m_fileRecordName != settings.m_fileRecordName) || force) {
|
||||
reverseAPIKeys.append("fileRecordName");
|
||||
}
|
||||
|
||||
// determine if buddies threads or own thread need to be suspended
|
||||
|
||||
@@ -769,11 +723,6 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
||||
|
||||
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency);
|
||||
|
||||
if (m_fileSink) {
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -1002,9 +951,6 @@ void PlutoSDRInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("transverterMode")) {
|
||||
settings.m_transverterMode = response.getPlutoSdrInputSettings()->getTransverterMode() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getPlutoSdrInputSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getPlutoSdrInputSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -1030,37 +976,6 @@ int PlutoSDRInput::webapiReportGet(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int PlutoSDRInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGPlutoSdrInputActions *swgPlutoSdrInputActions = query.getPlutoSdrInputActions();
|
||||
|
||||
if (swgPlutoSdrInputActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgPlutoSdrInputActions->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 PlutoSdrInputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void PlutoSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const PlutoSDRInputSettings& settings)
|
||||
{
|
||||
response.getPlutoSdrInputSettings()->setCenterFrequency(settings.m_centerFrequency);
|
||||
@@ -1085,12 +1000,6 @@ void PlutoSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
|
||||
response.getPlutoSdrInputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
|
||||
response.getPlutoSdrInputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
|
||||
if (response.getPlutoSdrInputSettings()->getFileRecordName()) {
|
||||
*response.getPlutoSdrInputSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getPlutoSdrInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getPlutoSdrInputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getPlutoSdrInputSettings()->getReverseApiAddress()) {
|
||||
@@ -1190,9 +1099,6 @@ void PlutoSDRInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys
|
||||
if (deviceSettingsKeys.contains("transverterMode") || force) {
|
||||
swgPlutoSdrInputSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgPlutoSdrInputSettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceAPI;
|
||||
class FileRecord;
|
||||
class PlutoSDRInputThread;
|
||||
|
||||
class PlutoSDRInput : public DeviceSampleSource {
|
||||
@@ -61,25 +60,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
|
||||
|
||||
@@ -142,11 +122,6 @@ public:
|
||||
SWGSDRangel::SWGDeviceReport& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& actions,
|
||||
QString& errorMessage);
|
||||
|
||||
static void webapiFormatDeviceSettings(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
const PlutoSDRInputSettings& settings);
|
||||
@@ -168,7 +143,6 @@ public:
|
||||
private:
|
||||
DeviceAPI *m_deviceAPI;
|
||||
bool m_open;
|
||||
FileRecord *m_fileSink;
|
||||
QString m_deviceDescription;
|
||||
PlutoSDRInputSettings m_settings;
|
||||
bool m_running;
|
||||
|
||||
@@ -70,9 +70,6 @@ PlutoSDRInputGui::PlutoSDRInputGui(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 &)));
|
||||
|
||||
blockApplySettings(true);
|
||||
displaySettings();
|
||||
blockApplySettings(false);
|
||||
@@ -178,23 +175,6 @@ bool PlutoSDRInputGui::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (PlutoSDRInput::MsgFileRecord::match(message)) // API action "record" feedback
|
||||
{
|
||||
const PlutoSDRInput::MsgFileRecord& notif = (const PlutoSDRInput::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;
|
||||
@@ -210,18 +190,6 @@ void PlutoSDRInputGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void PlutoSDRInputGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
PlutoSDRInput::MsgFileRecord* message = PlutoSDRInput::MsgFileRecord::create(checked);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void PlutoSDRInputGui::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_centerFrequency = value * 1000;
|
||||
@@ -619,29 +587,3 @@ void PlutoSDRInputGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void PlutoSDRInputGui::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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,6 @@ private:
|
||||
|
||||
private slots:
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_centerFrequency_changed(quint64 value);
|
||||
void on_loPPM_valueChanged(int value);
|
||||
void on_dcOffset_toggled(bool checked);
|
||||
@@ -106,7 +105,6 @@ private slots:
|
||||
void updateStatus();
|
||||
void handleInputMessages();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif /* PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTGUI_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>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user