📄 gps.h
字号:
#ifndef GPS_H
#define GPS_H
//#include <windows.h>
#include "Serial.h"
class GPS
{
public:
struct SatelliteInfo
{
int satid;
int theata;
int alpha;
int snr;
};
typedef void cbLocationgProc(int valid,
int hh,int mm,int ss,int ms,
double longitude, double latitude,
double height,
char heightunit,
double velocity,
double direction,
int satnum,
double error,
LPVOID userptr);
typedef void cbSatelliteInfoProc(int allsatnum,
GPS::SatelliteInfo *satinfo,
LPVOID userptr);
typedef void cbDopProc(char mode1,
char mode2,
int usedsatnum,
int usedsat[12],
float error1,
float error2,
float error3,
LPVOID userptr);
private:
Serial *pSerial;
char buf[256],lasttime[20];
BOOL isrunning;
char *match(char *str,char *patten);
char *next_fld(char *str);
int hh,mm,ss,ms;
double longitude,latitude,dis,height,velocity,direction;
int code,satnum;
char heightunit;
int allsats;
SatelliteInfo satinfo[38];
char mode1,mode2;
int usedsat[12];
float error1,error3;
BOOL parse(char *buf);
HANDLE hWorkthread;
DWORD dwWorkthread;
static DWORD WINAPI WorkProc(LPVOID lpParam);
LPVOID lpUserPtr;
cbLocationgProc *pcbLocation;
cbSatelliteInfoProc *pcbSatInfo;
cbDopProc *pcbDop;
public:
GPS();
~GPS();
BOOL OpenDevice(TCHAR *strPort,int nBaudRate);
void CloseDevice();
BOOL Run();
void Stop();
BOOL IsRunning();
BOOL IsLocationValid();
double GetTimestamp();
double GetLongitude();
double GetLatitude();
double GetHeight();
char GetHeightUnit();
double GetVelocity();
double GetDirection();
int GetSatNum();
double GetError();
void set_EventProc(cbLocationgProc *cbLocation,cbSatelliteInfoProc *cbSatInfo,cbDopProc *cbDop,LPVOID userptr);
};
#endif //GPS_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -