GPSCNavAlm_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 "GPSCNavAlm.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 GPSCNavAlm_T ::
66 {
67  TUDEF("GPSCNavAlm", "GPSCNavAlm");
70  uut.signal.messageType);
71  TUASSERTE(bool, true, uut.healthL1);
72  TUASSERTE(bool, true, uut.healthL2);
73  TUASSERTE(bool, true, uut.healthL5);
74  TUASSERTFE(0, uut.deltai);
75  TUASSERTE(unsigned, 0, uut.wna);
76  TUASSERTFE(0, uut.toa);
77  TURETURN();
78 }
79 
80 
81 unsigned GPSCNavAlm_T ::
83 {
84  TUDEF("GPSCNavAlm", "getUserTime");
86  // L2 has a 12s cadence, L5 has a 6s cadence
87  gnsstk::CommonTime expL2(gnsstk::GPSWeekSecond(2100,147.0));
88  gnsstk::CommonTime expL5(gnsstk::GPSWeekSecond(2100,141.0));
89  uut.timeStamp = gnsstk::GPSWeekSecond(2100,135.0);
102  TURETURN();
103 }
104 
105 
106 unsigned GPSCNavAlm_T ::
108 {
109  TUDEF("GPSCNavAlm", "fixFit");
110  gnsstk::CommonTime toa = gnsstk::GPSWeekSecond(2100,135.0);
111  gnsstk::CommonTime xmit = gnsstk::GPSWeekSecond(2099,604000.0);
112  gnsstk::CommonTime expBegin = xmit;
114  gnsstk::GPSCNavAlm uut;
115  uut.Toe = toa;
116  uut.xmitTime = xmit;
117  TUCATCH(uut.fixFit());
118  TUASSERTE(gnsstk::CommonTime, expBegin, uut.beginFit);
119  TUASSERTE(gnsstk::CommonTime, expEnd, uut.endFit);
120  TURETURN();
121 }
122 
123 
124 unsigned GPSCNavAlm_T ::
126 {
127  TUDEF("GPSCNavAlm", "getXvt");
128  gnsstk::GPSCNavAlm uut;
129  gnsstk::Xvt xvt;
131  uut.xmitTime = gnsstk::GPSWeekSecond(1854, .720000000000e+04);
132  uut.Toe = gnsstk::GPSWeekSecond(1854, .143840000000e+05);
133  uut.Toc = gnsstk::CivilTime(2015,7,19,3,59,44.0,gnsstk::TimeSystem::GPS);
135  gnsstk::CivilTime civ(2015,7,19,2,0,35.0,gnsstk::TimeSystem::GPS);
136  TUASSERT(uut.getXvt(civ, xvt));
138  TUASSERTE(gnsstk::RefFrame,expRF,xvt.frame);
139  TURETURN();
140 }
141 
142 
143 int main()
144 {
145  GPSCNavAlm_T testClass;
146  unsigned errorTotal = 0;
147 
148  errorTotal += testClass.constructorTest();
149  errorTotal += testClass.getUserTimeTest();
150  errorTotal += testClass.fixFitTest();
151  errorTotal += testClass.getXvtTest();
152 
153  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
154  << std::endl;
155 
156  return errorTotal;
157 }
gnsstk::GPSCNavAlm::healthL2
bool healthL2
L2 signal health from message type 10.
Definition: GPSCNavAlm.hpp:86
gnsstk::RefFrameRlz::WGS84G1762
@ WGS84G1762
WGS84, GPS week 1762 version.
gnsstk::NavMessageID
Class used to identify/categorize navigation message data.
Definition: NavMessageID.hpp:52
main
int main()
Definition: GPSCNavAlm_T.cpp:143
GPSCNavAlm_T::getXvtTest
unsigned getXvtTest()
Definition: GPSCNavAlm_T.cpp:125
gnsstk::OrbitDataGPS::getXvt
bool getXvt(const CommonTime &when, Xvt &xvt, const ObsID &oid=ObsID()) override
Definition: OrbitDataGPS.hpp:64
gnsstk::GPSCNavAlm::healthL5
bool healthL5
L5 signal health from message type 10.
Definition: GPSCNavAlm.hpp:87
TUCATCH
#define TUCATCH(STATEMENT)
Definition: TestUtil.hpp:193
GPSCNavAlm_T
Definition: GPSCNavAlm_T.cpp:53
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::GPSCNavAlm::healthL1
bool healthL1
L1 signal health from message type 10.
Definition: GPSCNavAlm.hpp:85
gnsstk::Xvt::frame
RefFrame frame
reference frame of this data
Definition: Xvt.hpp:156
gnsstk::TrackingCode::L5I
@ L5I
Modernized GPS L5 civil in-phase.
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
GPSCNavAlm_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GPSCNavAlm_T.cpp:65
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
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::CarrierBand::L2
@ L2
GPS L2, QZSS L2.
gnsstk::GPSCNavAlm::wna
unsigned wna
Reference week for toa.
Definition: GPSCNavAlm.hpp:89
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
gnsstk::SatelliteSystem::GPS
@ GPS
gnsstk::CommonTime::END_OF_TIME
static const GNSSTK_EXPORT CommonTime END_OF_TIME
latest representable CommonTime
Definition: CommonTime.hpp:104
TUASSERT
#define TUASSERT(EXPR)
Definition: TestUtil.hpp:63
GPSCNavAlm.hpp
TestUtil.hpp
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
gnsstk::GPSCNavAlm::deltai
double deltai
Inclination in rad relative to 0.3*pi rad.
Definition: GPSCNavAlm.hpp:88
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
GPSCNavAlm_T::fixFitTest
unsigned fixFitTest()
Definition: GPSCNavAlm_T.cpp:107
gnsstk::NavType::GPSCNAVL2
@ GPSCNAVL2
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
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
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::GPSCNavAlm::getUserTime
CommonTime getUserTime() const override
Definition: GPSCNavAlm.cpp:66
gnsstk::TrackingCode::L2CM
@ L2CM
Modernized GPS L2 civil M code.
gnsstk::GPSCNavAlm
Class containing data elements unique to GPS CNav midi almanac.
Definition: GPSCNavAlm.hpp:50
gnsstk::TimeSystem::GPS
@ GPS
GPS system time.
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
gnsstk::GPSCNavAlm::fixFit
void fixFit()
Fill the beginFit and endFit values for this object.
Definition: GPSCNavAlm.cpp:75
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
gnsstk::OrbitDataKepler::health
SVHealth health
SV health status.
Definition: OrbitDataKepler.hpp:173
GPSCNavAlm_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GPSCNavAlm_T.cpp:82
gnsstk::NavType::GPSCNAVL5
@ GPSCNAVL5
gnsstk::NavMessageType::Almanac
@ Almanac
Low-precision orbits for other than the transmitting SV.
gnsstk::GPSCNavAlm::toa
double toa
Convenience storage of unqualified toa.
Definition: GPSCNavAlm.hpp:90
gnsstk::CarrierBand::L5
@ L5
GPS L5, Galileo E5a, SBAS L5, QZSS L5, BeiDou B2a, NavIC L5.


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