Allow the program to "send" frames even if no buses are configured.
These frames will show up in the main frame list and can be operated on as if they came into the program. It is likely that only the playback window will work for this special use. Other sending windows are to follow.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <QSettings>
|
||||
|
||||
#include "canconmanager.h"
|
||||
#include "canconfactory.h"
|
||||
|
||||
CANConManager* CANConManager::mInstance = NULL;
|
||||
|
||||
@@ -80,6 +81,17 @@ void CANConManager::refreshCanList()
|
||||
{
|
||||
QObject* sender_p = QObject::sender();
|
||||
|
||||
if (mConns.count() == 0)
|
||||
{
|
||||
if(buslessFrames.size()) {
|
||||
tempFrames.clear();
|
||||
tempFrames.append(buslessFrames); //make a copy and pass that copy
|
||||
buslessFrames.clear(); //delete all frames from the original
|
||||
emit framesReceived(nullptr, tempFrames);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if( sender_p != &mTimer)
|
||||
{
|
||||
/* if we are not the sender, the signal is coming from a connection */
|
||||
@@ -176,6 +188,12 @@ bool CANConManager::sendFrame(const CANFrame& pFrame)
|
||||
CANFrame workingFrame = pFrame;
|
||||
CANFrame *txFrame;
|
||||
|
||||
if (mConns.count() == 0)
|
||||
{
|
||||
buslessFrames.append(pFrame);
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach (CANConnection* conn, mConns)
|
||||
{
|
||||
//check if this CAN connection is supposed to handle the requested bus
|
||||
|
||||
Reference in New Issue
Block a user