Remove some older junk code, add ability for main screen to show the number of connected buses

This commit is contained in:
Collin Kidder
2016-12-20 20:33:11 -05:00
parent 4d4eabad7a
commit 9cceb4404d
6 changed files with 17 additions and 70 deletions
+2 -1
View File
@@ -40,6 +40,7 @@ void CANConManager::add(CANConnection* pConn_p)
{
connect(pConn_p, SIGNAL(notify()), this, SLOT(refreshCanList()));
mConns.append(pConn_p);
emit connectionStatusUpdated(getNumBuses());
}
@@ -47,6 +48,7 @@ void CANConManager::remove(CANConnection* pConn_p)
{
disconnect(pConn_p, 0, this, 0);
mConns.removeOne(pConn_p);
emit connectionStatusUpdated(getNumBuses());
}
//Get total number of buses currently registered with the program
@@ -169,7 +171,6 @@ bool CANConManager::sendFrame(const CANFrame& pFrame)
bool CANConManager::sendFrames(const QList<CANFrame>& pFrames)
{
qDebug() << "CANConManager sendFrames #" << pFrames.count();
foreach(const CANFrame& frame, pFrames)
{
if(!sendFrame(frame))
+1
View File
@@ -38,6 +38,7 @@ public:
signals:
void framesReceived(CANConnection* pConn_p, QVector<CANFrame>& pFrames);
void connectionStatusUpdated(int conns);
private slots:
void refreshCanList();
+2 -6
View File
@@ -135,10 +135,8 @@ void CANConnectionModel::add(CANConnection* pConn_p)
{
CANConManager* manager = CANConManager::getInstance();
connect(pConn_p, SIGNAL(notify()), manager, SLOT(refreshCanList()));
beginResetModel();
manager->getConnections().append(pConn_p);
manager->add(pConn_p);
endResetModel();
}
@@ -147,10 +145,8 @@ void CANConnectionModel::remove(CANConnection* pConn_p)
{
CANConManager* manager = CANConManager::getInstance();
disconnect(pConn_p, 0, manager, 0);
beginResetModel();
manager->getConnections().removeOne(pConn_p);
manager->remove(pConn_p);
endResetModel();
}
+2 -1
View File
@@ -2,6 +2,7 @@
#include <QThread>
#include "connectionwindow.h"
#include "mainwindow.h"
#include "ui_connectionwindow.h"
#include "connections/canconfactory.h"
#include "connections/canconmanager.h"
@@ -38,7 +39,7 @@ ConnectionWindow::ConnectionWindow(QWidget *parent) :
ui->cbSpeed->addItem(tr("250000"));
ui->cbSpeed->addItem(tr("500000"));
ui->cbSpeed->addItem(tr("1000000"));
ui->cbSpeed->addItem(tr("33333"));
ui->cbSpeed->addItem(tr("33333"));
/* load connection configuration */
loadConnections();