Rinex3ClockHeader.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Rinex3ClockHeader.hpp 3319 2012-09-19 16:58:10Z prestonherrmann $"
00002 
00009 #ifndef GPSTK_RINEX3CLOCKHEADER_HPP
00010 #define GPSTK_RINEX3CLOCKHEADER_HPP
00011 
00012 //============================================================================
00013 //
00014 //  This file is part of GPSTk, the GPS Toolkit.
00015 //
00016 //  The GPSTk is free software; you can redistribute it and/or modify
00017 //  it under the terms of the GNU Lesser General Public License as published
00018 //  by the Free Software Foundation; either version 2.1 of the License, or
00019 //  any later version.
00020 //
00021 //  The GPSTk is distributed in the hope that it will be useful,
00022 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 //  GNU Lesser General Public License for more details.
00025 //
00026 //  You should have received a copy of the GNU Lesser General Public
00027 //  License along with GPSTk; if not, write to the Free Software Foundation,
00028 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00029 //
00030 //  Octavian Andrei - FGI ( http://www.fgi.fi ). 2008
00031 //
00032 //============================================================================
00033 
00034 // system
00035 #include <vector>
00036 #include <list>
00037 #include <map>
00038 #include <iostream>
00039 #include <iomanip>
00040 // GPSTk
00041 #include "CommonTime.hpp"
00042 #include "FFStream.hpp"
00043 #include "Rinex3ClockBase.hpp"
00044 #include "Triple.hpp"
00045 #include "RinexSatID.hpp"
00046 
00047 
00048 
00049 namespace gpstk
00050 {
00053 
00059    class Rinex3ClockHeader : public Rinex3ClockBase
00060    {
00061    public:
00062 
00064       Rinex3ClockHeader() : 
00065          version(3.0), valid(false), timeFirst(CommonTime::BEGINNING_OF_TIME)
00066          {}
00067 
00068 
00070       void clear(void);
00071 
00072 
00078       static const std::string versionString;       
00079       static const std::string runByString;         
00080       static const std::string commentString;       
00081       static const std::string numObsString;        
00082       static const std::string timeSystemString;    
00083       static const std::string leapSecondsString;   
00084       static const std::string sysDCBString;        
00085       static const std::string sysPCVString;        
00086       static const std::string dataTypesString;     
00087       static const std::string stationNameString;   
00088       static const std::string calibrationClkString;
00089       static const std::string acNameString;        
00090       static const std::string numRefClkString;     
00091       static const std::string analysisClkRefString;
00092       static const std::string numStationsString;   
00093       static const std::string solnStaNameString;   
00094       static const std::string numSatsString;       
00095       static const std::string prnListString;       
00096       static const std::string endOfHeader;         
00097 
00098 
00100       enum validBits
00101       {
00102          versionValid         = 0x01,        
00103          runByValid           = 0x02,        
00104          commentValid         = 0x04,        
00105          numObsValid          = 0x08,        
00106          timeSystemValid      = 0x010,       
00107          leapSecondsValid     = 0x020,       
00108          sysDCBsValid         = 0x040,       
00109          sysPCVsValid         = 0x080,       
00110          dataTypesValid       = 0x0100,      
00111          stationNameValid     = 0x0200,      
00112          calibrationClkValid  = 0x0400,      
00113          acNameValid          = 0x0800,      
00114          numRefClkValid       = 0x01000,     
00115          analysisClkRefValid  = 0x02000,     
00116          numStationsValid     = 0x04000,     
00117          solnStaNameValid     = 0x08000,     
00118          numSatsValid         = 0x010000,    
00119          prnListValid         = 0x020000,    
00120 
00121          endValid = 0x080000000,          
00122 
00124          allValid = 0x08003FFFF
00125 
00126       };
00127 
00128 
00131       struct RefClk
00132       {
00134          std::string name;
00136          double sigma;
00137       };
00138 
00139 
00142       struct RefClkRecord
00143       {
00145          size_t nRef;
00147          std::list<RefClk> clk;
00149          double refWin[2];
00150 
00151          RefClkRecord() : nRef(0) 
00152          { refWin[0] = refWin[1] = 0.0; };
00153       };
00154 
00156       struct RinexClkType
00157       {
00158          std::string type;
00159          std::string description;
00160          RinexClkType() : type(std::string("UN")),
00161             description(std::string("Unknown or Invalid")) {}
00162          RinexClkType(std::string t, std::string d) :
00163             type(t),description(d) {}
00164       };
00165 
00166 
00170       static const RinexClkType UN;
00171       static const RinexClkType AR;
00172       static const RinexClkType AS;
00173       static const RinexClkType CR;
00174       static const RinexClkType DR;
00175       static const RinexClkType MS;
00177 
00178       //static const std::vector<ObsID> StandardRinex3ObsIDs;
00179       //static std::vector<ObsID> RegisteredRinex3ObsIDs;
00180 
00181 
00185       double version;                        
00186       std::string fileType;                  
00187       RinexSatID system;                     
00188       std::string fileProgram,               
00189          fileAgency,                         
00190          date;                               
00191       std::vector<std::string> commentList;  
00192       int numObsTyp;                         
00193       std::vector<std::string> obsTypeList;  
00194       std::string timeSystem;                
00195       int leapSeconds;                       
00196       int numTyp;                            
00197       std::vector<std::string> dataTypeList; 
00198       std::string clk0Name;                  
00199       std::string calName;                   
00200       std::string ac;                        
00201       std::string acName;                    
00202       CommonTime timeFirst;                  
00203       std::list<RefClkRecord> refClkList;    
00204       std::string trfName;                   
00205       int numSta,                            
00206          numSVs;                             
00207       std::vector<std::string> clkNameList;  
00208       std::vector<Triple> staCoordList;      
00209 
00210       unsigned long valid; 
00211 
00212       bool isPGM;          
00213       bool isAC;           
00214 
00216 
00217 
00219       virtual ~Rinex3ClockHeader() {}
00220 
00221          // The next four lines is our common interface
00224       virtual bool isHeader() const {return true;}
00225 
00226 
00232       virtual void dump(std::ostream& s) const;
00233 
00234 
00240       void ParseHeaderRecord(std::string& line)
00241          throw(FFStreamError);
00242 
00243 
00245       bool isValid() const { return ((valid & allValid) == allValid); }
00246 
00247 
00248    protected:
00249 
00253       virtual void reallyPutRecord(FFStream& s) const
00254          throw(std::exception, FFStreamError, StringUtils::StringException);
00255 
00265       virtual void reallyGetRecord(FFStream& s) 
00266          throw(std::exception, FFStreamError,StringUtils::StringException);
00267 
00268       friend class Rinex3ClockData;
00269 
00270    private:
00273       std::string writeTime(const CommonTime& dt) const;
00274 
00279       CommonTime parseTime(const std::string& line) const;
00280 
00281    }; // end class Rinex3ClockHeader
00282 
00284 
00285 }  // End of namespace gpstk
00286 
00287 #endif   // GPSTK_RINEX3CLOCKHEADER_HPP

Generated on Tue May 21 03:31:13 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1