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
qDebug() << "recalcOverwrite called in model";
int lastUnique = 0;
bool found;
@@ -362,24 +364,24 @@ void CANFrameModel::sendBulkRefresh(int num)
num = filteredFrames.count() - lastUpdateNumFrames;
lastUpdateNumFrames += num; //done this way to avoid asking for filteredFrames.count() again
//qDebug() << "Bulk refresh of " << num;
if (num == 0) return;
if (num == 0 && !overwriteDups) return;
if (filteredFrames.count() == 0) return;
mutex.lock();
qDebug() << "Bulk refresh of " << num;
if (!overwriteDups)
{
mutex.lock();
if (num > filteredFrames.count()) num = filteredFrames.count();
beginInsertRows(QModelIndex(), filteredFrames.count() - num, filteredFrames.count() - 1);
endInsertRows();
mutex.unlock();
}
else
{
sendRefresh();
beginResetModel();
endResetModel();
}
mutex.unlock();
}
void CANFrameModel::clearFrames()
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef CONFIG
#define CONFIG
#define VERSION 148
#define VERSION 149
//try to keep this in sync.
//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->disconnect();
ticker->stop();
//do not stop the ticker here. It always stays running now.
//ticker->stop();
delete serial;
serial = NULL;
}