00001 /*************************************************************************** 00002 ** 00003 ** This file is part of GeopsySLink. 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-04-24 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (LGIT, Grenoble, France) 00024 ** 00025 ***************************************************************************/ 00026 00027 #ifndef SEEDLINKSTREAM_H 00028 #define SEEDLINKSTREAM_H 00029 00030 #include <GeopsyCore.h> 00031 00032 #include "GeopsySLinkDLLExport.h" 00033 00034 namespace GeopsySLink { 00035 00036 class SeedLinkStation; 00037 00038 class GEOPSYSLINK_EXPORT SeedLinkStream : public XMLClass 00039 { 00040 TRANSLATIONS("SeedLinkStream") 00041 public: 00042 SeedLinkStream(SeedLinkStation * station); 00043 00044 enum BufferType {Unlimited, CreateNew, Rotate}; 00045 00046 virtual const QString& xml_tagName() const {return xmlSeedLinkStreamTag;} 00047 static const QString xmlSeedLinkStreamTag; 00048 00049 SeedLinkStation * station() const {return _station;} 00050 00051 QByteArray tag() const {return _tag;} 00052 void setTag(); 00053 00054 virtual void xml_attributes(XML_ATTRIBUTES_ARGS) const; 00055 virtual bool xml_setAttributes(XML_SETATTRIBUTES_ARGS); 00056 00057 QString location() const {return _location;} 00058 00059 QString seedName() const {return _seedName;} 00060 void setSeedName(QString n) {_seedName=n;} 00061 00062 QString type() const {return _type;} 00063 QString beginTime() const {return _beginTime;} 00064 QString endTime() const {return _endTime;} 00065 int beginRecNo() const {return _beginRecNo;} 00066 int endRecNo() const {return _endRecNo;} 00067 bool gapCheck() const {return _gapCheck;} 00068 int gapThreshold() const {return _gapThreshold;} 00069 00070 DynamicSignal * signal() const {return _signal;} 00071 void initSignal(double t0, double samplingFrequency); 00072 void detachSignal() {_signal=0;} 00073 double localTime(double t) const; 00074 void set(double t, int * samples, int nSamples, BufferType bt, double maxTime=0.0); 00075 00076 bool listening() const {return _listening;} 00077 bool setListening(bool l) {return _listening=l;} 00078 private: 00079 void createSignal(); 00080 00081 SeedLinkStation * _station; 00082 00083 QString _location; 00084 QString _seedName; 00085 QString _type; 00086 QString _beginTime; 00087 QString _endTime; 00088 int _beginRecNo; 00089 int _endRecNo; 00090 bool _gapCheck; 00091 int _gapThreshold; 00092 QByteArray _tag; 00093 00094 DynamicSignal * _signal; 00095 bool _listening; 00096 }; 00097 00098 } // namespace GeopsySLink 00099 00100 #endif // SEEDLINKSTREAM_H