| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | #ifndef INCLUDE_GLSPECTRUMGUI_H
 | 
					
						
							|  |  |  | #define INCLUDE_GLSPECTRUMGUI_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QWidget>
 | 
					
						
							|  |  |  | #include "dsp/dsptypes.h"
 | 
					
						
							| 
									
										
										
										
											2018-03-20 13:49:21 +01:00
										 |  |  | #include "export.h"
 | 
					
						
							| 
									
										
										
										
											2017-10-01 17:54:48 +02:00
										 |  |  | #include "settings/serializable.h"
 | 
					
						
							| 
									
										
										
										
											2018-07-01 20:48:30 +02:00
										 |  |  | #include "util/messagequeue.h"
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Ui { | 
					
						
							|  |  |  | 	class GLSpectrumGUI; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SpectrumVis; | 
					
						
							|  |  |  | class GLSpectrum; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | class SDRGUI_API GLSpectrumGUI : public QWidget, public Serializable { | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2018-06-30 22:30:42 +02:00
										 |  |  |     enum AveragingMode | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2018-07-01 22:36:36 +02:00
										 |  |  |         AvgModeNone, | 
					
						
							| 
									
										
										
										
											2018-06-30 22:30:42 +02:00
										 |  |  |         AvgModeMoving, | 
					
						
							| 
									
										
										
										
											2018-10-12 08:47:14 +02:00
										 |  |  |         AvgModeFixed, | 
					
						
							|  |  |  |         AvgModeMax | 
					
						
							| 
									
										
										
										
											2018-06-30 22:30:42 +02:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	explicit GLSpectrumGUI(QWidget* parent = NULL); | 
					
						
							|  |  |  | 	~GLSpectrumGUI(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void setBuddies(MessageQueue* messageQueue, SpectrumVis* spectrumVis, GLSpectrum* glSpectrum); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void resetToDefaults(); | 
					
						
							| 
									
										
										
										
											2017-10-01 17:54:48 +02:00
										 |  |  | 	virtual QByteArray serialize() const; | 
					
						
							|  |  |  | 	virtual bool deserialize(const QByteArray& data); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  | 	Ui::GLSpectrumGUI* ui; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-01 20:48:30 +02:00
										 |  |  | 	MessageQueue* m_messageQueueToVis; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	SpectrumVis* m_spectrumVis; | 
					
						
							|  |  |  | 	GLSpectrum* m_glSpectrum; | 
					
						
							| 
									
										
										
										
											2018-07-01 20:48:30 +02:00
										 |  |  | 	MessageQueue m_messageQueue; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	qint32 m_fftSize; | 
					
						
							|  |  |  | 	qint32 m_fftOverlap; | 
					
						
							|  |  |  | 	qint32 m_fftWindow; | 
					
						
							|  |  |  | 	Real m_refLevel; | 
					
						
							|  |  |  | 	Real m_powerRange; | 
					
						
							|  |  |  | 	int m_decay; | 
					
						
							| 
									
										
										
										
											2018-10-19 00:40:14 +02:00
										 |  |  | 	int m_decayDivisor; | 
					
						
							| 
									
										
										
										
											2015-07-15 08:48:02 +02:00
										 |  |  | 	int m_histogramStroke; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:49:03 +02:00
										 |  |  | 	int m_displayGridIntensity; | 
					
						
							| 
									
										
										
										
											2015-07-18 17:53:57 +02:00
										 |  |  | 	int m_displayTraceIntensity; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	bool m_displayWaterfall; | 
					
						
							|  |  |  | 	bool m_invertedWaterfall; | 
					
						
							|  |  |  | 	bool m_displayMaxHold; | 
					
						
							| 
									
										
										
										
											2015-07-16 04:55:14 +02:00
										 |  |  | 	bool m_displayCurrent; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	bool m_displayHistogram; | 
					
						
							|  |  |  | 	bool m_displayGrid; | 
					
						
							|  |  |  | 	bool m_invert; | 
					
						
							| 
									
										
										
										
											2018-06-30 22:30:42 +02:00
										 |  |  | 	AveragingMode m_averagingMode; | 
					
						
							|  |  |  | 	int m_averagingIndex; | 
					
						
							| 
									
										
										
										
											2018-07-01 00:55:30 +02:00
										 |  |  | 	int m_averagingMaxScale; //!< Max power of 10 multiplier to 2,5,10 base ex: 2 -> 2,5,10,20,50,100,200,500,1000
 | 
					
						
							| 
									
										
										
										
											2018-06-30 22:30:42 +02:00
										 |  |  | 	unsigned int m_averagingNb; | 
					
						
							| 
									
										
										
										
											2018-07-04 23:11:28 +02:00
										 |  |  | 	bool m_linear; //!< linear else logarithmic scale
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void applySettings(); | 
					
						
							| 
									
										
										
										
											2018-06-30 22:30:42 +02:00
										 |  |  | 	int getAveragingIndex(int averaging) const; | 
					
						
							|  |  |  | 	int getAveragingValue(int averagingIndex) const; | 
					
						
							| 
									
										
										
										
											2018-07-01 00:55:30 +02:00
										 |  |  | 	void setAveragingCombo(); | 
					
						
							|  |  |  | 	void setNumberStr(int n, QString& s); | 
					
						
							| 
									
										
										
										
											2018-07-01 20:48:30 +02:00
										 |  |  | 	void setNumberStr(float v, int decimalPlaces, QString& s); | 
					
						
							|  |  |  | 	void setAveragingToolitp(); | 
					
						
							|  |  |  | 	bool handleMessage(const Message& message); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							|  |  |  | 	void on_fftWindow_currentIndexChanged(int index); | 
					
						
							|  |  |  | 	void on_fftSize_currentIndexChanged(int index); | 
					
						
							|  |  |  | 	void on_refLevel_currentIndexChanged(int index); | 
					
						
							|  |  |  | 	void on_levelRange_currentIndexChanged(int index); | 
					
						
							| 
									
										
										
										
											2015-07-15 08:48:02 +02:00
										 |  |  | 	void on_decay_valueChanged(int index); | 
					
						
							| 
									
										
										
										
											2018-10-19 00:40:14 +02:00
										 |  |  | 	void on_decayDivisor_valueChanged(int index); | 
					
						
							| 
									
										
										
										
											2015-07-15 08:48:02 +02:00
										 |  |  | 	void on_stroke_valueChanged(int index); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:49:03 +02:00
										 |  |  | 	void on_gridIntensity_valueChanged(int index); | 
					
						
							| 
									
										
										
										
											2015-07-18 17:53:57 +02:00
										 |  |  | 	void on_traceIntensity_valueChanged(int index); | 
					
						
							| 
									
										
										
										
											2018-06-30 22:30:42 +02:00
										 |  |  | 	void on_averagingMode_currentIndexChanged(int index); | 
					
						
							|  |  |  |     void on_averaging_currentIndexChanged(int index); | 
					
						
							| 
									
										
										
										
											2018-07-04 23:11:28 +02:00
										 |  |  |     void on_linscale_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void on_waterfall_toggled(bool checked); | 
					
						
							|  |  |  | 	void on_histogram_toggled(bool checked); | 
					
						
							|  |  |  | 	void on_maxHold_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2015-07-16 04:55:14 +02:00
										 |  |  | 	void on_current_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	void on_invert_toggled(bool checked); | 
					
						
							|  |  |  | 	void on_grid_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2015-07-24 01:09:03 +02:00
										 |  |  | 	void on_clearSpectrum_clicked(bool checked); | 
					
						
							| 
									
										
										
										
											2018-07-01 20:48:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void handleInputMessages(); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // INCLUDE_GLSPECTRUMGUI_H
 |