⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 globledefine.h

📁 GPS 定位授时源码
💻 H
字号:
#if !defined AFX_GLOBLEDEFINE_H_
#define      AFX_GLOBLEDEFINE_H_

#include "Afx.h"

//  The following parameters possibly have to be adjusted according to the specific situtation
#define MAXCHA           (     12    )      	// The Max of the channal
#define MAXTYPE          (     9     )      	// The Max of the observation type
#define MAXNAVSAT        (     31    )      	// the Max of the gps SatliteS 
#define MAXCLKRECORDS    (     288   )      	// the Max of the clk records in clk file
                                            	
                                            	
/* define the serials port values   */      	
                                            	
/* define the constant values       */      	
#define PI               (4*atan(1.0))      	// PI=4*atan(1.0)
#define PS               ( 1013.25   )      	// standard pressure,unit:mba .(1ba=0.1Mpa=e5pa)
#define TS               (     18    )      	// standard temperature (unit: oC) ,is units as centigrade 18.0 
#define RHS              (   50.0    )	    	// standard humidity
                                            	
#define VC               (299792458.0)      	// Speed of Light m/s
#define FREQ_L1          (154*1.023E7)      	// L1 Frequency in Hz
#define FREQ_L2          (120*1.023E7)      	// L2 Frequency in Hz
                                            	
#define WAVELENGTH1      ((VC)/(FREQ_L1) )  	// WAVELENGTH1 of L1
#define WAVELENGTH2      ((VC)/(FREQ_L2) )  	// WAVELENGTH1 of L2

#define omega            (7.2921151467E-5)      // The rotation vecolity of earth
#define mu               (3.986005e14    )      // Earth gravitation constant , unit m^3/s^2 mu=GM


#define ellips_a         (6378137.000      )    // WGS-84 Equatorial Radius (a) = 6378137.0 WGS-84 Flattening (f) = 1/298.257223563 
#define ellips_b         ((1-flat)*ellips_a )   // WGS-84 Equatorial Radius (a) = 6378137.0 WGS-84 Flattening (f) = 1/298.257223563 
#define flat             (1/298.257223563)      // Keep in mind, all digital is important cannot be ignored
#define ellips_e2        (1-(1-flat)*(1-flat))  // eccentricity of the reference ellipose

#define TRUE             1
#define FALSE            0

#define AmbSmoLen		 20

// The definition of struct for PPP program CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
typedef struct      //  UTC time
{
	
	BOOL            ModelPPP;
	BOOL            ModelHolding;
	int				Days;
	int				TropModel;
	long double     PhaseSTD ;
	long double     PseudoSTD;

} CONPARAMETAR;

typedef struct      //  UTC time
{

	int				iYEAR;
	int				iMONTH;
	int				iDAY;
	int				iHOUR;
	int				iMINUTE;
	long double  	dSECOND;
} UTCTIME;

typedef struct      //GPS time
{

	long            lGPSWEEK;
	double long     dWEEKSECONDS;               
} GPSTIME;

typedef struct 
{
	
	long double  	lX,
				 	lY,
				 	lZ;
} XYZ;

typedef struct 
{
	
	XYZ				xyz;
	long double  	lT ;
} XYZT;

typedef struct 
{
	
	long double  	lB,
					lL,
				 	lH;
} BLH;

typedef struct      // the coordinate and velocity of satellite 
{
	
	int				iPRN;
	GPSTIME			time;						  // seconds of  gps week
	XYZ             xyz;
	XYZ				Dotxyz;
	double			dE,
					dA;
} SATPOS;

typedef struct  	// the coordinate of receiver
{
	XYZ				xyz;
	BLH				blh;
}RECPOS;

//CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
typedef struct		// head of each epoch in Rinex obs file   
{
	
	UTCTIME			TIME;
	int    			iTAG;
	int    			iSATNUM;
	CString         SatList;
} OBSRECEPOHEAD;

/*
 obsertation combination struct
 typedef struct
 {	
 	long double		L5;							// widelane combination--->L1-L2
 	long double     ambioncmb ;					// ambiguity of ionfree phase combination 	
 	long double     allfree;					// L3-P3;L3-->ionfree phase ; P3-->  ionfree pseudorange	
 	double          WL;							// ambiguity for Melbourne-Wubbena combination 	
 } OBSCMB;*/
 

