GLOFNavISC_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 <math.h>
40 #include "GLOFNavISC.hpp"
41 #include "TestUtil.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 
53 
55 {
56 public:
58  : oid1(gnsstk::ObservationType::Unknown,
59  gnsstk::CarrierBand::G1,
60  gnsstk::TrackingCode::Standard),
61  oid2(gnsstk::ObservationType::Unknown,
62  gnsstk::CarrierBand::G2,
63  gnsstk::TrackingCode::Standard),
64  oid3(gnsstk::ObservationType::Unknown,
66  gnsstk::TrackingCode::Y),
69  gnsstk::TrackingCode::Y)
70  {}
72  unsigned constructorTest();
74  unsigned validateTest();
76  unsigned getUserTimeTest();
78  unsigned getISCSFTest();
80  unsigned getISCDFTest();
81 
83 };
84 
85 
86 unsigned GLOFNavISC_T ::
88 {
89  TUDEF("GLOFNavISC", "GLOFNavISC");
92  uut.signal.messageType);
93  TURETURN();
94 }
95 
96 
97 unsigned GLOFNavISC_T ::
99 {
100  TUDEF("GLOFNavISC", "validate");
101  gnsstk::GLOFNavISC uut;
103  TUASSERTE(bool, true, uut.validate());
104  TURETURN();
105 }
106 
107 
108 unsigned GLOFNavISC_T ::
110 {
111  TUDEF("GLOFNavISC", "getUserTime");
112  gnsstk::GLOFNavISC uut;
113  uut.timeStamp = gnsstk::CivilTime(2006, 10, 01, 0, 15, 0,
115  // 1x 2s string
116  gnsstk::CommonTime exp(uut.timeStamp + 2.0);
118  TURETURN();
119 }
120 
121 
122 unsigned GLOFNavISC_T ::
124 {
125  TUDEF("GLOFNavISC", "getISC(single-frequency)");
126  gnsstk::GLOFNavISC uut;
127  // isc is initially nan
128  double corr = 0.123456;
129  double expCorr1 = 0.123456;
130  TUASSERTE(bool, false, uut.getISC(oid1, corr));
131  TUASSERTFE(expCorr1, corr); // corr should not change.
132  // set isc
133  uut.isc = -6.519258E-09;
134  TUASSERTE(bool, false, uut.getISC(oid1, corr));
135  TUASSERTFE(expCorr1, corr);
136  // try again with same band, different code.
137  TUASSERTE(bool, false, uut.getISC(oid2, corr));
138  TUASSERTFE(expCorr1, corr);
139  // and again with L2-Y
140  TUASSERTE(bool, false, uut.getISC(oid3, corr));
141  TUASSERTFE(expCorr1, corr);
142  // again but with an ObservationType other than "Unknown"
143  TUASSERTE(bool, false, uut.getISC(oid4, corr));
144  TUASSERTFE(expCorr1, corr);
145  TURETURN();
146 }
147 
148 
149 unsigned GLOFNavISC_T ::
151 {
152  TUDEF("GLOFNavISC", "getISC(dual-frequency)");
153  gnsstk::GLOFNavISC uut;
154  uut.isc = 987654;
155  double corr = 0.123456;
156  TUASSERTE(bool, true, uut.getISC(oid1, oid2, corr));
157  TUASSERTFE(987654, corr);
158  corr = 0.123456;
159  TUASSERTE(bool, true, uut.getISC(oid2, oid1, corr));
160  TUASSERTFE(-987654, corr);
161  TUASSERTE(bool, false, uut.getISC(oid1, oid3, corr));
162  TUASSERTE(bool, false, uut.getISC(oid1, oid4, corr));
163  TUASSERTE(bool, false, uut.getISC(oid2, oid3, corr));
164  TUASSERTE(bool, false, uut.getISC(oid2, oid4, corr));
165  TUASSERTE(bool, false, uut.getISC(oid3, oid1, corr));
166  TUASSERTE(bool, false, uut.getISC(oid3, oid2, corr));
167  TUASSERTE(bool, false, uut.getISC(oid4, oid1, corr));
168  TUASSERTE(bool, false, uut.getISC(oid4, oid2, corr));
169  TURETURN();
170 }
171 
172 
173 int main()
174 {
175  GLOFNavISC_T testClass;
176  unsigned errorTotal = 0;
177 
178  errorTotal += testClass.constructorTest();
179  errorTotal += testClass.validateTest();
180  errorTotal += testClass.getUserTimeTest();
181  errorTotal += testClass.getISCSFTest();
182  errorTotal += testClass.getISCDFTest();
183 
184  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
185  << std::endl;
186 
187  return errorTotal;
188 }
gnsstk::NavMessageType::ISC
@ ISC
Inter-signal corrections.
GLOFNavISC_T::oid4
gnsstk::ObsID oid4
Definition: GLOFNavISC_T.cpp:82
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
GLOFNavISC_T::getUserTimeTest
unsigned getUserTimeTest()
Check getUserTime()
Definition: GLOFNavISC_T.cpp:109
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::CarrierBand
CarrierBand
Definition: CarrierBand.hpp:54
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::GLOFNavISC::validate
bool validate() const override
Definition: GLOFNavISC.cpp:58
GLOFNavISC_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GLOFNavISC_T.cpp:87
GLOFNavISC_T::oid2
gnsstk::ObsID oid2
Definition: GLOFNavISC_T.cpp:82
gnsstk::GLOFNavISC
Definition: GLOFNavISC.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::InterSigCorr::isc
double isc
Definition: InterSigCorr.hpp:171
GLOFNavISC_T::GLOFNavISC_T
GLOFNavISC_T()
Definition: GLOFNavISC_T.cpp:57
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
TestUtil.hpp
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::ObsID
Definition: ObsID.hpp:82
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
GLOFNavISC_T::getISCDFTest
unsigned getISCDFTest()
Dual frequency ISC test.
Definition: GLOFNavISC_T.cpp:150
CivilTime.hpp
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
GLOFNavISC_T::oid3
gnsstk::ObsID oid3
Definition: GLOFNavISC_T.cpp:82
gnsstk::TimeSystem::GLO
@ GLO
GLONASS system time (aka UTC(SU))
gnsstk::CivilTime
Definition: CivilTime.hpp:55
gnsstk::TrackingCode
TrackingCode
Definition: TrackingCode.hpp:64
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
GLOFNavISC_T
Definition: GLOFNavISC_T.cpp:54
GLOFNavISC_T::oid1
gnsstk::ObsID oid1
Definition: GLOFNavISC_T.cpp:82
main
int main()
Definition: GLOFNavISC_T.cpp:173
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
gnsstk::GLOFNavISC::getISC
bool getISC(const ObsID &oid, double &corrOut) const override
Definition: GLOFNavISC.hpp:75
L2
gnsstk::Matrix< double > L2
Definition: Matrix_LUDecomp_T.cpp:46
GLOFNavISC.hpp
GLOFNavISC_T::getISCSFTest
unsigned getISCSFTest()
Single frequency ISC test.
Definition: GLOFNavISC_T.cpp:123
gnsstk::ObservationType
ObservationType
The type of observation, mostly used by ObsID.
Definition: ObservationType.hpp:55
GLOFNavISC_T::validateTest
unsigned validateTest()
Check validate()
Definition: GLOFNavISC_T.cpp:98


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