19 #include <QMessageBox> 21 #include <libairspyhf/airspyhf.h> 27 #include "ui_airspyhfgui.h" 39 m_deviceUISet(deviceUISet),
40 m_doApplySettings(true),
41 m_forceSettings(true),
44 m_lastEngineState(
DeviceAPI::StNotStarted)
57 connect(startStopRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
openDeviceSettingsDialog(
const QPoint &)));
158 qDebug(
"AirspyHFGui::handleInputMessages: message: %s", message->
getIdentifier());
165 qDebug(
"AirspyGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->
getSampleRate(), notif->
getCenterFrequency());
208 minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
209 maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
211 qDebug(
"AirspyHFGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
213 ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
219 ui->band->blockSignals(
true);
230 ui->band->blockSignals(
false);
243 ui->sampleRate->blockSignals(
true);
247 ui->sampleRate->clear();
249 for (
unsigned int i = 0;
i <
m_rates.size();
i++)
252 ui->sampleRate->addItem(QString(
"%1").
arg(QString(
"%1").
arg(sampleRate, 5, 10, QChar(
' '))));
256 ui->sampleRate->blockSignals(
false);
258 if (savedIndex <
m_rates.size())
260 ui->sampleRate->setCurrentIndex(savedIndex);
264 ui->sampleRate->setCurrentIndex((
int)
m_rates.size()-1);
273 ui->agc->setCurrentIndex(2);
275 ui->agc->setCurrentIndex(1);
280 ui->agc->setCurrentIndex(0);
305 ui->LOppm->setValue(0);
316 if ((index < 0) || (index > 6))
334 ui->record->setStyleSheet(
"QToolButton { background-color : red; }");
336 ui->record->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
355 if ((index < 0) || (index > 1)) {
361 qDebug(
"AirspyHFGui::on_band_currentIndexChanged: freq: %llu",
ui->centerFrequency->getValueNew() * 1000);
401 if ((index >= 0) && (index <= 8))
422 qDebug() <<
"AirspyHFGui::updateHardware";
438 ui->startStop->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
441 ui->startStop->setStyleSheet(
"QToolButton { background-color : blue; }");
444 ui->startStop->setStyleSheet(
"QToolButton { background-color : green; }");
447 ui->startStop->setStyleSheet(
"QToolButton { background-color : red; }");
460 if (rate_index <
m_rates.size())
472 for (
unsigned int i=0;
i <
m_rates.size();
i++)
bool deserialize(const QByteArray &data)
void on_resetLOppm_clicked()
quint32 m_attenuatorSteps
Message * pop()
Pop message from queue.
const QString & getReverseAPIAddress() const
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void setSampleRate(qint32 sampleRate)
void on_transverter_clicked()
void on_agc_currentIndexChanged(int index)
void displaySampleRates()
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
void setUseReverseAPI(bool useReverseAPI)
void blockApplySettings(bool block)
MessageQueue * getInputMessageQueue()
uint16_t m_reverseAPIDeviceIndex
bool deserialize(const QByteArray &data)
void on_lna_toggled(bool checked)
uint16_t getReverseAPIDeviceIndex() const
uint16_t m_reverseAPIPort
QString errorMessage()
Last error message from the device engine.
void on_startStop_toggled(bool checked)
void on_sampleRate_currentIndexChanged(int index)
void handleInputMessages()
int getDevSampleRateIndex(uint32_t sampleRate)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
GLSpectrum * getSpectrum()
Direct spectrum getter.
uint32_t getDevSampleRate(unsigned int index)
engine is before initialization
virtual qint64 getCenterFrequency() const
qint64 getCenterFrequency() const
EngineState state() const
Return the state of the device engine corresponding to the stream type.
void on_centerFrequency_changed(quint64 value)
uint16_t getReverseAPIPort() const
AirspyHFSettings m_settings
qint64 m_transverterDeltaFrequency
DeviceUISet * m_deviceUISet
void on_LOppm_valueChanged(int value)
void on_iqImbalance_toggled(bool checked)
static bool match(const Message *message)
QString m_reverseAPIAddress
virtual void setCenterFrequency(qint64 centerFrequency)
void on_dcOffset_toggled(bool checked)
quint32 m_devSampleRateIndex
MessageQueue m_inputMessageQueue
QByteArray serialize() const
void on_att_currentIndexChanged(int index)
quint64 m_centerFrequency
AirspyHFGui(DeviceUISet *deviceUISet, QWidget *parent=0)
void updateSampleRateAndFrequency()
std::vector< uint32_t > m_rates
void on_band_currentIndexChanged(int index)
quint64 m_deviceCenterFrequency
Center frequency in device.
void updateFrequencyLimits()
int getSampleRate() const
void on_record_toggled(bool checked)
QByteArray serialize() const
void setCenterFrequency(qint64 frequency)
virtual const char * getIdentifier() const
void setReverseAPIAddress(const QString &address)
void on_dsp_toggled(bool checked)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
void openDeviceSettingsDialog(const QPoint &p)
void setReverseAPIPort(uint16_t port)
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
void setName(const QString &name)
DeviceSampleSource * m_sampleSource
bool useReverseAPI() const
void on_decim_currentIndexChanged(int index)
virtual bool handleMessage(const Message &message)