BDSD1NavAlm_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 "BDSD1NavAlm.hpp"
40 #include "TestUtil.hpp"
41 #include "BDSWeekSecond.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 BDSD1NavAlm_T ::
66 {
67  TUDEF("BDSD1NavAlm", "BDSD1NavAlm");
70  uut.signal.messageType);
71  TUASSERTE(unsigned, 0xff, uut.pnum);
72  TUASSERTFE(0.0, uut.deltai);
73  TUASSERTFE(0.0, uut.toa);
74  TUASSERTE(uint16_t, 0xffff, uut.healthBits);
75  TUASSERTE(bool, false, uut.isDefault);
76  TURETURN();
77 }
78 
79 
80 unsigned BDSD1NavAlm_T ::
82 {
83  TUDEF("BDSD1NavAlm", "getUserTime");
85  uut.timeStamp = gnsstk::BDSWeekSecond(2100,135.0);
87  // almanac = 1 subframes * 6 seconds
88  // We don't take the timestamp of the WNa page into account here.
89  exp = exp + 6.0;
91  TURETURN();
92 }
93 
94 
95 unsigned BDSD1NavAlm_T ::
97 {
98  TUDEF("BDSD1NavAlm", "fixFit");
99  gnsstk::CommonTime expBegin = gnsstk::BDSWeekSecond(2100,135.0);
102  uut.xmitTime = gnsstk::BDSWeekSecond(2100,135.0);
103  TUCATCH(uut.fixFit());
104  TUASSERTE(gnsstk::CommonTime, expBegin, uut.beginFit);
105  TUASSERTE(gnsstk::CommonTime, expEnd, uut.endFit);
106  TURETURN();
107 }
108 
109 
110 unsigned BDSD1NavAlm_T ::
112 {
113  TUDEF("BDSD1NavAlm", "getXvt");
115  gnsstk::Xvt xvt;
117  uut.xmitTime = gnsstk::BDSWeekSecond(1854, .720000000000e+04);
118  uut.Toe = gnsstk::BDSWeekSecond(1854, .143840000000e+05);
119  uut.Toc = gnsstk::CivilTime(2015,7,19,3,59,44.0,gnsstk::TimeSystem::BDT);
121  gnsstk::CivilTime civ(2015,7,19,2,0,35.0,gnsstk::TimeSystem::BDT);
122  TUASSERT(uut.getXvt(civ, xvt));
124  TUASSERTE(gnsstk::RefFrame,expRF,xvt.frame);
125  TURETURN();
126 }
127 
128 
129 int main()
130 {
131  BDSD1NavAlm_T testClass;
132  unsigned errorTotal = 0;
133 
134  errorTotal += testClass.constructorTest();
135  errorTotal += testClass.getUserTimeTest();
136  errorTotal += testClass.fixFitTest();
137  errorTotal += testClass.getXvtTest();
138 
139  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
140  << std::endl;
141 
142  return errorTotal;
143 }
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
BDSD1NavAlm_T::getXvtTest
unsigned getXvtTest()
Definition: BDSD1NavAlm_T.cpp:111
TUCATCH
#define TUCATCH(STATEMENT)
Definition: TestUtil.hpp:193
gnsstk::BDSD1NavAlm::isDefault
bool isDefault
True if the source page was all 0s for orbit.
Definition: BDSD1NavAlm.hpp:82
main
int main()
Definition: BDSD1NavAlm_T.cpp:129
BDSD1NavAlm_T::fixFitTest
unsigned fixFitTest()
Definition: BDSD1NavAlm_T.cpp:96
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::BDSD1NavAlm::fixFit
void fixFit()
Fill the beginFit and endFit values for this object.
Definition: BDSD1NavAlm.cpp:67
gnsstk::Xvt::frame
RefFrame frame
reference frame of this data
Definition: Xvt.hpp:156
gnsstk::BDSD1NavAlm::deltai
double deltai
Inclination in rad relative to 0.3*pi rad.
Definition: BDSD1NavAlm.hpp:79
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::BDSD1NavAlm
Class containing data elements unique to BeiDou D1 almanac pages.
Definition: BDSD1NavAlm.hpp:50
gnsstk::OrbitDataBDS::getXvt
bool getXvt(const CommonTime &when, Xvt &xvt, const ObsID &oid=ObsID()) override
Definition: OrbitDataBDS.hpp:64
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::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::CommonTime::END_OF_TIME
static const GNSSTK_EXPORT CommonTime END_OF_TIME
latest representable CommonTime
Definition: CommonTime.hpp:104
gnsstk::RefFrameRlz::CGCS2000Y2008
@ CGCS2000Y2008
CGCS200 (BDS)
TUASSERT
#define TUASSERT(EXPR)
Definition: TestUtil.hpp:63
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::BDSD1NavAlm::pnum
uint8_t pnum
Almanac page number.
Definition: BDSD1NavAlm.hpp:78
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
BDSD1NavAlm.hpp
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
BDSD1NavAlm_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: BDSD1NavAlm_T.cpp:81
BDSWeekSecond.hpp
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
BDSD1NavAlm_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: BDSD1NavAlm_T.cpp:65
gnsstk::BDSD1NavAlm::healthBits
uint16_t healthBits
9 bits of health from sf5,pg7/8.
Definition: BDSD1NavAlm.hpp:81
gnsstk::BDSWeekSecond
Definition: BDSWeekSecond.hpp:56
gnsstk::OrbitDataKepler::health
SVHealth health
SV health status.
Definition: OrbitDataKepler.hpp:173
gnsstk::BDSD1NavAlm::toa
double toa
Convenience storage of unqualified toa.
Definition: BDSD1NavAlm.hpp:80
BDSD1NavAlm_T
Definition: BDSD1NavAlm_T.cpp:53
gnsstk::TimeSystem::BDT
@ BDT
BeiDou system Time.
gnsstk::NavMessageType::Almanac
@ Almanac
Low-precision orbits for other than the transmitting SV.


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