19 #include <QMessageBox> 21 #include <libhackrf/hackrf.h> 35 #include "ui_hackrfoutputgui.h" 40 m_deviceUISet(deviceUISet),
41 m_forceSettings(true),
43 m_sampleRateMode(true),
44 m_deviceSampleSink(0),
45 m_lastEngineState(
DeviceAPI::StNotStarted),
46 m_doApplySettings(true)
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 &)));
173 qDebug(
"HackRFOutputGui::handleInputMessages: message: %s", message->
getIdentifier());
180 qDebug(
"HackRFOutputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->
getSampleRate(), notif->
getCenterFrequency());
204 ui->sampleRate->blockSignals(
true);
209 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(60,60,60); }");
210 ui->sampleRateMode->setText(
"SR");
211 ui->sampleRate->setValueRange(8, 1000000U, 20000000U);
213 ui->sampleRate->setToolTip(
"Host to device sample rate (S/s)");
214 ui->deviceRateText->setToolTip(
"Baseband sample rate (S/s)");
216 ui->deviceRateText->setText(tr(
"%1k").
arg(QString::number(basebandSampleRate / 1000.0f,
'g', 5)));
220 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(50,50,50); }");
221 ui->sampleRateMode->setText(
"BB");
224 ui->sampleRate->setToolTip(
"Baseband sample rate (S/s)");
225 ui->deviceRateText->setToolTip(
"Host to device sample rate (S/s)");
229 ui->sampleRate->blockSignals(
false);
238 ui->fcPos->setToolTip(tr(
"Relative position of device center frequency: %1 kHz").
arg(QString::number(fShift / 1000.0f,
'g', 5)));
261 ui->bbFilter->setCurrentIndex(bandwidthIndex);
269 ui->bbFilter->blockSignals(
true);
270 ui->bbFilter->clear();
277 ui->bbFilter->blockSignals(
false);
279 if (savedIndex < HackRFBandwidths::m_nb_bw)
281 ui->bbFilter->setCurrentIndex(savedIndex);
285 ui->bbFilter->setCurrentIndex((
int) HackRFBandwidths::m_nb_bw-1);
342 if ((index <0) || (index > 6)) {
366 if ((value < 0) || (value > 47))
369 ui->txvgaGainText->setText(tr(
"%1dB").
arg(value));
393 qDebug() <<
"HackRFOutputGui::updateHardware";
410 ui->startStop->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
413 ui->startStop->setStyleSheet(
"QToolButton { background-color : blue; }");
414 ui->startStop->setChecked(
false);
417 ui->startStop->setStyleSheet(
"QToolButton { background-color : green; }");
420 ui->startStop->setStyleSheet(
"QToolButton { background-color : red; }");
static const unsigned int m_nb_bw
uint16_t m_reverseAPIDeviceIndex
Message * pop()
Pop message from queue.
const QString & getReverseAPIAddress() const
void on_sampleRateMode_toggled(bool checked)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void setSampleRate(qint32 sampleRate)
void on_LOppm_valueChanged(int value)
virtual ~HackRFOutputGui()
void setUseReverseAPI(bool useReverseAPI)
static const unsigned int m_bw_k[]
void on_txvga_valueChanged(int value)
void on_sampleRate_changed(quint64 value)
void blockApplySettings(bool block)
void on_interp_currentIndexChanged(int index)
HackRFOutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
uint16_t getReverseAPIDeviceIndex() const
void on_centerFrequency_changed(quint64 value)
QString errorMessage()
Last error message from the device engine.
void updateSampleRateAndFrequency()
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
DeviceSampleSink * m_deviceSampleSink
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.
MessageQueue * getInputMessageQueue()
void openDeviceSettingsDialog(const QPoint &p)
uint16_t getReverseAPIPort() const
MessageQueue m_inputMessageQueue
static bool match(const Message *message)
static unsigned int getBandwidth(unsigned int bandwidth_index)
static unsigned int getBandwidthIndex(unsigned int bandwidth)
virtual void setCenterFrequency(qint64 centerFrequency)
HackRFOutputGui(DeviceUISet *deviceUISet, QWidget *parent=0)
bool deserialize(const QByteArray &data)
QString m_reverseAPIAddress
void handleInputMessages()
DeviceUISet * m_deviceUISet
quint64 m_centerFrequency
bool getStartStop() const
void on_biasT_stateChanged(int state)
virtual bool handleMessage(const Message &message)
void on_startStop_toggled(bool checked)
void on_fcPos_currentIndexChanged(int index)
int getSampleRate() const
void setName(const QString &name)
void setCenterFrequency(qint64 frequency)
virtual const char * getIdentifier() const
void setReverseAPIAddress(const QString &address)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
void on_bbFilter_currentIndexChanged(int index)
static qint32 calculateFrequencyShift(int log2Interp, fcPos_t fcPos, quint32 devSampleRate)
void setReverseAPIPort(uint16_t port)
bool deserialize(const QByteArray &data)
virtual qint64 getCenterFrequency() const
void on_lnaExt_stateChanged(int state)
quint64 m_deviceCenterFrequency
Center frequency in device.
uint16_t m_reverseAPIPort
bool useReverseAPI() const
static MsgStartStop * create(bool startStop)
QByteArray serialize() const
QByteArray serialize() const