SpikeStream Application Library
0.2
|
00001 #ifndef CONNECTIONGROUPMODEL_H 00002 #define CONNECTIONGROUPMODEL_H 00003 00004 //SpikeStream includes 00005 #include "ConnectionGroupInfo.h" 00006 using namespace spikestream; 00007 00008 //Qt includes 00009 #include <QAbstractTableModel> 00010 #include <QStringList> 00011 00012 namespace spikestream { 00013 00016 class ConnectionGroupModel : public QAbstractTableModel { 00017 Q_OBJECT 00018 00019 public: 00020 ConnectionGroupModel(); 00021 ~ConnectionGroupModel(); 00022 void clearSelection(); 00023 int columnCount(const QModelIndex& parent = QModelIndex()) const; 00024 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; 00025 ConnectionGroupInfo getInfo(const QModelIndex & index); 00026 QList<unsigned int> getSelectedConnectionGroupIDs(); 00027 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 00028 QHash<QString, double> getParameters(int row); 00029 void reload(); 00030 int rowCount(const QModelIndex& parent = QModelIndex()) const; 00031 void selectAllOrNone(); 00032 bool setData(const QModelIndex& index, const QVariant& value, int role=Qt::EditRole); 00033 00034 friend class ConnectionGroupTableView; 00035 00036 00037 public slots: 00038 void showAllOrNone(); 00039 00040 00041 private slots: 00042 void loadConnectionGroups(); 00043 00044 00045 private: 00046 //==================== VARIABLES ==================== 00049 QList<ConnectionGroupInfo> conGrpInfoList; 00050 00052 QList<unsigned> conGrpSizeList; 00053 00055 QHash<unsigned int, bool> selectionMap; 00056 00057 static const int NUM_COLS = 9; 00058 static const int VIS_COL = 0; 00059 static const int ID_COL = 1; 00060 static const int DESC_COL = 2; 00061 static const int SIZE_COL = 3; 00062 static const int FROM_NEUR_ID_COL = 4; 00063 static const int T0_NEUR_ID_COL = 5; 00064 static const int SYNAPSE_TYPE_COL = 6; 00065 static const int SELECT_COL = 7; 00066 static const int PARAM_COL = 8; 00067 }; 00068 00069 } 00070 00071 #endif//CONNECTIONGROUPMODEL_H 00072