Rinex_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 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 #include "RinexNavData.hpp"
40 #include "TestUtil.hpp"
41 #include <sstream>
42 
43 using namespace std;
44 using namespace gnsstk;
45 
46 class Rinex_T
47 {
48 
49 public:
50 
52  {
53  init();
54  }
55 
56  ~Rinex_T() {}
57 
58  void init( void );
59  int run( void );
60 
61 private:
62 
66 
67  static const short weeknum;
68  static const uint32_t subframe1[10];
69  static const uint32_t subframe2[10];
70  static const uint32_t subframe3[10];
71 };
72 
73 //------------------------------------------------------------
74 // Inialization of static class data members
75 //------------------------------------------------------------
76 
77 // By rules of Kepler Orbit, this must be week of Toe
78 const short Rinex_T::weeknum = 1638;
79 
80 // Test data from 06/02/2011
81 const uint32_t Rinex_T::subframe1[10] =
82 { 0x22C2663D, 0x1F0E29B8, 0x2664002B, 0x09FCC1B6, 0x0F60EB8A,
83  0x1299CE93, 0x29CD3DB6, 0x0597BB0F, 0x00000B68, 0x17B28E5C };
84 const uint32_t Rinex_T::subframe2[10] =
85 { 0x22C2663D, 0x1F0E4A28, 0x05809675, 0x0EBD8AF1, 0x00089344,
86  0x008081F8, 0x1330CC2C, 0x0461E855, 0x034F8045, 0x17BB1E68 };
87 const uint32_t Rinex_T::subframe3[10] =
88 { 0x22C2663D, 0x1F0E6BA0, 0x3FE129CD, 0x26E31837, 0x0006C96A,
89  0x35A74DFC, 0x065C8B0F, 0x1E4F400A, 0x3FE8966D, 0x05860C44 };
90 
91 //------------------------------------------------------------
92 // Rinext_T::init()
93 //------------------------------------------------------------
94 void Rinex_T :: init( void )
95 {
96  // ...in contemplation of the meaning of life.
97 }
98 
99 //------------------------------------------------------------
100 // Rinext_T::run()
101 //------------------------------------------------------------
102 int Rinex_T :: run( void )
103 {
104 
105  TestUtil testFramework( "Rinex", "run", __FILE__, __LINE__ );
106 
107  std::stringstream before;
108  std::stringstream after;
109  std::string test_desc =
110  "Test equality of data dumps for two data types with the same data.";
111  std::string test_fail = "These should be equal but they are not.";
112 
113  //The dump from ee_orig.dump() and ee_copy.dump() should be the same
114  // an EngEphemeris object is created, then used to create a RinexNavData
115 
116  ee_orig.addSubframe( subframe1, weeknum, 3, 1 );
117  ee_orig.addSubframe( subframe2, weeknum, 3, 1 );
118  ee_orig.addSubframe( subframe3, weeknum, 3, 1 );
119  ee_orig.setFIC(false); // make the dump text look the same
120  ee_orig.dump( before );
121 
122  RinexNavData rnd = RinexNavData( ee_orig ); //constructor
123 
124  ee_copy = EngEphemeris( rnd ); //cast
125  ee_copy.setFIC(false); // make the dump text look the same
126  ee_copy.dump( after );
127 
128  TUASSERTE( std::string, before.str(), after.str() );
129  return( testFramework.countFails() );
130 }
131 
132 //------------------------------------------------------------
133 // main()
134 //------------------------------------------------------------
135 int main( void )
136 {
137  int check, errorCounter = 0;
138  Rinex_T testClass;
139  check = testClass.run();
140  errorCounter += check;
141 
142  std::cout << "Total Failures for " << __FILE__ << ": " << errorCounter <<
143  std::endl;
144 
145  return errorCounter; //Return the total number of errors
146 }
gnsstk::TestUtil::countFails
int countFails(void)
Definition: TestUtil.hpp:771
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
main
int main(void)
Definition: Rinex_T.cpp:135
Rinex_T::ee_copy
EngEphemeris ee_copy
Definition: Rinex_T.cpp:64
Rinex_T::init
void init(void)
Definition: Rinex_T.cpp:94
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::RinexNavData
Definition: RinexNavData.hpp:67
Rinex_T::weeknum
static const short weeknum
Definition: Rinex_T.cpp:67
gnsstk::EngEphemeris
Definition: EngEphemeris.hpp:86
position_difference.run
def run(prn, filetype1, filename1, filetype2, filename2, verbose=False, noplot=False, savelocation=None, drawdots=False, timestep=300, format='%02H:%02M')
Definition: position_difference.py:320
TestUtil.hpp
Rinex_T::rnd
RinexNavData rnd
Definition: Rinex_T.cpp:65
Rinex_T::run
int run(void)
Definition: Rinex_T.cpp:102
Rinex_T::~Rinex_T
~Rinex_T()
Definition: Rinex_T.cpp:56
Rinex_T::subframe2
static const uint32_t subframe2[10]
Definition: Rinex_T.cpp:69
Rinex_T::Rinex_T
Rinex_T()
Definition: Rinex_T.cpp:51
Rinex_T::ee_orig
EngEphemeris ee_orig
Definition: Rinex_T.cpp:63
std
Definition: Angle.hpp:142
Rinex_T::subframe3
static const uint32_t subframe3[10]
Definition: Rinex_T.cpp:70
Rinex_T
Definition: Rinex_T.cpp:46
RinexNavData.hpp
Rinex_T::subframe1
static const uint32_t subframe1[10]
Definition: Rinex_T.cpp:68
gnsstk::TestUtil
Definition: TestUtil.hpp:265


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