GalFNavEph_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 "GalFNavEph.hpp"
40 #include "TestUtil.hpp"
41 #include "GALWeekSecond.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  std::ostream& operator<<(std::ostream& s, gnsstk::GalHealthStatus e)
53  {
54  s << StringUtils::asString(e);
55  return s;
56  }
57 
58  std::ostream& operator<<(std::ostream& s, gnsstk::GalDataValid e)
59  {
60  s << StringUtils::asString(e);
61  return s;
62  }
63 }
64 
66 {
67 public:
69  unsigned constructorTest();
70  unsigned getUserTimeTest();
71  unsigned fixFitTest();
72  unsigned getXvtTest();
73 };
74 
75 
76 unsigned GalFNavEph_T ::
78 {
79  TUDEF("GalFNavEph", "GalFNavEph");
81  TUASSERTFE(0.0, uut.bgdE5aE1);
82  TUASSERTE(unsigned, 255, uut.sisaIndex);
83  TUASSERTE(unsigned, 0, uut.svid);
87  TUASSERTE(uint16_t, 0, uut.iodnav1);
88  TUASSERTE(uint16_t, 0, uut.iodnav2);
89  TUASSERTE(uint16_t, 0, uut.iodnav3);
90  TUASSERTE(uint16_t, 0, uut.iodnav4);
94  uut.signal.messageType);
95  TUASSERTE(uint16_t, 0, uut.wn1);
96  TUASSERTE(uint32_t, 0, uut.tow1);
97  TUASSERTE(uint16_t, 0, uut.wn2);
98  TUASSERTE(uint32_t, 0, uut.tow2);
99  TUASSERTE(uint16_t, 0, uut.wn3);
100  TUASSERTE(uint32_t, 0, uut.tow3);
101  TUASSERTE(uint32_t, 0, uut.tow4);
102  TURETURN();
103 }
104 
105 
106 unsigned GalFNavEph_T ::
108 {
109  TUDEF("GalFNavEph", "getUserTime");
110  gnsstk::GalFNavEph uut;
111  // just using made-up numbers
112  uut.timeStamp = gnsstk::GALWeekSecond(2100,135.0);
113  uut.xmitTime = gnsstk::GALWeekSecond(2100,139.0);
114  uut.xmit2 = gnsstk::GALWeekSecond(2100,200.0);
115  uut.xmit3 = gnsstk::GALWeekSecond(2100,1.0);
116  uut.xmit4 = gnsstk::GALWeekSecond(2100,7.0);
117  gnsstk::CommonTime exp(gnsstk::GALWeekSecond(2100,210.0));
119  TURETURN();
120 }
121 
122 
123 unsigned GalFNavEph_T ::
125 {
126  TUDEF("GalFNavEph", "fixFit");
127  gnsstk::GalFNavEph uut;
128  gnsstk::GALWeekSecond beginExpWS2(2059, 597600), endExpWS2(2060, 12600);
129  gnsstk::CommonTime beginExp2(beginExpWS2), endExp2(endExpWS2);
130  uut.Toe = gnsstk::GALWeekSecond(2059, 603000);
131  uut.xmitTime = gnsstk::GALWeekSecond(2059,597600);
132  TUCATCH(uut.fixFit());
133  TUASSERTE(gnsstk::CommonTime, beginExp2, uut.beginFit);
134  TUASSERTE(gnsstk::CommonTime, endExp2, uut.endFit);
135  //uut.dump(std::cerr, gnsstk::OrbitDataKepler::Detail::Full);
136  TURETURN();
137 }
138 
139 
140 unsigned GalFNavEph_T ::
142 {
143  TUDEF("GalFNavEph", "getXvt");
144  gnsstk::GalFNavEph uut;
145  gnsstk::Xvt xvt;
147  uut.xmitTime = gnsstk::GALWeekSecond(1854, .720000000000e+04);
148  uut.Toe = gnsstk::GALWeekSecond(1854, .143840000000e+05);
149  uut.Toc = gnsstk::CivilTime(2015,7,19,3,59,44.0,gnsstk::TimeSystem::GAL);
151  gnsstk::CivilTime civ(2015,7,19,2,0,35.0,gnsstk::TimeSystem::GAL);
152  TUASSERT(uut.getXvt(civ, xvt));
154  TUASSERTE(gnsstk::RefFrame,expRF,xvt.frame);
155  TURETURN();
156 }
157 
158 
159 int main()
160 {
161  GalFNavEph_T testClass;
162  unsigned errorTotal = 0;
163 
164  errorTotal += testClass.constructorTest();
165  errorTotal += testClass.getUserTimeTest();
166  errorTotal += testClass.fixFitTest();
167  errorTotal += testClass.getXvtTest();
168 
169  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
170  << std::endl;
171 
172  return errorTotal;
173 }
gnsstk::GalFNavEph::iodnav2
uint16_t iodnav2
IODnav for page type 2.
Definition: GalFNavEph.hpp:92
gnsstk::GalFNavEph::getUserTime
CommonTime getUserTime() const override
Definition: GalFNavEph.cpp:75
gnsstk::GalDataValid
GalDataValid
Identify Galileo Data Validity Status (DVS) states.
Definition: GalDataValid.hpp:51
gnsstk::RefFrameRlz::ITRF2014
@ ITRF2014
ITRF, 2014 version.
TUCATCH
#define TUCATCH(STATEMENT)
Definition: TestUtil.hpp:193
gnsstk::GalFNavEph::bgdE5aE1
double bgdE5aE1
Group delay in seconds between E5a and E1.
Definition: GalFNavEph.hpp:85
gnsstk::GalFNavEph::wn1
uint16_t wn1
GST WN (week number) for page type 1.
Definition: GalFNavEph.hpp:97
gnsstk::GalFNavEph::dvsE5a
GalDataValid dvsE5a
Data validity status for E5a.
Definition: GalFNavEph.hpp:96
main
int main()
Definition: GalFNavEph_T.cpp:159
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::GalFNavEph::sisaIndex
uint8_t sisaIndex
Signal in space accuracy index (OS-SIS-ICD tbl 76)
Definition: GalFNavEph.hpp:86
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::GALWeekSecond
Definition: GALWeekSecond.hpp:56
gnsstk::GalDataValid::Unknown
@ Unknown
Health is not known or is uninitialized.
GalFNavEph.hpp
gnsstk::GalFNavEph::iodnav4
uint16_t iodnav4
IODnav for page type 4.
Definition: GalFNavEph.hpp:94
gnsstk::GalFNavEph::xmit2
CommonTime xmit2
Transmit time for page type 2.
Definition: GalFNavEph.hpp:88
gnsstk::OrbitDataKepler::Toe
CommonTime Toe
Orbit epoch.
Definition: OrbitDataKepler.hpp:171
GalFNavEph_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GalFNavEph_T.cpp:107
gnsstk::RefFrame
Definition: RefFrame.hpp:53
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
gnsstk::GalFNavEph::svid
uint8_t svid
Definition: GalFNavEph.hpp:87
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GalFNavEph::xmit3
CommonTime xmit3
Transmit time for page type 3.
Definition: GalFNavEph.hpp:89
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
GalFNavEph_T::fixFitTest
unsigned fixFitTest()
Definition: GalFNavEph_T.cpp:124
gnsstk::GalFNavEph::hsE5a
GalHealthStatus hsE5a
Health status for E5a.
Definition: GalFNavEph.hpp:95
TUASSERT
#define TUASSERT(EXPR)
Definition: TestUtil.hpp:63
TestUtil.hpp
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
gnsstk::GalFNavEph::xmit4
CommonTime xmit4
Transmit time for page type 4.
Definition: GalFNavEph.hpp:90
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
GalFNavEph_T
Definition: GalFNavEph_T.cpp:65
gnsstk::TimeSystem::GAL
@ GAL
Galileo system time.
GalFNavEph_T::getXvtTest
unsigned getXvtTest()
Definition: GalFNavEph_T.cpp:141
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::GalFNavEph::fixFit
void fixFit()
Definition: GalFNavEph.cpp:103
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::GalFNavEph::wn3
uint16_t wn3
GST WN (week number) for page type 3.
Definition: GalFNavEph.hpp:101
gnsstk::GalFNavEph::tow2
uint32_t tow2
GST TOW (time of week) for page type 2.
Definition: GalFNavEph.hpp:100
gnsstk::OrbitDataGal::getXvt
bool getXvt(const CommonTime &when, Xvt &xvt, const ObsID &oid=ObsID()) override
Definition: OrbitDataGal.hpp:64
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::GalFNavEph::tow3
uint32_t tow3
GST TOW (time of week) for page type 3.
Definition: GalFNavEph.hpp:102
gnsstk::CivilTime
Definition: CivilTime.hpp:55
gnsstk::GalFNavEph::iodnav1
uint16_t iodnav1
IODnav for page type 1.
Definition: GalFNavEph.hpp:91
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
gnsstk::NavMessageType::Ephemeris
@ Ephemeris
Precision orbits for the transmitting SV.
gnsstk::GalFNavEph::tow4
uint32_t tow4
GST TOW (time of week) for page type 4.
Definition: GalFNavEph.hpp:103
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
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::GalFNavEph::wn2
uint16_t wn2
GST WN (week number) for page type 2.
Definition: GalFNavEph.hpp:99
gnsstk::GalFNavEph::tow1
uint32_t tow1
GST TOW (time of week) for page type 1.
Definition: GalFNavEph.hpp:98
gnsstk::GalFNavEph
Class containing data elements unique to Galileo F/NAV ephemerides.
Definition: GalFNavEph.hpp:52
gnsstk::OrbitDataKepler::health
SVHealth health
SV health status.
Definition: OrbitDataKepler.hpp:173
GALWeekSecond.hpp
GalFNavEph_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GalFNavEph_T.cpp:77
gnsstk::GalFNavEph::iodnav3
uint16_t iodnav3
IODnav for page type 3.
Definition: GalFNavEph.hpp:93


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