mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-01-06 08:19:05 -05:00
BladeRF MIMO: removed IQ record feature
This commit is contained in:
parent
b486b1dda7
commit
95af7c915f
@ -41,7 +41,6 @@
|
||||
#include "bladerf2mimo.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2MIMO::MsgConfigureBladeRF2MIMO, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2MIMO::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2MIMO::MsgStartStop, Message)
|
||||
|
||||
BladeRF2MIMO::BladeRF2MIMO(DeviceAPI *deviceAPI) :
|
||||
@ -70,12 +69,6 @@ BladeRF2MIMO::BladeRF2MIMO(DeviceAPI *deviceAPI) :
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<FileRecord*>::iterator it = m_fileSinks.begin();
|
||||
|
||||
for (; it != m_fileSinks.end(); ++it) {
|
||||
*it = nullptr;
|
||||
}
|
||||
|
||||
m_mimoType = MIMOHalfSynchronous;
|
||||
m_sampleMIFifo.init(2, 4096 * 64);
|
||||
m_sampleMOFifo.init(2, 4096 * 64);
|
||||
@ -89,19 +82,7 @@ BladeRF2MIMO::~BladeRF2MIMO()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
|
||||
closeDevice();
|
||||
|
||||
std::vector<FileRecord*>::iterator it = m_fileSinks.begin();
|
||||
int istream = 0;
|
||||
|
||||
for (; it != m_fileSinks.end(); ++it, istream++)
|
||||
{
|
||||
if (*it) {
|
||||
m_deviceAPI->removeAncillarySink(*it, istream);
|
||||
delete *it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2MIMO::destroy()
|
||||
@ -370,38 +351,6 @@ bool BladeRF2MIMO::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "BladeRF2MIMO::handleMessage: MsgFileRecord: " << conf.getStartStop();
|
||||
int istream = conf.getStreamIndex();
|
||||
|
||||
if (conf.getStartStop())
|
||||
{
|
||||
if (m_fileSinks[istream])
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(m_fileSinks[istream], istream);
|
||||
delete m_fileSinks[istream];
|
||||
}
|
||||
|
||||
if (m_settings.m_fileRecordName.size() != 0) {
|
||||
m_fileSinks[istream] = new FileRecord(QString("%1_%2.sdriq"). arg(m_settings.m_fileRecordName).arg(istream));
|
||||
} else {
|
||||
m_fileSinks[istream] = new FileRecord(QString("%1.sdriq").arg(FileRecordInterface::genUniqueFileName(m_deviceAPI->getDeviceUID(), istream)));
|
||||
}
|
||||
|
||||
m_deviceAPI->addAncillarySink(m_fileSinks[istream], istream);
|
||||
m_fileSinks[istream]->startRecording();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fileSinks[istream]->stopRecording();
|
||||
delete m_fileSinks[istream];
|
||||
m_fileSinks[istream] = nullptr;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@ -466,7 +415,6 @@ bool BladeRF2MIMO::applySettings(const BladeRF2MIMOSettings& settings, bool forc
|
||||
<< " m_txBiasTee: " << settings.m_txBiasTee
|
||||
<< " m_txTransverterMode: " << settings.m_txTransverterMode
|
||||
<< " m_txTransverterDeltaFrequency: " << settings.m_txTransverterDeltaFrequency
|
||||
<< " m_fileRecordName: " << settings.m_fileRecordName
|
||||
<< " m_useReverseAPI: " << settings.m_useReverseAPI
|
||||
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
|
||||
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
|
||||
@ -846,18 +794,6 @@ bool BladeRF2MIMO::applySettings(const BladeRF2MIMOSettings& settings, bool forc
|
||||
if (forwardChangeRxDSP)
|
||||
{
|
||||
int sampleRate = settings.m_devSampleRate/(1<<settings.m_log2Decim);
|
||||
DSPSignalNotification *notifFileSink0 = new DSPSignalNotification(sampleRate, settings.m_rxCenterFrequency);
|
||||
|
||||
if (m_fileSinks[0]) {
|
||||
m_fileSinks[0]->handleMessage(*notifFileSink0); // forward to file sinks
|
||||
}
|
||||
|
||||
DSPSignalNotification *notifFileSink1 = new DSPSignalNotification(sampleRate, settings.m_rxCenterFrequency);
|
||||
|
||||
if (m_fileSinks[1]) {
|
||||
m_fileSinks[1]->handleMessage(*notifFileSink0); // forward to file sinks
|
||||
}
|
||||
|
||||
DSPMIMOSignalNotification *notif0 = new DSPMIMOSignalNotification(sampleRate, settings.m_rxCenterFrequency, true, 0);
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif0);
|
||||
DSPMIMOSignalNotification *notif1 = new DSPMIMOSignalNotification(sampleRate, settings.m_rxCenterFrequency, true, 1);
|
||||
@ -1127,9 +1063,6 @@ void BladeRF2MIMO::webapiUpdateDeviceSettings(
|
||||
settings.m_txTransverterDeltaFrequency = response.getBladeRf2MimoSettings()->getTxTransverterDeltaFrequency();
|
||||
}
|
||||
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getBladeRf2MimoSettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getBladeRf2MimoSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@ -1174,12 +1107,6 @@ void BladeRF2MIMO::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
|
||||
response.getBladeRf2MimoSettings()->setTxTransverterDeltaFrequency(settings.m_txTransverterDeltaFrequency);
|
||||
response.getBladeRf2MimoSettings()->setTxTransverterMode(settings.m_txTransverterMode ? 1 : 0);
|
||||
|
||||
if (response.getBladeRf2MimoSettings()->getFileRecordName()) {
|
||||
*response.getBladeRf2MimoSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getBladeRf2MimoSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getBladeRf2MimoSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getBladeRf2MimoSettings()->getReverseApiAddress()) {
|
||||
|
||||
@ -65,28 +65,6 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgFileRecord : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
bool getStartStop() const { return m_startStop; }
|
||||
int getStreamIndex() const { return m_streamIndex; }
|
||||
|
||||
static MsgFileRecord* create(bool startStop, int streamIndex) {
|
||||
return new MsgFileRecord(startStop, streamIndex);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_startStop;
|
||||
int m_streamIndex;
|
||||
|
||||
MsgFileRecord(bool startStop, int streamIndex) :
|
||||
Message(),
|
||||
m_startStop(startStop),
|
||||
m_streamIndex(streamIndex)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgStartStop : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
@ -194,7 +172,6 @@ public:
|
||||
|
||||
private:
|
||||
DeviceAPI *m_deviceAPI;
|
||||
std::vector<FileRecord *> m_fileSinks; //!< File sinks to record device I/Q output
|
||||
QMutex m_mutex;
|
||||
BladeRF2MIMOSettings m_settings;
|
||||
BladeRF2MIThread* m_sourceThread;
|
||||
|
||||
@ -97,9 +97,6 @@ BladeRF2MIMOGui::BladeRF2MIMOGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStopRx);
|
||||
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 &)));
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -176,7 +173,6 @@ void BladeRF2MIMOGui::displaySettings()
|
||||
ui->centerFrequency->setValue(m_settings.m_rxCenterFrequency / 1000);
|
||||
ui->bandwidth->setValueRange(5, m_bwMinRx / 1000, m_bwMaxRx / 1000);
|
||||
ui->bandwidth->setValue(m_settings.m_rxBandwidth / 1000);
|
||||
ui->record->setEnabled(true);
|
||||
uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim);
|
||||
ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
|
||||
ui->dcOffset->setEnabled(true);
|
||||
@ -212,7 +208,6 @@ void BladeRF2MIMOGui::displaySettings()
|
||||
ui->centerFrequency->setValue(m_settings.m_txCenterFrequency / 1000);
|
||||
ui->bandwidth->setValueRange(5, m_bwMinTx / 1000, m_bwMaxTx / 1000);
|
||||
ui->bandwidth->setValue(m_settings.m_txBandwidth / 1000);
|
||||
ui->record->setEnabled(false);
|
||||
uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp);
|
||||
ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
|
||||
ui->dcOffset->setEnabled(false);
|
||||
@ -410,15 +405,6 @@ void BladeRF2MIMOGui::updateSampleRateAndFrequency()
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2MIMOGui::updateFileRecordStatus()
|
||||
{
|
||||
if (m_sampleMIMO->isRecording(m_streamIndex)) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2MIMOGui::on_streamSide_currentIndexChanged(int index)
|
||||
{
|
||||
m_rxElseTx = index == 0;
|
||||
@ -467,18 +453,6 @@ void BladeRF2MIMOGui::on_startStopTx_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2MIMOGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
BladeRF2MIMO::MsgFileRecord* message = BladeRF2MIMO::MsgFileRecord::create(checked, m_streamIndex);
|
||||
m_sampleMIMO->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void BladeRF2MIMOGui::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
if (m_rxElseTx) {
|
||||
@ -818,29 +792,3 @@ void BladeRF2MIMOGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2MIMOGui::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,7 +90,6 @@ private:
|
||||
void displayGainModes();
|
||||
void sendSettings();
|
||||
void updateSampleRateAndFrequency();
|
||||
void updateFileRecordStatus();
|
||||
void updateFrequencyLimits();
|
||||
void setCenterFrequencySetting(uint64_t kHzValue);
|
||||
|
||||
@ -104,7 +103,6 @@ private slots:
|
||||
void on_spectrumIndex_currentIndexChanged(int index);
|
||||
void on_startStopRx_toggled(bool checked);
|
||||
void on_startStopTx_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);
|
||||
@ -119,7 +117,6 @@ private slots:
|
||||
void on_biasTee_toggled(bool checked);
|
||||
void on_transverter_clicked();
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void openFileRecordDialog(const QPoint& p);
|
||||
};
|
||||
|
||||
#endif // _BLADERF2MIMO_BLADERF2MIMOGUI_H_
|
||||
|
||||
@ -254,50 +254,23 @@
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="deviceUILayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="deviceButtonsLayout">
|
||||
<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>
|
||||
<layout class="QHBoxLayout" name="deviceRateLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="deviceRateText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>I/Q sample rate kS/s</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>00000k</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLabel" name="deviceRateText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>I/Q sample rate kS/s</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>00000k</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="freqLeftSpacer">
|
||||
|
||||
@ -54,7 +54,6 @@ void BladeRF2MIMOSettings::resetToDefaults()
|
||||
m_txTransverterMode = false;
|
||||
m_txTransverterDeltaFrequency = 0;
|
||||
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
@ -93,7 +92,6 @@ QByteArray BladeRF2MIMOSettings::serialize() const
|
||||
s.writeS64(37, m_txTransverterDeltaFrequency);
|
||||
s.writeS32(38, (int) m_fcPosTx);
|
||||
|
||||
s.writeString(50, m_fileRecordName);
|
||||
s.writeBool(51, m_useReverseAPI);
|
||||
s.writeString(52, m_reverseAPIAddress);
|
||||
s.writeU32(53, m_reverseAPIPort);
|
||||
@ -147,7 +145,6 @@ bool BladeRF2MIMOSettings::deserialize(const QByteArray& data)
|
||||
d.readS32(38, &intval, 2);
|
||||
m_fcPosTx = (fcPos_t) intval;
|
||||
|
||||
d.readString(50, &m_fileRecordName, "");
|
||||
d.readBool(51, &m_useReverseAPI, false);
|
||||
d.readString(52, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(53, &uintval, 0);
|
||||
|
||||
@ -56,7 +56,6 @@ struct BladeRF2MIMOSettings {
|
||||
bool m_txTransverterMode;
|
||||
qint64 m_txTransverterDeltaFrequency;
|
||||
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
|
||||
@ -187,8 +187,6 @@ BladeRF2MIMOSettings:
|
||||
txTransverterDeltaFrequency:
|
||||
type: integer
|
||||
format: int64
|
||||
fileRecordName:
|
||||
type: string
|
||||
useReverseAPI:
|
||||
description: boolean
|
||||
type: integer
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user