From 3d2c16201be5fa6a92f2931cfad754cee48448a1 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Tue, 7 Feb 2023 17:51:52 +0000 Subject: [PATCH] Fix invalid scope data in combine mode --- commhandler.cpp | 7 +++---- wfmain.ui | 13 ++++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/commhandler.cpp b/commhandler.cpp index 9b02952..e0e6a3f 100644 --- a/commhandler.cpp +++ b/commhandler.cpp @@ -126,7 +126,7 @@ void commHandler::sendDataOut(const QByteArray &writeData) printHex(pttreturncmd, false, true); emit haveDataFromPort(pttreturncmd); - + mutex.unlock(); return; } else if(writeData.endsWith(QByteArrayLiteral("\x1C\x00\x01\xFD"))) @@ -210,7 +210,6 @@ void commHandler::receiveDataIn() //printHex(inPortData, false, true); while (pos > -1 && fdPos > -1) { combined++; - spectrumDivisionNumber = 0; spectrumDivisionNumber = inPortData[pos + 3] & 0x0f; spectrumDivisionNumber += ((inPortData[pos + 3] & 0xf0) >> 4) * 10; @@ -226,8 +225,8 @@ void commHandler::receiveDataIn() } else if (spectrumDivisionNumber > lastSpectrum && spectrumDivisionNumber <= spectrumDivisionMax) { - spectrumData.insert(spectrumData.length(), inPortData.mid(pos + 4, fdPos-5)); - //qDebug() << "Added spectrum seq:" << spectrumDivisionNumber << "len" << fdPos-5; + spectrumData.insert(spectrumData.length(), inPortData.mid(pos + 5, fdPos-5)); + //qInfo() << "Added spectrum seq:" << spectrumDivisionNumber << "len" << fdPos-5<< "Spec" << spectrumData.length(); //printHex(inPortData.mid((pos+4),fdPos - (pos+5)), false, true); } else { diff --git a/wfmain.ui b/wfmain.ui index 78f9851..1228901 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -2245,7 +2245,7 @@ - 1 + 4 @@ -4978,6 +4978,13 @@ + + + + Only change this if you are absolutely sure you need it (connecting to N1MM+ or similar) + + + @@ -5530,8 +5537,8 @@ - - + +