GalINavHealth.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 "GalINavHealth.hpp"
40 
41 using namespace std;
42 
43 namespace gnsstk
44 {
45  GalINavHealth ::
46  GalINavHealth()
47  : sigHealthStatus(GalHealthStatus::Unknown),
48  dataValidityStatus(GalDataValid::Unknown),
49  sisaIndex(255)
50  {
54  weekFmt = "%4L(%4l)";
55  msgLenSec = 2.0;
56  }
57 
58 
59  void GalINavHealth ::
60  dump(std::ostream& s, DumpDetail dl) const
61  {
62  const ios::fmtflags oldFlags = s.flags();
63  s.setf(ios::fixed, ios::floatfield);
64  s.setf(ios::right, ios::adjustfield);
65  s.setf(ios::uppercase);
66  s.precision(0);
67  s.fill(' ');
68  switch (dl)
69  {
71  NavData::dump(s,dl);
72  break;
73  case DumpDetail::Brief:
74  NavData::dump(s,dl);
75  s << " sigHealthStatus = "
76  << static_cast<unsigned>(sigHealthStatus)
78  << " dataValidityStatus = "
79  << static_cast<unsigned>(dataValidityStatus)
81  << endl
82  << " sigInSpaceAcc = " << static_cast<unsigned>(sisaIndex) <<endl
83  << " health = " << gnsstk::StringUtils::asString(getHealth())
84  << endl;
85  break;
86  case DumpDetail::Full:
87  // "header"
88  s << "*************************************************************"
89  << "***************" << endl
90  << "Satellite Health"
91  << endl
92  << endl
93  << getSignalString() << endl
94  << " TIMES OF INTEREST"
95  << endl << endl
96  << " " << getDumpTimeHdr(dl) << endl
97  << "Transmit: " << getDumpTime(dl, timeStamp) << endl
98  << endl
99  << " HEALTH DATA" << endl
100  << "SHS Bits 0x" << hex << setw(1)
101  << static_cast<unsigned>(sigHealthStatus) << dec << " ("
102  << StringUtils::asString(sigHealthStatus) << ")" << endl
103  << "DVS Bits 0x" << hex << setw(1)
104  << static_cast<unsigned>(dataValidityStatus) << dec << " ("
105  << StringUtils::asString(dataValidityStatus) << ")" << endl
106  << "SISA Index " << dec
107  << static_cast<unsigned>(sisaIndex) << endl
108  << "Status " << StringUtils::asString(getHealth())
109  << endl << endl;
110  break;
111  }
112  s.flags(oldFlags);
113  }
114 
115 
117  getHealth() const
118  {
120  }
121 
122 
124  galHealth(GalHealthStatus shs, GalDataValid dvs, uint8_t sisa)
125  {
126  // This logic corresponds to Table 6 and Figure 4 of Galileo
127  // Open Signal System Description Document (Galileo-OS-SDD
128  // v1.1).
129  // Note that what the OS-SDD refers to as "marginal", our
130  // enumeration name is "Degraded".
131  switch (shs)
132  {
135  return SVHealth::Unhealthy;
137  return SVHealth::Degraded;
138  case GalHealthStatus::OK:
139  switch (dvs)
140  {
142  return SVHealth::Degraded;
143  case GalDataValid::Valid:
144  if (sisa == 255)
145  return SVHealth::Degraded;
146  else if (sisa < 255)
147  return SVHealth::Healthy;
148  else
149  return SVHealth::Unknown;
150  default:
151  return SVHealth::Unknown;
152  }
153  default:
154  return SVHealth::Unknown;
155  }
156  }
157 }
gnsstk::NavData::getSignalString
std::string getSignalString() const
Definition: NavData.cpp:86
gnsstk::GalINavHealth::sisaIndex
uint8_t sisaIndex
Signal in space accuracy index (OS-SIS-ICD tbl 76)
Definition: GalINavHealth.hpp:97
gnsstk::NavData::msgLenSec
double msgLenSec
Definition: NavData.hpp:199
gnsstk::GalDataValid::Valid
@ Valid
Navigation data valid.
gnsstk::GalDataValid
GalDataValid
Identify Galileo Data Validity Status (DVS) states.
Definition: GalDataValid.hpp:51
gnsstk::NavData::dump
virtual void dump(std::ostream &s, DumpDetail dl) const
Definition: NavData.cpp:79
gnsstk::GalINavHealth::sigHealthStatus
GalHealthStatus sigHealthStatus
Signal health status (SHS)
Definition: GalINavHealth.hpp:93
gnsstk::NavData::getDumpTime
std::string getDumpTime(DumpDetail dl, const CommonTime &t) const
Definition: NavData.cpp:145
GalINavHealth.hpp
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::SVHealth::Degraded
@ Degraded
Satellite is in a degraded state. Use at your own risk.
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::IonexStoreStrategy::Unknown
@ Unknown
Unknown or uninitialized stategy value.
gnsstk::GalINavHealth::dataValidityStatus
GalDataValid dataValidityStatus
Data Validity Status (DVS)
Definition: GalINavHealth.hpp:95
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::GalINavHealth::getHealth
SVHealth getHealth() const override
Definition: GalINavHealth.cpp:117
gnsstk::NavData::weekFmt
std::string weekFmt
Definition: NavData.hpp:193
gnsstk::SVHealth::Unknown
@ Unknown
Health is not known or is uninitialized.
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
gnsstk::GalHealthStatus::InTest
@ InTest
Signal Component currently in Test.
gnsstk::GalHealthStatus::OK
@ OK
Signal OK.
gnsstk::DumpDetail::Full
@ Full
Include all detailed information.
gnsstk::DumpDetail
DumpDetail
Specify level of detail for dump output.
Definition: DumpDetail.hpp:51
gnsstk::GalHealthStatus::WillBeOOS
@ WillBeOOS
Signal will be out of service.
gnsstk::DumpDetail::Brief
@ Brief
Limit output to <= 5 lines of minimal information.
std
Definition: Angle.hpp:142
gnsstk::GalDataValid::NoGuarantee
@ NoGuarantee
Working without guarantee.
gnsstk::DumpDetail::OneLine
@ OneLine
Limit output to minimal information on a single line.
gnsstk::GalHealthStatus
GalHealthStatus
Identify different types of SV health states.
Definition: GalHealthStatus.hpp:51
gnsstk::GalHealthStatus::OutOfService
@ OutOfService
Signal out of service.
gnsstk::SVHealth::Unhealthy
@ Unhealthy
Satellite is unhealthy and should not be used.
gnsstk::GalINavHealth::galHealth
static SVHealth galHealth(GalHealthStatus shs, GalDataValid dvs, uint8_t sisa)
Definition: GalINavHealth.cpp:124
gnsstk::GalINavHealth::dump
void dump(std::ostream &s, DumpDetail dl) const override
Definition: GalINavHealth.cpp:60


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