typedef struct		//  need to be modified 
{
	int				iEpoNum;
	int				SN ;						 // SINGLE NOISE ratio
	int			 	iPRN;						 // Prn number
	int				HEALTH;						 // satellite health status, 
												 // judging by full of P1,P2,L1,L2 or not
	long double	 	lOBS[MAXTYPE];				 // store all the raw observations 
	// All the obs type and the default order are C1,L1,L2,P1,P2,D1,D2,S1,S2

	int				iCycleFlag; 				 // The usage is for detect the cycleslip
	// added in 2006.5.18 by cheng shilai
	/*
	  -1  means observation of the epoch is bad,
		  but the next one is also useful*/
	
	// 0  Phase connected arc 
	// 1  The first epoch of the new satellite PRn 
	// 2  the Cycle slips occurred 

	long double     lIonDelay;					 //Ionospheric delay
	long double		lTropDelay;					 // tropospheric delay  
	long double		lRelatDelay;				 // relatisitic correcction	
	
	long double		lPhaseRes;					 // save the observations residual of the satellite which be use for ppp
	long double		lPseudoRes;					 // save the observations residual of the satellite which be use for ppp	
	
	long double		lPhaSmoPse;         		 // added in 2002.5.49   
	// The usage is for carrier smooth psudorange and cycleslip dectecting and correction                                                                                                                                                                         
	long double		lLDelta,       				 // M-W combination Phase
					lPDelta,        			 // M-W combination pseudorange 
					lBDelta,        			 // M-W combination integer or Phase biases 
					lDeltaB;        		     // M-W combination RMS of the Phase biases  
	
	long double		lPIono;						 // Ionospheric Combination Pseudorange
	long double		lLIono;						 // Ionospheric Combination phase ,is also refered to as geometry free combination
	
	double			rawIFpseudo;				 // use for raw iono-free pseudorange
	double			rawIFphase;					 // use for raw iono-free phase; because the up two was change by phase smoothing 
	
	long double		ionfree_pseudo;				 // their value of this pairs will be updated in smooth function
	long double		ionfree_phase ;

	long double		P2_P1;						 // P2-P1, for ionospheric delay value
	
	long double		Cyslip;					     // use for cycle slip detection; Cyslip = phase_L1 - (FREQ_L1/FREQ_L2)* phase_L2
	// the combination is ideal for cycle slip detection, it decrease the ion delay effects,
	// and get rid of the item related to frequency.
	long double     lAmbiguity;                  // the ambiguity to resolve
	int             iAmbSmoTime;                 // times of Ambiguity somothing
	
} OBSRECPERSAT;     // per satellite

typedef struct		// Total of each epoch in Rinex obs file 
{
	OBSRECEPOHEAD 	epohead;
	OBSRECPERSAT 	eporec[MAXCHA];
	long double     lRecClk;
	long double     lRMS   ;
	long double     lTDop  ;
	XYZ             RecPOs ;
					// The user can add as you need 	

} OBSREC;           // per epoch 

typedef struct      // Obs head
{					// add at 2006.10.19      
	char*			Markername;  
	XYZ             dapproxmiatexyz;
	double			dANTDELTA_H,
					dANTDELTA_E,                                 
					dANTDELTA_N;                                 
	int			    iTYPENUM;                
	CString	        TYPE[MAXTYPE];
	UTCTIME	        FIRSTTIME;
	int				iLEAPSECONDS;	
} OBSHEAD;


// data of OBS record stored in link arrayed as epoch increases in each satellite PRN 
/**********added in 2005.5.22******/
typedef struct      
{                   // added in 2006.4.15 by cheng shilai          
	OBSRECPERSAT**	PObsEpoRec; 
} SATOBSREC;

// The requirement for Reading SP3 format data CCCCCCCCCCCCCCCCCCCCCCCCC
typedef struct         
{
	int             iPrn;
	XYZT            xyzt;
//  XYZT			Dotxyzt      				 // have no any meaning to solve the problem
} NAVSP3REC;

typedef struct 		// Record per epoch in SP3 file
{
	UTCTIME			EpoTime;
	NAVSP3REC		NavSp3[MAXNAVSAT];
} NAVSP3EPO;

