📄 wxgpsevent.cpp
字号:
/* * Roadnav * wxGPSEvent.cpp * * Copyright (c) 2004 - 2007 Richard L. Lynch <rllynch@users.sourceforge.net> * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public License * as published by the Free Software Foundation. * * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ ///////////////////////////////////////////////////////////////////////////////// \file////// GPS event class./////////////////////////////////////////////////////////////////////////////////#ifdef HAVE_CONFIG_H# include <config.h>#endif#ifdef _MSC_VER#pragma warning(disable: 4786)#pragma warning(disable: 4800)#endif#include <wx/wx.h>#include "wxGPSEvent.h"DEFINE_EVENT_TYPE( wxEVT_GPS_ACTION )wxGPSEvent::wxGPSEvent() : wxEvent(0, wxEVT_GPS_ACTION){ SetEventObject(NULL); m_bEnabled = false; m_bActive = false; m_bLocked = false; m_fSpeed = -1; m_fHeading = -1; m_nSatUsedForLock = -1; m_nSatellitesVisible = 0;}//////////////////////////////////////////////////////////////////////////////////// \brief GPS event constructor - initialize object from parameters////// \param bEnabled Indicates if GPS support is turned on.////// \param bActive Indicates if a GPS unit has been detected.////// \param bLocked Indicates if the GPS unit is locked.////// \param pt GPS coordinates.////// \param fSpeed Speed in MPH.////// \param fHeading Heading in degrees.////// \param strLockType Indicates the type of GPS lock.////// \param nSat Number of satellites used for lock./////////////////////////////////////////////////////////////////////////////////wxGPSEvent::wxGPSEvent(bool bEnabled, bool bActive, bool bLocked, const Point & pt, double fSpeed, double fHeading, const wxString & strLockType, int nSatUsedForLock, const SSatelliteInfo * parSatellitesVisible, int nSatellitesVisible, const wxString & strErrorMessage) : wxEvent(0, wxEVT_GPS_ACTION){ int i; SetEventObject(NULL); m_bEnabled = bEnabled; m_bActive = bActive; m_bLocked = bLocked; m_pt = pt; m_fSpeed = fSpeed; m_fHeading = fHeading; m_strLockType = strLockType; m_nSatUsedForLock = nSatUsedForLock; m_nSatellitesVisible = nSatellitesVisible; m_strErrorMessage = strErrorMessage; for (i = 0; i < nSatellitesVisible; i++) m_arSatellitesVisible[i] = parSatellitesVisible[i];}//////////////////////////////////////////////////////////////////////////////////// \brief Produce a copy of this object./////////////////////////////////////////////////////////////////////////////////wxEvent * wxGPSEvent::Clone() const{ return new wxGPSEvent(*this);}//////////////////////////////////////////////////////////////////////////////////// \brief wxGPSEvent assignment operator/////////////////////////////////////////////////////////////////////////////////wxGPSEvent & wxGPSEvent::operator =(const wxGPSEvent & p) { if (this != &p) { int i; m_bEnabled = p.m_bEnabled; m_bActive = p.m_bActive; m_bLocked = p.m_bLocked; m_pt = p.m_pt; m_fSpeed = p.m_fSpeed; m_fHeading = p.m_fHeading; m_strLockType = p.m_strLockType; m_nSatUsedForLock = p.m_nSatUsedForLock; m_strErrorMessage = p.m_strErrorMessage; m_nSatellitesVisible = p.m_nSatellitesVisible; for (i = 0; i < p.m_nSatellitesVisible; i++) m_arSatellitesVisible[i] = p.m_arSatellitesVisible[i]; } return *this;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -