GLOFNavHealth_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 "TestUtil.hpp"
40 #include "GLOFNavHealth.hpp"
41 #include "CivilTime.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 }
56 
58 {
59 public:
60  unsigned constructorTest();
61  unsigned getUserTimeTest();
62  unsigned getHealthTest();
63 };
64 
65 
66 unsigned GLOFNavHealth_T ::
68 {
69  TUDEF("GLOFNavHealth", "GLOFNavHealth");
71  TUASSERTE(bool, false, uut.healthBits.is_valid());
72  TUASSERTE(bool, false, uut.ln.is_valid());
73  TUASSERTE(bool, false, uut.Cn.is_valid());
75  uut.signal.messageType);
76  TURETURN();
77 }
78 
79 
80 unsigned GLOFNavHealth_T ::
82 {
83  TUDEF("GLOFNavHealth", "getUserTime");
85  uut.timeStamp = gnsstk::CivilTime(2006, 10, 01, 0, 15, 0,
87  // 1x 2s string
88  gnsstk::CommonTime exp(uut.timeStamp + 2.0);
90  TURETURN();
91 }
92 
93 
94 unsigned GLOFNavHealth_T ::
96 {
97  TUDEF("GLOFNavHealth", "getHealth");
98  gnsstk::GLOFNavHealth uut1, uut2, uut3;
99  // default should be unknown
101  // healthy ephemeris
102  uut1.healthBits = 0;
103  uut1.ln = false;
105  // healthy ephemeris
106  uut1.healthBits = 3;
108  // unhealthy ephemeris
109  uut1.healthBits = 4;
111  // unhealthy ephemeris
112  uut1.healthBits = 0;
113  uut1.ln = true;
115  // healthy almanac
116  uut2.Cn = true;
118  uut2.ln = true;
120  uut2.ln = false;
122  // unhealthy almanac
123  uut2.Cn = false;
125  uut2.ln = true;
127  uut2.ln = false;
129  // healthy string 5
130  uut3.ln = true;
132  // unhealthy string 5
133  uut3.ln = false;
135  TURETURN();
136 }
137 
138 
139 int main()
140 {
141  GLOFNavHealth_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::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
GLOFNavHealth_T
Definition: GLOFNavHealth_T.cpp:57
gnsstk::NavMessageType::Health
@ Health
SV health status information message.
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::GLOFNavHealth::Cn
ValidType< bool > Cn
The C_n health bit in strings 6,8,10,12,14.
Definition: GLOFNavHealth.hpp:82
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::GLOFNavHealth
Definition: GLOFNavHealth.hpp:52
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
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.
main
int main()
Definition: GLOFNavHealth_T.cpp:139
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
GLOFNavHealth_T::getHealthTest
unsigned getHealthTest()
Definition: GLOFNavHealth_T.cpp:95
gnsstk::GLOFNavHealth::healthBits
ValidType< uint8_t > healthBits
The 3-bit B_n value.
Definition: GLOFNavHealth.hpp:80
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::ValidType::is_valid
bool is_valid() const
Definition: ValidType.hpp:96
CivilTime.hpp
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::TimeSystem::GLO
@ GLO
GLONASS system time (aka UTC(SU))
gnsstk::CivilTime
Definition: CivilTime.hpp:55
GLOFNavHealth_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GLOFNavHealth_T.cpp:81
GLOFNavHealth.hpp
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
gnsstk::SVHealth::Unhealthy
@ Unhealthy
Satellite is unhealthy and should not be used.
gnsstk::GLOFNavHealth::getHealth
SVHealth getHealth() const override
Definition: GLOFNavHealth.cpp:128
GLOFNavHealth_T::constructorTest
unsigned constructorTest()
Definition: GLOFNavHealth_T.cpp:67
gnsstk::GLOFNavHealth::ln
ValidType< bool > ln
The l_n health bit in strings 3,5,7,9,11,13,15.
Definition: GLOFNavHealth.hpp:81


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