SpikeStream Application Library  0.2
ArchivePlayerThread.h
Go to the documentation of this file.
00001 #ifndef ARCHIVEPLAYERTHREAD_H
00002 #define ARCHIVEPLAYERTHREAD_H
00003 
00004 //SpikeStream includes
00005 #include "ArchiveDao.h"
00006 #include "DBInfo.h"
00007 #include "RGBColor.h"
00008 using namespace spikestream;
00009 
00010 //Qt includes
00011 #include <QString>
00012 #include <QHash>
00013 #include <QMutex>
00014 #include <QThread>
00015 
00016 namespace spikestream {
00017 
00019     class ArchivePlayerThread : public QThread {
00020                 Q_OBJECT
00021 
00022                 public:
00023                         ArchivePlayerThread(DBInfo dbInfo);
00024                         ~ArchivePlayerThread();
00025                         void clearWaitForGraphics() { waitForGraphics = false; }
00026                         QString getErrorMessage();
00027                         bool isError();
00028                         void play(unsigned int startTimeStep, unsigned int archiveID, unsigned int frameRate);
00029                         void step(unsigned int startTimeStep, unsigned int archiveID);
00030                         void setFrameRate(unsigned int frameRate);
00031                         void stop();
00032 
00033                 signals:
00034                         void timeStepChanged(unsigned timeStep, const QList<unsigned>& neuronIDList);
00035 
00036                 private slots:
00037                         void run();
00038 
00039                 private:
00040                         //===========================  VARIABLES  ============================
00042                         bool stopThread;
00043 
00045                         bool error;
00046 
00048                         QString errorMessage;
00049 
00051                         unsigned int archiveID;
00052 
00054                         unsigned int startTimeStep;
00055 
00057                         unsigned int updateInterval_ms;
00058 
00060                         ArchiveDao* archiveDao;
00061 
00063                         DBInfo archiveDBInfo;
00064 
00066                         QMutex mutex;
00067 
00069                         bool stepMode;
00070 
00072                         bool waitForGraphics;
00073 
00074 
00075                         //============================  METHODS  =============================
00076                         void clearError();
00077                         void setError(const QString& errMsg);
00078     };
00079 
00080 }
00081 
00082 #endif//ARCHIVEPLAYERTHREAD_H
00083 
 All Classes Files Functions Variables Typedefs Friends Defines