rapclass/Station.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of rapclass.
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: 2013-04-02
00021 **  Authors:
00022 **    Marc Wathelet (ISTerre, Grenoble, France)
00023 **
00024 ***************************************************************************/
00025 
00026 #ifndef STATION_H
00027 #define STATION_H
00028 
00029 #include <GeopsyCore.h>
00030 
00031 class Station
00032 {
00033 public:
00034   Station();
00035   ~Station();
00036 
00037   enum Status {Unknown, ToSort, Valid, Rejected};
00038 
00039   static QString statusToString(Status s);
00040   Status status() const {return _status;}
00041   void setStatus(Status s) {_status=s;}
00042   void setStatus(QString s);
00043   void rollStatus();
00044 
00045   void setName(const QString& n) {_name=n;}
00046   const QString& name() const {return _name;}
00047 
00048   double distance(bool& ok) const;
00049   double magnitude(bool& ok) const;
00050 
00051   bool addComponent(QChar c, const QString& file);
00052   bool checkComponents() const;
00053   SubSignalPool * raw();
00054   SubSignalPool * filter1();
00055   SubSignalPool * filter2();
00056 
00057   static void setSortIndex(int index) {_sortIndex=index;}
00058   static bool lessThan(const Station * s1, const Station * s2);
00059 private:
00060   bool readDistance(const QString& file);
00061   void setTimePicks();
00062 
00063   Status _status;
00064   double _distance;
00065   double _magnitude;
00066   double _eventTime;
00067   bool _hasMagnitude, _hasDistance;
00068   QString _name;
00069   QString _components[3];
00070   SubSignalPool * _raw;
00071   SubSignalPool * _filter1;
00072   SubSignalPool * _filter2;
00073 
00074   static int _sortIndex;
00075 };
00076 
00077 #endif // STATION_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines