GLOCNavHealth.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 "GLOCNavHealth.hpp"
40 
41 using namespace std;
42 
43 namespace gnsstk
44 {
45  GLOCNavHealth ::
46  GLOCNavHealth()
47  : Hj(true), lj(true)
48  {
49  // Allow the data fields to default to invalid via ValidType.
50  msgLenSec = 3.0;
51  }
52 
53 
54  bool GLOCNavHealth ::
55  validate() const
56  {
57  // l^j indicates data validity of the string containing it,
58  // but validate() should return an indication of the validity
59  // of the data within this structure, i.e. Hj and lj
60  // themselves. Which should always be true?
61  return true;
62  }
63 
64 
65  void GLOCNavHealth ::
66  dump(std::ostream& s, DumpDetail dl) const
67  {
68  const ios::fmtflags oldFlags = s.flags();
69  s.setf(ios::fixed, ios::floatfield);
70  s.setf(ios::right, ios::adjustfield);
71  s.setf(ios::uppercase);
72  s.precision(0);
73  s.fill(' ');
74  switch (dl)
75  {
77  NavData::dump(s,dl);
78  break;
79  case DumpDetail::Brief:
80  NavData::dump(s,dl);
81  s << " lj = " << hex << (unsigned)lj
82  << " Hj = " << hex << (unsigned)Hj
83  << endl;
84  break;
85  case DumpDetail::Full:
86  // "header"
87  s << "*************************************************************"
88  << "***************" << endl
89  << "Satellite Health" << endl << endl
90  << "PRN : " << setw(2) << signal.sat << " / "
91  << "SVN : " << setw(2);
92  std::string svn;
93  if (getSVN(signal.sat, timeStamp, svn))
94  {
95  s << svn;
96  }
97  s << endl << endl
98  << " TIMES OF INTEREST"
99  << endl << endl
100  << " " << getDumpTimeHdr(dl) << endl
101  << "Transmit: " << getDumpTime(dl, timeStamp) << endl
102  << endl
103  << " HEALTH DATA" << endl
104  << "Hj " << Hj << endl
105  << "lj " << lj << endl
106  << "Status " << StringUtils::asString(getHealth())
107  << endl;
108  break;
109  }
110  s.flags(oldFlags);
111  }
112 
113 
115  getHealth() const
116  {
117  return (Hj || lj) ? SVHealth::Unhealthy : SVHealth::Healthy;
118  }
119 
120 }
gnsstk::NavData::msgLenSec
double msgLenSec
Definition: NavData.hpp:199
gnsstk::NavData::dump
virtual void dump(std::ostream &s, DumpDetail dl) const
Definition: NavData.cpp:79
gnsstk::GLOCNavHealth::dump
void dump(std::ostream &s, DumpDetail dl) const override
Definition: GLOCNavHealth.cpp:66
gnsstk::NavData::getDumpTime
std::string getDumpTime(DumpDetail dl, const CommonTime &t) const
Definition: NavData.cpp:145
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::NavData::getDumpTimeHdr
std::string getDumpTimeHdr(DumpDetail dl) const
Definition: NavData.cpp:127
gnsstk::SVHealth
SVHealth
Identify different types of SV health states.
Definition: SVHealth.hpp:52
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
gnsstk::GLOCNavHealth::getHealth
SVHealth getHealth() const override
Definition: GLOCNavHealth.cpp:115
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
gnsstk::GLOCNavHealth::validate
bool validate() const override
Definition: GLOCNavHealth.cpp:55
gnsstk::NavSatelliteID::sat
SatID sat
ID of satellite to which the nav data applies.
Definition: NavSatelliteID.hpp:169
gnsstk::GLOCNavHealth::Hj
bool Hj
The H^j health bit (SV health).
Definition: GLOCNavHealth.hpp:78
gnsstk::DumpDetail::Full
@ Full
Include all detailed information.
gnsstk::DumpDetail
DumpDetail
Specify level of detail for dump output.
Definition: DumpDetail.hpp:51
gnsstk::DumpDetail::Brief
@ Brief
Limit output to <= 5 lines of minimal information.
std
Definition: Angle.hpp:142
GLOCNavHealth.hpp
gnsstk::DumpDetail::OneLine
@ OneLine
Limit output to minimal information on a single line.
gnsstk::GLOCNavHealth::lj
bool lj
The l^j health bit (validity indicator).
Definition: GLOCNavHealth.hpp:79
gnsstk::NavData::getSVN
bool getSVN(const SatID &sat, const gnsstk::CommonTime &when, std::string &svn) const
Definition: NavData.hpp:150
gnsstk::SVHealth::Unhealthy
@ Unhealthy
Satellite is unhealthy and should not be used.


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