LNavEphMaker.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 "LNavEphMaker.hpp"
40 #include "EngNav.hpp"
41 
42 namespace gnsstk
43 {
46  {
47  }
48 
49 
50  void LNavEphMaker ::
51  validate(NavMsgList& msgBitsIn, NavMsgList& msgBitsOut)
52  {
53  NavMsgList::iterator nmli;
54  completeEphs.clear();
55  for (nmli = msgBitsIn.begin(); nmli != msgBitsIn.end(); nmli++)
56  {
57  LNavFilterData *fd = dynamic_cast<LNavFilterData*>(*nmli);
58  uint32_t sfid = EngNav::getSFID(fd->sf[1]);
59  if ((sfid < 1) || (sfid > 3))
60  {
61  // ignore non-ephemeris data
62  accept(fd, msgBitsOut);
63  continue;
64  }
65  if (ephemerides.find(fd) == ephemerides.end())
66  {
67  // set up us the ephemeris
68  ephemerides[fd].resize(3, NULL);
69  }
70  EphGroup &ephGrp(ephemerides[fd]);
71  ephGrp[sfid-1] = fd;
72 
73  // determine if a complete, valid ephemeris is available
74 
75  // check that all subframes are present
76  if ((ephGrp[0] == NULL) || (ephGrp[1] == NULL) || (ephGrp[2] == NULL))
77  {
78  continue;
79  }
80  // check that TOW counts are consecutive
81  if ((EngNav::getTOW(ephGrp[1]->sf[1]) -
82  EngNav::getTOW(ephGrp[0]->sf[1]) != 1) ||
83  (EngNav::getTOW(ephGrp[2]->sf[1]) -
84  EngNav::getTOW(ephGrp[1]->sf[1]) != 1))
85  {
86  continue;
87  }
88  // check that the IODE/IODC are consistent
89  if (((ephGrp[0]->sf[7] >> 22) != (ephGrp[1]->sf[2] >> 22)) ||
90  ((ephGrp[0]->sf[7] >> 22) != (ephGrp[2]->sf[9] >> 22)))
91  {
92  continue;
93  }
94  // everything checks out, put the data where the user can find it
95  completeEphs.push_back(&ephGrp);
96  }
97  }
98 
99 
100  void LNavEphMaker ::
101  finalize(NavMsgList& msgBitsOut)
102  {
103  // Don't really need to do anything but clear out our own
104  // data structures. Any valid ephemerides would have been
105  // immediately produced as soon as they had been determined
106  // valid, and all subframes are passed.
107  ephemerides.clear();
108  completeEphs.clear();
109  }
110 
111 }
gnsstk::LNavEphMaker::validate
virtual void validate(NavMsgList &msgBitsIn, NavMsgList &msgBitsOut)
Definition: LNavEphMaker.cpp:51
gnsstk::EngNav::getTOW
static unsigned long getTOW(uint32_t word2)
Get the TOW count from the provided HOW.
Definition: EngNav.hpp:154
gnsstk::LNavEphMaker::EphGroup
std::vector< LNavFilterData * > EphGroup
Group of 3 subframes making up an ephemeris.
Definition: LNavEphMaker.hpp:79
NULL
#define NULL
Definition: getopt1.c:64
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
LNavEphMaker.hpp
gnsstk::LNavEphMaker::LNavEphMaker
LNavEphMaker()
Definition: LNavEphMaker.cpp:45
gnsstk::LNavEphMaker::finalize
virtual void finalize(NavMsgList &msgBitsOut)
Definition: LNavEphMaker.cpp:101
gnsstk::EngNav::getSFID
static short getSFID(uint32_t word2)
Get the subframe ID from the provided HOW.
Definition: EngNav.hpp:163
gnsstk::LNavFilterData
Definition: LNavFilterData.hpp:52
gnsstk::NavFilter::NavMsgList
std::list< NavFilterKey * > NavMsgList
Definition: NavFilter.hpp:58
gnsstk::NavFilter::accept
void accept(NavFilterKey *data, NavMsgList &msgBitsOut)
Definition: NavFilter.hpp:172
gnsstk::LNavEphMaker::completeEphs
EphList completeEphs
Definition: LNavEphMaker.hpp:125
gnsstk::LNavEphMaker::ephemerides
EphMap ephemerides
Storage for the assembly of ephemerides.
Definition: LNavEphMaker.hpp:119
gnsstk::LNavFilterData::sf
uint32_t * sf
Definition: LNavFilterData.hpp:68
EngNav.hpp


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