19 #include <QMessageBox> 21 #include <libbladeRF.h> 23 #include "ui_bladerf1outputgui.h" 37 m_deviceUISet(deviceUISet),
38 m_doApplySettings(true),
39 m_forceSettings(true),
41 m_sampleRateMode(true),
42 m_deviceSampleSink(nullptr),
44 m_lastEngineState(
DeviceAPI::StNotStarted)
50 ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000);
53 ui->sampleRate->setValueRange(8, BLADERF_SAMPLERATE_MIN, BLADERF_SAMPLERATE_REC_MAX);
55 ui->bandwidth->clear();
67 connect(startStopRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
openDeviceSettingsDialog(
const QPoint &)));
167 qDebug(
"BladerfOutputGui::handleInputMessages: message: %s", message->
getIdentifier());
174 qDebug(
"BladerfOutputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->
getSampleRate(), notif->
getCenterFrequency());
198 ui->sampleRate->blockSignals(
true);
202 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(60,60,60); }");
203 ui->sampleRateMode->setText(
"SR");
204 ui->sampleRate->setValueRange(8, BLADERF_SAMPLERATE_MIN, BLADERF_SAMPLERATE_REC_MAX);
206 ui->sampleRate->setToolTip(
"Host to device sample rate (S/s)");
207 ui->deviceRateText->setToolTip(
"Baseband sample rate (S/s)");
209 ui->deviceRateText->setText(tr(
"%1k").
arg(QString::number(basebandSampleRate / 1000.0f,
'g', 5)));
213 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(50,50,50); }");
214 ui->sampleRateMode->setText(
"BB");
217 ui->sampleRate->setToolTip(
"Baseband sample rate (S/s)");
218 ui->deviceRateText->setToolTip(
"Host to device sample rate (S/s)");
222 ui->sampleRate->blockSignals(
false);
231 ui->bandwidth->setCurrentIndex(bandwidthIndex);
276 if ((index <0) || (index > 6)) {
294 if ((value < BLADERF_TXVGA1_GAIN_MIN) || (value > BLADERF_TXVGA1_GAIN_MAX))
297 ui->vga1Text->setText(tr(
"%1dB").
arg(value));
304 if ((value < BLADERF_TXVGA2_GAIN_MIN) || (value > BLADERF_TXVGA2_GAIN_MAX))
307 ui->vga2Text->setText(tr(
"%1dB").
arg(value));
362 ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000);
366 ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN/1000, BLADERF_FREQUENCY_MAX/1000);
389 qDebug() <<
"BladerfGui::updateHardware";
405 ui->startStop->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
408 ui->startStop->setStyleSheet(
"QToolButton { background-color : blue; }");
411 ui->startStop->setStyleSheet(
"QToolButton { background-color : green; }");
414 ui->startStop->setStyleSheet(
"QToolButton { background-color : red; }");
429 if (xb200Path == BLADERF_XB200_BYPASS)
435 if (xb200Filter == BLADERF_XB200_AUTO_1DB)
439 else if (xb200Filter == BLADERF_XB200_AUTO_3DB)
443 else if (xb200Filter == BLADERF_XB200_CUSTOM)
447 else if (xb200Filter == BLADERF_XB200_50M)
451 else if (xb200Filter == BLADERF_XB200_144M)
void openDeviceSettingsDialog(const QPoint &p)
void handleInputMessages()
virtual qint64 getCenterFrequency() const
Message * pop()
Pop message from queue.
const QString & getReverseAPIAddress() const
bool getStartStop() const
void push(Message *message, bool emitSignal=true)
Push message onto queue.
bool deserialize(const QByteArray &data)
void setSampleRate(qint32 sampleRate)
virtual void setCenterFrequency(qint64 centerFrequency)
void updateSampleRateAndFrequency()
void setUseReverseAPI(bool useReverseAPI)
bladerf_xb200_path m_xb200Path
void on_sampleRateMode_toggled(bool checked)
uint16_t getReverseAPIDeviceIndex() const
void setName(const QString &name)
void on_xb200_currentIndexChanged(int index)
QString errorMessage()
Last error message from the device engine.
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
void on_interp_currentIndexChanged(int index)
bool m_sampleRateMode
true: device, false: base band sample rate update mode
static unsigned int getBandwidth(unsigned int bandwidth_index)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
GLSpectrum * getSpectrum()
Direct spectrum getter.
engine is before initialization
qint64 getCenterFrequency() const
EngineState state() const
Return the state of the device engine corresponding to the stream type.
QString m_reverseAPIAddress
MessageQueue * getInputMessageQueue()
uint16_t m_reverseAPIPort
void on_centerFrequency_changed(quint64 value)
uint16_t getReverseAPIPort() const
BladeRF1OutputSettings m_settings
quint64 m_deviceCenterFrequency
Center frequency in device.
DeviceUISet * m_deviceUISet
static bool match(const Message *message)
bladerf_xb200_filter m_xb200Filter
void blockApplySettings(bool block)
quint64 m_centerFrequency
Ui::Bladerf1OutputGui * ui
virtual ~Bladerf1OutputGui()
void on_startStop_toggled(bool checked)
uint16_t m_reverseAPIDeviceIndex
void on_sampleRate_changed(quint64 value)
static unsigned int getNbBandwidths()
static unsigned int getBandwidthIndex(unsigned int bandwidth)
QByteArray serialize() const
void on_vga1_valueChanged(int value)
DeviceSampleSink * m_deviceSampleSink
int getSampleRate() const
void setCenterFrequency(qint64 frequency)
virtual const char * getIdentifier() const
void on_vga2_valueChanged(int value)
void setReverseAPIAddress(const QString &address)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
virtual bool handleMessage(const Message &message)
void setReverseAPIPort(uint16_t port)
QByteArray serialize() const
bool useReverseAPI() const
Bladerf1OutputGui(DeviceUISet *deviceUISet, QWidget *parent=0)
bool deserialize(const QByteArray &data)
MessageQueue m_inputMessageQueue
unsigned int getXb200Index(bool xb_200, bladerf_xb200_path xb200Path, bladerf_xb200_filter xb200Filter)
void on_bandwidth_currentIndexChanged(int index)
static MsgStartStop * create(bool startStop)