GLOCNavHeader.cpp
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 //
28 // This software was developed by Applied Research Laboratories at the
29 // University of Texas at Austin, under contract to an agency or agencies
30 // within the U.S. Department of Defense. The U.S. Government retains all
31 // rights to use, duplicate, distribute, disclose, or release this software.
32 //
33 // Pursuant to DoD Directive 523024
34 //
35 // DISTRIBUTION STATEMENT A: This software has been approved for public
36 // release, distribution is unlimited.
37 //
38 //==============================================================================
39 #include "GLOCNavHeader.hpp"
40 #include "GLOCBits.hpp"
41 #include "TimeString.hpp"
42 
43 using namespace std;
44 
45 namespace gnsstk
46 {
47  GLOCNavHeader ::
48  GLOCNavHeader()
49  : preamble(0),
50  TS(0),
51  svid(0),
52  svUnhealthy(true),
53  dataInvalid(true),
54  health(SVHealth::Unknown),
55  P1(0),
56  P2(false),
57  KP(0),
58  A(false)
59  {
60  }
61 
62 
63  bool GLOCNavHeader ::
64  validate() const
65  {
66  return (!dataInvalid &&
68  }
69 
70 
71  void GLOCNavHeader ::
72  dumpOverHeader(std::ostream& s)
73  {
74  s << " STRING OVERHEAD" << endl << endl
75  << " SOD DOW:HH:MM:SS TS P1 P2 KP A H l"
76  << endl;
77  }
78 
79 
80  void GLOCNavHeader ::
81  dumpStrOverhead(const std::string& label, std::ostream& s) const
82  {
83  s << left << setw(11) << label << right
84  << gnsstk::printTime(xmit, "%7.0s %3a-%1w:%02H:%02M:%02S %3P")
85  << " " << setw(5) << TS << " " << setw(2) << (unsigned)P1 << " "
86  << setw(2) << P2 << " " << setw(2) << KP << " " << setw(1) << A
87  << " " << svUnhealthy << " " << dataInvalid << endl;
88  }
89 
90 
91  void GLOCNavHeader ::
92  dumpFlags(std::ostream& s) const
93  {
94  s << "P1 " << setw(16) << (unsigned)P1
95  << endl
96  << "P2 " << setw(16) << P2 << " encoded:";
97  if (P2)
98  {
99  s << " turn maneuver";
100  }
101  else
102  {
103  s << " Sun-pointing";
104  }
105  s << endl
106  << "KP " << setw(16) << KP << " encoded:";
107  switch (KP)
108  {
109  case 0:
110  s << " no correction planned";
111  break;
112  case 1:
113  s << " day length increased by 1s";
114  break;
115  case 2:
116  s << " correction decision pending";
117  break;
118  case 3:
119  s << " day length decreased by 1s";
120  break;
121  default:
122  s << " ????";
123  break;
124  }
125  s << endl
126  << "A: " << setw(16) << A << " encoded:"
127  << (A ? " correction planned" : " no correction planned")
128  << endl
129  << "H^j " << setw(16) << (unsigned)svUnhealthy << " encoded:";
130  if (svUnhealthy)
131  {
132  s << " non-healthy";
133  }
134  else
135  {
136  s << " healthy";
137  }
138  s << endl
139  << "l^j " << setw(16) << (unsigned)dataInvalid << " encoded:"
140  << setw(0);
141  if (dataInvalid)
142  {
143  s << " data not valid";
144  }
145  else
146  {
147  s << " data valid";
148  }
149  s << endl;
150  }
151 }
example3.svid
svid
Definition: example3.py:19
gnsstk::GLOCNavHeader::dumpStrOverhead
void dumpStrOverhead(const std::string &label, std::ostream &s) const
Definition: GLOCNavHeader.cpp:81
gnsstk::GLOCNavHeader::dumpOverHeader
static void dumpOverHeader(std::ostream &s)
Definition: GLOCNavHeader.cpp:72
GLOCNavHeader.hpp
gnsstk::gloc::valPreamble
@ valPreamble
Definition: GLOCBits.hpp:79
gnsstk::GLOCNavHeader::dataInvalid
bool dataInvalid
Data validity flag (lj, false=valid).
Definition: GLOCNavHeader.hpp:88
gnsstk::GLOCNavHeader::preamble
uint32_t preamble
20 bit preamble for the message.
Definition: GLOCNavHeader.hpp:79
gnsstk::GLOCNavHeader::dumpFlags
void dumpFlags(std::ostream &s) const
Definition: GLOCNavHeader.cpp:92
gnsstk::GLOCNavHeader::TS
uint16_t TS
Time stamp (3 second counter for each string).
Definition: GLOCNavHeader.hpp:80
gnsstk::SVHealth
SVHealth
Identify different types of SV health states.
Definition: SVHealth.hpp:52
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::IonexStoreStrategy::Unknown
@ Unknown
Unknown or uninitialized stategy value.
P1
gnsstk::Matrix< double > P1
Definition: Matrix_LUDecomp_T.cpp:49
gnsstk::GLOCNavHeader::A
bool A
true=time correction planned (see ICD 4.2.2.10).
Definition: GLOCNavHeader.hpp:93
P2
gnsstk::Matrix< double > P2
Definition: Matrix_LUDecomp_T.cpp:49
gnsstk::GLOCNavHeader::validate
bool validate() const
Definition: GLOCNavHeader.cpp:64
GLOCBits.hpp
gnsstk::GLOCNavHeader::P1
uint8_t P1
SV call to ground control.
Definition: GLOCNavHeader.hpp:90
gnsstk::GLOCNavHeader::svUnhealthy
bool svUnhealthy
Health flag (Hj, false=healthy).
Definition: GLOCNavHeader.hpp:87
gnsstk::printTime
std::string printTime(const CommonTime &t, const std::string &fmt)
Definition: TimeString.cpp:64
std
Definition: Angle.hpp:142
gnsstk::GLOCNavHeader::KP
unsigned KP
Leap second indicator (see ICD 4.2.2.9).
Definition: GLOCNavHeader.hpp:92
gnsstk::GLOCNavHeader::xmit
CommonTime xmit
Transmit time of the string.
Definition: GLOCNavHeader.hpp:78
gnsstk::GLOCNavHeader::P2
bool P2
false=sun pointing (see ICD 4.2.2.8).
Definition: GLOCNavHeader.hpp:91
TimeString.hpp


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