kephren_plugin/TitanProcess.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of kephren_plugin.
00004 **
00005 **  This file may be distributed and/or modified under the terms of the
00006 **  GNU General Public License version 2 or 3 as published by the Free
00007 **  Software Foundation and appearing in the file LICENSE.GPL included
00008 **  in the packaging of this file.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
00013 **  more details.
00014 **
00015 **  You should have received a copy of the GNU General Public License
00016 **  along with this program. If not, see <http://www.gnu.org/licenses/>.
00017 **
00018 **  See http://www.geopsy.org for more information.
00019 **
00020 **  Created : 2009-08-13
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (LGIT, Grenoble, France)
00024 **
00025 ***************************************************************************/
00026 
00027 #ifndef TITANPROCESS_H
00028 #define TITANPROCESS_H
00029 
00030 #include <QObject>
00031 #include <QDateTime>
00032 #include <QLinkedList>
00033 #include <QDir>
00034 
00035 #include <GeopsyCore.h>
00036 #include "KephrenFtpWatcher.h"
00037 
00038 class TitanProcess : public QObject
00039 {
00040   Q_OBJECT
00041 public:
00042   TitanProcess(QObject * parent=0);
00043   ~TitanProcess();
00044 
00045   void setInitialWatchDelay(int secs) {_fsWatcher.setInitialWatchDelay(secs);}
00046   void setSignalDuration(double d) {_signalDuration=d;}
00047   void setTimeReference(const QDateTime& t) {_timeReference=t;}
00048   void setStationName(const QString& name) {_stationName=name;}
00049   bool setSourcePath(const QString& path);
00050 public slots:
00051   void fileCreated(const QString& path);
00052 private:
00053   bool extractTime(const QString& path);
00054   bool loadTitan();
00055   void send();
00056   void send(const Signal * sig);
00057   void setSendLedStatus();
00058 
00059   QDir _workDir;
00060   KephrenFtpWatcher _fsWatcher;
00061   QDateTime _lastTime;
00062   struct File {
00063     QDateTime time;
00064     QString path;
00065   };
00066   QLinkedList<File> _files;
00067   QStringList _fltFilter, _binFilter, _binInfoFilter;
00068   AsciiSignalFormat _titanAsciiFormat;
00069   QDateTime _timeReference;
00070   QMap<int,QString> _channels;
00071   QString _stationName;
00072   double _signalDuration;
00073   QTimer _sendLedTimer;
00074   QTime _sendLedChrono;
00075 };
00076 
00077 #endif // TITANPROCESS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines