Fixed bugs in connect/disconnect and overwrite mode.
This commit is contained in:
+9
-7
@@ -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();
|
||||
}
|
||||
mutex.unlock();
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
}
|
||||
}
|
||||
|
||||
void CANFrameModel::clearFrames()
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user