changed the way connections are organized and retrieved by connection window
This commit is contained in:
+12
-15
@@ -1,13 +1,13 @@
|
||||
#ifndef CANCONNECTIONMODEL_H
|
||||
#define CANCONNECTIONMODEL_H
|
||||
|
||||
#include "canconnection.h"
|
||||
#include "canbus.h"
|
||||
#include "canconnectioncontainer.h"
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
class CANConnectionContainer;
|
||||
#include "canbus.h"
|
||||
#include "connections/canconnection.h"
|
||||
#include "connectionwindow.h"
|
||||
|
||||
|
||||
class CANConnectionModel : public QAbstractTableModel
|
||||
{
|
||||
@@ -19,24 +19,21 @@ public:
|
||||
// Header:
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
void addConnection(CANConnectionContainer *conn);
|
||||
void removeConnection(CANConnection*);
|
||||
void addBus(CANBus &bus);
|
||||
void removeBus(int busIdx);
|
||||
CANBus* getBus(int bus);
|
||||
CANConnection* getConnection(int conn);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
void add(CANConnection* pConn_p);
|
||||
void remove(CANConnection* pConn_p);
|
||||
|
||||
QList<CANConnection*>& getConnections();
|
||||
CANConnection* getAtIdx(int, int&) const;
|
||||
void refreshView();
|
||||
|
||||
private:
|
||||
QList<CANConnectionContainer *> connections;
|
||||
QList<CANBus> buses;
|
||||
|
||||
CANBus *findBusByNum(int bus);
|
||||
QList<CANConnection*> mConns;
|
||||
};
|
||||
|
||||
#endif // CANCONNECTIONMODEL_H
|
||||
|
||||
Reference in New Issue
Block a user