本文整理汇总了C++中InfoBoxData::SetInvalid方法的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxData::SetInvalid方法的具体用法?C++ InfoBoxData::SetInvalid怎么用?C++ InfoBoxData::SetInvalid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoBoxData
的用法示例。
在下文中一共展示了InfoBoxData::SetInvalid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
UpdateInfoBoxSpeed(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
if (!basic.airspeed_available) {
data.SetInvalid();
return;
}
data.SetValueFromSpeed(basic.true_airspeed, false);
}
示例2:
void
UpdateInfoBoxFinalGR(InfoBoxData &data)
{
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
if (!task_stats.task_valid) {
data.SetInvalid();
return;
}
auto gradient = task_stats.total.gradient;
if (gradient <= 0) {
data.SetValue(_T("+++"));
return;
}
if (::GradientValid(gradient))
data.SetValueFromGlideRatio(gradient);
else
data.SetInvalid();
}
示例3:
void
UpdateInfoBoxGLoad(InfoBoxData &data)
{
if (!CommonInterface::Basic().acceleration.available) {
data.SetInvalid();
return;
}
// Set Value
data.SetValue(_T("%2.2f"), CommonInterface::Basic().acceleration.g_load);
}
示例4:
void
InfoBoxContentGLoad::Update(InfoBoxData &data)
{
if (!XCSoarInterface::Basic().acceleration.available) {
data.SetInvalid();
return;
}
// Set Value
data.SetValue(_T("%2.2f"), XCSoarInterface::Basic().acceleration.g_load);
}
示例5:
void
InfoBoxContentThermalLastGain::Update(InfoBoxData &data)
{
const OneClimbInfo &thermal = CommonInterface::Calculated().last_thermal;
if (!thermal.IsDefined()) {
data.SetInvalid();
return;
}
data.SetValueFromAltitude(thermal.gain);
}
示例6: SetVSpeed
void
InfoBoxContentThermalLastAvg::Update(InfoBoxData &data)
{
const OneClimbInfo &thermal = CommonInterface::Calculated().last_thermal;
if (!thermal.IsDefined()) {
data.SetInvalid();
return;
}
SetVSpeed(data, thermal.lift_rate);
}
示例7:
void
InfoBoxContentFinalGR::Update(InfoBoxData &data)
{
const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats;
if (!task_stats.task_valid) {
data.SetInvalid();
return;
}
fixed gradient = task_stats.total.gradient;
if (!positive(gradient)) {
data.SetValue(_T("+++"));
return;
}
if (::GradientValid(gradient)) {
data.UnsafeFormatValue(_T("%d"), (int)gradient);
} else {
data.SetInvalid();
}
}
示例8:
void
UpdateInfoBoxFinalAltitudeRequire(InfoBoxData &data)
{
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
if (!task_stats.task_valid ||
!task_stats.total.solution_remaining.IsOk()) {
data.SetInvalid();
return;
}
data.SetValueFromAltitude(task_stats.total.solution_remaining.GetRequiredAltitude());
}
示例9: FindNearestVerticalAirspace
void
InfoBoxContentNearestAirspaceVertical::Update(InfoBoxData &data)
{
NearestAirspace nearest = FindNearestVerticalAirspace();
if (!nearest.IsDefined()) {
data.SetInvalid();
return;
}
data.SetValueFromArrival(nearest.distance);
data.SetComment(nearest.airspace->GetName());
}
示例10:
void
UpdateInfoBoxTerrainHeight(InfoBoxData &data)
{
const TerrainInfo &calculated = CommonInterface::Calculated();
if (!calculated.terrain_valid){
data.SetInvalid();
return;
}
data.SetValueFromAltitude(calculated.terrain_altitude);
data.SetCommentFromAlternateAltitude(calculated.terrain_altitude);
}
示例11:
void
UpdateInfoBoxHumidity(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
if (!basic.humidity_available) {
data.SetInvalid();
return;
}
// Set Value
data.UnsafeFormatValue( _T("%d"), (int)basic.humidity);
}
示例12:
void
InfoBoxContentHumidity::Update(InfoBoxData &data)
{
const NMEAInfo &basic = XCSoarInterface::Basic();
if (!basic.humidity_available) {
data.SetInvalid();
return;
}
// Set Value
data.UnsafeFormatValue( _T("%d"), (int)basic.humidity);
}
示例13:
void
InfoBoxContentAltitudeGPS::Update(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
if (!basic.gps_altitude_available) {
data.SetInvalid();
return;
}
data.SetValueFromAltitude(basic.gps_altitude);
data.SetCommentFromAlternateAltitude(basic.gps_altitude);
}
示例14: lease
void
InfoBoxContentAlternateName::Update(InfoBoxData &data)
{
if (protected_task_manager == NULL) {
data.SetInvalid();
return;
}
ProtectedTaskManager::Lease lease(*protected_task_manager);
const AlternateList &alternates = lease->GetAlternates();
const AlternatePoint *alternate;
if (!alternates.empty()) {
if (index >= alternates.size())
index = alternates.size() - 1;
alternate = &alternates[index];
} else {
alternate = NULL;
}
data.FormatTitle(_("Altn %d"), index + 1);
if (alternate == NULL || !CommonInterface::Basic().track_available) {
data.SetInvalid();
return;
}
data.SetComment(alternate->waypoint.name.c_str());
// Set Value
Angle Value = alternate->solution.vector.bearing -
CommonInterface::Basic().track;
data.SetValueFromBearingDifference(Value);
// Set Color (blue/black)
data.SetValueColor(alternate->solution.IsFinalGlide() ? 2 : 0);
}
示例15:
void
UpdateInfoBoxGRInstant(InfoBoxData &data)
{
const auto gr = CommonInterface::Calculated().gr;
if (!::GradientValid(gr)) {
data.SetInvalid();
return;
}
// Set Value
data.SetValueFromGlideRatio(gr);
}