本文整理汇总了C++中SENTENCE类的典型用法代码示例。如果您正苦于以下问题:C++ SENTENCE类的具体用法?C++ SENTENCE怎么用?C++ SENTENCE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SENTENCE类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 );
}
开发者ID:mikejwatts,项目名称:epl_pi,代码行数:34,代码来源:hsc.cpp
示例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 );
}
开发者ID:mikejwatts,项目名称:epl_pi,代码行数:34,代码来源:ztg.cpp
示例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 );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:29,代码来源:HDM.CPP
示例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 );
}
开发者ID:JONA-GA,项目名称:connectorga_pi,代码行数:32,代码来源:mtw.cpp
示例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 );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:30,代码来源:WDR.CPP
示例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 );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:34,代码来源:apb.cpp
示例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 );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:30,代码来源:hdt.cpp
示例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 );
}
开发者ID:mikejwatts,项目名称:epl_pi,代码行数:30,代码来源:stn.cpp
示例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 );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:32,代码来源:VPW.CPP
示例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 );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:34,代码来源:dpt.cpp
示例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 );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:28,代码来源:VWE.CPP
示例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 );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:31,代码来源:GPwpl.cpp
示例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 );
}
开发者ID:JONA-GA,项目名称:connectorga_pi,代码行数:30,代码来源:hdm.cpp
示例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 );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:35,代码来源:GTD.CPP
示例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 );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:29,代码来源:TEP.CPP
示例16: Parse
bool ZZU::Parse( const SENTENCE& sentence )
{
/*
** ZZU - Time UTC
**
** 1 2
** | |
** $--ZZU,hhmmss.ss,*hh<CR><LF>
**
** 1) Universal Time Coordinated (UTC)
** 2) Checksum
*/
/*
** First we check the checksum...
*/
if ( sentence.IsChecksumBad( 2 ) == True )
{
SetErrorMessage( "Invalid Checksum" );
return( false );
}
time_t temp_time = time(nullptr);
struct tm * tm_p = gmtime(&temp_time);
int year = tm_p->tm_year + 1900;
int month = tm_p->tm_mon;
int day = tm_p->tm_mday;
UTCTimeString = sentence.Field( 1 );
char temp_number[ 3 ];
temp_number[ 2 ] = 0x00;
temp_number[ 0 ] = UTCTimeString[ 0 ];
temp_number[ 1 ] = UTCTimeString[ 1 ];
int hours = ::atoi( temp_number );
temp_number[ 0 ] = UTCTimeString[ 2 ];
temp_number[ 1 ] = UTCTimeString[ 3 ];
int minutes = ::atoi( temp_number );
temp_number[ 0 ] = UTCTimeString[ 4 ];
temp_number[ 1 ] = UTCTimeString[ 5 ];
int seconds = ::atoi( temp_number );
UTCTime = ctime( year, month, day, hours, minutes, seconds );
return( true );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:56,代码来源:ZZU.CPP
示例17: Parse
void LATITUDE::Parse( int position_field_number, int north_or_south_field_number, const SENTENCE& sentence )
{
// Thanks go to Eric Parsonage ([email protected]) for finding a nasty
// little bug that used to live here.
double position = 0.0;
position = sentence.Double( position_field_number );
std::string north_or_south = sentence.Field( north_or_south_field_number );
Set( position, north_or_south.c_str() );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:13,代码来源:LAT.CPP
示例18: Parse
bool RMB::Parse( const SENTENCE& sentence )
{
/*
** RMB - Recommended Minimum Navigation Information
** 14
** 1 2 3 4 5 6 7 8 9 10 11 12 13|
** | | | | | | | | | | | | | |
** $--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A*hh<CR><LF>
**
** Field Number:
** 1) Status, V = Navigation receiver warning
** 2) Cross Track error - nautical miles
** 3) Direction to Steer, Left or Right
** 4) TO Waypoint ID
** 5) FROM Waypoint ID
** 6) Destination Waypoint Latitude
** 7) N or S
** 8) Destination Waypoint Longitude
** 9) E or W
** 10) Range to destination in nautical miles
** 11) Bearing to destination in degrees True
** 12) Destination closing velocity in knots
** 13) Arrival Status, A = Arrival Circle Entered
** 14) Checksum
*/
/*
** First we check the checksum...
*/
NMEA0183_BOOLEAN check = sentence.IsChecksumBad( 14 );
if ( check == NTrue )
{
SetErrorMessage( _T("Invalid Checksum") );
return( FALSE );
}
/*
if ( check == Unknown0183 )
{
SetErrorMessage( _T("Missing Checksum") );
return( FALSE );
}
*/
IsDataValid = sentence.Boolean( 1 );
CrossTrackError = sentence.Double( 2 );
DirectionToSteer = sentence.LeftOrRight( 3 );
From = sentence.Field( 4 );
To = sentence.Field( 5 );
DestinationPosition.Parse( 6, 7, 8, 9, sentence );
RangeToDestinationNauticalMiles = sentence.Double( 10 );
BearingToDestinationDegreesTrue = sentence.Double( 11 );
DestinationClosingVelocityKnots = sentence.Double( 12 );
IsArrivalCircleEntered = sentence.Boolean( 13 );
return( TRUE );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:60,代码来源:rmb.cpp
示例19: Parse
bool XTE::Parse( const SENTENCE& sentence )
{
// ASSERT_VALID( this );
wxString field_data;
/*
** XTE - Autopilot Sentence
**
** 1 2 3 4 5 6
** | | | | | |
** $--XTE,A,A,x.x,a,N*hh<CR><LF>
**
** 1) Status
** V = LORAN-C Blink or SNR warning
** V = general warning flag or other navigation systems when a reliable
** fix is not available
** 2) Status
** V = Loran-C Cycle Lock warning flag
** A = OK or not used
** 3) Cross Track Error Magnitude
** 4) Direction to steer, L or R
** 5) Cross Track Units, N = Nautical Miles
** 6) Checksum
*/
/*
** First we check the checksum...
*/
NMEA0183_BOOLEAN check = sentence.IsChecksumBad( 15 );
if ( check == NTrue )
{
SetErrorMessage( _T("Invalid Checksum") );
return( FALSE );
}
/*
** Line has already been checked for checksum validity
*/
IsLoranBlinkOK = sentence.Boolean( 1 );
IsLoranCCycleLockOK = sentence.Boolean( 2 );
CrossTrackErrorDistance = sentence.Double( 3 );
DirectionToSteer = sentence.LeftOrRight( 4 );
CrossTrackUnits = sentence.Field( 5 );
return( TRUE );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:50,代码来源:xte.cpp
示例20: Write
bool RMC::Write( SENTENCE& sentence )
{
// ASSERT_VALID( this );
/*
** Let the parent do its thing
*/
RESPONSE::Write( sentence );
sentence += UTCTime;
sentence += IsDataValid;
sentence += Position;
sentence += SpeedOverGroundKnots;
sentence += TrackMadeGoodDegreesTrue;
sentence += Date;
if(MagneticVariation > 360.)
sentence += _T(",,");
else
{
sentence += MagneticVariation;
sentence += MagneticVariationDirection;
}
sentence.Finish();
return( TRUE );
}
开发者ID:buya07,项目名称:KomodoExercise,代码行数:29,代码来源:rmc.cpp
注:本文中的SENTENCE类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论