Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CITYSCANNER_H
00029 #define CITYSCANNER_H
00030
00031 #include <QGpCoreTools.h>
00032
00033 #include "GeopsyCoreDLLExport.h"
00034
00035 namespace GeopsyCore {
00036
00037 class CitySignal;
00038
00039 class GEOPSYCORE_EXPORT CityScanner: public Thread
00040 {
00041 Q_OBJECT
00042 public:
00043 CityScanner(QObject * parent=0);
00044 ~CityScanner();
00045
00046 bool setPath(const QDir& cardPath);
00047 void cleanStop();
00048 void clear();
00049 int count() {return _signals.count();}
00050 void erase();
00051 QString softwareVersion() const {return _softwareVersion;}
00052 const CitySignal * at(int index) const {return _signals.at(index);}
00053 QFile * readStream() {return fichbaseStream(_cardPath, QIODevice::ReadOnly);}
00054 signals:
00055 void signalsChanged();
00056 protected:
00057 virtual void run();
00058 void normalScan();
00059 QFile * fichbaseStream(const QDir& cardPath, QIODevice::OpenModeFlag mode);
00060 QFile * sectcityStream(const QDir& cardPath, QIODevice::OpenModeFlag mode);
00061 private:
00062 void readSoftwareVersion();
00063
00064 QDir _cardPath;
00065 QFile * _stream;
00066 QList<CitySignal *> _signals;
00067 QString _softwareVersion;
00068 QAtomicInt _stopRequest;
00069 };
00070
00071 }
00072
00073 #endif // CITYSCANNER_H