00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SESSIONINFORMATION_H
00019 #define SESSIONINFORMATION_H
00020
00021
00022 #include <qvaluelist.h>
00023 #include <qdatetime.h>
00024 #include <qcolor.h>
00025 #include <qstring.h>
00026 #include <qmap.h>
00027
00028
00029 #include <kurl.h>
00030
00031
00032 #include "eventsprovider.h"
00033
00034 #include <iostream>
00035 using namespace std;
00036
00042 class SessionFile {
00043 public:
00044
00046 enum type{CLUSTER=0,SPIKE=1,EVENT=2,POSITION=3};
00047
00048 inline SessionFile(){
00049 fileUrl = KURL();
00050 fileType = CLUSTER;
00051 fileModification = QDateTime();
00052 };
00053
00054 inline SessionFile(KURL url,type fileType,QDateTime modification):fileUrl(url),fileType(fileType),fileModification(modification){};
00055
00056 inline ~SessionFile(){};
00057
00061 inline void setUrl(KURL url){fileUrl = url;};
00062
00066 inline void setType(type fileType){this->fileType = fileType;};
00067
00071 inline void setModification(QDateTime modification){fileModification = modification;};
00072
00077 inline void setItemColor(EventDescription itemId,QString color){
00078 itemColors.insert(itemId,QColor(color));
00079 };
00080
00085 inline void setBackgroundPath(QString path){imagePath = path;};
00086
00087
00091 inline KURL getUrl() const{return fileUrl;};
00092
00096 inline type getType() const{return fileType;};
00097
00101 inline QDateTime getModification() const{return fileModification;};
00102
00106 inline QMap<EventDescription,QColor> getItemColors() const{return itemColors;};
00107
00112 inline QString getBackgroundPath() const{return imagePath;};
00113
00114
00115 private:
00117 KURL fileUrl;
00119 QString imagePath;
00121 type fileType;
00123 QDateTime fileModification;
00125 QMap<EventDescription,QColor> itemColors;
00126 };
00127
00128 class TracePosition;
00129
00135 class DisplayInformation {
00136 public:
00137
00139 enum spikeDisplayType{RASTER=0,WAVEFORMS=1,LINES=2};
00140
00142 enum mode{SINGLE=0,MULTIPLE=1};
00143
00152 inline DisplayInformation(){
00153 presentationMode = SINGLE;
00154 labelStatus = 0;
00155 greyScale = 0;
00156 startTime = 0;
00157 timeWindow = 50;
00158 isPositionView = false;
00159 rasterHeight = -1;
00160 areEventsInPositionView = false;
00161 };
00162
00163 inline ~DisplayInformation(){};
00164
00168 inline void addSpikeDisplayType(spikeDisplayType type){spikeDisplayTypes.append(type);};
00169
00173 inline void setMode(mode modeOfPresentation){presentationMode = modeOfPresentation;};
00174
00178 inline void setRasterHeight(int height){rasterHeight = height;};
00179
00183 inline void setGreyScale(int value){greyScale = value;};
00184
00189 inline void setSelectedClusters(QString clusterFile,QValueList<int> clusterIds){
00190 selectedClusters.insert(clusterFile,clusterIds);
00191 };
00192
00197 inline void setSelectedEvents(QString eventFile,QValueList<int> eventIds){
00198 selectedEvents.insert(eventFile,eventIds);
00199 };
00200
00201
00206 inline void setSkippedClusters(QString clusterFile,QValueList<int> clusterIds){
00207 skippedClusters.insert(clusterFile,clusterIds);
00208 };
00209
00214 inline void setSkippedEvents(QString eventFile,QValueList<int> eventIds){
00215 skippedEvents.insert(eventFile,eventIds);
00216 };
00217
00221 inline void setSelectedSpikeFiles(QValueList<QString> files){shownSpikeFiles = files;};
00222
00226 inline void setPositions(QValueList<TracePosition> positions){this->positions = positions;};
00227
00231 inline void setChannelIds(QValueList<int> ids) {channelIds = ids;};
00232
00236 inline void setSelectedChannelIds(QValueList<int> ids){selectedChannelIds = ids;};
00237
00241 inline void setStartTime(long start){startTime = start;};
00242
00246 inline void setTimeWindow(long duration){timeWindow = duration;};
00247
00251 inline void setTabLabel(QString newLabel){tabLabel = newLabel;};
00252
00256 inline void setLabelStatus(int value){labelStatus = value;};
00257
00261 inline void setPositionView(int present){isPositionView = present;};
00262
00266 inline void setEventsInPositionView(int shown){areEventsInPositionView = shown;};
00267
00271 inline QValueList<spikeDisplayType> getSpikeDisplayTypes() const{return spikeDisplayTypes;};
00272
00276 inline mode getMode() const{return presentationMode;};
00277
00281 inline int getRasterHeight() const{return rasterHeight;};
00282
00286 inline int getGreyScale() const{return greyScale;};
00287
00291 inline QMap<QString, QValueList<int> > getSelectedClusters() const{return selectedClusters;};
00292
00296 inline QMap<QString, QValueList<int> > getSelectedEvents() const{return selectedEvents;};
00297
00301 inline QMap<QString, QValueList<int> > getSkippedClusters() const{return skippedClusters;};
00302
00306 inline QMap<QString, QValueList<int> > getSkippedEvents() const{return skippedEvents;};
00307
00311 inline QValueList<QString> getSelectedSpikeFiles() const{return shownSpikeFiles;};
00312
00316 inline QValueList<TracePosition> getPositions() const{return positions;};
00317
00321 inline QValueList<int> getChannelIds() const{return channelIds;};
00322
00326 inline QValueList<int> getSelectedChannelIds() const{return selectedChannelIds;};
00327
00331 inline QString getTabLabel()const{return tabLabel;};
00332
00336 inline int getLabelStatus()const {return labelStatus;};
00337
00341 inline long getStartTime()const{return startTime;};
00342
00346 inline long getTimeWindow()const{return timeWindow;};
00347
00351 inline int isAPositionView()const{return isPositionView;};
00352
00353
00357 inline int isEventsDisplayedInPositionView()const{return areEventsInPositionView;};
00358
00359
00360 private:
00362 QValueList<spikeDisplayType> spikeDisplayTypes;
00363
00365 mode presentationMode;
00366
00368 int rasterHeight;
00369
00371 int greyScale;
00372
00374 QMap<QString, QValueList<int> > selectedClusters;
00375
00377 QMap<QString, QValueList<int> > selectedEvents;
00378
00380 QMap<QString, QValueList<int> > skippedClusters;
00381
00383 QMap<QString, QValueList<int> > skippedEvents;
00384
00386 QValueList<QString> shownSpikeFiles;
00387
00389 QValueList<TracePosition> positions;
00390
00392 QValueList<int> channelIds;
00393
00395 QValueList<int> selectedChannelIds;
00396
00398 QString tabLabel;
00399
00400
00401 long startTime;
00402
00403
00404 long timeWindow;
00405
00406
00407 int labelStatus;
00408
00410 int isPositionView;
00411
00413 int areEventsInPositionView;
00414 };
00415
00420 class ChannelDescription {
00421 public:
00422
00423 inline ChannelDescription(){
00424 id = 0;
00425 color = QColor(Qt::black);
00426 };
00427
00428 inline ChannelDescription(int id,QString color):id(id){
00429 setColor(color);
00430 };
00431
00432 inline ~ChannelDescription(){};
00433
00437 inline void setId(int channelId){id = channelId;};
00438
00442 inline void setColor(QString colorName){color = QColor(colorName);};
00443
00447 inline void setGroupColor(QString colorName){groupColor = QColor(colorName);};
00448
00452 inline void setSpikeGroupColor(QString colorName){spikeGroupColor = QColor(colorName);};
00453
00457 inline int getId() const{return id;};
00458
00462 inline QColor getColor() const{return color;};
00463
00467 inline QColor getGroupColor() const{return groupColor;};
00468
00472 inline QColor getSpikeGroupColor() const{return spikeGroupColor;};
00473
00474 private:
00476 int id;
00477
00479 QColor color;
00480
00482 QColor groupColor;
00483
00485 QColor spikeGroupColor;
00486
00487 };
00488
00493 class TracePosition {
00494 public:
00495
00496 inline TracePosition(){
00497 id = 0;
00498 offset = 0;
00499 };
00500
00501 inline TracePosition(int id,int offset):id(id),offset(offset){};
00502
00503 inline ~TracePosition(){};
00504
00508 inline void setId(int channelId){id = channelId;};
00509
00513 inline void setOffset(int value){offset = value;};
00514
00518 inline void setGain(int value){gain = value;};
00519
00523 inline int getId() const{return id;};
00524
00528 inline int getOffset() const{return offset;};
00529
00533 inline int getGain() const{return gain;};
00534
00535 private:
00537 int id;
00538
00540 int offset;
00541
00543 int gain;
00544
00545 };
00546
00547
00548
00549 #endif //SESSIONINFORMATION_H