?? latlong.cpp
字號:
#include "nmea0183.h"
#pragma hdrstop
/*
** Author: Samuel R. Blackburn
** Internet: sam_blackburn@pobox.com
**
** You can use it any way you like as long as you don't try to sell it.
**
** Copyright, 1996, Samuel R. Blackburn
**
** $Workfile: latlong.cpp $
** $Revision: 5 $
** $Modtime: 10/13/98 6:39a $
*/
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
LATLONG::LATLONG()
{
Empty();
}
LATLONG::~LATLONG()
{
Empty();
}
void LATLONG::Empty( void )
{
Latitude.Empty();
Longitude.Empty();
}
BOOL LATLONG::Parse( int LatitudePositionFieldNumber, int NorthingFieldNumber, int LongitudePositionFieldNumber, int EastingFieldNumber, const SENTENCE& LineToParse )
{
Latitude.Parse( LatitudePositionFieldNumber, NorthingFieldNumber, LineToParse );
Longitude.Parse( LongitudePositionFieldNumber, EastingFieldNumber, LineToParse );
if ( Latitude.IsDataValid() && Longitude.IsDataValid() )
{
return( TRUE );
}
else
{
return( FALSE );
}
}
CString LATLONG::PlainEnglish( void ) const
{
CString return_string;
return_string.Format( "Latitude %d %8.5lf", Latitude.GetWholeDegrees(), Latitude.GetDecimalMinutes() );
if ( Latitude.Northing == North )
{
return_string += " North, Longitude ";
}
else
{
return_string += " South, Longitude ";
}
char temp_string[ 80 ];
::sprintf( temp_string, "%d %8.5lf", Longitude.GetWholeDegrees(), Longitude.GetDecimalMinutes() );
return_string += temp_string;
if ( Longitude.Easting == East )
{
return_string += " East";
}
else
{
return_string += " West";
}
return( return_string );
}
void LATLONG::Write( SENTENCE& sentence )
{
Latitude.Write( sentence );
Longitude.Write( sentence );
}
const LATLONG& LATLONG::operator = ( const LATLONG& source )
{
Latitude = source.Latitude;
Longitude = source.Longitude;
return( *this );
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -