FICData.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: FICData.hpp 2432 2010-05-26 18:16:40Z afarris $"
00002 
00003 
00004 
00010 //============================================================================
00011 //
00012 //  This file is part of GPSTk, the GPS Toolkit.
00013 //
00014 //  The GPSTk is free software; you can redistribute it and/or modify
00015 //  it under the terms of the GNU Lesser General Public License as published
00016 //  by the Free Software Foundation; either version 2.1 of the License, or
00017 //  any later version.
00018 //
00019 //  The GPSTk is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU Lesser General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU Lesser General Public
00025 //  License along with GPSTk; if not, write to the Free Software Foundation,
00026 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027 //  
00028 //  Copyright 2004, The University of Texas at Austin
00029 //
00030 //============================================================================
00031 
00032 //============================================================================
00033 //
00034 //This software developed by Applied Research Laboratories at the University of
00035 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00036 //Department of Defense. The U.S. Government retains all rights to use,
00037 //duplicate, distribute, disclose, or release this software. 
00038 //
00039 //Pursuant to DoD Directive 523024 
00040 //
00041 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00042 //                           release, distribution is unlimited.
00043 //
00044 //=============================================================================
00045 
00046 
00047 
00048 
00049 
00050 
00051 #ifndef FICDATA_HPP
00052 #define FICDATA_HPP
00053 
00054 #include <vector>
00055 #include <map>
00056 
00057 #include "FFStream.hpp"
00058 #include "FICBase.hpp"
00059 #include "EngEphemeris.hpp"
00060 #include "AlmOrbit.hpp"
00061 #include "DayTime.hpp"
00062 
00063 namespace gpstk
00064 {
00067    NEW_EXCEPTION_CLASS(WrongBlockNumber, gpstk::Exception);
00068       
00071    NEW_EXCEPTION_CLASS(WrongBlockFormat, gpstk::Exception);
00072 
00081    class FICData : public FICBase
00082    {
00083    public:
00085       FICData() : blockNum(0) {}
00086 
00087          /*
00088           * Construct a FICData from an EngEphemeris object.
00089           * @param engEph the EngEphemeris to copy
00090           */
00091          // if you uncomment this, fix the doxygen comment above as well
00092          //FICData(const EngEphemeris& engEph) throw();
00093       
00095       virtual ~FICData() {}
00102       bool isValid() const;      
00103 
00105       virtual bool isData() const {return true;}
00106 
00112       virtual void dump(std::ostream& s) const;
00113 
00118       void prettyDump(std::ostream& os) const;
00119 
00125       bool getTransmitTime(DayTime& dt) const;
00126 
00131       operator EngEphemeris() const throw(WrongBlockNumber);
00132 
00137       operator AlmOrbit() const throw(WrongBlockNumber);
00138 
00145       std::string generateUniqueKey() const throw(WrongBlockNumber,
00146                                                   WrongBlockFormat);
00147 
00148         /***
00149          * Standard equality operator.
00150          */
00151       bool operator==(const FICData& rhs);
00152 
00153      /***
00154       * Returns a human readable string describing an entry
00155       * in a FIC vector.
00156       * @param block Block number: 9, 109, 62, 162.
00157       * @param type Which vector type. 'f' for floating, 'i' for integer, 'c' for character.
00158       * @param indx The number of the element in the vector to describe. Starts with zero.
00159       * @return String describing the entry.
00160       */
00161       std::string getElementLabel(char type, size_t indx) const;
00162   
00163 
00165 
00166       static const std::string blockString; 
00167       long blockNum;             
00168       std::vector<double> f;          
00169       std::vector<long> i;            
00170       std::vector<char> c;            
00171 
00172 
00173    protected:
00175       virtual void reallyPutRecord(FFStream& s) const 
00176          throw(std::exception, gpstk::StringUtils::StringException, 
00177                gpstk::FFStreamError);
00186       virtual void reallyGetRecord(FFStream& s)
00187          throw(std::exception, gpstk::StringUtils::StringException, 
00188                gpstk::FFStreamError);
00189 
00190    private:
00192       void prettyDump9(std::ostream& o) const;
00194       void prettyDump109(std::ostream& o) const;
00196       void prettyDump62(std::ostream& o) const;
00198       void prettyDump162(std::ostream& o) const;
00199 
00201       void timeDisplay( std::ostream & os, const char * legend,
00202                         const short week, const double SOW, 
00203                         const short headerFlag ) const;
00204 
00207       void shortcut(std::ostream & os, const double HOW ) const;
00208    };
00209    
00210 }
00211 
00212 #endif // FICDATA_HPP
00213 

Generated on Wed Feb 8 03:30:59 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1