Merge branch 'fix_dbc_delete' of github.com:qurrent-llc/SavvyCAN into fix_dbc_delete
This commit is contained in:
+1
-1
@@ -779,7 +779,7 @@ int CANFrameModel::sendBulkRefresh()
|
||||
if (lastUpdateNumFrames == 0 && !overwriteDups) return 0;
|
||||
if (filteredFrames.count() == 0) return 0;
|
||||
|
||||
qDebug() << "Bulk refresh of " << lastUpdateNumFrames;
|
||||
//qDebug() << "Bulk refresh of " << lastUpdateNumFrames;
|
||||
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
|
||||
@@ -13,6 +13,9 @@ CANConnection* CanConFactory::create(type pType, QString pPortName, QString pDri
|
||||
case SERIALBUS:
|
||||
return new SerialBusConnection(pPortName, pDriverName);
|
||||
case GVRET_SERIAL:
|
||||
if(pPortName.contains("."))
|
||||
return new GVRetSerial(pPortName, true);
|
||||
else
|
||||
return new GVRetSerial(pPortName, false);
|
||||
case REMOTE:
|
||||
return new GVRetSerial(pPortName, true); //it's a special case of GVRET connected over TCP/IP so it uses the same class
|
||||
|
||||
@@ -263,6 +263,12 @@ void SocketCANd::decodeFrames(QString data, int busNum)
|
||||
QString frameStr = frameStrConst;
|
||||
QStringList frameParsed = (frameStr.remove(QRegExp("^<")).remove(QRegExp(">$"))).simplified().split(' ');
|
||||
|
||||
if(frameParsed.length() < 2)
|
||||
{
|
||||
qDebug() << "Received datagramm is an incomplete frame: " << data;
|
||||
return;
|
||||
}
|
||||
|
||||
buildFrame.setFrameId(frameParsed[1].toUInt(nullptr, 16));
|
||||
buildFrame.bus = busNum;
|
||||
|
||||
@@ -271,6 +277,13 @@ void SocketCANd::decodeFrames(QString data, int busNum)
|
||||
|
||||
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, frameParsed[2].toDouble() * 1000000l));
|
||||
//buildFrame.len = frameParsed[3].length() * 0.5;
|
||||
|
||||
if(frameParsed.length() < 4)
|
||||
{
|
||||
qDebug() << "Received frame doesn't contain any data: " << data;
|
||||
return;
|
||||
}
|
||||
|
||||
int framelength = frameParsed[3].length() * 0.5;
|
||||
|
||||
buildData.resize(framelength);
|
||||
@@ -383,6 +396,18 @@ void SocketCANd::procRXData(QString data, int busNum)
|
||||
{
|
||||
rx_state[busNum] = RAWMODE;
|
||||
}
|
||||
else if(data.indexOf("< ok >", 0, Qt::CaseSensitivity::CaseInsensitive) == 0)
|
||||
{
|
||||
qDebug() << "Ok found at start of compound message, switching to RAW and decoding immediately";
|
||||
rx_state[busNum] = RAWMODE;
|
||||
decodeFrames(data, busNum);
|
||||
}
|
||||
else if(data.indexOf("< ok >", 0, Qt::CaseSensitivity::CaseInsensitive) > 0)
|
||||
{
|
||||
qDebug() << "Ok found at in middle of compound message, switching to RAW and decoding immediately";
|
||||
rx_state[busNum] = RAWMODE;
|
||||
decodeFrames(data, busNum);
|
||||
}
|
||||
break;
|
||||
case RAWMODE:
|
||||
decodeFrames(data, busNum);
|
||||
|
||||
@@ -898,7 +898,7 @@ void FrameSenderWindow::processCellChange(int line, int col)
|
||||
case 6: //Data bytes
|
||||
for (int i = 0; i < 8; i++) sendingData[line].payload().data()[i] = 0;
|
||||
|
||||
tokens = ui->tableSender->item(line, 6)->text().split(" ");
|
||||
tokens = ui->tableSender->item(line, 6)->text().split(" ", QString::SkipEmptyParts);
|
||||
arr.clear();
|
||||
arr.reserve(tokens.count());
|
||||
for (int j = 0; j < tokens.count(); j++)
|
||||
|
||||
Reference in New Issue
Block a user