19 #include <QMessageBox> 27 #include "ui_rtlsdrgui.h" 39 m_deviceUISet(deviceUISet),
40 m_doApplySettings(true),
41 m_forceSettings(true),
43 m_sampleRateMode(true),
45 m_lastEngineState(
DeviceAPI::StNotStarted)
56 ui->rfBW->setValueRange(4, 350, 8000);
71 connect(startStopRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
openDeviceSettingsDialog(
const QPoint &)));
180 qDebug(
"RTLSDRGui::handleInputMessages: message: %s", message->
getIdentifier());
187 qDebug(
"RTLSDRGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->
getSampleRate(), notif->
getCenterFrequency());
216 minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
217 maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
219 qDebug(
"RTLSDRGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
221 ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
241 ui->gain->setMaximum(
m_gains.size() - 1);
242 ui->gain->setEnabled(
true);
243 ui->gain->setValue(pos);
247 ui->gain->setMaximum(0);
248 ui->gain->setEnabled(
false);
249 ui->gain->setValue(0);
255 ui->sampleRate->blockSignals(
true);
260 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(60,60,60); }");
261 ui->sampleRateMode->setText(
"SR");
270 ui->sampleRate->setToolTip(
"Device to host sample rate (S/s)");
271 ui->deviceRateText->setToolTip(
"Baseband sample rate (S/s)");
273 ui->deviceRateText->setText(tr(
"%1k").
arg(QString::number(basebandSampleRate / 1000.0f,
'g', 5)));
277 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(50,50,50); }");
278 ui->sampleRateMode->setText(
"BB");
287 ui->sampleRate->setToolTip(
"Baseband sample rate (S/s)");
288 ui->deviceRateText->setToolTip(
"Device to host sample rate (S/s)");
292 ui->sampleRate->blockSignals(
false);
301 DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD
303 ui->fcPos->setToolTip(tr(
"Relative position of device center frequency: %1 kHz").
arg(QString::number(fShift / 1000.0f,
'g', 5)));
342 if ((index <0) || (index > 6)) {
367 if ((value > 99) || (value < -99))
372 ui->ppmText->setText(tr(
"%1").
arg(value));
380 if (value > (
int)
m_gains.size())
386 ui->gainText->setText(tr(
"%1.%2").
arg(gain / 10).
arg(
abs(gain % 10)));
404 ui->record->setStyleSheet(
"QToolButton { background-color : red; }");
406 ui->record->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
449 ui->startStop->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
452 ui->startStop->setStyleSheet(
"QToolButton { background-color : blue; }");
455 ui->startStop->setStyleSheet(
"QToolButton { background-color : green; }");
458 ui->startStop->setStyleSheet(
"QToolButton { background-color : red; }");
476 if (state == Qt::Checked)
478 ui->gain->setEnabled(
false);
481 ui->centerFrequency->setValue(7000);
486 ui->gain->setEnabled(
true);
489 ui->centerFrequency->setValue(434000);
490 ui->gain->setValue(0);
void on_sampleRate_changed(quint64 value)
Message * pop()
Pop message from queue.
const QString & getReverseAPIAddress() const
QByteArray serialize() const
static qint32 calculateFrequencyShift(int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme)
void on_offsetTuning_toggled(bool checked)
void on_centerFrequency_changed(quint64 value)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void on_rfBW_changed(quint64 value)
void setSampleRate(qint32 sampleRate)
void updateFrequencyLimits()
void on_dcOffset_toggled(bool checked)
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
void setUseReverseAPI(bool useReverseAPI)
void on_sampleRateMode_toggled(bool checked)
virtual qint64 getCenterFrequency() const
MessageQueue * getInputMessageQueue()
QByteArray serialize() const
bool deserialize(const QByteArray &data)
RTLSDRGui(DeviceUISet *deviceUISet, QWidget *parent=0)
void on_checkBox_stateChanged(int state)
uint16_t getReverseAPIDeviceIndex() const
void updateSampleRateAndFrequency()
Fixed< IntType, IntBits > abs(Fixed< IntType, IntBits > const &x)
DeviceUISet * m_deviceUISet
QString errorMessage()
Last error message from the device engine.
void on_decim_currentIndexChanged(int index)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
GLSpectrum * getSpectrum()
Direct spectrum getter.
engine is before initialization
uint16_t m_reverseAPIDeviceIndex
qint64 getCenterFrequency() const
uint16_t m_reverseAPIPort
EngineState state() const
Return the state of the device engine corresponding to the stream type.
RTLSDRSettings m_settings
void on_agc_stateChanged(int state)
bool m_sampleRateMode
true: device, false: base band sample rate update mode
uint16_t getReverseAPIPort() const
void openDeviceSettingsDialog(const QPoint &p)
virtual void setCenterFrequency(qint64 centerFrequency)
void on_startStop_toggled(bool checked)
RTLSDRInput * m_sampleSource
static bool match(const Message *message)
void handleInputMessages()
void on_transverter_clicked()
void setName(const QString &name)
void blockApplySettings(bool block)
virtual bool handleMessage(const Message &message)
void on_record_toggled(bool checked)
quint32 m_rfBandwidth
RF filter bandwidth in Hz.
quint64 m_deviceCenterFrequency
Center frequency in device.
std::vector< int > m_gains
QString m_reverseAPIAddress
MessageQueue m_inputMessageQueue
int getSampleRate() const
void on_fcPos_currentIndexChanged(int index)
void setCenterFrequency(qint64 frequency)
virtual const char * getIdentifier() const
void on_iqImbalance_toggled(bool checked)
void setReverseAPIAddress(const QString &address)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
qint64 m_transverterDeltaFrequency
void setReverseAPIPort(uint16_t port)
quint64 m_centerFrequency
void on_gain_valueChanged(int value)
bool useReverseAPI() const
bool deserialize(const QByteArray &data)
void on_ppm_valueChanged(int value)
void on_lowSampleRate_toggled(bool checked)