GalINavHealth_T.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 #include "TestUtil.hpp"
41 #include "GPSWeekSecond.hpp"
42 
43 namespace gnsstk
44 {
45  std::ostream& operator<<(std::ostream& s, gnsstk::NavMessageType e)
46  {
47  s << StringUtils::asString(e);
48  return s;
49  }
50  std::ostream& operator<<(std::ostream& s, gnsstk::SVHealth e)
51  {
52  s << StringUtils::asString(e);
53  return s;
54  }
55  std::ostream& operator<<(std::ostream& s, gnsstk::GalHealthStatus e)
56  {
57  s << StringUtils::asString(e);
58  return s;
59  }
60  std::ostream& operator<<(std::ostream& s, gnsstk::GalDataValid e)
61  {
62  s << StringUtils::asString(e);
63  return s;
64  }
65 }
66 
68 {
69 public:
71  unsigned constructorTest();
72  unsigned getUserTimeTest();
74  unsigned getHealthTest();
75 };
76 
77 
78 unsigned GalINavHealth_T ::
80 {
81  TUDEF("GalINavHealth", "GalINavHealth");
84  uut.sigHealthStatus);
86  uut.dataValidityStatus);
87  TUASSERTE(unsigned, 255, uut.sisaIndex);
89  uut.signal.messageType);
90  TURETURN();
91 }
92 
93 
94 unsigned GalINavHealth_T ::
96 {
97  TUDEF("GalINavHealth", "getUserTime");
99  uut.timeStamp = gnsstk::GPSWeekSecond(2100,135.0);
100  gnsstk::CommonTime exp(gnsstk::GPSWeekSecond(2100,135.0));
101  exp = exp + 2.0;
103  TURETURN();
104 }
105 
106 
107 unsigned GalINavHealth_T ::
109 {
110  TUDEF("GalINavHealth", "getHealth");
112  // default should be unknown
126  uut.sisaIndex = 255;
128  uut.sisaIndex = 254;
130  uut.sisaIndex = 0;
134 
135  TURETURN();
136 }
137 
138 
139 int main()
140 {
141  GalINavHealth_T testClass;
142  unsigned errorTotal = 0;
143 
144  errorTotal += testClass.constructorTest();
145  errorTotal += testClass.getUserTimeTest();
146  errorTotal += testClass.getHealthTest();
147 
148  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
149  << std::endl;
150 
151  return errorTotal;
152 }
gnsstk::GalINavHealth::sisaIndex
uint8_t sisaIndex
Signal in space accuracy index (OS-SIS-ICD tbl 76)
Definition: GalINavHealth.hpp:97
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
gnsstk::GalDataValid::Valid
@ Valid
Navigation data valid.
gnsstk::GalDataValid
GalDataValid
Identify Galileo Data Validity Status (DVS) states.
Definition: GalDataValid.hpp:51
main
int main()
Definition: GalINavHealth_T.cpp:139
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
gnsstk::GalINavHealth::sigHealthStatus
GalHealthStatus sigHealthStatus
Signal health status (SHS)
Definition: GalINavHealth.hpp:93
GalINavHealth_T::getHealthTest
unsigned getHealthTest()
explicitly test getHealth, implicitly test galHealth
Definition: GalINavHealth_T.cpp:108
gnsstk::NavMessageType::Health
@ Health
SV health status information message.
GalINavHealth.hpp
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::GalDataValid::Unknown
@ Unknown
Health is not known or is uninitialized.
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::SVHealth::Degraded
@ Degraded
Satellite is in a degraded state. Use at your own risk.
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GalINavHealth::dataValidityStatus
GalDataValid dataValidityStatus
Data Validity Status (DVS)
Definition: GalINavHealth.hpp:95
gnsstk::GPSWeekSecond
Definition: GPSWeekSecond.hpp:56
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::GalINavHealth::getHealth
SVHealth getHealth() const override
Definition: GalINavHealth.cpp:117
gnsstk::SVHealth::Unknown
@ Unknown
Health is not known or is uninitialized.
TestUtil.hpp
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::GalHealthStatus::InTest
@ InTest
Signal Component currently in Test.
gnsstk::GalHealthStatus::OK
@ OK
Signal OK.
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
GalINavHealth_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GalINavHealth_T.cpp:79
gnsstk::GalINavHealth
Definition: GalINavHealth.hpp:53
GPSWeekSecond.hpp
gnsstk::GalHealthStatus::WillBeOOS
@ WillBeOOS
Signal will be out of service.
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
gnsstk::GalDataValid::NoGuarantee
@ NoGuarantee
Working without guarantee.
gnsstk::GalHealthStatus::Unknown
@ Unknown
Health is not known or is uninitialized.
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.
GalINavHealth_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GalINavHealth_T.cpp:95
GalINavHealth_T
Definition: GalINavHealth_T.cpp:67


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