BDSD2NavHealth.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 "BDSD2NavHealth.hpp"
40 #include "TimeString.hpp"
41 
42 using namespace std;
43 
44 namespace gnsstk
45 {
46  BDSD2NavHealth ::
47  BDSD2NavHealth()
48  : isAlmHealth(true),
49  satH1(true),
50  svHealth(0xff)
51  {
52  weekFmt = "%4D(%4e)";
53  msgLenSec = 6.0;
54  }
55 
56 
58  getHealth() const
59  {
60  if (isAlmHealth)
61  {
75  }
76  else
77  {
79  }
80  }
81 
83  dump(std::ostream& s, DumpDetail dl) const
84  {
85  const ios::fmtflags oldFlags = s.flags();
86 
87  s.setf(ios::fixed, ios::floatfield);
88  s.setf(ios::right, ios::adjustfield);
89  s.setf(ios::uppercase);
90  s.precision(0);
91  s.fill(' ');
92  switch (dl)
93  {
95  NavData::dump(s,dl);
96  break;
97  case DumpDetail::Brief:
98  NavData::dump(s,dl);
99  s << "svHealth = " << hex << (unsigned)svHealth << dec << " "
100  << StringUtils::asString(getHealth()) << endl;
101  break;
102  case DumpDetail::Full:
103  // "header"
104  s << "*************************************************************"
105  << "***************" << endl
106  << "Satellite Health"
107  << endl
108  << endl
109  << getSignalString() << endl
110  << " TIMES OF INTEREST"
111  << endl << endl
112  << " " << getDumpTimeHdr(dl) << endl
113  << "Transmit: " << getDumpTime(dl, timeStamp) << endl
114  << endl
115  << " HEALTH DATA" << endl
116  << "Bits 0x" << hex << setw(3) << setfill('0')
117  << svHealth << endl << endl
118  << "Function Status" << endl
119  << "Satellite clock ";
120  if ((svHealth & SatClock) == SatClock)
121  {
122  if ((svHealth ^ SatClock) == 0)
123  {
124  s << "unavailable";
125  }
126  else if ((svHealth & 0xff) == 0xff)
127  {
128  s << "failed";
129  }
130  else
131  {
132  s << "reserved";
133  }
134  }
135  else
136  {
137  s << "normal";
138  }
139  s << endl
140  << "B1I signal "
141  << (svHealth & B1ISignalWeak ? "weak" : "normal") << endl
142  << "B2I signal "
143  << (svHealth & B2ISignalWeak ? "weak" : "normal") << endl
144  << "B3I signal "
145  << (svHealth & B3ISignalWeak ? "weak" : "normal") << endl
146  << "Reserved (5) "
147  << (svHealth & 0x10 ? "set" : "unset") << endl
148  << "Reserved (4) "
149  << (svHealth & 0x08 ? "set" : "unset") << endl
150  << "Reserved (3) "
151  << (svHealth & 0x04 ? "set" : "unset") << endl
152  << "Navigation message "
153  << (svHealth & NavMsgBad ? "invalid" : "valid") << endl
154  << "Reserved (1) "
155  << (svHealth & 0x01 ? "set" : "unset") << endl;
156  break;
157  }
158  s.flags(oldFlags);
159  }
160 }
gnsstk::NavData::getSignalString
std::string getSignalString() const
Definition: NavData.cpp:86
gnsstk::BDSD2NavHealth::NavMsgBad
@ NavMsgBad
IOD over limit.
Definition: BDSD2NavHealth.hpp:70
gnsstk::NavData::msgLenSec
double msgLenSec
Definition: NavData.hpp:199
gnsstk::BDSD2NavHealth::getHealth
SVHealth getHealth() const override
Definition: BDSD2NavHealth.cpp:58
gnsstk::NavData::dump
virtual void dump(std::ostream &s, DumpDetail dl) const
Definition: NavData.cpp:79
gnsstk::BDSD2NavHealth::satH1
bool satH1
Ephemeris health (autonomous satellite health flag).
Definition: BDSD2NavHealth.hpp:101
gnsstk::NavData::getDumpTime
std::string getDumpTime(DumpDetail dl, const CommonTime &t) const
Definition: NavData.cpp:145
gnsstk::BDSD2NavHealth::B3ISignalWeak
@ B3ISignalWeak
B3I signal power 10dB+ lower than nominal.
Definition: BDSD2NavHealth.hpp:69
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::BDSD2NavHealth::isAlmHealth
bool isAlmHealth
If true, svHealth is representative, otherwise satH1 is.
Definition: BDSD2NavHealth.hpp:99
gnsstk::SVHealth
SVHealth
Identify different types of SV health states.
Definition: SVHealth.hpp:52
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::NavData::weekFmt
std::string weekFmt
Definition: NavData.hpp:193
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
gnsstk::BDSD2NavHealth::B2ISignalWeak
@ B2ISignalWeak
B2I signal power 10dB+ lower than nominal.
Definition: BDSD2NavHealth.hpp:68
gnsstk::BDSD2NavHealth::svHealth
uint16_t svHealth
9-bit health from subframes 4.
Definition: BDSD2NavHealth.hpp:103
gnsstk::DumpDetail::Full
@ Full
Include all detailed information.
BDSD2NavHealth.hpp
gnsstk::BDSD2NavHealth::dump
void dump(std::ostream &s, DumpDetail dl) const override
Definition: BDSD2NavHealth.cpp:83
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
gnsstk::BDSD2NavHealth::B1ISignalWeak
@ B1ISignalWeak
B1I signal power 10dB+ lower than nominal.
Definition: BDSD2NavHealth.hpp:67
gnsstk::DumpDetail::OneLine
@ OneLine
Limit output to minimal information on a single line.
gnsstk::BDSD2NavHealth::SatClock
@ SatClock
Definition: BDSD2NavHealth.hpp:66
gnsstk::SVHealth::Unhealthy
@ Unhealthy
Satellite is unhealthy and should not be used.
TimeString.hpp


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