mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 13:00:26 -04: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 newSpectrum(const std::vector<Real>& spectrum, int fftSize); | ||||||
| 	void clearSpectrumHistogram(); | 	void clearSpectrumHistogram(); | ||||||
| 
 | 
 | ||||||
|  | 	Real getWaterfallShare() const { return m_waterfallShare; } | ||||||
|  | 	void setWaterfallShare(Real waterfallShare); | ||||||
|  | 
 | ||||||
| private: | private: | ||||||
| 	struct ChannelMarkerState { | 	struct ChannelMarkerState { | ||||||
| 		ChannelMarker* m_channelMarker; | 		ChannelMarker* m_channelMarker; | ||||||
|  | |||||||
| @ -1530,3 +1530,16 @@ void GLSpectrum::channelMarkerDestroyed(QObject* object) | |||||||
| { | { | ||||||
| 	removeChannelMarker((ChannelMarker*)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.writeS32(15, m_histogramStroke); | ||||||
| 	s.writeBool(16, m_displayCurrent); | 	s.writeBool(16, m_displayCurrent); | ||||||
| 	s.writeS32(17, m_displayTraceIntensity); | 	s.writeS32(17, m_displayTraceIntensity); | ||||||
|  | 	s.writeReal(18, m_glSpectrum->getWaterfallShare()); | ||||||
| 	return s.final(); | 	return s.final(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -119,6 +120,9 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data) | |||||||
| 		d.readS32(15, &m_histogramStroke, 40); | 		d.readS32(15, &m_histogramStroke, 40); | ||||||
| 		d.readBool(16, &m_displayCurrent, false); | 		d.readBool(16, &m_displayCurrent, false); | ||||||
| 		d.readS32(17, &m_displayTraceIntensity, 50); | 		d.readS32(17, &m_displayTraceIntensity, 50); | ||||||
|  | 		Real waterfallShare; | ||||||
|  | 		d.readReal(18, &waterfallShare, 0.66); | ||||||
|  | 		m_glSpectrum->setWaterfallShare(waterfallShare); | ||||||
| 		applySettings(); | 		applySettings(); | ||||||
| 		return true; | 		return true; | ||||||
| 	} else { | 	} else { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user