From be203ffef356328469e074185aef98d2d5dc65ab Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 31 May 2016 19:55:20 -0400 Subject: [PATCH] Previous commit with merge of fixes from another user added code in the wrong place for this branch and I didn't catch it. Fixed now. --- mainwindow.cpp | 10 ++++++++-- serialworker.cpp | 12 ------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index e2e41dd..7590f1d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -515,8 +515,14 @@ void MainWindow::filterClearAll() void MainWindow::tickGUIUpdate() { - framesPerSec += rxFrames * 1000 / elapsedTime->elapsed() - (framesPerSec / 4); - elapsedTime->restart(); + int elapsed = elapsedTime->elapsed(); + if(elapsed) { + framesPerSec += rxFrames * 1000 / elapsed - (framesPerSec / 4); + elapsedTime->restart(); + } + else + framesPerSec = 0; + model->sendBulkRefresh(rxFrames); ui->lbNumFrames->setText(QString::number(model->rowCount())); diff --git a/serialworker.cpp b/serialworker.cpp index fdf5f4c..61a0b5f 100644 --- a/serialworker.cpp +++ b/serialworker.cpp @@ -478,18 +478,6 @@ void SerialWorker::handleTick() } } - int elapsed = elapsedTime->elapsed(); - if(elapsed) { - framesPerSec += gotFrames * 1000 / elapsed - (framesPerSec / 4); - elapsedTime->restart(); - } - else - framesPerSec = 0; - - emit frameUpdateTick(framesPerSec / 4, gotFrames); //sends stats to interested parties - canModel->sendBulkRefresh(gotFrames); - gotFrames = 0; - if (doValidation && serial && serial->isOpen()) sendCommValidation(); }