21 #include <QMessageBox> 23 #include <libhackrf/hackrf.h> 35 #include "ui_hackrfinputgui.h" 40 m_deviceUISet(deviceUISet),
42 m_sampleRateMode(true),
43 m_forceSettings(true),
44 m_doApplySettings(true),
46 m_lastEngineState(
DeviceAPI::StNotStarted)
52 ui->centerFrequency->setValueRange(7, 0U, 7250000U);
55 ui->sampleRate->setValueRange(8, 1000000U, 20000000U);
62 connect(startStopRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
openDeviceSettingsDialog(
const QPoint &)));
170 qDebug(
"HackRFGui::handleInputMessages: message: %s", message->
getIdentifier());
177 qDebug(
"HackRFGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->
getSampleRate(), notif->
getCenterFrequency());
201 ui->sampleRate->blockSignals(
true);
206 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(60,60,60); }");
207 ui->sampleRateMode->setText(
"SR");
208 ui->sampleRate->setValueRange(8, 1000000U, 20000000U);
210 ui->sampleRate->setToolTip(
"Device to host sample rate (S/s)");
211 ui->deviceRateText->setToolTip(
"Baseband sample rate (S/s)");
213 ui->deviceRateText->setText(tr(
"%1k").
arg(QString::number(basebandSampleRate / 1000.0f,
'g', 5)));
217 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(50,50,50); }");
218 ui->sampleRateMode->setText(
"BB");
221 ui->sampleRate->setToolTip(
"Baseband sample rate (S/s)");
222 ui->deviceRateText->setToolTip(
"Device to host sample rate (S/s)");
226 ui->sampleRate->blockSignals(
false);
235 DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD
237 ui->fcPos->setToolTip(tr(
"Relative position of device center frequency: %1 kHz").
arg(QString::number(fShift / 1000.0f,
'g', 5)));
265 ui->bbFilter->setCurrentIndex(bandwidthIndex);
276 ui->bbFilter->blockSignals(
true);
277 ui->bbFilter->clear();
284 ui->bbFilter->blockSignals(
false);
286 if (savedIndex < HackRFBandwidths::m_nb_bw)
288 ui->bbFilter->setCurrentIndex(savedIndex);
292 ui->bbFilter->setCurrentIndex((
int) HackRFBandwidths::m_nb_bw-1);
360 if ((index <0) || (index > 6)) {
384 if ((value < 0) || (value > 40))
387 ui->lnaGainText->setText(tr(
"%1dB").
arg(value));
394 if ((value < 0) || (value > 62))
397 ui->vgaText->setText(tr(
"%1dB").
arg(value));
414 ui->record->setStyleSheet(
"QToolButton { background-color : red; }");
416 ui->record->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
433 qDebug() <<
"HackRFGui::updateHardware";
455 ui->startStop->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
458 ui->startStop->setStyleSheet(
"QToolButton { background-color : blue; }");
459 ui->startStop->setChecked(
false);
462 ui->startStop->setStyleSheet(
"QToolButton { background-color : green; }");
465 ui->startStop->setStyleSheet(
"QToolButton { background-color : red; }");
static const unsigned int m_nb_bw
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)
static const unsigned int m_bw_k[]
MessageQueue * getInputMessageQueue()
uint16_t getReverseAPIDeviceIndex() const
QString errorMessage()
Last error message from the device engine.
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 getBandwidth(unsigned int bandwidth_index)
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