Fixed bugs in connect/disconnect and overwrite mode.

This commit is contained in:
Collin Kidder
2016-01-25 20:02:20 -05:00
parent c41815e628
commit 427b2cf326
3 changed files with 12 additions and 9 deletions
+8 -6
View File
@@ -115,6 +115,8 @@ void CANFrameModel::recalcOverwrite()
{ {
if (!overwriteDups) return; //no need to do a thing if mode is disabled if (!overwriteDups) return; //no need to do a thing if mode is disabled
qDebug() << "recalcOverwrite called in model";
int lastUnique = 0; int lastUnique = 0;
bool found; bool found;
@@ -362,24 +364,24 @@ void CANFrameModel::sendBulkRefresh(int num)
num = filteredFrames.count() - lastUpdateNumFrames; num = filteredFrames.count() - lastUpdateNumFrames;
lastUpdateNumFrames += num; //done this way to avoid asking for filteredFrames.count() again lastUpdateNumFrames += num; //done this way to avoid asking for filteredFrames.count() again
//qDebug() << "Bulk refresh of " << num; if (num == 0 && !overwriteDups) return;
if (num == 0) return;
if (filteredFrames.count() == 0) return; if (filteredFrames.count() == 0) return;
mutex.lock(); qDebug() << "Bulk refresh of " << num;
if (!overwriteDups) if (!overwriteDups)
{ {
mutex.lock();
if (num > filteredFrames.count()) num = filteredFrames.count(); if (num > filteredFrames.count()) num = filteredFrames.count();
beginInsertRows(QModelIndex(), filteredFrames.count() - num, filteredFrames.count() - 1); beginInsertRows(QModelIndex(), filteredFrames.count() - num, filteredFrames.count() - 1);
endInsertRows(); endInsertRows();
mutex.unlock();
} }
else else
{ {
sendRefresh(); beginResetModel();
endResetModel();
} }
mutex.unlock();
} }
void CANFrameModel::clearFrames() void CANFrameModel::clearFrames()
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef CONFIG #ifndef CONFIG
#define CONFIG #define CONFIG
#define VERSION 148 #define VERSION 149
//try to keep this in sync. //try to keep this in sync.
//SavvyCAN will complain if you connect a GVRET board with a revision //SavvyCAN will complain if you connect a GVRET board with a revision
+2 -1
View File
@@ -477,7 +477,8 @@ void SerialWorker::closeSerialPort()
serial->close(); serial->close();
} }
serial->disconnect(); serial->disconnect();
ticker->stop(); //do not stop the ticker here. It always stays running now.
//ticker->stop();
delete serial; delete serial;
serial = NULL; serial = NULL;
} }