mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 04:50:29 -04:00 
			
		
		
		
	SDRDaemonSink GUI: sample rate active feedback (2)
This commit is contained in:
		
							parent
							
								
									f8383f8cff
								
							
						
					
					
						commit
						c25c7fda58
					
				| @ -537,7 +537,6 @@ void SDRdaemonSinkGui::analyzeApiReply(const QJsonObject& jsonObject) | ||||
|         ui->queueLengthGauge->setValue(queueLengthPercent); | ||||
|         int unrecoverableCount = report["uncorrectableErrorsCount"].toInt(); | ||||
|         int recoverableCount = report["correctableErrorsCount"].toInt(); | ||||
|         LimitedCounter<uint32_t, 2000000000> sampleCount(report["samplesCount"].toInt()); | ||||
|         uint64_t timestampUs = report["tvSec"].toInt()*1000000ULL + report["tvUSec"].toInt(); | ||||
| 
 | ||||
|         if (m_lastTimestampRateCorrection == 0) { | ||||
| @ -559,13 +558,20 @@ void SDRdaemonSinkGui::analyzeApiReply(const QJsonObject& jsonObject) | ||||
|             displayEventCounts(); | ||||
|         } | ||||
| 
 | ||||
|         LimitedCounter<uint32_t, 2000000000> sampleCountDelta = sampleCount - m_lastSampleCount; | ||||
|         uint32_t sampleCountDelta, sampleCount; | ||||
|         sampleCount = report["samplesCount"].toInt(); | ||||
| 
 | ||||
|         if (sampleCountDelta.value() == 0) { | ||||
|         if (sampleCount < m_lastSampleCount) { | ||||
|             sampleCountDelta = (0xFFFFFFFFU - sampleCount) + m_lastSampleCount + 1; | ||||
|         } else { | ||||
|             sampleCountDelta = sampleCount - m_lastSampleCount; | ||||
|         } | ||||
| 
 | ||||
|         if (sampleCountDelta == 0) { | ||||
|             ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : blue; }"); | ||||
|         } | ||||
| 
 | ||||
|         double remoteStreamRate = sampleCountDelta.value()*1e6 / (double) (timestampUs - m_lastTimestampUs); | ||||
|         double remoteStreamRate = sampleCountDelta*1e6 / (double) (timestampUs - m_lastTimestampUs); | ||||
| 
 | ||||
|         if (remoteStreamRate != 0) | ||||
|         { | ||||
|  | ||||
| @ -71,7 +71,7 @@ private: | ||||
|     int m_sampleRate; | ||||
|     quint64 m_deviceCenterFrequency; //!< Center frequency in device
 | ||||
| 	int m_samplesCount; | ||||
| 	MovingAverageUtil<double, double, 120> m_rateMovingAverage; // ~2mn average
 | ||||
| 	MovingAverageUtil<double, double, 30> m_rateMovingAverage; // ~30s average
 | ||||
| 	uint32_t m_tickCount; | ||||
| 	std::size_t m_nbSinceLastFlowCheck; | ||||
| 	int m_lastEngineState; | ||||
| @ -82,7 +82,7 @@ private: | ||||
|     uint32_t m_countRecovered; | ||||
|     uint32_t m_lastCountUnrecoverable; | ||||
|     uint32_t m_lastCountRecovered; | ||||
| 	LimitedCounter<uint32_t, 2000000000> m_lastSampleCount; | ||||
| 	uint32_t m_lastSampleCount; | ||||
| 	uint64_t m_lastTimestampUs; | ||||
| 	uint64_t m_lastTimestampRateCorrection; | ||||
|     bool m_resetCounts; | ||||
|  | ||||
| @ -28688,7 +28688,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2018-08-30T01:40:47.594+02:00 | ||||
|               Generated 2018-08-31T08:45:52.974+02:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
| @ -407,7 +407,7 @@ void SDRDaemonChannelSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelRe | ||||
|     response.getSdrDaemonChannelSourceReport()->setTvUSec(tv.tv_usec); | ||||
|     response.getSdrDaemonChannelSourceReport()->setQueueSize(m_dataReadQueue.size()); | ||||
|     response.getSdrDaemonChannelSourceReport()->setQueueLength(m_dataReadQueue.length()); | ||||
|     response.getSdrDaemonChannelSourceReport()->setSamplesCount(m_dataReadQueue.readSampleCount().value()); | ||||
|     response.getSdrDaemonChannelSourceReport()->setSamplesCount(m_dataReadQueue.readSampleCount()); | ||||
|     response.getSdrDaemonChannelSourceReport()->setCorrectableErrorsCount(m_nbCorrectableErrors); | ||||
|     response.getSdrDaemonChannelSourceReport()->setUncorrectableErrorsCount(m_nbUncorrectableErrors); | ||||
| } | ||||
|  | ||||
| @ -25,8 +25,6 @@ | ||||
| 
 | ||||
| #include <QQueue> | ||||
| 
 | ||||
| #include "util/limitedcounter.h" | ||||
| 
 | ||||
| class SDRDaemonDataBlock; | ||||
| class Sample; | ||||
| 
 | ||||
| @ -42,7 +40,7 @@ public: | ||||
|     uint32_t length() const { return m_dataReadQueue.size(); } //!< Returns queue length
 | ||||
|     uint32_t size() const { return m_maxSize; } //!< Returns queue size (max length)
 | ||||
|     void setSize(uint32_t size);              //!< Sets the queue size (max length)
 | ||||
|     LimitedCounter<uint32_t, 2000000000> readSampleCount() const { return m_sampleCount; } //!< Returns the absolute number of samples read
 | ||||
|     uint32_t readSampleCount() const { return m_sampleCount; } //!< Returns the absolute number of samples read
 | ||||
| 
 | ||||
|     static const uint32_t MinimumMaxSize; | ||||
| 
 | ||||
| @ -52,7 +50,7 @@ private: | ||||
|     uint32_t m_maxSize; | ||||
|     uint32_t m_blockIndex; | ||||
|     uint32_t m_sampleIndex; | ||||
|     LimitedCounter<uint32_t, 2000000000> m_sampleCount; //!< use a counter capped below 2^31 as it is going to be converted to an int in the web interface
 | ||||
|     uint32_t m_sampleCount; //!< use a counter capped below 2^31 as it is going to be converted to an int in the web interface
 | ||||
|     bool m_full; //!< full condition was hit
 | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -28688,7 +28688,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2018-08-30T01:40:47.594+02:00 | ||||
|               Generated 2018-08-31T08:45:52.974+02:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user