www.pudn.com > opengpssim.zip > ogsextern.h


/* ************************************************************************  
   *                                                                      * 
   *                          GPS Simulation                              * 
   *                                                                      * 
   * -------------------------------------------------------------------- * 
   *                                                                      * 
   *    Module:   ogsextern.h                                             * 
   *                                                                      * 
   *   Version:   0.1                                                     * 
   *                                                                      * 
   *      Date:   17.02.02                                                * 
   *                                                                      * 
   *    Author:   G. Beyerle                                              * 
   *                                                                      * 
   * -------------------------------------------------------------------- * 
   *                                                                      * 
   * Copyright (C) 2002-2006 Georg Beyerle                                * 
   *                                                                      * 
   * This program is free software; you can redistribute it and/or modify * 
   * it under the terms of the GNU General Public License as published by * 
   * the Free Software Foundation; either version 2 of the License, or    * 
   * (at your option) any later version.                                  * 
   *                                                                      * 
   * This program is distributed in the hope that it will be useful,      * 
   * but WITHOUT ANY WARRANTY; without even the implied warranty of       * 
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        * 
   * GNU General Public License for more details.                         * 
   *                                                                      * 
   * You should have received a copy of the GNU General Public License    * 
   * along with this program; if not, write to the Free Software          * 
   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            * 
   *                                                                      * 
   * -------------------------------------------------------------------- * 
   *                                                                      * 
   * The files 'gpsfuncs.cpp', 'gpsrcvr.cpp' are modified versions of     * 
   * the files with the same name from Clifford Kelley's OpenSourceGPS    * 
   * distribution. The unmodified files can be obtained from              * 
   *   http://www.home.earthlink.net/~cwkelley                            * 
   *                                                                      * 
   * -------------------------------------------------------------------- * 
   *                                                                      * 
   *                            Global Variables                          * 
   *                                                                      * 
   ************************************************************************ */ 
 
/* ******************************* changes ******************************** 
 
   dd.mm.yy - 
 
   ************************************************************************ */ 
 
/* ------------------------------------------------------------------------ */ 
 
// 
// constants defined for GPS 
// 
 
#ifdef OGSEXTERN_H 
# undef MAIN 
#endif 
 
#define OGSEXTERN_H 
 
#ifdef MAIN 
 
char *OGSBinDir; 
char *OGSDataDir; 
 
double    pi = 3.1415926535898E0,         // GPS values 
          r_to_d = 57.29577951308232; 
double    c = 2.99792458e8,               // WGS-84 speed of light m/sec 
          omegae = 7.2921151467E-5;       // WGS-84 earth rotation rate rad/sec 
double    a = 6378137.0, b = 6356752.314; // WGS-84 ellipsoid parameters 
double    lambda = .1902936728;           // L1 wavelength in meters 
 
CHANNEL   chan[NOFCHAN]; 
EPHEMERIS gps_eph[NOFSAT+1];              // index 1,...,NOFSAT 
ALMANAC   gps_alm[NOFSAT+1];              // index 1,...,NOFSAT 
int       SVh[NOFSAT+1],                  // satellite vehicle health 
          ASV[NOFSAT+1];                  // anti-spoofing & satellite vehicle configuration 
 
// Setting up the library of GP1020 GPS correlator functions 
int  bit_pat[12] = {0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000}; 
int  last_hi_carr[12], last_hi_code[12], ch_status; 
char last_address; 
 
char *tzstr = "TZ=PST8PDT"; 
 
FILE *stream, *in, *out; 
 
//float b0, b1, b2, b3, al0, al1, al2, al3;       // broadcast ionospheric delay model 
//float a0, a1, tot, WNt, dtls, WNlsf, DN, dtlsf; // broadcast UTC data 
 
IONODATA Iono; 
UTCDATA Utc; 
 
float gdop, pdop, hdop, vdop, tdop, alm_toa; 
 
unsigned long  clock_tow; 
LLH   rec_pos_llh; 
LLH   current_loc,rp_llh; 
ECEFT track_sat[13]; 
ECEF  satuse[13], rec_pos_xyz; 
int   alm_gps_week, gps_week, almanac_valid, almanac_flag; 
 
unsigned long sf[6][11]; 
//unsigned long sf2[6][11]; 
int p_error[6], status; 
 
