19 #include <QMessageBox> 21 #include <libbladeRF.h> 23 #include "ui_bladerf1inputgui.h" 38 m_deviceUISet(deviceUISet),
39 m_forceSettings(true),
40 m_doApplySettings(true),
42 m_sampleRateMode(true),
45 m_lastEngineState(
DeviceAPI::StNotStarted)
51 ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000);
55 ui->sampleRate->setValueRange(8, 330000U, BLADERF_SAMPLERATE_REC_MAX);
57 ui->bandwidth->clear();
68 connect(startStopRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
openDeviceSettingsDialog(
const QPoint &)));
167 qDebug(
"BladerfGui::handleInputMessages: message: %s", message->
getIdentifier());
174 qDebug(
"BladerfGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->
getSampleRate(), notif->
getCenterFrequency());
198 ui->sampleRate->blockSignals(
true);
203 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(60,60,60); }");
204 ui->sampleRateMode->setText(
"SR");
206 ui->sampleRate->setValueRange(8, 330000U, BLADERF_SAMPLERATE_REC_MAX);
208 ui->sampleRate->setToolTip(
"Device to host sample rate (S/s)");
209 ui->deviceRateText->setToolTip(
"Baseband sample rate (S/s)");
211 ui->deviceRateText->setText(tr(
"%1k").
arg(QString::number(basebandSampleRate / 1000.0f,
'g', 5)));
215 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(50,50,50); }");
216 ui->sampleRateMode->setText(
"BB");
220 ui->sampleRate->setToolTip(
"Baseband sample rate (S/s)");
221 ui->deviceRateText->setToolTip(
"Device to host sample rate (S/s)");
225 ui->sampleRate->blockSignals(
false);
234 DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD
236 ui->fcPos->setToolTip(tr(
"Relative position of device center frequency: %1 kHz").
arg(QString::number(fShift / 1000.0f,
'g', 5)));
250 ui->bandwidth->setCurrentIndex(bandwidthIndex);
314 if ((index <0) || (index > 6)) {
339 qDebug() <<
"BladerfGui: LNA gain = " << index * 3 <<
" dB";
341 if ((index < 0) || (index > 2))
350 if ((value < BLADERF_RXVGA1_GAIN_MIN) || (value > BLADERF_RXVGA1_GAIN_MAX))
353 ui->vga1Text->setText(tr(
"%1dB").
arg(value));
360 if ((value < BLADERF_RXVGA2_GAIN_MIN) || (value > BLADERF_RXVGA2_GAIN_MAX))
363 ui->vga2Text->setText(tr(
"%1dB").
arg(value));
418 ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000);
422 ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN/1000, BLADERF_FREQUENCY_MAX/1000);
440 ui->record->setStyleSheet(
"QToolButton { background-color : red; }");
442 ui->record->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
459 qDebug() <<
"BladerfGui::updateHardware";
481 ui->startStop->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
484 ui->startStop->setStyleSheet(
"QToolButton { background-color : blue; }");
487 ui->startStop->setStyleSheet(
"QToolButton { background-color : green; }");
490 ui->startStop->setStyleSheet(
"QToolButton { background-color : red; }");
505 if (xb200Path == BLADERF_XB200_BYPASS)
511 if (xb200Filter == BLADERF_XB200_AUTO_1DB)
515 else if (xb200Filter == BLADERF_XB200_AUTO_3DB)
519 else if (xb200Filter == BLADERF_XB200_CUSTOM)
523 else if (xb200Filter == BLADERF_XB200_50M)
527 else if (xb200Filter == BLADERF_XB200_144M)
Message * pop()
Pop message from queue.
const QString & getReverseAPIAddress() const
static qint32 calculateFrequencyShift(int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void setSampleRate(qint32 sampleRate)
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
void setUseReverseAPI(bool useReverseAPI)
MessageQueue * getInputMessageQueue()
uint16_t getReverseAPIDeviceIndex() const
QString errorMessage()
Last error message from the device engine.
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.
uint16_t getReverseAPIPort() const
static bool match(const Message *message)
static unsigned int getNbBandwidths()
static unsigned int getBandwidthIndex(unsigned int bandwidth)
int getSampleRate() const
void setCenterFrequency(qint64 frequency)
virtual const char * getIdentifier() const
void setReverseAPIAddress(const QString &address)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
void setReverseAPIPort(uint16_t port)
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
bool useReverseAPI() const