From 7128daf79e405d95fe2562a54bfb7f3631d6329f Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Tue, 5 Nov 2019 16:37:51 -0500 Subject: [PATCH] Keep track of previous kin for delta on detector reset --- Detector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Detector.cpp b/Detector.cpp index 9064717..4974a25 100644 --- a/Detector.cpp +++ b/Detector.cpp @@ -47,13 +47,14 @@ void Detector::clear () // set index to roughly where we are in time (1ms resolution) qint64 now (DriftingDateTime::currentMSecsSinceEpoch ()); unsigned msInPeriod ((now % 86400000LL) % (m_period * 1000)); + int prevKin = dec_data.params.kin; dec_data.params.kin = qMin ((msInPeriod * m_frameRate) / 1000, static_cast (sizeof (dec_data.d2) / sizeof (dec_data.d2[0]))); m_bufferPos = m_samplesPerFFT; // erase everything after kin. memset(dec_data.d2 + dec_data.params.kin, 0, sizeof(dec_data.d2) - (sizeof(dec_data.d2[0]) * dec_data.params.kin)); - qDebug() << "advancing detector buffer to" << dec_data.params.kin; + qDebug() << "advancing detector buffer from" << prevKin << "to" << dec_data.params.kin << "delta" << dec_data.params.kin - prevKin; #else dec_data.params.kin = 0; m_bufferPos = 0;