unsigned long test_l[33]={0x00000000L, 
  0x00000001L,0x00000002L,0x00000004L,0x00000008L, 
  0x00000010L,0x00000020L,0x00000040L,0x00000080L, 
  0x00000100L,0x00000200L,0x00000400L,0x00000800L, 
  0x00001000L,0x00002000L,0x00004000L,0x00008000L, 
  0x00010000L,0x00020000L,0x00040000L,0x00080000L, 
  0x00100000L,0x00200000L,0x00400000L,0x00800000L, 
  0x01000000L,0x02000000L,0x04000000L,0x08000000L, 
  0x10000000L,0x20000000L,0x40000000L,0x80000000L}; 
 
float mask_angle; 
 
char  header[45], text[27], trailer; 
 
double meas_dop[13]; 
 
ECEF d_sat[13]; 
 
// write 0x1f7b1b9  -> CHx_CARRIER_DCO_INCR : 1.405396845 MHz 
//                     resolution : 42.57475 mHz 
// write 0x016ea4a8 -> CHx_CODE_DCO_INCR    : 1.022999968 MHz 
//                     resolution : 42.57475 mHz 
long carrier_ref = 0x1f7b1b9L,   
     code_ref    = 0x016ea4a8L;  
double  dt[13], cbias; 
SATVIS  xyz[33]; 
 
//char *Buffer = NULL; 
//unsigned long BufferLen = 0L; 
 
int NofChanActive = 0; 
 
// CA codes for all 32 PRNs; [1,...,32][0,...,1022] 
short int CACode[NOFSAT+1][NOFCHIPS];  
 
// options 
int OutputIQ, 
    OutputCarFrq, 
    Verbose; 
 
int PRNChn[NOFSAT+1]; 
 
// 
//  conversion table sat ID to page 
// 
int satid2page[64] =  
{  
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 
 16,17,18,19,20,21,22,23,24, 2, 3, 4, 5, 7, 8, 9, 
 10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,  
 -1,-1,-1,25,13,14,15,17,18, 1,19,20,22,23,12,25 
}; 
 
// 
//  conversion page (4th/5th subframe) to table sat ID 
// 
int page4sf2page[26] =  
{ 
 0,57,25,26,27,28,57,29,30,31,32,57,62,52,53,54,57,55,56,58,59,57,60,61,62,63 
}; 
 
int page5sf2page[26] =  
{ 
 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,51 
}; 
 
#else 
 
extern char *OGSBinDir; 
extern char *OGSDataDir; 
 
extern double pi, r_to_d; 
extern double c,                       // WGS-84 speed of light m/sec 
       omegae;                         // WGS-84 earth rotation rate rad/sec 
extern double a, b;                    // WGS-84 ellipsoid parameters 
extern double lambda;                  // L1 wavelength in meters 
 
extern CHANNEL   chan[]; 
extern EPHEMERIS gps_eph[]; 
extern ALMANAC   gps_alm[]; 
extern int SVh[], ASV[]; 
 
extern int  bit_pat[]; 
extern int  last_hi_carr[], last_hi_code[], ch_status; 
extern char last_address; 
 
extern char *tzstr; 
 
extern FILE *stream; 
 
//extern float b0, b1, b2, b3, al0, al1, al2, al3;       // broadcast ionospheric delay model 
//extern float a0, a1, tot, WNt, dtls, WNlsf, DN, dtlsf; // broadcast UTC data 
 
extern IONODATA Iono; 
extern UTCDATA Utc; 
 
extern float gdop, pdop, hdop, vdop, tdop, alm_toa; 
extern unsigned long  clock_tow; 
extern LLH   rec_pos_llh; 
extern LLH   current_loc,rp_llh; 
extern ECEFT track_sat[]; 
extern ECEF  satuse[], rec_pos_xyz; 
extern int   alm_gps_week, gps_week, almanac_valid, almanac_flag, handle; 
 
extern unsigned long sf[][11]; 
//extern unsigned long sf2[][11]; 
extern int p_error[], status; 
 
extern unsigned long test_l[]; 
 
extern float mask_angle; 
 
extern char  header[], text[], trailer; 
 
extern double meas_dop[]; 
 
extern ECEF d_sat[]; 
 
extern long carrier_ref, code_ref;  
extern double dt[], cbias; 
extern FILE *in,*out; 
extern SATVIS xyz[]; 
 
//extern char *Buffer; 
//extern unsigned long BufferLen; 
 
extern int NofChanActive; 
 
extern short int CACode[][NOFCHIPS];      
 
// options 
extern int OutputIQ, 
           OutputCarFrq, 
           Verbose; 
 
extern int PRNChn[]; 
 
extern int satid2page[]; 
extern int page4sf2page[]; 
extern int page5sf2page[]; 
 
#endif 
 
/* ------------------------------ end of file ----------------------------- */