6 #include "ui_glspectrumgui.h" 11 m_messageQueueToVis(0),
21 m_histogramStroke(30),
22 m_displayGridIntensity(5),
23 m_displayTraceIntensity(50),
24 m_displayWaterfall(true),
25 m_invertedWaterfall(false),
26 m_displayMaxHold(false),
27 m_displayCurrent(false),
28 m_displayHistogram(false),
31 m_averagingMode(AvgModeNone),
33 m_averagingMaxScale(5),
38 ui->refLevel->clear();
39 for(
int ref = 0; ref >= -110; ref -= 5)
40 ui->refLevel->addItem(QString(
"%1").
arg(ref));
41 ui->levelRange->clear();
42 for(
int range = 100; range >= 5; range -= 5)
43 ui->levelRange->addItem(QString(
"%1").
arg(range));
142 d.
readReal(18, &waterfallShare, 0.66);
162 for(
int i = 0;
i < 6;
i++) {
164 ui->fftSize->setCurrentIndex(
i);
184 ui->decay->setToolTip(QString(
"Decay: %1").
arg(
m_decay));
326 qDebug(
"GLSpectrumGUI::on_linscale_toggled: refLevel: %e powerRange: %e", refLevel, powerRange);
341 qDebug(
"GLSpectrumGUI::on_refLevel_currentIndexChanged: refLevel: %e ", refLevel);
355 qDebug(
"GLSpectrumGUI::on_levelRange_currentIndexChanged: powerRange: %e", powerRange);
364 ui->decay->setToolTip(QString(
"Decay: %1").
arg(
m_decay));
464 if (averagingValue <= 1) {
468 int v = averagingValue;
496 if (averagingIndex <= 0) {
500 int v = averagingIndex - 1;
506 }
else if (v % 3 == 1) {
508 }
else if (v % 3 == 2) {
517 int index =
ui->averaging->currentIndex();
518 ui->averaging->clear();
519 ui->averaging->addItem(QString(
"1"));
524 int m = pow(10.0,
i);
527 ui->averaging->addItem(s);
530 ui->averaging->addItem(s);
533 ui->averaging->addItem(s);
536 ui->averaging->setCurrentIndex(index >=
ui->averaging->count() ?
ui->averaging->count() - 1 : index);
543 }
else if (n < 100000) {
544 s = tr(
"%1k").arg(n/1000);
545 }
else if (n < 1000000) {
546 s = tr(
"%1e5").arg(n/100000);
547 }
else if (n < 1000000000) {
548 s = tr(
"%1M").arg(n/1000000);
550 s = tr(
"%1G").arg(n/1000000000);
557 s = tr(
"%1n").arg(v*1e9, 0,
'f', decimalPlaces);
558 }
else if (v < 1e-3) {
559 s = tr(
"%1ยต").arg(v*1e6, 0,
'f', decimalPlaces);
560 }
else if (v < 1.0) {
561 s = tr(
"%1m").arg(v*1e3, 0,
'f', decimalPlaces);
562 }
else if (v < 1e3) {
563 s = tr(
"%1").arg(v, 0,
'f', decimalPlaces);
564 }
else if (v < 1e6) {
565 s = tr(
"%1k").arg(v*1e-3, 0,
'f', decimalPlaces);
566 }
else if (v < 1e9) {
567 s = tr(
"%1M").arg(v*1e-6, 0,
'f', decimalPlaces);
569 s = tr(
"%1G").arg(v*1e-9, 0,
'f', decimalPlaces);
580 ui->averaging->setToolTip(QString(
"Number of averaging samples (avg time: %1s)").
arg(s));
584 ui->averaging->setToolTip(QString(
"Number of averaging samples"));
605 qDebug(
"GLSpectrumGUI::handleInputMessages: message: %s", message->
getIdentifier());
Message * pop()
Pop message from queue.
int m_displayTraceIntensity
void on_refLevel_currentIndexChanged(int index)
void setDisplayGrid(bool display)
void setTimingRate(qint32 timingRate)
void on_fftSize_currentIndexChanged(int index)
qint32 getSampleRate() const
void setDisplayTraceIntensity(int intensity)
void on_gridIntensity_valueChanged(int index)
void setPowerRange(Real powerRange)
void on_clearSpectrum_clicked(bool checked)
Real getWaterfallShare() const
MessageQueue * m_messageQueueToVis
MessageQueue m_messageQueue
void on_grid_toggled(bool checked)
void setReferenceLevel(Real referenceLevel)
void setBuddies(MessageQueue *messageQueue, SpectrumVis *spectrumVis, GLSpectrum *glSpectrum)
bool m_linear
linear else logarithmic scale
void on_averagingMode_currentIndexChanged(int index)
void setDisplayHistogram(bool display)
bool readBool(quint32 id, bool *result, bool def=false) const
void on_averaging_currentIndexChanged(int index)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
void setDecayDivisor(int decayDivisor)
void on_stroke_valueChanged(int index)
void setAveragingToolitp()
void setDisplayCurrent(bool display)
void on_waterfall_toggled(bool checked)
void on_traceIntensity_valueChanged(int index)
bool readS32(quint32 id, qint32 *result, qint32 def=0) const
SpectrumVis * m_spectrumVis
void on_decayDivisor_valueChanged(int index)
void setMessageQueueToGUI(MessageQueue *messageQueue)
void setInvertedWaterfall(bool inv)
void on_linscale_toggled(bool checked)
static bool match(const Message *message)
void on_current_toggled(bool checked)
void writeS32(quint32 id, qint32 value)
void setHistoStroke(int stroke)
quint32 getVersion() const
void on_maxHold_toggled(bool checked)
void handleInputMessages()
void on_invert_toggled(bool checked)
GLSpectrum * m_glSpectrum
int m_averagingMaxScale
Max power of 10 multiplier to 2,5,10 base ex: 2 -> 2,5,10,20,50,100,200,500,1000. ...
virtual QByteArray serialize() const
void writeReal(quint32 id, Real value)
void on_levelRange_currentIndexChanged(int index)
bool readReal(quint32 id, Real *result, Real def=0) const
bool handleMessage(const Message &message)
void setNumberStr(int n, QString &s)
void on_decay_valueChanged(int index)
void setLinear(bool linear)
void writeBool(quint32 id, bool value)
GLSpectrumGUI(QWidget *parent=NULL)
virtual const char * getIdentifier() const
void on_fftWindow_currentIndexChanged(int index)
AveragingMode m_averagingMode
void configure(MessageQueue *msgQueue, int fftSize, int overlapPercent, unsigned int averagingNb, int averagingMode, FFTWindow::Function window, bool m_linear)
int m_displayGridIntensity
void setDisplayGridIntensity(int intensity)
int getAveragingValue(int averagingIndex) const
void setWaterfallShare(Real waterfallShare)
void on_histogram_toggled(bool checked)
void clearSpectrumHistogram()
const QByteArray & final()
void setDisplayMaxHold(bool display)
virtual bool deserialize(const QByteArray &data)
unsigned int m_averagingNb
int getAveragingIndex(int averaging) const
void setDisplayWaterfall(bool display)