📄 wcv.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: wcv.cpp $
** $Revision: 4 $
** $Modtime: 10/10/98 2:39p $
*/
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
WCV::WCV()
{
Mnemonic = "WCV";
Empty();
}
WCV::~WCV()
{
Mnemonic.Empty();
Empty();
}
void WCV::Empty( void )
{
Velocity = 0.0;
To.Empty();
}
BOOL WCV::Parse( const SENTENCE& sentence )
{
/*
** WCV - Waypoint Closure Velocity
**
** 1 2 3 4
** | | | |
** $--WCV,x.x,N,c--c*hh<CR><LF>
**
** Field Number:
** 1) Velocity
** 2) N = knots
** 3) Waypoint ID
** 4) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 4 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( FALSE );
}
Velocity = sentence.Double( 1 );
To = sentence.Field( 3 );
return( TRUE );
}
BOOL WCV::Write( SENTENCE& sentence )
{
/*
** Let the parent do its thing
*/
RESPONSE::Write( sentence );
sentence += Velocity;
sentence += "N";
sentence += To;
sentence.Finish();
return( TRUE );
}
const WCV& WCV::operator = ( const WCV& source )
{
Velocity = source.Velocity;
To = source.To;
return( *this );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -