00001 #pragma ident "$Id: MDPNavSubframe.hpp 1023 2008-01-08 16:53:53Z ocibu $" 00002 00003 //============================================================================ 00004 // 00005 // This file is part of GPSTk, the GPS Toolkit. 00006 // 00007 // The GPSTk is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU Lesser General Public License as published 00009 // by the Free Software Foundation; either version 2.1 of the License, or 00010 // any later version. 00011 // 00012 // The GPSTk is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with GPSTk; if not, write to the Free Software Foundation, 00019 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 // Copyright 2004, The University of Texas at Austin 00022 // 00023 //============================================================================ 00024 00025 //============================================================================ 00026 // 00027 //This software developed by Applied Research Laboratories at the University of 00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 00029 //Department of Defense. The U.S. Government retains all rights to use, 00030 //duplicate, distribute, disclose, or release this software. 00031 // 00032 //Pursuant to DoD Directive 523024 00033 // 00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 00035 // release, distribution is unlimited. 00036 // 00037 //============================================================================= 00038 00039 #ifndef MDPNAVSUBFRAME_HPP 00040 #define MDPNAVSUBFRAME_HPP 00041 00042 #include <vector> 00043 00044 #include "miscenum.hpp" 00045 #include "MDPHeader.hpp" 00046 00047 namespace gpstk 00048 { 00050 class MDPNavSubframe : public MDPHeader 00051 { 00052 public: 00053 MDPNavSubframe() throw(); 00054 00058 virtual std::string encode() const throw(); 00059 00064 virtual void decode(std::string str) 00065 throw(); 00066 00067 // Return the seconds of week computed from the HOW 00068 unsigned long getHOWTime() const throw(); 00069 00070 // extract the SFID from the HOW 00071 unsigned int getSFID() const throw(); 00072 00073 // extract the SVID from word 3 of an almanac page 00074 unsigned int getSVID() const throw(); 00075 00076 void fillArray(long out[10]) const 00077 { for(int i=1; i<=10; i++) out[i-1]=subframe[i];}; 00078 00079 void fillArray(uint32_t out[10]) const 00080 { for(int i=1; i<=10; i++) out[i-1]=subframe[i];}; 00081 00082 // This is an experiment. It inverts words based upon the D30 00083 // of the previous word. Don't do this unless there is some reason 00084 // to believe that the D30 bits are accurate. Like the subframe 00085 // has passed its parity check. 00086 void cookSubframe() throw(); 00087 00091 bool checkParity() const throw(); 00092 00093 virtual std::string getName() const {return "nav";} 00094 00099 void dump(std::ostream& out) const throw(); 00100 00101 int prn; 00102 CarrierCode carrier; 00103 RangeCode range; 00104 NavCode nav; 00105 00108 std::vector<uint32_t> subframe; 00109 00110 00111 // These are not actually encoded in the message but are used 00112 // in the parity checking 00113 bool cooked; 00114 bool inverted; 00115 00116 // set true when the subframe needed setting upright by cookSubframe 00117 bool neededCooking; 00118 00119 // set true when the subframe has passed parity check. 00120 bool parityGood; 00121 00122 static const unsigned myLength = 44; 00123 static const unsigned myId = 310; 00124 00125 }; // class MDPNavSubframe 00126 00127 // These used to group together a set of nav subframes, indexed by the 00128 // subframe number. It is used in building up a complete a complete 00129 // ephemeris from an SV. 00130 typedef std::map<short, MDPNavSubframe> EphemerisPages; 00131 void dump(std::ostream& out, const EphemerisPages& pages) throw(); 00132 00133 // First element is the page number, as determined from the HOW TOW 00134 // i.e. page = tow % 750 00135 typedef std::pair<short, short> SubframePage; 00136 typedef std::map<SubframePage, MDPNavSubframe> AlmanacPages; 00137 void dump(std::ostream& out, const AlmanacPages& pages) throw(); 00138 00139 } // namespace gpstk 00140 00141 #endif // MDPNAVSUBFRAME_HPP
1.3.9.1