本文整理汇总了C++中NMEAInfo::ProvideIndicatedAirspeedWithAltitude方法的典型用法代码示例。如果您正苦于以下问题:C++ NMEAInfo::ProvideIndicatedAirspeedWithAltitude方法的具体用法?C++ NMEAInfo::ProvideIndicatedAirspeedWithAltitude怎么用?C++ NMEAInfo::ProvideIndicatedAirspeedWithAltitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NMEAInfo
的用法示例。
在下文中一共展示了NMEAInfo::ProvideIndicatedAirspeedWithAltitude方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static bool
ParseAPENV1(NMEAInputLine &line, NMEAInfo &info)
{
// $APENV1,IAS,Altitude,0,0,0,VerticalSpeed,
int ias;
if (!line.ReadChecked(ias)) return false;
int altitude;
if (!line.ReadChecked(altitude)) return false;
line.Skip();
line.Skip();
line.Skip();
// In ft/min, quality of this is limited, do not use for the time being
int vs;
if (!line.ReadChecked(vs)) return false;
auto sys_alt = Units::ToSysUnit(fixed(altitude), Unit::FEET);
info.ProvidePressureAltitude(sys_alt);
info.ProvideIndicatedAirspeedWithAltitude(Units::ToSysUnit(fixed(ias), Unit::KNOTS), sys_alt);
return true;
}
示例2:
/**
* Parse the $PLXVF sentence (LXNav V7).
*
* $PLXVF,time ,AccX,AccY,AccZ,Vario,IAS,PressAlt*CS<CR><LF>
*
* Example: $PLXVF,1.00,0.87,-0.12,-0.25,90.2,244.3,*CS<CR><LF>
*
* @see http://www.xcsoar.org/trac/raw-attachment/ticket/1666/V7%20dataport%20specification%201.97.pdf
*/
static bool
PLXVF(NMEAInputLine &line, NMEAInfo &info)
{
line.Skip(4);
fixed vario;
if (line.ReadChecked(vario))
info.ProvideNettoVario(vario);
fixed ias;
bool have_ias = line.ReadChecked(ias);
fixed altitude;
if (line.ReadChecked(altitude)) {
info.ProvidePressureAltitude(altitude);
if (have_ias)
info.ProvideIndicatedAirspeedWithAltitude(ias, altitude);
}
return true;
}
示例3: while
bool
IgcReplay::Update(NMEAInfo &basic)
{
IGCFix fix;
while (true) {
if (!ReadPoint(fix, basic))
return false;
if (fix.time.IsPlausible())
break;
}
basic.clock = fixed(fix.time.GetSecondOfDay());
basic.alive.Update(basic.clock);
basic.ProvideTime(basic.clock);
basic.location = fix.location;
basic.location_available.Update(basic.clock);
if (fix.gps_altitude != 0) {
basic.gps_altitude = fixed(fix.gps_altitude);
basic.gps_altitude_available.Update(basic.clock);
} else
basic.gps_altitude_available.Clear();
if (fix.pressure_altitude != 0) {
basic.ProvidePressureAltitude(fixed(fix.pressure_altitude));
basic.ProvideBaroAltitudeTrue(fixed(fix.pressure_altitude));
} else {
basic.pressure_altitude_available.Clear();
basic.baro_altitude_available.Clear();
}
if (fix.enl >= 0) {
basic.engine_noise_level = fix.enl;
basic.engine_noise_level_available.Update(basic.clock);
} else
basic.engine_noise_level_available.Clear();
if (fix.trt >= 0) {
basic.track = Angle::Degrees(fixed(fix.trt));
basic.track_available.Update(basic.clock);
} else
basic.track_available.Clear();
if (fix.gsp >= 0) {
basic.ground_speed = Units::ToSysUnit(fixed(fix.gsp),
Unit::KILOMETER_PER_HOUR);
basic.ground_speed_available.Update(basic.clock);
} else
basic.ground_speed_available.Clear();
if (fix.ias >= 0) {
fixed ias = Units::ToSysUnit(fixed(fix.ias), Unit::KILOMETER_PER_HOUR);
if (fix.tas >= 0)
basic.ProvideBothAirspeeds(ias,
Units::ToSysUnit(fixed(fix.tas),
Unit::KILOMETER_PER_HOUR));
else
basic.ProvideIndicatedAirspeedWithAltitude(ias, basic.pressure_altitude);
} else if (fix.tas >= 0)
basic.ProvideTrueAirspeed(Units::ToSysUnit(fixed(fix.tas),
Unit::KILOMETER_PER_HOUR));
if (fix.siu >= 0) {
basic.gps.satellites_used = fix.siu;
basic.gps.satellites_used_available.Update(basic.clock);
}
basic.gps.real = false;
basic.gps.replay = true;
basic.gps.simulator = false;
return true;
}