本文整理汇总了C++中NMEAInfo::ProvidePressureAltitude方法的典型用法代码示例。如果您正苦于以下问题:C++ NMEAInfo::ProvidePressureAltitude方法的具体用法?C++ NMEAInfo::ProvidePressureAltitude怎么用?C++ NMEAInfo::ProvidePressureAltitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NMEAInfo
的用法示例。
在下文中一共展示了NMEAInfo::ProvidePressureAltitude方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: line
bool
EWMicroRecorderDevice::ParseNMEA(const char *String, NMEAInfo &info)
{
if (!VerifyNMEAChecksum(String))
return false;
NMEAInputLine line(String);
char type[16];
line.Read(type, 16);
if (StringIsEqual(type, "$PGRMZ")) {
fixed value;
/* The normal Garmin $PGRMZ line contains the "true" barometric
altitude above MSL (corrected with QNH), but EWMicroRecorder
differs here slightly: it emits the uncorrected barometric
altitude. That is the only reason why we catch this sentence
in the driver instead of letting the generic class NMEAParser
do it. */
if (ReadAltitude(line, value))
info.ProvidePressureAltitude(value);
return true;
} else
return false;
}
示例2: altitude
// RMN: Volkslogger
// Source data:
// $PGCS,1,0EC0,FFF9,0C6E,02*61
// $PGCS,1,0EC0,FFFA,0C6E,03*18
static bool
vl_PGCS1(NMEAInputLine &line, NMEAInfo &info)
{
if (line.Read(1) != 1)
return false;
/* pressure sensor */
line.Skip();
// four characers, hex, barometric altitude
unsigned u_altitude;
if (line.ReadHexChecked(u_altitude)) {
int altitude(u_altitude);
if (altitude > 60000)
/* Assuming that altitude has wrapped around. 60 000 m occurs
at QNH ~2000 hPa */
altitude -= 65535;
info.ProvidePressureAltitude(fixed(altitude));
}
// ExtractParameter(String,ctemp,3);
// four characters, hex, constant. Value 1371 (dec)
// nSatellites = (int)(min(12,HexStrToDouble(ctemp, NULL)));
return false;
}
示例3:
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;
}
示例4:
static bool
GPWIN(NMEAInputLine &line, NMEAInfo &info)
{
line.skip(2);
fixed value;
if (line.read_checked(value))
info.ProvidePressureAltitude(value / 10);
return false;
}
示例5: 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;
}
示例6: 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;
}
示例7: IAS
static bool
LXWP0(NMEAInputLine &line, NMEAInfo &info)
{
/*
$LXWP0,Y,222.3,1665.5,1.71,,,,,,239,174,10.1
0 loger_stored (Y/N)
1 IAS (kph) ----> Condor uses TAS!
2 baroaltitude (m)
3-8 vario (m/s) (last 6 measurements in last second)
9 heading of plane
10 windcourse (deg)
11 windspeed (kph)
*/
line.Skip();
fixed airspeed;
bool tas_available = line.ReadChecked(airspeed);
if (tas_available && (airspeed < fixed(-50) || airspeed > fixed(250)))
/* implausible */
return false;
fixed value;
if (line.ReadChecked(value))
/* a dump on a LX7007 has confirmed that the LX sends uncorrected
altitude above 1013.25hPa here */
info.ProvidePressureAltitude(value);
if (tas_available)
/*
* Call ProvideTrueAirspeed() after ProvidePressureAltitude() to use
* the provided altitude (if available)
*/
info.ProvideTrueAirspeed(Units::ToSysUnit(airspeed, Unit::KILOMETER_PER_HOUR));
if (line.ReadChecked(value))
info.ProvideTotalEnergyVario(value);
line.Skip(6);
SpeedVector wind;
if (ReadSpeedVector(line, wind))
info.ProvideExternalWind(wind);
return true;
}
示例8: meters
/*
$PCAID,<1>,<2>,<3>,<4>*hh<CR><LF>
<1> Logged 'L' Last point Logged 'N' Last Point not logged
<2> Barometer Altitude in meters (Leading zeros will be transmitted)
<3> Engine Noise Level
<4> Log Flags
*hh Checksum, XOR of all bytes of the sentence after the $ and before the *
*/
static bool
cai_PCAID(NMEAInputLine &line, NMEAInfo &data)
{
line.skip();
fixed value;
if (line.read_checked(value))
data.ProvidePressureAltitude(value);
unsigned enl;
if (line.read_checked(enl)) {
data.engine_noise_level = enl;
data.engine_noise_level_available.Update(data.clock);
}
return true;
}
示例9: fixed
bool
NMEAParser::PTAS1(NMEAInputLine &line, NMEAInfo &info)
{
/*
* $PTAS1,xxx,yyy,zzzzz,aaa*CS<CR><LF>
*
* xxx
* CV or current vario. =vario*10+200 range 0-400(display +/-20.0 knots)
*
* yyy
* AV or average vario. =vario*10+200 range 0-400(display +/-20.0 knots)
*
* zzzzz
* Barometric altitude in feet +2000
*
* aaa
* TAS knots 0-200
*/
// Parse current vario data
fixed vario;
if (line.ReadChecked(vario)) {
// Properly convert to m/s
vario = Units::ToSysUnit((vario - fixed(200)) / 10, Unit::KNOTS);
info.ProvideTotalEnergyVario(vario);
}
// Skip average vario data
line.Skip();
// Parse barometric altitude
fixed baro_altitude;
if (line.ReadChecked(baro_altitude)) {
// Properly convert to meter
baro_altitude = Units::ToSysUnit(baro_altitude - fixed(2000), Unit::FEET);
info.ProvidePressureAltitude(baro_altitude);
}
// Parse true airspeed
fixed vtas;
if (line.ReadChecked(vtas))
info.ProvideTrueAirspeed(Units::ToSysUnit(vtas, Unit::KNOTS));
return true;
}
示例10: 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;
}
示例11:
/**
* 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;
}
示例12: line
bool
AltairProDevice::ParseNMEA(const char *String, NMEAInfo &info)
{
NMEAInputLine line(String);
char type[16];
line.read(type, 16);
// no propriatary sentence
if (strcmp(type, "$PGRMZ") == 0) {
fixed value;
if (ReadAltitude(line, value))
info.ProvidePressureAltitude(value);
return true;
}
return false;
}
示例13:
static bool
PDVDV(NMEAInputLine &line, NMEAInfo &info)
{
fixed value;
if (line.read_checked(value))
info.ProvideTotalEnergyVario(value / 10);
bool ias_available = line.read_checked(value);
fixed tas_ratio = line.read(fixed(1024)) / 1024;
if (ias_available)
info.ProvideBothAirspeeds(value / 10, value / 10 * tas_ratio);
//hasVega = true;
if (line.read_checked(value))
info.ProvidePressureAltitude(value);
return true;
}
示例14: protected_task_manager
bool
DemoReplayGlue::Update(NMEAInfo &data, fixed time_scale)
{
if (!UpdateTime())
return true;
fixed floor_alt = fixed_300;
if (device_blackboard->Calculated().terrain_valid) {
floor_alt += device_blackboard->Calculated().terrain_altitude;
}
bool retval;
{
ProtectedTaskManager::ExclusiveLease protected_task_manager(*task_manager);
TaskAccessor ta(protected_task_manager, floor_alt);
retval = DemoReplay::Update(time_scale, ta);
}
const AircraftState &s = aircraft.GetState();
data.clock = s.time;
data.alive.Update(data.clock);
data.ProvideTime(s.time);
data.location = s.location;
data.location_available.Update(data.clock);
data.ground_speed = s.ground_speed;
data.ground_speed_available.Update(data.clock);
data.track = s.track;
data.track_available.Update(data.clock);
data.gps_altitude = s.altitude;
data.gps_altitude_available.Update(data.clock);
data.ProvidePressureAltitude(s.altitude);
data.ProvideBaroAltitudeTrue(s.altitude);
data.gps.real = false;
data.gps.replay = true;
data.gps.simulator = false;
return retval;
}
示例15: fixed
static bool
PDVDV(NMEAInputLine &line, NMEAInfo &info)
{
int value;
if (line.ReadChecked(value))
info.ProvideTotalEnergyVario(fixed(value) / 10);
bool ias_available = line.ReadChecked(value);
int tas_ratio = line.Read(1024);
if (ias_available) {
const fixed ias = fixed(value) / 10;
info.ProvideBothAirspeeds(ias, ias * tas_ratio / 1024);
}
//hasVega = true;
if (line.ReadChecked(value))
info.ProvidePressureAltitude(fixed(value));
return true;
}