本文整理汇总了C++中NMEAInfo::ProvideNettoVario方法的典型用法代码示例。如果您正苦于以下问题:C++ NMEAInfo::ProvideNettoVario方法的具体用法?C++ NMEAInfo::ProvideNettoVario怎么用?C++ NMEAInfo::ProvideNettoVario使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NMEAInfo
的用法示例。
在下文中一共展示了NMEAInfo::ProvideNettoVario方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// $PDVDS,nx,nz,flap,stallratio,netto
static bool
PDVDS(NMEAInputLine &line, NMEAInfo &info)
{
fixed AccelX = line.read(fixed_zero);
fixed AccelZ = line.read(fixed_zero);
int mag = (int)hypot(AccelX, AccelZ);
info.acceleration.ProvideGLoad(fixed(mag) / 100, true);
/*
double flap = line.read(0.0);
*/
line.skip();
info.stall_ratio = line.read(fixed_zero);
info.stall_ratio_available.Update(info.clock);
fixed value;
if (line.read_checked(value))
info.ProvideNettoVario(value / 10);
//hasVega = true;
return true;
}
示例2: if
/**
* $PWES0,DD,VVVV,MMMM,NNNN,BBBB,SSSS,AAAAA,QQQQQ,IIII,TTTT,UUU,CCCC*CS<CR><LF>
*/
static bool
PWES0(NMEAInputLine &line, NMEAInfo &info)
{
int i;
line.Skip(); /* device */
if (line.ReadChecked(i) && i >= -999 && i <= 999)
info.ProvideTotalEnergyVario(fixed(i) / 10);
line.Skip(); /* average vario */
if (line.ReadChecked(i) && i >= -999 && i <= 999)
info.ProvideNettoVario(fixed(i) / 10);
line.Skip(); /* average netto vario */
line.Skip(); /* speed to fly */
unsigned altitude;
if (line.ReadChecked(altitude) && altitude <= 99999)
info.ProvidePressureAltitude(fixed(altitude));
if (line.ReadChecked(altitude) && altitude <= 99999)
info.ProvideBaroAltitudeTrue(fixed(altitude));
unsigned ias, tas;
bool have_ias = line.ReadChecked(ias) && ias <= 9999;
bool have_tas = line.ReadChecked(tas) && tas <= 9999;
if (have_ias && have_tas)
info.ProvideBothAirspeeds(Units::ToSysUnit(fixed(ias) / 10,
Unit::KILOMETER_PER_HOUR),
Units::ToSysUnit(fixed(tas) / 10,
Unit::KILOMETER_PER_HOUR));
else if (!have_ias && have_tas)
info.ProvideTrueAirspeed(Units::ToSysUnit(fixed(tas) / 10,
Unit::KILOMETER_PER_HOUR));
unsigned voltage;
if (line.ReadChecked(voltage) && voltage <= 999) {
info.voltage = fixed(voltage) / 10;
info.voltage_available.Update(info.clock);
}
if (line.ReadChecked(i) && i >= -999 && i <= 999) {
info.temperature = CelsiusToKelvin(fixed(i) / 10);
info.temperature_available = true;
}
return true;
}
示例3: if
/**
* $PWES0,DD,VVVV,MMMM,NNNN,BBBB,SSSS,AAAAA,QQQQQ,IIII,TTTT,UUU,CCCC*CS<CR><LF>
*/
static bool
PWES0(NMEAInputLine &line, NMEAInfo &info)
{
int i, k;
line.skip(); /* device */
if (line.read_checked(i))
info.ProvideTotalEnergyVario(fixed(i) / 10);
line.skip(); /* average vario */
if (line.read_checked(i))
info.ProvideNettoVario(fixed(i) / 10);
line.skip(); /* average netto vario */
line.skip(); /* speed to fly */
if (line.read_checked(i))
info.ProvidePressureAltitude(fixed(i));
if (line.read_checked(i))
info.ProvideBaroAltitudeTrue(fixed(i));
bool have_ias = line.read_checked(i);
bool have_tas = line.read_checked(k);
if (have_ias && have_tas)
info.ProvideBothAirspeeds(Units::ToSysUnit(fixed(i) / 10,
Unit::KILOMETER_PER_HOUR),
Units::ToSysUnit(fixed(k) / 10,
Unit::KILOMETER_PER_HOUR));
else if (!have_ias && have_tas)
info.ProvideTrueAirspeed(Units::ToSysUnit(fixed(k) / 10,
Unit::KILOMETER_PER_HOUR));
if (line.read_checked(i)) {
info.voltage = fixed(i) / 10;
info.voltage_available.Update(info.clock);
}
if (line.read_checked(i)) {
info.temperature = CelsiusToKelvin(fixed(i) / 10);
info.temperature_available = true;
}
return true;
}
示例4: CelsiusToKelvin
/**
* Parse a "$D" sentence.
*
* Example: "$D,+0,100554,+25,18,+31,,0,-356,+25,+11,115,96*6A"
*/
static bool
LeonardoParseD(NMEAInputLine &line, NMEAInfo &info)
{
double value;
// 0 = vario [dm/s]
if (line.ReadChecked(value))
info.ProvideTotalEnergyVario(value / 10);
if (line.Rest().empty())
/* short "$D" sentence ends after vario */
return true;
// 1 = air pressure [Pa]
if (line.ReadChecked(value))
info.ProvideStaticPressure(AtmosphericPressure::Pascal(value));
// 2 = netto vario [dm/s]
if (line.ReadChecked(value))
info.ProvideNettoVario(value / 10);
// 3 = airspeed [km/h]
/* XXX is that TAS or IAS? */
if (line.ReadChecked(value))
info.ProvideTrueAirspeed(Units::ToSysUnit(value, Unit::KILOMETER_PER_HOUR));
// 4 = temperature [deg C]
double oat;
info.temperature_available = line.ReadChecked(oat);
if (info.temperature_available)
info.temperature = CelsiusToKelvin(oat);
// 5 = compass [degrees]
/* XXX unsupported by XCSoar */
// 6 = optimal speed [km/h]
/* XXX unsupported by XCSoar */
// 7 = equivalent MacCready [cm/s]
/* XXX unsupported by XCSoar */
// 8 = wind speed [km/h]
/* not used here, the "$C" record repeats it together with the
direction */
return true;
}
示例5:
/**
* Parse a "$PDGFTL1" sentence.
*
* Example: "$PDGFTL1,2025,2000,250,-14,45,134,28,65,382,153*3D"
*/
static bool
PDGFTL1(NMEAInputLine &line, NMEAInfo &info)
{
double value;
// Baro Altitude QNE(1013.25) 2025 meter 2025 mt
if (line.ReadChecked(value))
info.ProvidePressureAltitude(value);
// Baro Altitude QNH 2000 meter 2000 mt
if (line.ReadChecked(value))
info.ProvideBaroAltitudeTrue(value);
// Vario 250 cm/sec +2,50 m/s
if (line.ReadChecked(value))
info.ProvideTotalEnergyVario(value / 100);
// Netto Vario -14 dm/sec -1,40 m/s
if (line.ReadChecked(value))
info.ProvideNettoVario(value / 10);
// Indicated Air Speed 45 km/h 45 km/h
if (line.ReadChecked(value))
info.ProvideIndicatedAirspeed(Units::ToSysUnit(value, Unit::KILOMETER_PER_HOUR));
// Ground Efficiency 134 ratio 13,4 : 1
line.Skip();
// Wind Speed 28 km/h 28 km/h
// Wind Direction 65 degree 65 degree
SpeedVector wind;
if (ReadSpeedVector(line, wind))
info.ProvideExternalWind(wind);
// Main Lithium Battery Voltage 382 0.01 volts 3,82 volts
if (line.ReadChecked(value)) {
info.voltage = value / 100;
info.voltage_available.Update(info.clock);
}
// Backup AA Battery Voltage 153 0.01 volts 1,53 volts
return true;
}
示例6: fixed
/**
* $PWES0,DD,VVVV,MMMM,NNNN,BBBB,SSSS,AAAAA,QQQQQ,IIII,TTTT,UUU,CCC*CS<CR><LF>
*/
static bool
PWES0(NMEAInputLine &line, NMEAInfo &info)
{
int i, k;
line.skip(); /* device */
if (line.read_checked(i))
info.ProvideTotalEnergyVario(fixed(i) / 10);
line.skip(); /* average vario */
if (line.read_checked(i))
info.ProvideNettoVario(fixed(i) / 10);
line.skip(); /* average netto vario */
line.skip(); /* speed to fly */
if (line.read_checked(i))
info.ProvidePressureAltitude(fixed(i));
if (line.read_checked(i))
info.ProvideBaroAltitudeTrue(fixed(i));
bool have_ias = line.read_checked(i);
bool have_tas = line.read_checked(k);
if (have_ias && have_tas)
info.ProvideBothAirspeeds(Units::ToSysUnit(fixed(i) / 10,
unKiloMeterPerHour),
Units::ToSysUnit(fixed(k) / 10,
unKiloMeterPerHour));
if (line.read_checked(i)) {
info.voltage = fixed(i) / 10;
info.voltage_available.Update(info.clock);
}
if (line.read_checked(i)) {
info.temperature = Units::ToSysUnit(fixed(i) / 10, unGradCelcius);
info.temperature_available = true;
}
return true;
}
示例7:
/**
* 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;
}
示例8: SmallHypot
// $PDVDS,nx,nz,flap,stallratio,netto
static bool
PDVDS(NMEAInputLine &line, NMEAInfo &info)
{
const int accel_x = line.Read(0), accel_z = line.Read(0);
fixed mag = SmallHypot(fixed(accel_x), fixed(accel_z));
info.acceleration.ProvideGLoad(mag / 100, true);
/*
double flap = line.Read(0.0);
*/
line.Skip();
info.stall_ratio = line.Read(fixed(0));
info.stall_ratio_available.Update(info.clock);
int value;
if (line.ReadChecked(value))
info.ProvideNettoVario(fixed(value) / 10);
//hasVega = true;
return true;
}