diff --git a/sdrbase/websockets/wsspectrum.cpp b/sdrbase/websockets/wsspectrum.cpp index 26296f5d1..53dc4cd4f 100644 --- a/sdrbase/websockets/wsspectrum.cpp +++ b/sdrbase/websockets/wsspectrum.cpp @@ -19,6 +19,7 @@ #include #include +#include "util/timeutil.h" #include "wsspectrum.h" WSSpectrum::WSSpectrum(QObject *parent) : @@ -124,6 +125,7 @@ void WSSpectrum::newSpectrum( } qint64 elapsed = m_timer.restart(); + uint64_t nowMs = TimeUtil::nowms(); QWebSocket *pSender = qobject_cast(sender()); QByteArray payload; @@ -132,6 +134,7 @@ void WSSpectrum::newSpectrum( spectrum, fftSize, elapsed, + nowMs, centerFrequency, bandwidth, linear @@ -153,20 +156,18 @@ void WSSpectrum::buildPayload( const std::vector& spectrum, int fftSize, int64_t fftTimeMs, + uint64_t timestampMs, uint64_t centerFrequency, int bandwidth, bool linear ) { - float refLevel = -30.0; - float powerRange = 70.0; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); buffer.write((char*) ¢erFrequency, sizeof(uint64_t)); // 0 buffer.write((char*) &fftTimeMs, sizeof(int64_t)); // 8 - buffer.write((char*) &fftSize, sizeof(int)); // 16 - buffer.write((char*) &refLevel, sizeof(float)); // 20 - buffer.write((char*) &powerRange, sizeof(float)); // 24 + buffer.write((char*) ×tampMs, sizeof(uint64_t)); // 16 + buffer.write((char*) &fftSize, sizeof(int)); // 24 buffer.write((char*) &bandwidth, sizeof(int)); // 28 int linearInt = linear ? 1 : 0; buffer.write((char*) &linearInt, sizeof(int)); // 32 diff --git a/sdrbase/websockets/wsspectrum.h b/sdrbase/websockets/wsspectrum.h index 76f709f98..133526e85 100644 --- a/sdrbase/websockets/wsspectrum.h +++ b/sdrbase/websockets/wsspectrum.h @@ -74,6 +74,7 @@ private: const std::vector& spectrum, int fftSize, int64_t fftTimeMs, + uint64_t timestampMs, uint64_t centerFrequency, int bandwidth, bool linear