GPSLNavAlm_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 "GPSLNavAlm.hpp"
40 #include "TestUtil.hpp"
41 #include "GPSWeekSecond.hpp"
42 #include "CivilTime.hpp"
43 
44 namespace gnsstk
45 {
46  std::ostream& operator<<(std::ostream& s, gnsstk::NavMessageType e)
47  {
48  s << StringUtils::asString(e);
49  return s;
50  }
51 }
52 
54 {
55 public:
57  unsigned constructorTest();
58  unsigned getUserTimeTest();
59  unsigned fixFitTest();
60  unsigned getXvtTest();
61 };
62 
63 
64 unsigned GPSLNavAlm_T ::
66 {
67  TUDEF("GPSLNavAlm", "GPSLNavAlm");
70  uut.signal.messageType);
71  TUASSERTE(uint8_t, 0xff, uut.healthBits);
72  TUASSERTFE(0.0, uut.deltai);
73  TUASSERTFE(0.0, uut.toa);
74  TURETURN();
75 }
76 
77 
78 unsigned GPSLNavAlm_T ::
80 {
81  TUDEF("GPSLNavAlm", "getUserTime");
83  uut.timeStamp = gnsstk::GPSWeekSecond(2100,135.0);
85  // almanac = 1 subframes * 6 seconds
86  exp = exp + 6.0;
88  TURETURN();
89 }
90 
91 
92 unsigned GPSLNavAlm_T ::
94 {
95  TUDEF("GPSLNavAlm", "fixFit");
96  gnsstk::CommonTime toa = gnsstk::GPSWeekSecond(2100,135.0);
97  gnsstk::CommonTime expBegin = toa - (70.0 * 3600.0);
98  gnsstk::CommonTime expEnd = toa + (74.0 * 3600.0);
100  uut.Toe = toa;
101  TUCATCH(uut.fixFit());
102  TUASSERTE(gnsstk::CommonTime, expBegin, uut.beginFit);
103  TUASSERTE(gnsstk::CommonTime, expEnd, uut.endFit);
104  TURETURN();
105 }
106 
107 
108 unsigned GPSLNavAlm_T ::
110 {
111  TUDEF("GPSLNavAlm", "getXvt");
112  gnsstk::GPSLNavAlm uut;
113  gnsstk::Xvt xvt;
115  uut.xmitTime = gnsstk::GPSWeekSecond(1854, .720000000000e+04);
116  uut.Toe = gnsstk::GPSWeekSecond(1854, .143840000000e+05);
117  uut.Toc = gnsstk::CivilTime(2015,7,19,3,59,44.0,gnsstk::TimeSystem::GPS);
119  gnsstk::CivilTime civ(2015,7,19,2,0,35.0,gnsstk::TimeSystem::GPS);
120  TUASSERT(uut.getXvt(civ, xvt));
122  TUASSERTE(gnsstk::RefFrame,expRF,xvt.frame);
123  TURETURN();
124 }
125 
126 
127 int main()
128 {
129  GPSLNavAlm_T testClass;
130  unsigned errorTotal = 0;
131 
132  errorTotal += testClass.constructorTest();
133  errorTotal += testClass.getUserTimeTest();
134  errorTotal += testClass.fixFitTest();
135  errorTotal += testClass.getXvtTest();
136 
137  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
138  << std::endl;
139 
140  return errorTotal;
141 }
gnsstk::RefFrameRlz::WGS84G1762
@ WGS84G1762
WGS84, GPS week 1762 version.
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
GPSLNavAlm_T
Definition: GPSLNavAlm_T.cpp:53
gnsstk::OrbitDataGPS::getXvt
bool getXvt(const CommonTime &when, Xvt &xvt, const ObsID &oid=ObsID()) override
Definition: OrbitDataGPS.hpp:64
TUCATCH
#define TUCATCH(STATEMENT)
Definition: TestUtil.hpp:193
gnsstk::Xvt::Healthy
@ Healthy
Satellite is healthy, PVT valid.
Definition: Xvt.hpp:96
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
gnsstk::Xvt::frame
RefFrame frame
reference frame of this data
Definition: Xvt.hpp:156
gnsstk::NavFit::endFit
CommonTime endFit
Time at end of fit interval.
Definition: NavFit.hpp:55
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::GPSLNavAlm::toa
double toa
Convenience storage of unqualified toa.
Definition: GPSLNavAlm.hpp:80
gnsstk::OrbitDataKepler::Toe
CommonTime Toe
Orbit epoch.
Definition: OrbitDataKepler.hpp:171
gnsstk::RefFrame
Definition: RefFrame.hpp:53
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
GPSLNavAlm_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GPSLNavAlm_T.cpp:79
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
main
int main()
Definition: GPSLNavAlm_T.cpp:127
gnsstk::GPSWeekSecond
Definition: GPSWeekSecond.hpp:56
gnsstk::OrbitDataKepler::xmitTime
CommonTime xmitTime
Time of transmission of the start of the data.
Definition: OrbitDataKepler.hpp:170
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
TUASSERT
#define TUASSERT(EXPR)
Definition: TestUtil.hpp:63
GPSLNavAlm_T::getXvtTest
unsigned getXvtTest()
Definition: GPSLNavAlm_T.cpp:109
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::OrbitDataKepler::Toc
CommonTime Toc
Clock epoch.
Definition: OrbitDataKepler.hpp:172
gnsstk::NavFit::beginFit
CommonTime beginFit
Time at beginning of fit interval.
Definition: NavFit.hpp:54
gnsstk::Xvt
Definition: Xvt.hpp:60
CivilTime.hpp
GPSLNavAlm_T::fixFitTest
unsigned fixFitTest()
Definition: GPSLNavAlm_T.cpp:93
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::GPSLNavAlm::fixFit
void fixFit()
Fill the beginFit and endFit values for this object.
Definition: GPSLNavAlm.cpp:65
gnsstk::GPSLNavAlm::deltai
double deltai
Inclination in rad relative to 0.3*pi rad.
Definition: GPSLNavAlm.hpp:79
gnsstk::Xvt::HealthStatus
HealthStatus
Definition: Xvt.hpp:87
gnsstk::Xvt::health
HealthStatus health
Health status of satellite at ref time.
Definition: Xvt.hpp:157
gnsstk::CivilTime
Definition: CivilTime.hpp:55
GPSWeekSecond.hpp
gnsstk::TimeSystem::GPS
@ GPS
GPS system time.
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
GPSLNavAlm_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GPSLNavAlm_T.cpp:65
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
gnsstk::OrbitDataKepler::health
SVHealth health
SV health status.
Definition: OrbitDataKepler.hpp:173
gnsstk::GPSLNavAlm::healthBits
uint8_t healthBits
8 SV health bits.
Definition: GPSLNavAlm.hpp:78
GPSLNavAlm.hpp
gnsstk::GPSLNavAlm
Class containing data elements unique to GPS LNav almanac pages.
Definition: GPSLNavAlm.hpp:50
gnsstk::NavMessageType::Almanac
@ Almanac
Low-precision orbits for other than the transmitting SV.


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