typedef struct  
{	
	char    		CPorV;
	UTCTIME 		FirstTime;
	int     		iEpoNumber;
	int    			iWeek;
	double  		dSecond;
	double  		dInterval;
	int     		iMjdDay;
	double  		dMjdDayFra;
	int     		iRealSatNumber;	
} NAVSP3HEAD;



//CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
typedef struct //Nav head
{
	long    		lseconds;          				/*  UTC reference time*/
	long    		lweek;             				/*  GPS week number */
	double  		dA1,               				/*  clock correction(sec/sec) */
	        		dA0;               				/*  clock correction(sec) */
	int     		iLEAPSECONDS;		   				
	double  		dIONalph0,         				/*  ionospheric parameter(second) */
					dIONalph1,						/*  ionospheric parameter(sec/semi-circles) */
					dIONalph2,						/*  ionospheric parameter(s/semi-circles2)  */
					dIONalph3,						/*  ionospheric parameter(s/semi-circles3)  */
					dIONbelta0,						/*  ionospheric parameter(s)     */
					dIONbelta1,						/*  ionospheric parameter(s/semi-circles)  */
					dIONbelta2,						/*  ionospheric parameter(s/semi-circles2) */
					dIONbelta3;						/*  ionospheric parameter(s/semi-circles3) */
   
} NAVHEAD;

typedef struct										/*  standard ephemerus type for ALL programs */
													/*  orbit record per epoch in navagation file*/
{
    int				iPRN;							/*	sv prn number */
	UTCTIME			UTC; 
	GPSTIME			toc;							/*	The time of clock */
    double			dDELTASV,
					dDELTASV1,
					dDELTASV2;						/*  SV clock parameter s,s/s,s/s*s; */
	
	double			dIODE;							/*  clock date issue */
    double			dDeltaN;						/*  mean anomoly correction semi-circles per sec*pi = rads */
    double			dM0,							/*  mean anomoly at ref time semi-circles*pi = rads */
					dE,								/*  eccentricity */
					dRoota;							/*  sqr root a ( metres 1/2 ) */
	
    long			dtoe;							/*  ref time (sec) of ephemeris  */
    double			dcic,							/*  harmonic correction term(rads) */
					dcrc,							/*  harmonic correction term(metres) */
					dcis,							/*  harmonic correction term(rads) */
					dcrs,							/*  harmonic correction term(metres) */
					dcuc,							/*  harmonic correction term(rads) */
					dcus;							/*  harmonic correction term(rads) */
    double			dOMEGA,							/*  longitude  of asccending node semi-circles*pi = rads */
					dOmega,							/*  argument of perigee semi-circles*pi */
					DI0;							/*  inclination angle at ref time semi-circles*pi */
    double			dOMEGADOT,						/*  rate of right ascension semi-circles/sec*pi */
					dIDOT;							/*  rate of inclination semi-circles/sec*pi */
	long			lWEEK;							/*  GPS week */
    int				iACCURACY,						/*  User range accuracy */
					iHEALTH;						/*  Satellite health */
	double			dTGD;							/*  group delay (units with s)*/
	int				curvefit; 						/*  Curve fit interval  in hours */ 
    char*			cRES;							/*  Reserved character */
 	short			checksum;						/*  check sum  */  
} NAV;

/*****************ADD in 10.19*******************************************/
// The follow definitions are used for clock record reading and computing
/*****************ADD by cheng shilai************************************/
typedef struct		//   clock  of the IGS site 
{

	UTCTIME			UTCT;
	long double		lClk[2];

} SIGCLK;			//Site IGS  clock 

typedef struct		//clock  of the satellite
{
	
	UTCTIME			UTCT[MAXNAVSAT];
	long double		clk[MAXNAVSAT][2];

} SATCLK;

typedef struct      // record the clock file 
{
	char*			Makername;    
    double			RecPos[3];
	SIGCLK*			pRecClk ;						//  only  for IGS  site  
	SIGCLK*			pDifToReference;				//  for COD  file Reference is AMC2
	SATCLK*			pSavClk ;						//  for all sites 
 
} PRECLK;

//CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
enum OBSTYPE        {C1,L1,L2,P1,P2,D1,D2,S1,S2};



#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -