📄 wxgpsevent.cpp
字号:
/*
* Roadnav
* wxGPSEvent.cpp
*
* Copyright (c) 2004 - 2006 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 )
using namespace std;
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_nSat = -1;
}
//////////////////////////////////////////////////////////////////////////////
///
/// \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, Point pt, double fSpeed, double fHeading, wxString strLockType, int nSat, vector<SSatelliteInfo> vSatellites, wxString strErrorMessage) : wxEvent(0, wxEVT_GPS_ACTION)
{
SetEventObject(NULL);
m_bEnabled = bEnabled;
m_bActive = bActive;
m_bLocked = bLocked;
m_pt = pt;
m_fSpeed = fSpeed;
m_fHeading = fHeading;
m_strLockType = strLockType;
m_nSat = nSat;
m_vSatellites = vSatellites;
m_strErrorMessage = strErrorMessage;
}
//////////////////////////////////////////////////////////////////////////////
///
/// \brief Produce a copy of this object.
///
//////////////////////////////////////////////////////////////////////////////
wxEvent * wxGPSEvent::Clone() const
{
return new wxGPSEvent(*this);
}
wxGPSEvent & wxGPSEvent::operator =(const wxGPSEvent & p)
{
if (this != &p)
{
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_nSat = p.m_nSat;
m_vSatellites = p.m_vSatellites;
}
return *this;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -