Skip to content

Commit e1eb241

Browse files
committed
RT Log Bug Fixes
1 parent d9212ec commit e1eb241

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pages/pageloganalysis.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ PageLogAnalysis::PageLogAnalysis(QWidget *parent) :
121121
mGnssTimer->start(100);
122122
mGnssMsTodayLast = 0;
123123

124+
mLogRtFieldUpdatePending = false;
124125
mLogRtAppendTime = false;
125126
mLogRtTimer = new QTimer(this);
126127

@@ -259,6 +260,10 @@ void PageLogAnalysis::setVesc(VescInterface *vesc)
259260

260261
if (mVesc) {
261262
auto updatePlots = [this]() {
263+
if (mLogRtFieldUpdatePending) {
264+
return;
265+
}
266+
262267
storeSelection();
263268

264269
resetInds();
@@ -314,6 +319,7 @@ void PageLogAnalysis::setVesc(VescInterface *vesc)
314319
mLogRtHeader[0] = h;
315320
}
316321

322+
mLogRtFieldUpdatePending = false;
317323
mLogRtSamplesNow.resize(fieldNum);
318324
mLogRtTimer->start(1000.0 / rateHz);
319325
mLogRt.clear();
@@ -325,9 +331,7 @@ void PageLogAnalysis::setVesc(VescInterface *vesc)
325331
});
326332

327333
connect(mVesc->commands(), &Commands::logConfigField, [this](int fieldInd, LOG_HEADER h) {
328-
if (mLogRtAppendTime) {
329-
fieldInd++;
330-
}
334+
mLogRtFieldUpdatePending = true;
331335

332336
if (mLogRtHeader.size() <= fieldInd) {
333337
mLogRtHeader.resize(fieldInd + 1);
@@ -739,7 +743,7 @@ void PageLogAnalysis::updateGraphs()
739743
LocPoint p, p2;
740744

741745
double time = 0;
742-
for (const auto &d: mLogTruncated) {
746+
foreach (const auto &d, mLogTruncated) {
743747
if (mInd_t_day >= 0) {
744748
if (startTime < 0) {
745749
startTime = d[mInd_t_day];

pages/pageloganalysis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ private slots:
8989
QVector<double> mLogRtSamplesNow;
9090
QTimer *mLogRtTimer;
9191
bool mLogRtAppendTime;
92+
bool mLogRtFieldUpdatePending;
9293

9394
// Lightweight pre-calculated offsets in the log. These
9495
// need to be looked up a lot and finding them in the

0 commit comments

Comments
 (0)