mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-22 17:45:48 -05:00
Save the waterfall share percentage of the screen in the preset
This commit is contained in:
parent
a5bf0c2720
commit
ad2b941529
@ -56,6 +56,9 @@ public:
|
||||
void newSpectrum(const std::vector<Real>& spectrum, int fftSize);
|
||||
void clearSpectrumHistogram();
|
||||
|
||||
Real getWaterfallShare() const { return m_waterfallShare; }
|
||||
void setWaterfallShare(Real waterfallShare);
|
||||
|
||||
private:
|
||||
struct ChannelMarkerState {
|
||||
ChannelMarker* m_channelMarker;
|
||||
|
@ -1530,3 +1530,16 @@ void GLSpectrum::channelMarkerDestroyed(QObject* object)
|
||||
{
|
||||
removeChannelMarker((ChannelMarker*)object);
|
||||
}
|
||||
|
||||
void GLSpectrum::setWaterfallShare(Real waterfallShare)
|
||||
{
|
||||
if (waterfallShare < 0.1f) {
|
||||
m_waterfallShare = 0.1f;
|
||||
}
|
||||
else if (waterfallShare > 0.8f) {
|
||||
m_waterfallShare = 0.8f;
|
||||
} else {
|
||||
m_waterfallShare = waterfallShare;
|
||||
}
|
||||
m_changesPending = true;
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ QByteArray GLSpectrumGUI::serialize() const
|
||||
s.writeS32(15, m_histogramStroke);
|
||||
s.writeBool(16, m_displayCurrent);
|
||||
s.writeS32(17, m_displayTraceIntensity);
|
||||
s.writeReal(18, m_glSpectrum->getWaterfallShare());
|
||||
return s.final();
|
||||
}
|
||||
|
||||
@ -119,6 +120,9 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data)
|
||||
d.readS32(15, &m_histogramStroke, 40);
|
||||
d.readBool(16, &m_displayCurrent, false);
|
||||
d.readS32(17, &m_displayTraceIntensity, 50);
|
||||
Real waterfallShare;
|
||||
d.readReal(18, &waterfallShare, 0.66);
|
||||
m_glSpectrum->setWaterfallShare(waterfallShare);
|
||||
applySettings();
|
||||
return true;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user