📄 rgps_debug.c
字号:
#ident "@(#) rGPS_Debug.c v1.0.0"/* * Copyright (C) 2002 Ricardo Arroyo <ricardo.arroyo@eresmas.net> * * This code may be used under the terms of Version 2 of the GPL, * read the file COPYING for details. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ******************************************************************************/#include <stdio.h>#include <sys/param.h>#include "gps.h"#include "recGPS.h"#include "rGPS_Debug.h"#include <stdlib.h>#include <math.h>#include <time.h>#include "lc_debug.h"extern int iDebug;void vPrint_Debug_NMEA_Gga(GPS_PGga pGga){ fprintf(stderr,"recGPS: NMEA_Get_Gga\n"); fprintf(stderr," lat: %f\n",pGga->lat); fprintf(stderr," lon: %f\n",pGga->lon); fprintf(stderr," qual: %ld\n",pGga->qual); fprintf(stderr," nsat: %ld\n",pGga->nsat); fprintf(stderr," hdil: %f\n",pGga->hdil); fprintf(stderr," alt: %f\n",pGga->alt); fprintf(stderr," valid: %ld\n",pGga->valid);}void vPrint_Debug_NMEA_Rmc(GPS_PRmc pRmc){ fprintf(stderr,"recGPS: NMEA_Get_Rmc\n"); fprintf(stderr," lat: %f\n",pRmc->lat); fprintf(stderr," lon: %f\n",pRmc->lon); fprintf(stderr," speed: %f\n",pRmc->speed); fprintf(stderr," course: %f\n",pRmc->cmg);}void vPrint_Debug_NMEA_Rmm(GPS_PRmm pRmm){ fprintf(stderr,"recGPS: NMEA_Get_Rmm\n"); fprintf(stderr," datumlen: %d\n",sizeof(pRmm->datum)); fprintf(stderr," datum: {%-80s}\n",pRmm->datum);}void vPrint_Debug_DataPos(RGPS_dataMsg *pDataPos, const char *stModule){ fprintf(stderr,"%s : DataPos\n", stModule); fprintf(stderr," Datum: %d\n", pDataPos->iDatum); fprintf(stderr," Units: %d\n", pDataPos->btUnits); fprintf(stderr," NumSat: %d\n", pDataPos->shNumSat); /* num visible satellites */ fprintf(stderr," Dist: %lf\n", pDataPos->dDist); /* distance in m/miles from previous point */ fprintf(stderr," Speed: %f\n", pDataPos->fSpeed); /* Speed */ fprintf(stderr," Bearing: %lf\n", pDataPos->dBearing); /* Bearing */ fprintf(stderr," Altitude: %lf\n", pDataPos->dAltitude); /* Altitude above datum ellipsoid */ fprintf(stderr," PosFormat: %d\n", pDataPos->btPosFormat); fprintf(stderr," Time: %s",ctime(&pDataPos->tTime)); switch(pDataPos->btPosFormat) { case PF_HD: fprintf(stderr," Lat: %f\n", pDataPos->RGPSpos.stcD.dNorth); fprintf(stderr," Lon: %f\n", pDataPos->RGPSpos.stcD.dEast); break; case PF_HD_M: fprintf(stderr," Lat: %d, %f\n", pDataPos->RGPSpos.stcDM.iDNorth, pDataPos->RGPSpos.stcDM.dMNorth); fprintf(stderr," Lon: %d, %f\n", pDataPos->RGPSpos.stcDM.iDEast, pDataPos->RGPSpos.stcDM.dMEast); break; case PF_HD_M_S: fprintf(stderr," Lat: %d, %d, %f\n", pDataPos->RGPSpos.stcDMS.iDNorth, pDataPos->RGPSpos.stcDMS.iMNorth, pDataPos->RGPSpos.stcDMS.fSNorth); fprintf(stderr," Lon: %d, %d, %f\n", pDataPos->RGPSpos.stcDMS.iDEast, pDataPos->RGPSpos.stcDMS.iMEast, pDataPos->RGPSpos.stcDMS.fSEast); break; case PF_UTM: fprintf(stderr," Zone: %ld%c\n", pDataPos->RGPSpos.stcUTM.lZone, pDataPos->RGPSpos.stcUTM.cZC); fprintf(stderr," Northing: %7.0f, Easting: %7.0f\n", pDataPos->RGPSpos.stcUTM.dNorth, pDataPos->RGPSpos.stcUTM.dEast); break; default: break; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -