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
|
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,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
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user