diff --git a/include-gpl/gui/glscope.h b/include-gpl/gui/glscope.h index 62671c454..36d9cdd59 100644 --- a/include-gpl/gui/glscope.h +++ b/include-gpl/gui/glscope.h @@ -50,6 +50,7 @@ public: void setTimeOfsProMill(int timeOfsProMill); void setMode(Mode mode); void setOrientation(Qt::Orientation orientation); + void setDisplayGridIntensity(int intensity); void newTrace(const std::vector& trace, int sampleRate); @@ -93,6 +94,7 @@ private: // graphics stuff QRectF m_glScopeRect1; QRectF m_glScopeRect2; + int m_displayGridIntensity; void initializeGL(); void resizeGL(int width, int height); diff --git a/include-gpl/gui/glscopegui.h b/include-gpl/gui/glscopegui.h index a7d6c9728..7ee9085d0 100644 --- a/include-gpl/gui/glscopegui.h +++ b/include-gpl/gui/glscopegui.h @@ -43,6 +43,7 @@ private: qint32 m_timeBase; qint32 m_timeOffset; qint32 m_amplification; + int m_displayGridIntensity; void applySettings(); @@ -52,6 +53,7 @@ private slots: void on_time_valueChanged(int value); void on_timeOfs_valueChanged(int value); void on_dataMode_currentIndexChanged(int index); + void on_gridIntensity_valueChanged(int index); void on_horizView_clicked(); void on_vertView_clicked(); diff --git a/plugins/channel/chanalyzer/chanalyzergui.cpp b/plugins/channel/chanalyzer/chanalyzergui.cpp index 3d457918b..ea5eab582 100644 --- a/plugins/channel/chanalyzer/chanalyzergui.cpp +++ b/plugins/channel/chanalyzer/chanalyzergui.cpp @@ -55,6 +55,7 @@ QByteArray ChannelAnalyzerGUI::serialize() const s.writeS32(5, ui->lowCut->value()); s.writeS32(6, ui->spanLog2->value()); s.writeBool(7, ui->ssb->isChecked()); + s.writeBlob(8, ui->scopeGUI->serialize()); return s.final(); } @@ -87,6 +88,8 @@ bool ChannelAnalyzerGUI::deserialize(const QByteArray& data) setNewRate(tmp); d.readBool(7, &tmpBool, false); ui->ssb->setChecked(tmpBool); + d.readBlob(8, &bytetmp); + ui->scopeGUI->deserialize(bytetmp); applySettings(); return true; } else { diff --git a/sdrbase/gui/glscope.cpp b/sdrbase/gui/glscope.cpp index 3dcd28a74..6e56aa219 100644 --- a/sdrbase/gui/glscope.cpp +++ b/sdrbase/gui/glscope.cpp @@ -24,7 +24,8 @@ GLScope::GLScope(QWidget* parent) : m_amp(1.0), m_timeBase(1), m_timeOfsProMill(0), - m_triggerChannel(ScopeVis::TriggerFreeRun) + m_triggerChannel(ScopeVis::TriggerFreeRun), + m_displayGridIntensity(5) { setAttribute(Qt::WA_OpaquePaintEvent); connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); @@ -80,6 +81,15 @@ void GLScope::setOrientation(Qt::Orientation orientation) update(); } +void GLScope::setDisplayGridIntensity(int intensity) +{ + m_displayGridIntensity = intensity; + if (m_displayGridIntensity > 100) { + m_displayGridIntensity = 100; + } + update(); +} + void GLScope::newTrace(const std::vector& trace, int sampleRate) { if(!m_mutex.tryLock(2)) @@ -151,7 +161,7 @@ void GLScope::paintGL() glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glLineWidth(1.0f); - glColor4f(1, 1, 1, 0.05f); + glColor4f(1, 1, 1, m_displayGridIntensity / 100.0); for(int i = 1; i < 10; i++) { glBegin(GL_LINE_LOOP); glVertex2f(0, i * 0.1); @@ -238,7 +248,7 @@ void GLScope::paintGL() glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glLineWidth(1.0f); - glColor4f(1, 1, 1, 0.05f); + glColor4f(1, 1, 1, m_displayGridIntensity / 100.0); for(int i = 1; i < 10; i++) { glBegin(GL_LINE_LOOP); glVertex2f(0, i * 0.1); diff --git a/sdrbase/gui/glscopegui.cpp b/sdrbase/gui/glscopegui.cpp index 95dc51d7d..cad26d6f6 100644 --- a/sdrbase/gui/glscopegui.cpp +++ b/sdrbase/gui/glscopegui.cpp @@ -5,6 +5,7 @@ #include "util/simpleserializer.h" #include "ui_glscopegui.h" +#include GLScopeGUI::GLScopeGUI(QWidget* parent) : QWidget(parent), @@ -17,7 +18,8 @@ GLScopeGUI::GLScopeGUI(QWidget* parent) : m_displayOrientation(Qt::Horizontal), m_timeBase(1), m_timeOffset(0), - m_amplification(0) + m_amplification(0), + m_displayGridIntensity(1) { ui->setupUi(this); } @@ -42,6 +44,7 @@ void GLScopeGUI::resetToDefaults() m_timeBase = 1; m_timeOffset = 0; m_amplification = 0; + m_displayGridIntensity = 5; applySettings(); } @@ -54,6 +57,7 @@ QByteArray GLScopeGUI::serialize() const s.writeS32(3, m_timeBase); s.writeS32(4, m_timeOffset); s.writeS32(5, m_amplification); + s.writeS32(6, m_displayGridIntensity); return s.final(); } @@ -73,6 +77,7 @@ bool GLScopeGUI::deserialize(const QByteArray& data) d.readS32(3, &m_timeBase, 1); d.readS32(4, &m_timeOffset, 0); d.readS32(5, &m_amplification, 0); + d.readS32(6, &m_displayGridIntensity, 5); if(m_timeBase < 0) m_timeBase = 1; applySettings(); @@ -98,6 +103,7 @@ void GLScopeGUI::applySettings() ui->time->setValue(m_timeBase); ui->timeOfs->setValue(m_timeOffset); ui->amp->setValue(m_amplification); + ui->gridIntensity->setSliderPosition(m_displayGridIntensity); } void GLScopeGUI::on_amp_valueChanged(int value) @@ -181,6 +187,13 @@ void GLScopeGUI::on_vertView_clicked() } } +void GLScopeGUI::on_gridIntensity_valueChanged(int index) +{ + m_displayGridIntensity = index; + if(m_glScope != NULL) + m_glScope->setDisplayGridIntensity(m_displayGridIntensity); +} + bool GLScopeGUI::handleMessage(Message* cmd) { if(DSPSignalNotification::match(cmd)) diff --git a/sdrbase/gui/glscopegui.ui b/sdrbase/gui/glscopegui.ui index fdb386ecc..e0a83fd48 100644 --- a/sdrbase/gui/glscopegui.ui +++ b/sdrbase/gui/glscopegui.ui @@ -6,8 +6,8 @@ 0 0 - 798 - 40 + 807 + 34 @@ -61,27 +61,30 @@ 0 + + Grid intensity + QComboBox::AdjustToContentsOnFirstShow - I+Q Level (linear) + I+Q (linear) - Magnitude (linear) + Phase + Mag (linear) + Phi - Magnitude (dB) + Phase + Mag (dB) + Phi - Derived 1st + 2nd order + Derived 1+2nd @@ -310,6 +313,29 @@ + + + + Qt::Vertical + + + + + + + + 24 + 24 + + + + 100 + + + 1 + + +