| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							| 
									
										
										
										
											2023-11-19 13:31:45 +01:00
										 |  |  | // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
 | 
					
						
							|  |  |  | // written by Christian Daniel                                                   //
 | 
					
						
							|  |  |  | // Copyright (C) 2015-2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com>          //
 | 
					
						
							|  |  |  | // Copyright (C) 2018 beta-tester <alpha-beta-release@gmx.net>                   //
 | 
					
						
							|  |  |  | // Copyright (C) 2022 Jon Beniston, M7RCE <jon@beniston.com>                     //
 | 
					
						
							|  |  |  | // Copyright (C) 2022 Jiří Pinkava <jiri.pinkava@rossum.ai>                      //
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is free software; you can redistribute it and/or modify          //
 | 
					
						
							|  |  |  | // it under the terms of the GNU General Public License as published by          //
 | 
					
						
							|  |  |  | // the Free Software Foundation as version 3 of the License, or                  //
 | 
					
						
							| 
									
										
										
										
											2019-04-11 14:43:33 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful,               //
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of                //
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                  //
 | 
					
						
							|  |  |  | // GNU General Public License V3 for more details.                               //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU General Public License             //
 | 
					
						
							|  |  |  | // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  | #ifndef SDRGUI_GLSPECTRUM_H_
 | 
					
						
							|  |  |  | #define SDRGUI_GLSPECTRUM_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QWidget>
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-20 13:49:21 +01:00
										 |  |  | #include "export.h"
 | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  | #include "glspectrumview.h"
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  | class QSplitter; | 
					
						
							| 
									
										
										
										
											2022-09-28 16:59:35 +01:00
										 |  |  | class SpectrumMeasurements; | 
					
						
							| 
									
										
										
										
											2016-03-02 03:09:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  | // Combines GLSpectrumView with SpectrumMeasurements in a QSplitter
 | 
					
						
							|  |  |  | class SDRGUI_API GLSpectrum : public QWidget, public GLSpectrumInterface { | 
					
						
							| 
									
										
										
										
											2022-01-21 00:18:41 +01:00
										 |  |  |     Q_OBJECT | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  |     GLSpectrum(QWidget *parent = nullptr); | 
					
						
							|  |  |  |     GLSpectrumView *getSpectrumView() const { return m_spectrum; } | 
					
						
							|  |  |  |     SpectrumMeasurements *getMeasurements() const { return m_measurements; } | 
					
						
							|  |  |  |     void setMeasurementsVisible(bool visible); | 
					
						
							|  |  |  |     void setMeasurementsPosition(SpectrumSettings::MeasurementsPosition position); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void setCenterFrequency(qint64 frequency) { m_spectrum->setCenterFrequency(frequency); } | 
					
						
							|  |  |  |     qint64 getCenterFrequency() const { return m_spectrum->getCenterFrequency(); } | 
					
						
							|  |  |  |     float getPowerMax() const { return m_spectrum->getPowerMax(); } | 
					
						
							|  |  |  |     float getTimeMax() const { return m_spectrum->getTimeMax(); } | 
					
						
							|  |  |  |     void setSampleRate(qint32 sampleRate) { m_spectrum->setSampleRate(sampleRate); } | 
					
						
							|  |  |  |     void setTimingRate(qint32 timingRate) { m_spectrum->setTimingRate(timingRate); } | 
					
						
							|  |  |  |     void setFFTOverlap(int overlap) { m_spectrum->setFFTOverlap(overlap); } | 
					
						
							|  |  |  |     void setReferenceLevel(Real referenceLevel) { m_spectrum->setReferenceLevel(referenceLevel); } | 
					
						
							|  |  |  |     void setPowerRange(Real powerRange){ m_spectrum->setPowerRange(powerRange); } | 
					
						
							|  |  |  |     void setDecay(int decay) { m_spectrum->setDecay(decay); } | 
					
						
							|  |  |  |     void setDecayDivisor(int decayDivisor) { m_spectrum->setDecayDivisor(decayDivisor); } | 
					
						
							|  |  |  |     void setHistoStroke(int stroke) { m_spectrum->setHistoStroke(stroke); } | 
					
						
							|  |  |  |     void setDisplayWaterfall(bool display) { m_spectrum->setDisplayWaterfall(display); } | 
					
						
							|  |  |  |     void setDisplay3DSpectrogram(bool display) { m_spectrum->setDisplay3DSpectrogram(display); } | 
					
						
							|  |  |  |     void set3DSpectrogramStyle(SpectrumSettings::SpectrogramStyle style) { m_spectrum->set3DSpectrogramStyle(style); } | 
					
						
							|  |  |  |     void setColorMapName(const QString &colorMapName) { m_spectrum->setColorMapName(colorMapName); } | 
					
						
							|  |  |  |     void setSpectrumStyle(SpectrumSettings::SpectrumStyle style) { m_spectrum->setSpectrumStyle(style); } | 
					
						
							|  |  |  |     void setSsbSpectrum(bool ssbSpectrum) { m_spectrum->setSsbSpectrum(ssbSpectrum); } | 
					
						
							|  |  |  |     void setLsbDisplay(bool lsbDisplay) { m_spectrum->setLsbDisplay(lsbDisplay); } | 
					
						
							|  |  |  |     void setInvertedWaterfall(bool inv) { m_spectrum->setInvertedWaterfall(inv); } | 
					
						
							|  |  |  |     void setDisplayMaxHold(bool display) { m_spectrum->setDisplayMaxHold(display); } | 
					
						
							|  |  |  |     void setDisplayCurrent(bool display) { m_spectrum->setDisplayCurrent(display); } | 
					
						
							|  |  |  |     void setDisplayHistogram(bool display) { m_spectrum->setDisplayHistogram(display); } | 
					
						
							|  |  |  |     void setDisplayGrid(bool display) { m_spectrum->setDisplayGrid(display); } | 
					
						
							|  |  |  |     void setDisplayGridIntensity(int intensity) { m_spectrum->setDisplayGridIntensity(intensity); } | 
					
						
							|  |  |  |     void setDisplayTraceIntensity(int intensity) { m_spectrum->setDisplayTraceIntensity(intensity); } | 
					
						
							| 
									
										
										
										
											2022-10-16 04:48:07 +02:00
										 |  |  |     void setFreqScaleTruncationMode(bool mode) { m_spectrum->setFreqScaleTruncationMode(mode); } | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  |     void setLinear(bool linear) { m_spectrum->setLinear(linear); } | 
					
						
							|  |  |  |     void setUseCalibration(bool useCalibration) { m_spectrum->setUseCalibration(useCalibration); } | 
					
						
							| 
									
										
										
										
											2022-09-29 11:59:58 +01:00
										 |  |  |     void setMeasurementParams(SpectrumSettings::Measurement measurement, | 
					
						
							|  |  |  |                               int centerFrequencyOffset, int bandwidth, int chSpacing, int adjChBandwidth, | 
					
						
							| 
									
										
										
										
											2022-10-02 20:06:52 +01:00
										 |  |  |                               int harmonics, int peaks, bool highlight, int precision); | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  |     qint32 getSampleRate() const { return m_spectrum->getSampleRate(); } | 
					
						
							|  |  |  |     void addChannelMarker(ChannelMarker* channelMarker) { m_spectrum->addChannelMarker(channelMarker); } | 
					
						
							|  |  |  |     void removeChannelMarker(ChannelMarker* channelMarker) { m_spectrum->removeChannelMarker(channelMarker); } | 
					
						
							|  |  |  |     void setMessageQueueToGUI(MessageQueue* messageQueue) { m_spectrum->setMessageQueueToGUI(messageQueue); } | 
					
						
							|  |  |  |     void newSpectrum(const Real* spectrum, int nbBins, int fftSize) { m_spectrum->newSpectrum(spectrum, nbBins, fftSize); } | 
					
						
							|  |  |  |     void clearSpectrumHistogram() { m_spectrum->clearSpectrumHistogram(); } | 
					
						
							|  |  |  |     Real getWaterfallShare() const { return  m_spectrum->getWaterfallShare(); } | 
					
						
							|  |  |  |     void setWaterfallShare(Real waterfallShare) { m_spectrum->setWaterfallShare(waterfallShare); } | 
					
						
							|  |  |  |     void setFPSPeriodMs(int fpsPeriodMs) { m_spectrum->setFPSPeriodMs(fpsPeriodMs); } | 
					
						
							|  |  |  |     void setDisplayedStream(bool sourceOrSink, int streamIndex) { m_spectrum->setDisplayedStream(sourceOrSink, streamIndex); } | 
					
						
							|  |  |  |     void setSpectrumVis(SpectrumVis *spectrumVis) { m_spectrum->setSpectrumVis(spectrumVis); } | 
					
						
							|  |  |  |     SpectrumVis *getSpectrumVis() { return m_spectrum->getSpectrumVis(); } | 
					
						
							|  |  |  |     const QList<SpectrumHistogramMarker>& getHistogramMarkers() const { return m_spectrum->getHistogramMarkers(); } | 
					
						
							|  |  |  |     QList<SpectrumHistogramMarker>& getHistogramMarkers() { return m_spectrum->getHistogramMarkers(); } | 
					
						
							|  |  |  |     void setHistogramMarkers(const QList<SpectrumHistogramMarker>& histogramMarkers) { m_spectrum->setHistogramMarkers(histogramMarkers); } | 
					
						
							|  |  |  |     const QList<SpectrumWaterfallMarker>& getWaterfallMarkers() const { return m_spectrum->getWaterfallMarkers(); } | 
					
						
							|  |  |  |     QList<SpectrumWaterfallMarker>& getWaterfallMarkers() { return m_spectrum->getWaterfallMarkers(); } | 
					
						
							|  |  |  |     void setWaterfallMarkers(const QList<SpectrumWaterfallMarker>& waterfallMarkers) { m_spectrum->setWaterfallMarkers(waterfallMarkers); } | 
					
						
							|  |  |  |     const QList<SpectrumAnnotationMarker>& getAnnotationMarkers() const { return m_spectrum->getAnnotationMarkers(); } | 
					
						
							|  |  |  |     QList<SpectrumAnnotationMarker>& getAnnotationMarkers() { return m_spectrum->getAnnotationMarkers(); } | 
					
						
							|  |  |  |     void setAnnotationMarkers(const QList<SpectrumAnnotationMarker>& annotationMarkers) { m_spectrum->setAnnotationMarkers(annotationMarkers); }; | 
					
						
							|  |  |  |     void updateHistogramMarkers() { m_spectrum->updateHistogramMarkers(); } | 
					
						
							|  |  |  |     void updateWaterfallMarkers() { m_spectrum->updateWaterfallMarkers(); } | 
					
						
							|  |  |  |     void updateAnnotationMarkers() { m_spectrum->updateAnnotationMarkers();} | 
					
						
							|  |  |  |     void updateMarkersDisplay() { m_spectrum->updateMarkersDisplay(); } | 
					
						
							|  |  |  |     void updateCalibrationPoints() { m_spectrum->updateCalibrationPoints(); } | 
					
						
							|  |  |  |     SpectrumSettings::MarkersDisplay& getMarkersDisplay() { return m_spectrum->getMarkersDisplay(); } | 
					
						
							| 
									
										
										
										
											2022-10-03 00:23:47 +02:00
										 |  |  |     bool& getHistogramFindPeaks() { return m_spectrum->getHistogramFindPeaks(); } | 
					
						
							|  |  |  |     void setHistogramFindPeaks(bool value) { m_spectrum->setHistogramFindPeaks(value); } | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  | 	void setMarkersDisplay(SpectrumSettings::MarkersDisplay markersDisplay) { m_spectrum->setMarkersDisplay(markersDisplay); } | 
					
						
							|  |  |  |     QList<SpectrumCalibrationPoint>& getCalibrationPoints() { return m_spectrum->getCalibrationPoints(); } | 
					
						
							|  |  |  |     void setCalibrationPoints(const QList<SpectrumCalibrationPoint>& calibrationPoints) { m_spectrum->setCalibrationPoints(calibrationPoints); } | 
					
						
							|  |  |  |     SpectrumSettings::CalibrationInterpolationMode& getCalibrationInterpMode() { return m_spectrum->getCalibrationInterpMode(); } | 
					
						
							|  |  |  |     void setCalibrationInterpMode(SpectrumSettings::CalibrationInterpolationMode mode) { m_spectrum->setCalibrationInterpMode(mode); } | 
					
						
							|  |  |  |     void setIsDeviceSpectrum(bool isDeviceSpectrum) { m_spectrum->setIsDeviceSpectrum(isDeviceSpectrum); } | 
					
						
							|  |  |  |     bool isDeviceSpectrum() const { return m_spectrum->isDeviceSpectrum(); } | 
					
						
							| 
									
										
										
										
											2019-05-30 18:38:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  |     QSplitter *m_splitter; | 
					
						
							|  |  |  |     GLSpectrumView *m_spectrum; | 
					
						
							| 
									
										
										
										
											2022-09-28 16:59:35 +01:00
										 |  |  |     SpectrumMeasurements *m_measurements; | 
					
						
							| 
									
										
										
										
											2022-10-02 20:06:52 +01:00
										 |  |  |     SpectrumSettings::MeasurementsPosition m_position; | 
					
						
							| 
									
										
										
										
											2022-06-24 14:47:33 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-29 13:48:04 +01:00
										 |  |  | #endif // SDRGUI_GLSPECTRUM_H_
 |