本文整理汇总了C++中NMEAInputLine::ReadFirstChar方法的典型用法代码示例。如果您正苦于以下问题:C++ NMEAInputLine::ReadFirstChar方法的具体用法?C++ NMEAInputLine::ReadFirstChar怎么用?C++ NMEAInputLine::ReadFirstChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NMEAInputLine
的用法示例。
在下文中一共展示了NMEAInputLine::ReadFirstChar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wind
static bool
PZAN3(NMEAInputLine &line, NMEAInfo &info)
{
// old: $PZAN3,+,026,V,321,035,A,321,035,V*cc
// new: $PZAN3,+,026,A,321,035,V[,A]*cc
line.Skip(3);
int direction, speed;
if (!line.ReadChecked(direction) || !line.ReadChecked(speed))
return false;
char okay = line.ReadFirstChar();
if (okay == 'V') {
okay = line.ReadFirstChar();
if (okay == 'V')
return true;
if (okay != 'A') {
line.Skip();
okay = line.ReadFirstChar();
}
}
if (okay == 'A') {
SpeedVector wind(Angle::Degrees(direction),
Units::ToSysUnit(fixed(speed), Unit::KILOMETER_PER_HOUR));
info.ProvideExternalWind(wind);
}
return true;
}
示例2:
static bool
ReadFixedAndChar(NMEAInputLine &line, fixed &d, char &ch)
{
bool success = line.ReadChecked(d);
ch = line.ReadFirstChar();
return success;
}
示例3:
static bool
ReadAltitude(NMEAInputLine &line, fixed &value_r)
{
fixed value;
bool available = line.ReadChecked(value);
char unit = line.ReadFirstChar();
if (!available)
return false;
if (unit == _T('f') || unit == _T('F'))
value = Units::ToSysUnit(value, Unit::FEET);
value_r = value;
return true;
}
示例4: if
bool
NMEAParser::GLL(NMEAInputLine &line, NMEAInfo &info)
{
/*
* $--GLL,llll.ll,a,yyyyy.yy,a,hhmmss.ss,a,m,*hh
*
* Field Number:
* 1) Latitude
* 2) N or S (North or South)
* 3) Longitude
* 4) E or W (East or West)
* 5) Universal Time Coordinated (UTC)
* 6) Status A - Data Valid, V - Data Invalid
* 7) FAA mode indicator (NMEA 2.3 and later)
* 8) Checksum
*/
GeoPoint location;
bool valid_location = ReadGeoPoint(line, location);
fixed this_time;
if (!ReadTime(line, info.date_time_utc, this_time))
return true;
bool gps_valid = !NAVWarn(line.ReadFirstChar());
if (!TimeHasAdvanced(this_time, info))
return true;
if (!gps_valid)
info.location_available.Clear();
else if (valid_location)
info.location_available.Update(info.clock);
if (valid_location)
info.location = location;
info.gps.real = real;
#if defined(ANDROID) || defined(__APPLE__)
info.gps.nonexpiring_internal_gps = false;
#endif
return true;
}