Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef SIGNALFILE_H
00029 #define SIGNALFILE_H
00030
00031 #include <QGpCoreTools.h>
00032
00033 #include "GeopsyCoreDLLExport.h"
00034 #include "SignalFileFormat.h"
00035
00036 namespace GeopsyCore {
00037
00038 class Signal;
00039 class SignalDB;
00040 class SubSignalPool;
00041 class GeopsySignalHeader;
00042 class SignalFileFormat;
00043
00044 class GEOPSYCORE_EXPORT SignalFile : public XMLClass
00045 {
00046 TRANSLATIONS("SignalFile")
00047 public:
00048 SignalFile(SignalDB * db, QString fileName="", const SignalFileFormat& format=SignalFileFormat::Unknown);
00049 SignalFile(SignalDB * db, SignalFile& f, QDir& d);
00050 ~SignalFile();
00051
00052 virtual const QString& xml_tagName() const {return xmlSignalFileTag;}
00053 static const QString xmlSignalFileTag;
00054
00055 SignalFile& operator=(const SignalFile& p);
00056 QString name(int len) const;
00057 QString shortName() const;
00058
00059 QString name() const {return _name;}
00060 void setName(QString n) {_name=n;}
00061
00062 const SignalFileFormat& format() const {return _format;}
00063 void setFormat(const SignalFileFormat& f) {_format=f;}
00064 void setFormat(QString f) {_format=SignalFileFormat::fromString(f);}
00065
00066 bool isOriginalFile() {return _isOriginalFile;}
00067 void setOriginalFile(bool b) {_isOriginalFile=b;}
00068
00069 SignalDB * database() const {return _db;}
00070 void setDatabase(SignalDB * db) {_db=db;}
00071
00072
00073 void removeFile();
00074 bool load();
00075 bool loadGeopsySignal(const SubSignalPool& subPool);
00076
00077 static bool setTimeReference(double& t0, QDateTime& timeRef, QDateTime timeTrue);
00078 static void setSignalName(Signal * sig, QString stationName, QString sufix,
00079 int recNum, QString fileName);
00080 bool save(const QDir& d);
00081 protected:
00082 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00083 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00084 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS);
00085 virtual XMLMember xml_member(XML_MEMBER_ARGS);
00086 virtual void xml_polish(XML_POLISH_ARGS);
00087 private:
00088 SignalFileFormat _format;
00089 QString _name;
00090 bool _isOriginalFile;
00091 SignalDB * _db;
00092
00093 bool loadGeopsySignal();
00094 bool loadCity2();
00095 bool loadSeg2();
00096 bool loadSegD();
00097 bool loadSu(QDataStream::ByteOrder bo);
00098 bool loadSegY(QDataStream::ByteOrder bo);
00099 bool loadPasscalSegY(QDataStream::ByteOrder bo);
00100 bool loadRD3();
00101 bool loadTomo();
00102 bool loadNiSismo();
00103 bool loadSac(QDataStream::ByteOrder bo);
00104 bool loadRadan();
00105 bool loadGse2(SignalFileFormat::Storage sto=SignalFileFormat::Multi);
00106 bool loadAsciiOneColumn();
00107 bool loadAscii();
00108 bool loadFourier();
00109 bool loadSaf();
00110 bool loadSismalp();
00111 bool loadWav();
00112 bool loadSyscomXmr();
00113 bool loadSyscomSmr();
00114 bool loadSyscomVmrx();
00115 bool loadGuralpGcf();
00116 bool loadAsciiGeoSig();
00117 bool loadMiniSeed();
00118
00119 void warnAsciiHeader();
00120 };
00121
00122 }
00123
00124 #endif // SIGNALFILE_H