kephrenrtu/Process.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of kephrenrtu.
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: 2010-08-12
00021 **  Authors:
00022 **    Marc Wathelet (LGIT, Grenoble, France)
00023 **
00024 ***************************************************************************/
00025 
00026 #ifndef PROCESS_H
00027 #define PROCESS_H
00028 
00029 #include <GeopsyCore.h>
00030 
00031 #include "Schedule.h"
00032 
00033 class Process : public Thread
00034 {
00035   Q_OBJECT;
00036 public:
00037   Process();
00038   ~Process();
00039 
00040   bool setArguments(int& argc, char ** argv);
00041   bool failed() const {return _failed;}
00042 
00043   static const QString defaultDataDir;
00044   static const QString defaultTimeDir;
00045   static const QString defaultStationFile;
00046   static const QString defaultDestDir;
00047   static const QString defaultWorkDir;
00048   static const QString defaultTitanFormatFile;
00049 private slots:
00050   void pick(SubSignalPool * subPool, QString key, TimeRange recRange);
00051   void addRange(QString key, SparseTimeRange * r);
00052   void removeSignal(Signal * sig);
00053   void releasePickTool();
00054 protected:
00055   virtual void run();
00056 signals:
00057   void readyToPick(SubSignalPool * subPool, QString key, TimeRange recRange);
00058 private:
00059   void loadManualLimits();
00060   void saveManualLimits();
00061   QStringList readStations();
00062   bool loadTimeCorrections();
00063 
00064   QDir _dataDir;
00065   QDir _timeDir;
00066   QString _stationFile;
00067   QDir _destDir;
00068   QDir _workDir;
00069   QString _titanFormatFile;
00070   DateTime _timeReference;
00071   double _samplingFrequency;
00072   double _adcDelay, _filterDelay;
00073   bool _pickOnly;
00074   QString _manualLimitsFileName;
00075   bool _failed;
00076 
00077   AsciiSignalFormat _titanFormat;
00078   ScheduleList _schedule;
00079   QStringList _arrayStations, _hvStations;
00080   QMap<QString, Curve<Point2D> > _timeUncorr2Corr;
00081   QMap<QString, SparseTimeRange> _manualLimits;
00082   QMutex _manualLimitsMutex;
00083   SubSignalPool _pickSubPool;
00084   int _pickToolCount;
00085   QMutex _removeMutex;
00086   QList<Signal *> _toRemove;
00087   QMutex _pickToolMutex;
00088 };
00089 
00090 #endif // PROCESS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines