MonoStation/AbstractTool.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of MonoStation.
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 : 2007-08-17
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (LGIT, Grenoble, France)
00024 **
00025 ***************************************************************************/
00026 
00027 #ifndef ABSTRACTTOOL_H
00028 #define ABSTRACTTOOL_H
00029 
00030 #include <GeopsyCore.h>
00031 #include <GeopsyGui.h>
00032 
00033 #include "MonoStationDLLExport.h"
00034 
00035 namespace MonoStation {
00036 
00037 class AbstractStation;
00038 class AbstractToold;
00039 class WinResults;
00040 class AbstractSummary;
00041 
00042 #define _winResults static_cast<WinResults*>(_childrenList[0])
00043 #define _summary static_cast<AbstractSummary*>(_childrenList[1])
00044 
00045 class MONOSTATION_EXPORT AbstractTool : public ToolBase
00046 {
00047   Q_OBJECT
00048 public:
00049   AbstractTool(QWidget * parent);
00050   ~AbstractTool();
00051 
00052   virtual void restoreFields();
00053   virtual void setParameters(int& argc, char ** argv);
00054   virtual void outputResults(int& argc, char ** argv);
00055   virtual void refreshSignal(Signal * sig);
00056 protected slots:
00057   void signalMousePressed(bool& accept, QMouseEvent * e, int iSig, QRect * trackingRect);
00058   void signalMouseReleased(bool& accept, QMouseEvent * e);
00059   void signalMouseMoved(QPoint pt);
00060   void paintWindowPick(QPainter& p, double, int, int);
00061   void setCurrentDisplayStation();
00062   void updateNofWindows();
00063   void updateSummary();
00064   void forceReprocess();
00065   virtual void start();
00066   void startMakeUp();
00067 private slots:
00068   void autoWindows();
00069   void beginAddWindowsManually();
00070   void endAddWindowsManually();
00071   void addWindows(AbstractStation * stat, const TimeRange& r);
00072   void beginRemoveWindowsManually();
00073   void endRemoveWindowsManually();
00074   void removeWindows(AbstractStation * stat, const TimeRange& r);
00075   void inverseWindows();
00076   void clearWindows();
00077   void loadWindows(QString fileName=QString::null);
00078 protected:
00079   void createResults(QString subPoolName);
00080   virtual void updateAllFields();
00081   virtual AbstractParameters * parameters(AbstractParameters * param=0) const;
00082   virtual void setParameters(const AbstractParameters * param);
00083   virtual WinResults * createWinResults()=0;
00084   virtual AbstractSummary * createSummary()=0;
00085   virtual void setLimits();
00086   AbstractStation * belongsTo(Signal * sig);
00087   void windowsChanged();
00088   void setLog(AbstractStation * stat);
00089 protected:
00090   StationList _stationSignals;
00091   QList <AbstractStation *> _stations;
00092   AbstractToold * _d;
00093 private:
00094   QList<AbstractStation *> selectedStations();
00095   SparseKeepSignal * globalKeep(const TimeRange& r, const WindowingParameters& param);
00096   double deltaT();
00097   bool hasWindows();
00098 
00099   bool _forceReProcessAll;
00100   QRect * _trackingRect;
00101   Signal * _trackedSignal;
00102 };
00103 
00104 } // namespace MonoStation
00105 
00106 #endif // ABSTRACTTOOL_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines