1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-17 23:28:50 -05:00

Added button to change the brightess of the spectrum display grid

This commit is contained in:
f4exb 2015-05-12 15:49:03 +02:00
parent 3e922dbb0a
commit e15f4f26f1
6 changed files with 35 additions and 7 deletions

View File

@ -78,12 +78,12 @@ Done since the fork
- SSB bandwidth can now be tuned in steps of 100 Hz - SSB bandwidth can now be tuned in steps of 100 Hz
- NFM and SSB receiver in focus trigger the display of the central frequency line on the spectrum frequency scale thus facilitating its identification - NFM and SSB receiver in focus trigger the display of the central frequency line on the spectrum frequency scale thus facilitating its identification
- Added AM demod so now you can listen to air traffic! - Added AM demod so now you can listen to air traffic!
- Added the possibility to change the brightness and/or color of the grid.
===== =====
To Do To Do
===== =====
- Add the possibility to change the brightness and/or color of the grid. Sometimes it is barely visible yet useful
- Fix and possibly enhance (stereo, RDS?) WFM. Maybe into two plugins one for plain WFM and the other for Broadcast FM - Fix and possibly enhance (stereo, RDS?) WFM. Maybe into two plugins one for plain WFM and the other for Broadcast FM
- Make the the SSB filter frequency bounds tunable so that it can be used for CW. Change marker overlay accordingly. - Make the the SSB filter frequency bounds tunable so that it can be used for CW. Change marker overlay accordingly.
- Possibility to completely undock the receiver in a separate window. Useful when there are many receivers - Possibility to completely undock the receiver in a separate window. Useful when there are many receivers

View File

@ -43,6 +43,7 @@ public:
void setDisplayMaxHold(bool display); void setDisplayMaxHold(bool display);
void setDisplayHistogram(bool display); void setDisplayHistogram(bool display);
void setDisplayGrid(bool display); void setDisplayGrid(bool display);
void setDisplayGridIntensity(int intensity);
void addChannelMarker(ChannelMarker* channelMarker); void addChannelMarker(ChannelMarker* channelMarker);
void removeChannelMarker(ChannelMarker* channelMarker); void removeChannelMarker(ChannelMarker* channelMarker);
@ -87,6 +88,7 @@ private:
int m_fftSize; int m_fftSize;
bool m_displayGrid; bool m_displayGrid;
int m_displayGridIntensity;
bool m_invertedWaterfall; bool m_invertedWaterfall;
std::vector<Real> m_maxHold; std::vector<Real> m_maxHold;

View File

@ -39,6 +39,7 @@ private:
Real m_refLevel; Real m_refLevel;
Real m_powerRange; Real m_powerRange;
int m_decay; int m_decay;
int m_displayGridIntensity;
bool m_displayWaterfall; bool m_displayWaterfall;
bool m_invertedWaterfall; bool m_invertedWaterfall;
bool m_displayMaxHold; bool m_displayMaxHold;
@ -54,6 +55,7 @@ private slots:
void on_refLevel_currentIndexChanged(int index); void on_refLevel_currentIndexChanged(int index);
void on_levelRange_currentIndexChanged(int index); void on_levelRange_currentIndexChanged(int index);
void on_decay_currentIndexChanged(int index); void on_decay_currentIndexChanged(int index);
void on_gridIntensity_valueChanged(int index);
void on_waterfall_toggled(bool checked); void on_waterfall_toggled(bool checked);
void on_histogram_toggled(bool checked); void on_histogram_toggled(bool checked);

View File

@ -33,6 +33,7 @@ GLSpectrum::GLSpectrum(QWidget* parent) :
m_sampleRate(500000), m_sampleRate(500000),
m_fftSize(512), m_fftSize(512),
m_displayGrid(true), m_displayGrid(true),
m_displayGridIntensity(5),
m_invertedWaterfall(false), m_invertedWaterfall(false),
m_displayMaxHold(false), m_displayMaxHold(false),
m_leftMarginTextureAllocated(false), m_leftMarginTextureAllocated(false),
@ -217,6 +218,15 @@ void GLSpectrum::setDisplayGrid(bool display)
update(); update();
} }
void GLSpectrum::setDisplayGridIntensity(int intensity)
{
m_displayGridIntensity = intensity;
if (m_displayGridIntensity > 100) {
m_displayGridIntensity = 100;
}
update();
}
void GLSpectrum::addChannelMarker(ChannelMarker* channelMarker) void GLSpectrum::addChannelMarker(ChannelMarker* channelMarker)
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
@ -727,7 +737,8 @@ void GLSpectrum::paintGL()
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(1.0f); glLineWidth(1.0f);
glColor4f(1, 1, 1, 0.05f); //glColor4f(1, 1, 1, 0.05f);
glColor4f(1, 1, 1, m_displayGridIntensity / 100.0);
glPushMatrix(); glPushMatrix();
glTranslatef(m_glWaterfallRect.x(), m_glWaterfallRect.y(), 0); glTranslatef(m_glWaterfallRect.x(), m_glWaterfallRect.y(), 0);
@ -772,7 +783,7 @@ void GLSpectrum::paintGL()
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(1.0f); glLineWidth(1.0f);
glColor4f(1, 1, 1, 0.05f); glColor4f(1, 1, 1, m_displayGridIntensity / 100.0);
glPushMatrix(); glPushMatrix();
glTranslatef(m_glHistogramRect.x(), m_glHistogramRect.y(), 0); glTranslatef(m_glHistogramRect.x(), m_glHistogramRect.y(), 0);

