18 #include <QDockWidget> 19 #include <QMainWindow> 35 #include "ui_chanalyzergui.h" 112 ui->BWLabel->setText(
"LP");
114 ui->BWLabel->setText(
"BP");
125 ui->rrcRolloffText->setText(rolloffStr);
134 ui->pllPskOrder->setCurrentIndex(5);
140 ui->pllPskOrder->setCurrentIndex(i);
148 qDebug(
"ChannelAnalyzerGUI::setSpectrumDisplay: m_rate: %d",
m_rate);
151 ui->glSpectrum->setCenterFrequency(
m_rate/4);
152 ui->glSpectrum->setSampleRate(
m_rate/2);
153 ui->glSpectrum->setSsbSpectrum(
true);
154 ui->glSpectrum->setLsbDisplay(
ui->BW->value() < 0);
158 ui->glSpectrum->setCenterFrequency(0);
159 ui->glSpectrum->setSampleRate(
m_rate);
160 ui->glSpectrum->setSsbSpectrum(
false);
161 ui->glSpectrum->setLsbDisplay(
false);
209 qDebug(
"ChannelAnalyzerGUI::handleInputMessages: message: %s", message->
getIdentifier());
233 ui->channelPower->setText(tr(
"%1 dB").
arg(powDb, 0,
'f', 1));
236 ui->pll->setStyleSheet(
"QToolButton { background-color : green; }");
238 ui->pll->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
241 if (
ui->pll->isChecked())
245 ui->pll->setToolTip(tr(
"PLL lock. Freq = %1 Hz").
arg(freq));
259 ui->pll->setToolTip(tr(
"PLL lock"));
285 if (
ui->useRationalDownsampler->isChecked()) {
286 return ui->channelSampleRate->getValueNew();
314 QString rolloffStr = QString::number(value/100.0,
'f', 2);
315 ui->rrcRolloffText->setText(rolloffStr);
339 if ((index < 0) || (index > 6)) {
352 ui->BWLabel->setText(
"LP");
354 ui->BWLabel->setText(
"BP");
397 setAttribute(Qt::WA_DeleteOnClose,
true);
399 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
onMenuDialogCalled(
const QPoint &)));
408 ui->deltaFrequencyLabel->setText(QString(
"%1f").
arg(QChar(0x94, 0x03)));
410 ui->deltaFrequency->setValueRange(
false, 7, -9999999, 9999999);
415 ui->glSpectrum->setCenterFrequency(
m_rate/2);
416 ui->glSpectrum->setSampleRate(
m_rate);
417 ui->glSpectrum->setDisplayWaterfall(
true);
418 ui->glSpectrum->setDisplayMaxHold(
true);
419 ui->glSpectrum->setSsbSpectrum(
false);
420 ui->glSpectrum->setLsbDisplay(
false);
475 QString s = QString::number(
m_rate/1000.0,
'f', 1);
476 ui->spanText->setText(tr(
"%1 kS/s").
arg(s));
483 bool dsb = !
ui->ssb->isChecked();
484 int bw =
ui->BW->value();
485 int lw =
ui->lowCut->value();
488 bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw;
491 lw = lw < bw+1 ? bw+1 : lw < 0 ? lw : 0;
493 lw = lw > bw-1 ? bw-1 : lw < 0 ? 0 : lw;
500 bw = bw < 0 ? -bw : bw;
504 QString bwStr = QString::number(bw/10.0,
'f', 1);
505 QString lwStr = QString::number(lw/10.0,
'f', 1);
508 ui->BWText->setText(tr(
"%1%2k").
arg(QChar(0xB1, 0x00)).
arg(bwStr));
510 ui->BWText->setText(tr(
"%1k").
arg(bwStr));
513 ui->lowCutText->setText(tr(
"%1k").
arg(lwStr));
515 ui->BW->blockSignals(
true);
516 ui->lowCut->blockSignals(
true);
518 ui->BW->setMaximum(bwMax);
519 ui->BW->setMinimum(dsb ? 0 : -bwMax);
520 ui->BW->setValue(bw);
522 ui->lowCut->setMaximum(dsb ? 0 : bw);
523 ui->lowCut->setMinimum(dsb ? 0 : -bw);
524 ui->lowCut->setValue(lw);
526 ui->lowCut->blockSignals(
false);
527 ui->BW->blockSignals(
false);
541 ui->glScope->blockSignals(block);
542 ui->glSpectrum->blockSignals(block);
static MainWindow * getInstance()
virtual void setCenterFrequency(qint64 centerFrequency)
double getMagSqAvg() const
SpectrumScopeComboVis * m_spectrumScopeComboVis
int getCenterFrequency() const
void setLowCutoff(int lowCutoff)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void on_rrcRolloff_valueChanged(int value)
DeviceUISet * m_deviceUISet
void on_rrcFilter_toggled(bool checked)
int m_rate
sample rate after final in-channel decimation (spanlog2)
void applySettings(bool force=false)
static double dbPower(double magsq, double floor=1e-12)
void setSpectrumDisplay()
void setChannelMarker(Serializable *channelMarker)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void setName(const QString &name)
void on_deltaFrequency_changed(qint64 value)
void onMenuDialogCalled(const QPoint &p)
void on_pll_toggled(bool checked)
void on_lowCut_valueChanged(int value)
int getRequestedChannelSampleRate()
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
unsigned int m_pllPskOrder
bool deserialize(const QByteArray &data)
void leaveEvent(QEvent *)
QByteArray serialize() const
void setLiveRate(int sampleRate)
void on_spanLog2_currentIndexChanged(int index)
virtual bool handleMessage(const Message &message)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
SpectrumVis * m_spectrumVis
MovingAverageUtil< double, double, 40 > m_channelPowerAvg
void onWidgetRolled(QWidget *widget, bool rollDown)
Real getPllFrequency() const
void setScopeGUI(Serializable *scopeGUI)
void blockApplySettings(bool block)
void channelMarkerChangedByCursor()
void setSpectrumGUI(Serializable *spectrumGUI)
void on_useRationalDownsampler_toggled(bool checked)
virtual void setMessageQueueToGUI(MessageQueue *queue)
ChannelAnalyzerGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
void on_pllPskOrder_currentIndexChanged(int index)
void setSampleSink(BasebandSampleSink *sampleSink)
void on_signalSelect_currentIndexChanged(int index)
quint32 m_rrcRolloff
in 100ths
QByteArray serialize() const
void setHighlighted(bool highlighted)
void on_BW_valueChanged(int value)
DownChannelizer * getChannelizer()
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
const QString & getTitle() const
static bool match(const Message *message)
virtual ~ChannelAnalyzerGUI()
bool getHighlighted() const
int getInputSampleRate() const
virtual qint64 getCenterFrequency() const
ChannelMarker m_channelMarker
static ChannelAnalyzerGUI * create(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
void setFiltersUIBoundaries()
int getInputSampleRate() const
void handleInputMessages()
void setColor(const QColor &color)
void setNewFinalRate()
set sample rate after final in-channel decimation
void displayPLLSettings()
void setVisible(bool visible)
bool deserialize(const QByteArray &data)
virtual const char * getIdentifier() const
void setBandwidth(int bandwidth)
const QColor & getColor() const
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
void setLiveRateLog2Decim(int log2Decim)
Ui::ChannelAnalyzerGUI * ui
ChannelAnalyzerSettings m_settings
int getChannelSampleRate() const
static const QString m_channelIdURI
void on_channelSampleRate_changed(quint64 value)
void on_ssb_toggled(bool checked)
void enterEvent(QEvent *)
virtual MessageQueue * getInputMessageQueue()
ChannelAnalyzer * m_channelAnalyzer
int getDecimation() const
void channelMarkerHighlightedByCursor()