本文整理汇总了C++中SENTENCE类的典型用法代码示例。如果您正苦于以下问题:C++ SENTENCE类的具体用法?C++ SENTENCE怎么用?C++ SENTENCE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SENTENCE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parse
BOOL HSC::Parse( const SENTENCE& sentence )
{
ASSERT_VALID( this );
/*
** HSC - Heading Steering Command
**
** 1 2 3 4 5
** | | | | |
** $--HSC,x.x,T,x.x,M,*hh<CR><LF>
**
** Field Number:
** 1) Heading Degrees, True
** 2) T = True
** 3) Heading Degrees, Magnetic
** 4) M = Magnetic
** 5) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 5 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( FALSE );
}
DegreesTrue = sentence.Double( 1 );
DegreesMagnetic = sentence.Double( 3 );
return( TRUE );
}
示例2: Parse
BOOL ZTG::Parse( const SENTENCE& sentence )
{
ASSERT_VALID( this );
/*
** ZTG - UTC & Time to Destination Waypoint
**
** 1 2 3 4
** | | | |
** $--ZTG,hhmmss.ss,hhmmss.ss,c--c*hh<CR><LF>
**
** Fields:
** 1) Universal Time Coordinated (UTC)
** 2) Time Remaining
** 3) Destination Waypoint ID
** 4) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 4 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( FALSE );
}
UTCTime = sentence.Field( 1 );
TimeRemaining = sentence.Field( 2 );
To = sentence.Field( 3 );
return( TRUE );
}
示例3: Parse
bool HDM::Parse( const SENTENCE& sentence )
{
/*
** HDM - Heading - Deviation & Variation
**
** 1 2 3
** | | |
** $--HDM,x.x,M*hh<CR><LF>
**
** Field Number:
** 1) Heading in degrees
** 2) M, Magnetic Deviation
** 3) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 3 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( false );
}
HeadingDegrees = sentence.Double( 1 );
return( true );
}
示例4: Parse
bool MTW::Parse( const SENTENCE& sentence )
{
// ASSERT_VALID( this );
/*
** MTW - Water Temperature
**
** 1 2 3
** | | |
** $--MTW,x.x,C*hh<CR><LF>
**
** Field Number:
** 1) Degrees
** 2) Unit of Measurement, Celcius
** 3) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 3 ) == TRUE )
{
SetErrorMessage( _T("Invalid Checksum") );
return( FALSE );
}
Temperature = sentence.Double( 1 );
UnitOfMeasurement = sentence.Field( 2 );
return( TRUE );
}
示例5: Parse
bool WDR::Parse( const SENTENCE& sentence )
{
/*
** WDR - Distance to Waypoint, Rhumb Line
**
** 1 2 3 4
** | | | |
** $--WDR,x.x,N,c--c*hh<CR><LF>
**
** 1) Distance to waypoint
** 2) N = Nautical Miles
** 3) Waypoint ID (To)
** 4) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 4 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( false );
}
NauticalMiles = sentence.Double( 1 );
To = sentence.Field( 3 );
return( true );
}
示例6: Write
bool APB::Write( SENTENCE& sentence )
{
// ASSERT_VALID( this );
/*
** Let the parent do its thing
*/
RESPONSE::Write( sentence );
sentence += IsLoranBlinkOK;
sentence += IsLoranCCycleLockOK;
sentence.Add( CrossTrackErrorMagnitude, g_NMEAAPBPrecision);
if(DirectionToSteer == Left)
sentence += _T("L");
else
sentence += _T("R");
sentence += CrossTrackUnits;
sentence += IsArrivalCircleEntered;
sentence += IsPerpendicular;
sentence.Add( BearingOriginToDestination, g_NMEAAPBPrecision);
sentence += BearingOriginToDestinationUnits;
sentence += To;
sentence.Add( BearingPresentPositionToDestination, g_NMEAAPBPrecision );
sentence += BearingPresentPositionToDestinationUnits;
sentence.Add( HeadingToSteer, g_NMEAAPBPrecision );
sentence += HeadingToSteerUnits;
sentence.Finish();
return( TRUE );
}
示例7: Parse
bool HDT::Parse( const SENTENCE& sentence )
{
/*
** HDT - Heading - True
**
** 1 2 3
** | | |
** $--HDT,x.x,T*hh<CR><LF>
**
** Field Number:
** 1) Heading Degrees, TRUE
** 2) T = True
** 3) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 3 ) == TRUE )
{
SetErrorMessage( _T("Invalid Checksum") );
return( FALSE );
}
DegreesTrue = sentence.Double( 1 );
return( TRUE );
}
示例8: Parse
BOOL STN::Parse( const SENTENCE& sentence )
{
ASSERT_VALID( this );
/*
** STN - Multiple Data ID
**
** 1 2
** | |
** $--STN,x.x,*hh<CR><LF>
**
** Field Number:
** 1) Talker ID Number
** 2) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 2 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( FALSE );
}
TalkerIDNumber = sentence.Integer( 1 );
return( TRUE );
}
示例9: Parse
bool VPW::Parse( const SENTENCE& sentence )
{
/*
** VPW - Speed - Measured Parallel to Wind
**
** 1 2 3 4 5
** | | | | |
** $--VPW,x.x,N,x.x,M*hh<CR><LF>
**
** Field Number:
** 1) Speed, "-" means downwind
** 2) N = Knots
** 3) Speed, "-" means downwind
** 4) M = Meters per second
** 5) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 5 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( false );
}
Knots = sentence.Double( 1 );
MetersPerSecond = sentence.Double( 3 );
return( true );
}
示例10: Parse
bool DPT::Parse( const SENTENCE& sentence )
{
// ASSERT_VALID( this );
/*
** DPT - Heading - Deviation & Variation
**
** 1 2 3
** | | |
** $--DPT,x.x,x.x*hh<CR><LF>
**
** Field Number:
** 1) Depth, meters
** 2) Offset from transducer,
** positive means distance from tansducer to water line
** negative means distance from transducer to keel
** 3) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 3 ) == TRUE )
{
SetErrorMessage( _T("Invalid Checksum") );
return( FALSE );
}
DepthMeters = sentence.Double( 1 );
OffsetFromTransducerMeters = sentence.Double( 2 );
return( TRUE );
}
示例11: Parse
bool VWE::Parse( const SENTENCE& sentence )
{
/*
** VWE - Wind Track Efficiency
**
** 1 2
** | |
** $--VWE,x.x,*hh<CR><LF>
**
** Field Number:
** 1) Efficiency, Percent
** 2) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 2 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( false );
}
EfficiencyPercent = sentence.Integer( 1 );
return( true );
}
示例12: Parse
bool GPWPL::Parse( const SENTENCE& sentence )
{
/*
** WPL - Waypoint Location
**
** +-------------------------------- 1) Latitude
** | +------------------------ 2) N or S (North or South)
** | | +---------------------- 3) Longitude
** | | | +------------- 4) E or W (East or West)
** | | | | +----------- 5) Waypoint name
** | | | | | +-------6) Checksum
** | | | | | |
** $--WPL,llll.ll,a,yyyyy.yy,a,c--c*hh<CR><LF>
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 6 ) == NTrue )
{
SetErrorMessage( _T("Invalid Checksum") );
return( FALSE );
}
Position.Parse( 1, 2, 3, 4, sentence );
To = sentence.Field( 5 );
return( TRUE );
}
示例13: Parse
bool HDM::Parse( const SENTENCE& sentence )
{
/*
** HDM - Heading - Magnetic
**
** 1 2 3
** | | |
** $--HDM,x.x,M*hh<CR><LF>
**
** Field Number:
** 1) Heading Degrees, Magnetic
** 2) M = Magnetic
** 3) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 3 ) == TRUE )
{
SetErrorMessage( _T("Invalid Checksum") );
return( FALSE );
}
DegreesMagnetic = sentence.Double( 1 );
return( TRUE );
}
示例14: Parse
bool GTD::Parse( const SENTENCE& sentence )
{
/*
** GTD - Geographical Position, Loran-C TDs
**
** 1 2 3 4 5 6
** | | | | | |
** $--GTD,x.x,x.x,x.x,x,x,x.x*hh<CR><LF>
**
** 1) Time Difference 1 Microseconds
** 2) Time Difference 2 Microseconds
** 3) Time Difference 3 Microseconds
** 4) Time Difference 4 Microseconds
** 5) Time Difference 5 Microseconds
** 6) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 6 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( false );
}
TimeDifference1 = sentence.Field( 1 );
TimeDifference2 = sentence.Field( 2 );
TimeDifference3 = sentence.Field( 3 );
TimeDifference4 = sentence.Field( 4 );
TimeDifference5 = sentence.Field( 5 );
return( true );
}
示例15: Parse
bool TEP::Parse( const SENTENCE& sentence )
{
/*
** TEP - TRANSIT Satellite Predicted Elevation
**
** 1 2 3
** | | |
** $--TEP,x.x,T*hh<CR><LF>
**
** Field Number:
** 1) Elevation degrees
** 2) D = Degrees
** 3) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 3 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( false );
}
ElevationDegrees = sentence.Double( 1 );
return( true );
}