資源簡介
gps監控平臺,適合初學者學習使用

代碼片段和文件信息
//?Car.cpp:?implementation?of?the?CCar?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“GpsTest.h“
#include?“Car.h“
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCar::CCar()
{
m_bAlarm?=?FALSE;
m_bUnderWatch?=?FALSE;
m_bAlwaysAlarm?=?FALSE;
nLeftCount?=?0;
nInterval?=?0;
nLatitude?=?0;
nLongitude?=?0;
nSpeed?=?0;
nCourse?=?0;
dwStart?=?0;
dwBJtime?=?0;
m_strStatus?=?_T(“000000000000“);
m_strSn?=?_T(““);
m_strCmdWord?=?_T(““);
}
CCar::CCar(CString?strPhoneNum)
{
m_strPhoneNum?=?strPhoneNum;
m_bAlarm?=?FALSE;
m_bUnderWatch?=?FALSE;
m_bAlwaysAlarm?=?FALSE;
nLeftCount?=?0;
nInterval?=?0;
nLatitude?=?0;
nLongitude?=?0;
nSpeed?=?0;
nCourse?=?0;
dwStart?=?0;
dwBJtime?=?0;
m_strStatus?=?_T(“000000000000“);
m_strSn?=?_T(““);
m_strCmdWord?=?_T(““);
}
CCar::~CCar()
{
}
int?CCar::UpDateCar()
{
int?ij;
// srand((unsigned)?time?(NULL));
nLatitude?=?rand()%(nMaxLatitude-nMinLatitude+1)?+?nMinLatitude;
nLongitude?=?rand()%(nMaxLongitude-nMinLongitude+1)?+?nMinLongitude;
nSpeed?=?rand()%(nMaxSpeed-nMinSpeed+1)?+?nMinSpeed;
nCourse?=?rand()%(nMaxCourse-nMinCourse+1)?+nMinCourse;
i?=?rand()%200;
if?(i?==?10)
{
m_bAlarm?=?TRUE;
j?=?rand()%3;
if?(j?==?0)
m_strStatus?=?“000000000100“;
else?if?(j?==1)
m_strStatus?=?“000000000200“;
else?if?(j?==?2)
m_strStatus?=?“000000000400“;
}
// CCar?*car;
// CString??strMsg;
// for(k=0;?k<=m_carArray.GetUpperBound();?k++)
// {
// if?(static_cast(m_carArray.GetAt(k))->m_bAlarm)
// {
// car?=?m_carArray.GetAt(k);
// DWORD?dwtime;
// dwtime?=?GetTickCount();
// if?(!car->m_bAlwaysAlarm)
// {
// car->dwBJtime?=?dwtime;
// car->m_bAlwaysAlarm?=?TRUE;
// strMsg?=?CreateMessage(car?“00000000“?“BJ“?TRUE);
// int?nRet?=?SendCarData(car->m_strPhoneNum?strMsg);
// }
// }
//
// if?(static_cast(m_carArray.GetAt(k))->m_bAlwaysAlarm)
// {
// car?=?m_carArray.GetAt(k);
// DWORD?dwAtime;
// dwAtime?=?GetTickCount();
// if?((dwAtime?-?car->dwBJtime)?>?30000)
// {
// car->dwBJtime?=?dwAtime;
// strMsg?=?CreateMessage(car?“00000000“?“BJ“?TRUE);
// int?nRet?=?SendCarData(car->m_strPhoneNum?strMsg);
// }
// }
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2689??2006-06-15?09:52??GpsTest\Car.cpp
?????文件???????1124??2006-06-15?09:52??GpsTest\Car.h
?????文件???????4060??2006-06-15?09:52??GpsTest\CarSet.cpp
?????文件???????1581??2006-06-15?09:52??GpsTest\CarSet.h
?????文件???????4646??2006-06-15?09:52??GpsTest\ComSet.cpp
?????文件???????1433??2006-06-15?09:52??GpsTest\ComSet.h
?????文件??????13499??2006-06-15?09:52??GpsTest\EnumSerial.cpp
?????文件???????2466??2006-06-15?09:52??GpsTest\EnumSerial.h
?????文件?????198432??2009-01-02?10:40??GpsTest\GpsTest.aps
?????文件???????4484??2006-06-15?09:52??GpsTest\GpsTest.cpp
?????文件?????108323??2007-12-09?20:10??GpsTest\GpsTest.dep
?????文件???????6557??2008-09-14?03:19??GpsTest\GpsTest.dsp
?????文件????????539??2008-01-17?12:08??GpsTest\GpsTest.dsw
?????文件?????647223??2008-01-17?15:51??GpsTest\GpsTest.exe
?????文件???????1396??2006-06-15?09:52??GpsTest\GpsTest.h
?????文件??????12261??2008-09-14?03:19??GpsTest\GpsTest.mak
?????文件?????664576??2009-01-02?10:41??GpsTest\GpsTest.ncb
?????文件??????48640??2009-01-02?10:41??GpsTest\GpsTest.opt
?????文件???????1974??2008-09-14?01:12??GpsTest\GpsTest.plg
?????文件??????19448??2006-06-15?09:52??GpsTest\GpsTest.rc
?????文件???????1762??2006-06-15?09:52??GpsTest\GpsTestDoc.cpp
?????文件???????1486??2006-06-15?09:52??GpsTest\GpsTestDoc.h
?????文件??????52528??2008-09-14?01:12??GpsTest\GpsTestView.cpp
?????文件???????6360??2006-06-15?09:52??GpsTest\GpsTestView.h
?????文件???????2717??2006-06-15?09:52??GpsTest\MainFrm.cpp
?????文件???????1589??2006-06-15?09:52??GpsTest\MainFrm.h
?????文件?????153261??2006-06-15?09:52??GpsTest\MAPX.CPP
?????文件?????109587??2006-06-15?09:52??GpsTest\MAPX.H
?????文件???????9037??2006-06-15?09:52??GpsTest\motog18.cpp
?????文件???????3536??2006-06-15?09:52??GpsTest\motog18.h
............此處省略26個文件信息
- 上一篇:教程+軟件.rar
- 下一篇:BH1750 for CC2530
評論
共有 條評論