00001 #pragma ident "$Id: ObsID.hpp 1901 2009-05-20 12:47:43Z ocibu $"
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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00049 #ifndef OBSID_HPP
00050 #define OBSID_HPP
00051
00052 #include <iostream>
00053 #include <iomanip>
00054 #include <sstream>
00055 #include <string>
00056 #include <map>
00057
00058 #include "Exception.hpp"
00059 #include "SatID.hpp"
00060
00061 namespace gpstk
00062 {
00063 class ObsID;
00064 namespace StringUtils
00065 {
00067 std::string asString(const ObsID& id);
00068 std::string asRinex3ID(const ObsID& id);
00069 }
00070
00071
00073 std::ostream& operator<<(std::ostream& s, const ObsID& p);
00074
00075
00076 class ObsID
00077 {
00078 public:
00080 enum ObservationType
00081 {
00082 otUnknown,
00083 otAny,
00084 otRange,
00085 otPhase,
00086 otDoppler,
00087 otSNR,
00088 otChannel,
00089 otIono,
00090 otSSI,
00091 otLLI,
00092 otTrackLen,
00093 otUndefined,
00094 otLast
00095 };
00096
00097
00099 enum CarrierBand
00100 {
00101 cbUnknown,
00102 cbAny,
00103 cbZero,
00104 cbL1,
00105 cbL2,
00106 cbL5,
00107 cbG1,
00108 cbG2,
00109 cbE5b,
00110 cbE5ab,
00111 cbE6,
00112 cbL1L2,
00113 cbUndefined,
00114 cbLast
00115 };
00116
00117
00125 enum TrackingCode
00126 {
00127 tcUnknown,
00128 tcAny,
00129 tcCA,
00130 tcP,
00131 tcY,
00132 tcW,
00133 tcN,
00134 tcD,
00135 tcM,
00136 tcC2M,
00137 tcC2L,
00138 tcC2LM,
00139 tcI5,
00140 tcQ5,
00141 tcIQ5,
00142
00143 tcGCA,
00144 tcGP,
00145
00146 tcA,
00147 tcB,
00148 tcC,
00149 tcBC,
00150 tcABC,
00151 tcIE5,
00152 tcQE5,
00153 tcIQE5,
00154 tcUndefined,
00155 tcLast
00156 };
00157
00159 ObsID()
00160 : type(otUnknown), band(cbUnknown), code(tcUnknown) {};
00161
00163 ObsID(ObservationType ot, CarrierBand cb, TrackingCode tc)
00164 : type(ot), band(cb), code(tc) {};
00165
00172 ObsID(const std::string& id) throw(InvalidParameter);
00173 ObsID(const char* id) throw(InvalidParameter)
00174 { *this=ObsID(std::string(id));};
00175
00177 virtual bool operator==(const ObsID& right) const;
00178
00186 virtual bool operator<(const ObsID& right) const;
00187
00188 bool operator!=(const ObsID& right) const
00189 { return !(operator==(right)); };
00190
00191 bool operator>(const ObsID& right) const
00192 { return (!operator<(right) && !operator==(right)); };
00193
00194 bool operator<=(const ObsID& right) const
00195 { return (operator<(right) || operator==(right)); };
00196
00197 bool operator>=(const ObsID& right) const
00198 { return !(operator<(right)); };
00199
00204 std::string asRinex3ID() const;
00205
00207 virtual std::ostream& dump(std::ostream& s) const;
00208
00210 virtual ~ObsID() {};
00211
00213 static ObservationType newObservationType(const std::string& s);
00214 static CarrierBand newCarrierBand(const std::string& s);
00215 static TrackingCode newTrackingCode(const std::string& s);
00216
00217
00218
00219
00220
00221
00222 static ObsID newID(const std::string& id,
00223 const std::string& desc="") throw(InvalidParameter);
00224
00225
00226 ObservationType type;
00227 CarrierBand band;
00228 TrackingCode code;
00229
00231 static std::map< TrackingCode, std::string > tcDesc;
00232 static std::map< CarrierBand, std::string > cbDesc;
00233 static std::map< ObservationType, std::string > otDesc;
00234
00237 static std::map< char, ObservationType> rinex2ot;
00238 static std::map< char, CarrierBand> rinex2cb;
00239 static std::map< char, TrackingCode> rinex2tc;
00240 static std::map< ObservationType, char > ot2Rinex;
00241 static std::map< CarrierBand, char > cb2Rinex;
00242 static std::map< TrackingCode, char> tc2Rinex;
00243
00244 class Initializer
00245 {
00246 public:
00247 Initializer();
00248 };
00249
00250 static Initializer singleton;
00251
00252 private:
00253 static ObsID idCreator(const std::string& id, const std::string& desc="");
00254
00255 };
00256
00257 }
00258 #endif // OBSID_HPP