Fixed issues with frame counting
This commit is contained in:
parent
ecf14dcb5c
commit
f406553a5f
@ -8544,7 +8544,7 @@ void MainWindow::updateTextDisplay(){
|
|||||||
|
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#define USE_SYNC_FRAME_COUNT 1
|
#define USE_SYNC_FRAME_COUNT 0
|
||||||
#else
|
#else
|
||||||
#define USE_SYNC_FRAME_COUNT 0
|
#define USE_SYNC_FRAME_COUNT 0
|
||||||
#endif
|
#endif
|
||||||
@ -8600,28 +8600,14 @@ void MainWindow::refreshTextDisplay(){
|
|||||||
);
|
);
|
||||||
|
|
||||||
connect(t, &BuildMessageFramesThread::finished, t, &QObject::deleteLater);
|
connect(t, &BuildMessageFramesThread::finished, t, &QObject::deleteLater);
|
||||||
connect(t, &BuildMessageFramesThread::resultReady, this, [this, text](QStringList frames, QList<int> bits){
|
connect(t, &BuildMessageFramesThread::resultReady, this, [this, text](QString transmitText, int frames){
|
||||||
|
|
||||||
QStringList textList;
|
|
||||||
qDebug() << "frames:";
|
|
||||||
int i = 0;
|
|
||||||
foreach(auto frame, frames){
|
|
||||||
auto dt = DecodedText(frame, bits.at(i));
|
|
||||||
qDebug() << "->" << frame << dt.message() << Varicode::frameTypeString(dt.frameType());
|
|
||||||
textList.append(dt.message());
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto transmitText = textList.join("");
|
|
||||||
auto count = frames.length();
|
|
||||||
|
|
||||||
// ugh...i hate these globals
|
// ugh...i hate these globals
|
||||||
m_txTextDirtyLastSelectedCall = callsignSelected(true);
|
m_txTextDirtyLastSelectedCall = callsignSelected(true);
|
||||||
m_txTextDirtyLastText = text;
|
m_txTextDirtyLastText = text;
|
||||||
m_txFrameCountEstimate = count;
|
m_txFrameCountEstimate = frames;
|
||||||
m_txTextDirty = false;
|
m_txTextDirty = false;
|
||||||
|
|
||||||
updateTextStatsDisplay(transmitText, count);
|
updateTextStatsDisplay(transmitText, frames);
|
||||||
updateTxButtonDisplay();
|
updateTxButtonDisplay();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
16
varicode.cpp
16
varicode.cpp
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "varicode.h"
|
#include "varicode.h"
|
||||||
#include "jsc.h"
|
#include "jsc.h"
|
||||||
|
#include "decodedtext.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
@ -1892,12 +1893,15 @@ void BuildMessageFramesThread::run(){
|
|||||||
m_text
|
m_text
|
||||||
);
|
);
|
||||||
|
|
||||||
QList<QString> frames;
|
// TODO: jsherer - we wouldn't normally use decodedtext.h here... but it's useful for computing the actual frames transmitted.
|
||||||
QList<int> bits;
|
QStringList textList;
|
||||||
foreach(auto pair, results){
|
qDebug() << "frames:";
|
||||||
frames.append(pair.first);
|
foreach(auto frame, results){
|
||||||
bits.append(pair.second);
|
auto dt = DecodedText(frame.first, frame.second);
|
||||||
|
qDebug() << "->" << frame << dt.message() << Varicode::frameTypeString(dt.frameType());
|
||||||
|
textList.append(dt.message());
|
||||||
}
|
}
|
||||||
|
|
||||||
emit resultReady(frames, bits);
|
auto transmitText = textList.join("");
|
||||||
|
emit resultReady(transmitText, results.length());
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ public:
|
|||||||
QObject *parent=nullptr);
|
QObject *parent=nullptr);
|
||||||
void run() override;
|
void run() override;
|
||||||
signals:
|
signals:
|
||||||
void resultReady(QStringList, QList<int>);
|
void resultReady(QString, int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_mycall;
|
QString m_mycall;
|
||||||
|
Loading…
Reference in New Issue
Block a user