GeopsyCore/GeopsyCoreEngine.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of GeopsyCore.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2002-11-22
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (ULg, Liège, Belgium)
00025 **    Marc Wathelet (LGIT, Grenoble, France)
00026 **
00027 ***************************************************************************/
00028 
00029 #ifndef GEOPSYCOREENGINE_H
00030 #define GEOPSYCOREENGINE_H
00031 
00032 #include <QGpCoreTools.h>
00033 
00034 #include "GeopsyCoreDLLExport.h"
00035 #include "SignalFile.h"
00036 #include "SignalFileFormat.h"
00037 
00038 namespace GeopsyCore {
00039 
00040 class SignalDB;
00041 class GeopsyPlugins;
00042 class GeopsyPreferences;
00043 class Signal;
00044 class SubSignalPool;
00045 class SignalFile;
00046 class DoubleSignal;
00047 class KeepSignal;
00048 class CustomFileFormats;
00049 class AbstractSignalGroup;
00050 
00051 class GEOPSYCORE_EXPORT GeopsyCoreEngine : public GlobalObject
00052 {
00053   TRANSLATIONS( "GeopsyCoreEngine" )
00054 public:
00055   GeopsyCoreEngine(bool debug=false);
00056   virtual ~GeopsyCoreEngine();
00057 
00058   void clear();
00059 
00060   Cache * cache() {return _cache;}
00061   GeopsyPreferences * preferences() {return _preferences;}
00062   GeopsyPlugins * plugins() {return _plugins;}
00063   SignalDB * currentDB() {return _currentDB;}
00064   SignalDB * database(QString path);
00065   SignalFile * file(QString fileName);
00066   CustomFileFormats * customFileFormats() {return _customFileFormats;}
00067 
00068   SubSignalPool load(QString fileName, SignalFileFormat format=SignalFileFormat::Unknown, bool viewFile=false);
00069   SubSignalPool load(QStringList fileNames, SignalFileFormat format=SignalFileFormat::Unknown, bool viewFiles=false);
00070   void showSignal(const DoubleSignal * sig, const QString& name=QString::null, const QString& comments=QString::null);
00071   void showSignal(const KeepSignal * sig, const QString& name=QString::null, const QString& comments=QString::null);
00072 
00073   void setConsoleProgress(bool s);
00074   virtual bool useProgress() {return _progress;}
00075   virtual void setProgressMaximum(int val);
00076   virtual int progressMaximum() {if(_progress) return _progress->maximum(); else return 0;}
00077   virtual void setProgressValue(int val) {if(_progress) _progress->setValue(val);}
00078   virtual int progressValue() {if(_progress) return _progress->value(); else return 0;}
00079   virtual void increaseProgressValue(int val=1) {if(_progress) _progress->increaseValue(val);}
00080   virtual void showMessage(QString s);
00081   virtual void showLoadedSignals(const SubSignalPool& ) {}
00082 
00083   // Inteface for loading signals
00084   virtual SignalFileFormat askLoadFormat(const QString& signalFileName);
00085   virtual bool askTimeReference(double& t0, QDateTime& timeRef, const QDateTime& timeTrue);
00086   virtual bool askRD3LogParameter(int& nSamples, double& sampFreq, double& t0);
00087 protected:
00088   GeopsyPreferences * _preferences;
00089   Cache * _cache;
00090   QList<SignalDB *> _databases;
00091   SignalDB * _currentDB;
00092   CustomFileFormats * _customFileFormats;
00093   ConsoleProgress * _progress;
00094   GeopsyPlugins * _plugins;
00095 };
00096 
00097 extern GEOPSYCORE_EXPORT GeopsyCoreEngine * geopsyCore;
00098 
00099 } // namespace GeopsyCore
00100 
00101 #endif // GEOPSYCOREENGINE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines