00001 #pragma ident "$Id: RinexMetHeader.hpp 438 2007-03-21 17:22:21Z btolman $"
00002
00003
00004
00010 #ifndef GPSTK_RINEXMETHEADER_HPP
00011 #define GPSTK_RINEXMETHEADER_HPP
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #include "StringUtils.hpp"
00055 #include "FFStream.hpp"
00056 #include "RinexMetBase.hpp"
00057
00058 #include "Triple.hpp"
00059
00060 namespace gpstk
00061 {
00064
00075 class RinexMetHeader : public RinexMetBase
00076 {
00077 public:
00079 enum RinexMetType
00080 {
00081 PR,
00082 TD,
00083 HR,
00084 ZW,
00085 ZD,
00086 ZT,
00087 WD,
00088 WS,
00089 RI,
00090 HI
00091 };
00092
00094 RinexMetHeader() : valid(0), version(2.1) {}
00095
00097 virtual ~RinexMetHeader() {}
00098
00099
00101 virtual bool isHeader(void) const {return true;}
00102
00104 virtual void dump(std::ostream& s) const;
00105
00107 static RinexMetType convertObsType(const std::string& oneObs)
00108 throw(FFStreamError);
00109
00111 static std::string convertObsType(const RinexMetType& oneObs)
00112 throw(FFStreamError);
00113
00115 unsigned long valid;
00116
00118 enum validBits
00119 {
00120 versionValid = 0x01,
00121 runByValid = 0x02,
00122 commentValid = 0x04,
00123 markerNameValid = 0x08,
00124 markerNumberValid = 0x010,
00125 obsTypeValid = 0x020,
00126 sensorTypeValid = 0x040,
00127 sensorPosValid = 0x080,
00128
00129
00130 endValid = 0x080000000,
00131
00134 allValid20 = 0x0800000EB,
00137 allValid21 = 0x0800000EB
00138 };
00139
00140
00141 static inline std::string bitsAsString(validBits b)
00142 {
00143 switch (b)
00144 {
00145 case versionValid:
00146 return versionString;
00147 case runByValid:
00148 return runByString;
00149 case commentValid:
00150 return commentString;
00151 case markerNameValid:
00152 return markerNameString;
00153 case markerNumberValid:
00154 return markerNumberString;
00155 case obsTypeValid:
00156 return obsTypeString;
00157 case sensorTypeValid:
00158 return sensorTypeString;
00159 case sensorPosValid:
00160 return sensorPosString;
00161 case endValid:
00162 return endOfHeader;
00163 }
00164
00165 return "*UNKNOWN/INVALID BITS*";
00166 }
00167
00168
00169
00170
00171
00172
00173
00174
00175 static std::string bitString(unsigned long vb, char quote='\"',
00176 std::string sep=", ");
00177
00178
00180 struct sensorType
00181 {
00182 std::string model;
00183 std::string type;
00184 double accuracy;
00185 RinexMetType obsType;
00186 };
00187
00189 struct sensorPosType
00190 {
00195 gpstk::Triple position;
00196 double height;
00198 RinexMetType obsType;
00199 };
00200
00204 double version;
00205
00206 std::string fileType;
00207 std::string fileProgram;
00208 std::string fileAgency;
00209 std::string date;
00210 std::vector<std::string> commentList;
00211 std::string markerName;
00212 std::string markerNumber;
00213
00220 std::vector<RinexMetType> obsTypeList;
00221 std::vector<sensorType> sensorTypeList;
00222 std::vector<sensorPosType> sensorPosList;
00223
00225
00226 static const int maxObsPerLine;
00227
00231 static const std::string versionString;
00232 static const std::string runByString;
00233 static const std::string commentString;
00234 static const std::string markerNameString;
00235 static const std::string markerNumberString;
00236 static const std::string obsTypeString;
00237 static const std::string sensorTypeString;
00238 static const std::string sensorPosString;
00239 static const std::string endOfHeader;
00240
00241
00242 protected:
00244 virtual void reallyPutRecord(FFStream& s) const
00245 throw(std::exception, FFStreamError,
00246 gpstk::StringUtils::StringException);
00247
00257 virtual void reallyGetRecord(FFStream& s)
00258 throw(std::exception, FFStreamError,
00259 gpstk::StringUtils::StringException);
00260
00261
00262 };
00263
00265
00266 }
00267
00268 #endif