GPSCNav2Eph_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 "GPSCNav2Eph.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 validateTest();
61  unsigned getXvtTest();
62 };
63 
64 
65 unsigned GPSCNav2Eph_T ::
67 {
68  TUDEF("GPSCNav2Eph", "GPSCNav2Eph");
70  TUASSERTE(bool, true, uut.healthL1C);
71  TUASSERTE(int8_t, -16, uut.uraED);
72  TUASSERTE(int8_t, -16, uut.uraNED0);
73  TUASSERTE(uint8_t, 0, uut.uraNED1);
74  TUASSERTE(uint8_t, 0, uut.uraNED2);
75  TUASSERTE(bool, false, uut.integStat);
76  TUASSERTFE(0, uut.deltaA);
77  TUASSERTFE(0, uut.dOMEGAdot);
79  TUASSERTFE(0, uut.tgd);
80  TUASSERTFE(0, uut.iscL1CP);
81  TUASSERTFE(0, uut.iscL1CD);
83  uut.signal.messageType);
84  TURETURN();
85 }
86 
87 
88 unsigned GPSCNav2Eph_T ::
90 {
91  TUDEF("GPSCNav2Eph", "getUserTime");
93  // just using made-up numbers
94  uut.timeStamp = gnsstk::GPSWeekSecond(2100,135.0);
95  uut.xmitTime = gnsstk::GPSWeekSecond(2100,139.0);
96  // Note that the transmit time and timestamp are typically the
97  // same, but getUserTime() by default uses the timeStamp, which
98  // is present in NavData while xmitTime is not. Therefore, the
99  // expected user time is timeStamp+12 and not xmitTime+12.
100  gnsstk::CommonTime exp(gnsstk::GPSWeekSecond(2100,147.0));
107  TURETURN();
108 }
109 
110 
111 unsigned GPSCNav2Eph_T ::
113 {
114  TUDEF("GPSCNav2Eph", "fixFit");
116  gnsstk::GPSWeekSecond beginExpWS2(2059, 597600), endExpWS2(2060, 3600);
117  gnsstk::CommonTime beginExp2(beginExpWS2), endExp2(endExpWS2);
118  uut.Toe = gnsstk::GPSWeekSecond(2059, 603000);
119  uut.xmitTime = gnsstk::GPSWeekSecond(2059,597600);
120  TUCATCH(uut.fixFit());
121  TUASSERTE(gnsstk::CommonTime, beginExp2, uut.beginFit);
122  TUASSERTE(gnsstk::CommonTime, endExp2, uut.endFit);
123  //uut.dump(std::cerr, gnsstk::OrbitDataKepler::Detail::Full);
124  TURETURN();
125 }
126 
127 
128 unsigned GPSCNav2Eph_T ::
130 {
131  TUDEF("GPSCNav2Data", "validate");
133  TURETURN();
134 }
135 
136 
137 unsigned GPSCNav2Eph_T ::
139 {
140  TUDEF("GPSCNav2Eph", "getXvt");
142  gnsstk::Xvt xvt;
144  uut.xmitTime = gnsstk::GPSWeekSecond(1854, .720000000000e+04);
145  uut.Toe = gnsstk::GPSWeekSecond(1854, .143840000000e+05);
146  uut.Toc = gnsstk::CivilTime(2015,7,19,3,59,44.0,gnsstk::TimeSystem::GPS);
148  gnsstk::CivilTime civ(2015,7,19,2,0,35.0,gnsstk::TimeSystem::GPS);
149  TUASSERT(uut.getXvt(civ, xvt));
151  TUASSERTE(gnsstk::RefFrame,expRF,xvt.frame);
152  TURETURN();
153 }
154 
155 
156 int main()
157 {
158  GPSCNav2Eph_T testClass;
159  unsigned errorTotal = 0;
160 
161  errorTotal += testClass.constructorTest();
162  errorTotal += testClass.getUserTimeTest();
163  errorTotal += testClass.fixFitTest();
164  errorTotal += testClass.validateTest();
165  errorTotal += testClass.getXvtTest();
166 
167  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
168  << std::endl;
169 
170  return errorTotal;
171 }
GPSCNav2Eph.hpp
gnsstk::RefFrameRlz::WGS84G1762
@ WGS84G1762
WGS84, GPS week 1762 version.
gnsstk::NavMessageID
Class used to identify/categorize navigation message data.
Definition: NavMessageID.hpp:52
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
gnsstk::TrackingCode::L1CD
@ L1CD
Modernized GPS L1C civil code tracking (data)
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::NavSatelliteID
Definition: NavSatelliteID.hpp:57
gnsstk::GPSCNav2Eph::uraNED0
int8_t uraNED0
non-elevation dependent URA from clock message.
Definition: GPSCNav2Eph.hpp:88
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::CommonTime::BEGINNING_OF_TIME
static const GNSSTK_EXPORT CommonTime BEGINNING_OF_TIME
earliest representable CommonTime
Definition: CommonTime.hpp:102
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
GPSCNav2Eph_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GPSCNav2Eph_T.cpp:89
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GPSWeekSecond
Definition: GPSWeekSecond.hpp:56
gnsstk::GPSCNav2Eph::top
CommonTime top
Time of prediction.
Definition: GPSCNav2Eph.hpp:94
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
gnsstk::SatelliteSystem::GPS
@ GPS
GPSCNav2Eph_T
Definition: GPSCNav2Eph_T.cpp:53
TUASSERT
#define TUASSERT(EXPR)
Definition: TestUtil.hpp:63
gnsstk::GPSCNav2Eph::uraNED2
uint8_t uraNED2
non-elevation dependent URA from clock message.
Definition: GPSCNav2Eph.hpp:90
TestUtil.hpp
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
gnsstk::GPSCNav2Eph::healthL1C
bool healthL1C
L1C signal health.
Definition: GPSCNav2Eph.hpp:86
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::GPSCNav2Eph::dOMEGAdot
double dOMEGAdot
Rate of right ascension relative to -2.6e-9*pi.
Definition: GPSCNav2Eph.hpp:93
gnsstk::GPSCNav2Eph::uraED
int8_t uraED
5-bit URA index from message type 10.
Definition: GPSCNav2Eph.hpp:87
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::GPSCNav2Eph
Class containing data elements unique to GPS CNav2 ephemerides.
Definition: GPSCNav2Eph.hpp:51
gnsstk::GPSCNav2Eph::iscL1CP
double iscL1CP
Inter-signal correction for L1CP.
Definition: GPSCNav2Eph.hpp:96
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::OrbitDataKepler::Toc
CommonTime Toc
Clock epoch.
Definition: OrbitDataKepler.hpp:172
gnsstk::GPSCNav2Eph::uraNED1
uint8_t uraNED1
non-elevation dependent URA from clock message.
Definition: GPSCNav2Eph.hpp:89
GPSCNav2Eph_T::getXvtTest
unsigned getXvtTest()
Definition: GPSCNav2Eph_T.cpp:138
gnsstk::NavFit::beginFit
CommonTime beginFit
Time at beginning of fit interval.
Definition: NavFit.hpp:54
gnsstk::CarrierBand::L1
@ L1
GPS L1, Galileo E1, SBAS L1, QZSS L1, BeiDou L1.
gnsstk::Xvt
Definition: Xvt.hpp:60
gnsstk::GPSCNav2Eph::tgd
double tgd
Ionospheric group delay in seconds. NaN=invalid.
Definition: GPSCNav2Eph.hpp:95
CivilTime.hpp
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
GPSCNav2Eph_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GPSCNav2Eph_T.cpp:66
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::GPSCNav2Eph::iscL1CD
double iscL1CD
Inter-signal correction for L1CD.
Definition: GPSCNav2Eph.hpp:97
gnsstk::TimeSystem::GPS
@ GPS
GPS system time.
GPSCNav2Eph_T::fixFitTest
unsigned fixFitTest()
Definition: GPSCNav2Eph_T.cpp:112
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
main
int main()
Definition: GPSCNav2Eph_T.cpp:156
gnsstk::NavMessageType::Ephemeris
@ Ephemeris
Precision orbits for the transmitting SV.
gnsstk::GPSCNav2Eph::integStat
bool integStat
Integrity status flag.
Definition: GPSCNav2Eph.hpp:91
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
GPSCNav2Eph_T::validateTest
unsigned validateTest()
Definition: GPSCNav2Eph_T.cpp:129
gnsstk::GPSCNav2Eph::fixFit
void fixFit()
Definition: GPSCNav2Eph.cpp:81
gnsstk::OrbitDataKepler::health
SVHealth health
SV health status.
Definition: OrbitDataKepler.hpp:173
gnsstk::NavType::GPSCNAV2
@ GPSCNAV2
gnsstk::GPSCNav2Eph::deltaA
double deltaA
Semi-major axis relative to reference (Aref).
Definition: GPSCNav2Eph.hpp:92


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