View File

@ -17,6 +17,7 @@ GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) :
m_refLevel(0), m_refLevel(0),
m_powerRange(100), m_powerRange(100),
m_decay(0), m_decay(0),
m_displayGridIntensity(1),
m_displayWaterfall(true), m_displayWaterfall(true),
m_invertedWaterfall(false), m_invertedWaterfall(false),
m_displayMaxHold(false), m_displayMaxHold(false),
@ -52,6 +53,7 @@ void GLSpectrumGUI::resetToDefaults()
m_refLevel = 0; m_refLevel = 0;
m_powerRange = 100; m_powerRange = 100;
m_decay = 0; m_decay = 0;
m_displayGridIntensity = 5,
m_displayWaterfall = true; m_displayWaterfall = true;
m_invertedWaterfall = false; m_invertedWaterfall = false;
m_displayMaxHold = false; m_displayMaxHold = false;
@ -74,6 +76,7 @@ QByteArray GLSpectrumGUI::serialize() const
s.writeBool(8, m_displayMaxHold); s.writeBool(8, m_displayMaxHold);
s.writeBool(9, m_displayHistogram); s.writeBool(9, m_displayHistogram);
s.writeS32(10, m_decay); s.writeS32(10, m_decay);
s.writeS32(13, m_displayGridIntensity);
s.writeBool(11, m_displayGrid); s.writeBool(11, m_displayGrid);
s.writeBool(12, m_invert); s.writeBool(12, m_invert);
return s.final(); return s.final();
@ -99,6 +102,7 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data)
d.readBool(8, &m_displayMaxHold, false); d.readBool(8, &m_displayMaxHold, false);
d.readBool(9, &m_displayHistogram, false); d.readBool(9, &m_displayHistogram, false);
d.readS32(10, &m_decay, 0); d.readS32(10, &m_decay, 0);
d.readS32(13, &m_displayGridIntensity, 0);
d.readBool(11, &m_displayGrid, false); d.readBool(11, &m_displayGrid, false);
d.readBool(12, &m_invert, true); d.readBool(12, &m_invert, true);
applySettings(); applySettings();
@ -126,6 +130,7 @@ void GLSpectrumGUI::applySettings()
ui->histogram->setChecked(m_displayHistogram); ui->histogram->setChecked(m_displayHistogram);
ui->invert->setChecked(m_invert); ui->invert->setChecked(m_invert);
ui->grid->setChecked(m_displayGrid); ui->grid->setChecked(m_displayGrid);
ui->gridIntensity->setSliderPosition(m_displayGridIntensity);
m_glSpectrum->setDisplayWaterfall(m_displayWaterfall); m_glSpectrum->setDisplayWaterfall(m_displayWaterfall);
m_glSpectrum->setInvertedWaterfall(m_invertedWaterfall); m_glSpectrum->setInvertedWaterfall(m_invertedWaterfall);
@ -134,6 +139,7 @@ void GLSpectrumGUI::applySettings()
m_glSpectrum->setDecay(m_decay); m_glSpectrum->setDecay(m_decay);
m_glSpectrum->setInvertedWaterfall(m_invert); m_glSpectrum->setInvertedWaterfall(m_invert);
m_glSpectrum->setDisplayGrid(m_displayGrid); m_glSpectrum->setDisplayGrid(m_displayGrid);
m_glSpectrum->setDisplayGridIntensity(m_displayGridIntensity);
m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow); m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
} }
@ -208,3 +214,10 @@ void GLSpectrumGUI::on_grid_toggled(bool checked)
if(m_glSpectrum != NULL) if(m_glSpectrum != NULL)
m_glSpectrum->setDisplayGrid(m_displayGrid); m_glSpectrum->setDisplayGrid(m_displayGrid);
} }
void GLSpectrumGUI::on_gridIntensity_valueChanged(int index)
{
m_displayGridIntensity = index;
if(m_glSpectrum != NULL)
m_glSpectrum->setDisplayGridIntensity(m_displayGridIntensity);
}

View File

@ -457,13 +457,13 @@
<string>Grid intensity</string> <string>Grid intensity</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>255</number> <number>100</number>
</property> </property>
<property name="pageStep"> <property name="pageStep">
<number>16</number> <number>1</number>
</property> </property>
<property name="value"> <property name="value">
<number>64</number> <number>5</number>
</property> </property>
</widget> </widget>
</item> </item>