ObsID.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
46 
47 #ifndef OBSID_HPP
48 #define OBSID_HPP
49 
50 #include <iostream>
51 #include <iomanip>
52 #include <sstream>
53 #include <string>
54 #include <map>
55 
56 #include "gnsstk_export.h"
57 #include "Exception.hpp"
58 #include "SatID.hpp"
59 #include "Rinex3ObsBase.hpp"
60 #include "ObservationType.hpp"
61 #include "CarrierBand.hpp"
62 #include "TrackingCode.hpp"
63 #include "XmitAnt.hpp"
64 
65 // forward declaration of test class
66 class ObsID_T;
67 
68 namespace gnsstk
69 {
70  class ObsID;
71  namespace StringUtils
72  {
74  std::string asString(const ObsID& id);
75  }
76 
77 
79  std::ostream& operator<<(std::ostream& s, const ObsID& p);
80 
81 
82  class ObsID
83  {
84  public:
91  {}
92 
96  XmitAnt transmitter = XmitAnt::Any)
97  : type(ot), band(cb), code(tc), freqOffs(0), freqOffsWild(true),
98  mcode(0), mcodeMask(0), xmitAnt(transmitter)
99  {}
100 
109  int fo, XmitAnt transmitter = XmitAnt::Any,
110  bool fw = false)
111  : type(ot), band(cb), code(tc), freqOffs(fo), freqOffsWild(fw),
112  mcode(0), mcodeMask(0), xmitAnt(transmitter)
113  {}
114 
124  int fo, uint32_t mc,
125  XmitAnt transmitter = XmitAnt::Standard, bool fw = false)
126  : type(ot), band(cb), code(tc), freqOffs(fo), freqOffsWild(fw),
127  mcode(mc), mcodeMask(-1), xmitAnt(transmitter)
128  {}
129 
131  virtual bool operator==(const ObsID& right) const;
132 
142  virtual bool operator<(const ObsID& right) const;
143 
144  bool operator!=(const ObsID& right) const
145  { return !(operator==(right)); };
146 
147  bool operator>(const ObsID& right) const
148  { return (!operator<(right) && !operator==(right)); };
149 
150  bool operator<=(const ObsID& right) const
151  { return (operator<(right) || operator==(right)); };
152 
153  bool operator>=(const ObsID& right) const
154  { return !(operator<(right)); };
155 
157  virtual std::ostream& dump(std::ostream& s) const;
158 
160  virtual ~ObsID()
161  {}
162 
164  void makeWild();
165 
167  bool isWild() const;
168 
170  void setMcodeBits(uint32_t newval, uint32_t newmask = -1)
171  { mcode = newval; mcodeMask = newmask; }
180  void maskMcodeBits(uint32_t newval, uint32_t newmask)
181  {
182  mcode = (mcode & ~newmask) | (newval & newmask);
183  mcodeMask |= newmask;
184  }
186  uint32_t getMcodeBits() const
187  { return mcode; }
189  void setMcodeMask(uint32_t newmask = -1)
190  { mcodeMask = newmask; }
192  void clearMcodeMask(uint32_t clearmask)
193  { mcodeMask = mcodeMask & ~clearmask; }
195  uint32_t getMcodeMask() const
196  { return mcodeMask; }
197 
198  // Note that these are the only data members of objects of this class.
203  int freqOffs;
205 
207  static std::string getDescTC(TrackingCode e)
208  { return tcDesc[e]; }
210  static std::string getDescCB(CarrierBand e)
211  { return cbDesc[e]; }
213  static std::string getDescOT(ObservationType e)
214  { return otDesc[e]; }
216  GNSSTK_EXPORT static std::map< TrackingCode, std::string > tcDesc;
217  GNSSTK_EXPORT static std::map< CarrierBand, std::string > cbDesc;
218  GNSSTK_EXPORT static std::map< ObservationType, std::string > otDesc;
223  GNSSTK_EXPORT static bool verbose;
224 
225  private:
226  uint32_t mcode;
227  uint32_t mcodeMask;
228  friend class ::ObsID_T;
229  }; // class ObsID
230 
231 
232 } // namespace gnsstk
233 #endif // OBSID_HPP
gnsstk::ObsID::xmitAnt
XmitAnt xmitAnt
Identify the transmitting antenna.
Definition: ObsID.hpp:202
gnsstk::ObsID::maskMcodeBits
void maskMcodeBits(uint32_t newval, uint32_t newmask)
Definition: ObsID.hpp:180
gnsstk::ObsID::~ObsID
virtual ~ObsID()
Destructor.
Definition: ObsID.hpp:160
XmitAnt.hpp
gnsstk::ObsID::isWild
bool isWild() const
Return true if any of the data are wildcard values.
Definition: ObsID.cpp:159
gnsstk::CarrierBand
CarrierBand
Definition: CarrierBand.hpp:54
gnsstk::ObsID::getDescCB
static std::string getDescCB(CarrierBand e)
SWIG accessor. Not overloaded, because SWIG.
Definition: ObsID.hpp:210
gnsstk::ObsID::getMcodeMask
uint32_t getMcodeMask() const
Return the value of mcodeMask.
Definition: ObsID.hpp:195
gnsstk::ObsID::operator<
virtual bool operator<(const ObsID &right) const
Definition: ObsID.cpp:105
gnsstk::CarrierBand::Any
@ Any
Used to match any carrier band.
SatID.hpp
gnsstk::ObsID::tcDesc
static GNSSTK_EXPORT std::map< TrackingCode, std::string > tcDesc
These strings are for forming a somewhat verbose description.
Definition: ObsID.hpp:216
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::ObsID::clearMcodeMask
void clearMcodeMask(uint32_t clearmask)
Clear bits in mcodeMask that are set in clearmask.
Definition: ObsID.hpp:192
gnsstk::ObsID::band
CarrierBand band
Definition: ObsID.hpp:200
gnsstk::ObsID::ObsID
ObsID(ObservationType ot, CarrierBand cb, TrackingCode tc, XmitAnt transmitter=XmitAnt::Any)
Definition: ObsID.hpp:95
gnsstk::XmitAnt::Standard
@ Standard
Transmitting antenna is the primary for that signal.
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::IonexStoreStrategy::Unknown
@ Unknown
Unknown or uninitialized stategy value.
CarrierBand.hpp
ObsID_T
Definition: ObsID_T.cpp:77
gnsstk::ObsID::ObsID
ObsID(ObservationType ot, CarrierBand cb, TrackingCode tc, int fo, XmitAnt transmitter=XmitAnt::Any, bool fw=false)
Definition: ObsID.hpp:108
ObservationType.hpp
gnsstk::ObsID::setMcodeBits
void setMcodeBits(uint32_t newval, uint32_t newmask=-1)
Set the value of mcode while simultaneously setting the mask.
Definition: ObsID.hpp:170
gnsstk::ObsID
Definition: ObsID.hpp:82
gnsstk::ObsID::ObsID
ObsID(ObservationType ot, CarrierBand cb, TrackingCode tc, int fo, uint32_t mc, XmitAnt transmitter=XmitAnt::Standard, bool fw=false)
Definition: ObsID.hpp:123
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::ObsID::operator>
bool operator>(const ObsID &right) const
Definition: ObsID.hpp:147
gnsstk::ObsID::operator==
virtual bool operator==(const ObsID &right) const
Equality requires all fields to be the same.
Definition: ObsID.cpp:71
gnsstk::ObsID::getMcodeBits
uint32_t getMcodeBits() const
Return the value of mcode.
Definition: ObsID.hpp:186
gnsstk::ObsID::code
TrackingCode code
Definition: ObsID.hpp:201
gnsstk::XmitAnt
XmitAnt
Definition: XmitAnt.hpp:53
TrackingCode.hpp
gnsstk::ObsID::otDesc
static GNSSTK_EXPORT std::map< ObservationType, std::string > otDesc
Definition: ObsID.hpp:218
gnsstk::ObsID::freqOffsWild
bool freqOffsWild
True=Treat freqOffs as a wildcard when matching.
Definition: ObsID.hpp:204
gnsstk::ObsID::mcodeMask
uint32_t mcodeMask
Bitmask for matching mcode.
Definition: ObsID.hpp:227
gnsstk::ObsID::type
ObservationType type
Definition: ObsID.hpp:199
gnsstk::TrackingCode
TrackingCode
Definition: TrackingCode.hpp:64
Exception.hpp
gnsstk::ObsID::freqOffs
int freqOffs
GLONASS frequency offset.
Definition: ObsID.hpp:203
gnsstk::ObsID::ObsID
ObsID()
Definition: ObsID.hpp:87
gnsstk::ObsID::operator<=
bool operator<=(const ObsID &right) const
Definition: ObsID.hpp:150
gnsstk::ObsID::mcode
uint32_t mcode
Data to uniquely identify M-code signal.
Definition: ObsID.hpp:226
gnsstk::ObsID::dump
virtual std::ostream & dump(std::ostream &s) const
Convenience output method.
Definition: ObsID.cpp:51
gnsstk::ObsID::makeWild
void makeWild()
Set all data to wildcard values.
Definition: ObsID.cpp:147
gnsstk::ObsID::operator!=
bool operator!=(const ObsID &right) const
Definition: ObsID.hpp:144
Rinex3ObsBase.hpp
gnsstk::ObsID::operator>=
bool operator>=(const ObsID &right) const
Definition: ObsID.hpp:153
gnsstk::ObsID::cbDesc
static GNSSTK_EXPORT std::map< CarrierBand, std::string > cbDesc
Definition: ObsID.hpp:217
gnsstk::ObsID::getDescOT
static std::string getDescOT(ObservationType e)
SWIG accessor. Not overloaded, because SWIG.
Definition: ObsID.hpp:213
gnsstk::XmitAnt::Any
@ Any
When making comparisons in ObsID, matches any enumeration.
gnsstk::ObsID::getDescTC
static std::string getDescTC(TrackingCode e)
SWIG accessor. Not overloaded, because SWIG.
Definition: ObsID.hpp:207
gnsstk::ObsID::setMcodeMask
void setMcodeMask(uint32_t newmask=-1)
Set the value of mcodeMask on its own.
Definition: ObsID.hpp:189
gnsstk::ObsID::verbose
static GNSSTK_EXPORT bool verbose
Definition: ObsID.hpp:223
gnsstk::ObservationType
ObservationType
The type of observation, mostly used by ObsID.
Definition: ObservationType.hpp:55


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40