本文整理汇总了C++中InfoBoxData::SetCommentInvalid方法的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxData::SetCommentInvalid方法的具体用法?C++ InfoBoxData::SetCommentInvalid怎么用?C++ InfoBoxData::SetCommentInvalid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoBoxData
的用法示例。
在下文中一共展示了InfoBoxData::SetCommentInvalid方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
UpdateInfoBoxNextDistance(InfoBoxData &data)
{
const Waypoint* way_point = protected_task_manager != NULL
? protected_task_manager->GetActiveWaypoint()
: NULL;
// Set title
if (!way_point)
data.SetTitle(_("WP Dist"));
else
data.SetTitle(way_point->name.c_str());
// use proper non-terminal next task stats
const NMEAInfo &basic = CommonInterface::Basic();
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
const GeoVector &vector_remaining = task_stats.current_leg.vector_remaining;
if (!task_stats.task_valid || !vector_remaining.IsValid()) {
data.SetInvalid();
return;
}
// Set Value
data.SetValueFromDistance(vector_remaining.distance);
data.SetValueColor(task_stats.inside_oz ? 3 : 0);
if (basic.track_available) {
Angle bd = vector_remaining.bearing - basic.track;
data.SetCommentFromBearingDifference(bd);
} else
data.SetCommentInvalid();
}
示例2: if
void
UpdateInfoBoxTeamBearing(InfoBoxData &data)
{
const TeamCodeSettings &settings =
CommonInterface::GetComputerSettings().team_code;
const TrafficList &flarm = CommonInterface::Basic().flarm.traffic;
const TeamInfo &teamcode_info = CommonInterface::Calculated();
if (teamcode_info.teammate_available) {
// Set Value
data.SetValue(teamcode_info.teammate_vector.bearing);
}
else
data.SetValueInvalid();
// Set Comment
if (!settings.team_flarm_id.IsDefined())
data.SetCommentInvalid();
else if (!settings.team_flarm_callsign.empty())
data.SetComment(settings.team_flarm_callsign.c_str());
else
data.SetComment(_T("???"));
if (flarm.FindTraffic(settings.team_flarm_id) != NULL)
data.SetCommentColor(2);
else
data.SetCommentColor(1);
}
示例3:
/*
* The NextArrow infobox contains an arrow pointing at the next waypoint.
* This function updates the text fields in the infobox.
*/
void
InfoBoxContentNextArrow::Update(InfoBoxData &data)
{
// use proper non-terminal next task stats
const NMEAInfo &basic = CommonInterface::Basic();
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
const GeoVector &vector_remaining = task_stats.current_leg.vector_remaining;
// Check if data is valid
bool distance_valid = task_stats.task_valid && vector_remaining.IsValid();
bool angle_valid = distance_valid && basic.track_available;
// Set title. Use waypoint name if available.
const Waypoint *way_point = protected_task_manager != nullptr
? protected_task_manager->GetActiveWaypoint()
: nullptr;
if (!way_point)
data.SetTitle(_("Next arrow"));
else
data.SetTitle(way_point->name.c_str());
// Set value
if (angle_valid)
data.SetCustom(); // Enables OnCustomPaint
else
data.SetInvalid();
// Set comment
if (distance_valid)
data.SetCommentFromDistance(vector_remaining.distance);
else
data.SetCommentInvalid();
}
示例4: FormatUserAltitude
void
InfoBoxContentBarogram::Update(InfoBoxData &data)
{
const MoreData &basic = CommonInterface::Basic();
TCHAR sTmp[32];
if (basic.NavAltitudeAvailable()) {
FormatUserAltitude(basic.nav_altitude, sTmp,
ARRAY_SIZE(sTmp));
data.SetComment(sTmp);
} else
data.SetCommentInvalid();
data.SetCustom();
}
示例5: vector
void
UpdateInfoBoxTakeoffDistance(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
const FlyingState &flight = CommonInterface::Calculated().flight;
if (!basic.location_available || !flight.flying ||
!flight.takeoff_location.IsValid()) {
data.SetInvalid();
return;
}
const GeoVector vector(basic.location, flight.takeoff_location);
data.SetValueFromDistance(vector.distance);
if (basic.track_available)
data.SetCommentFromBearingDifference(vector.bearing - basic.track);
else
data.SetCommentInvalid();
}
示例6:
void
UpdateInfoBoxHomeDistance(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
const CommonStats &common_stats = CommonInterface::Calculated().common_stats;
if (!common_stats.vector_home.IsValid()) {
data.SetInvalid();
return;
}
// Set Value
data.SetValueFromDistance(common_stats.vector_home.distance);
if (basic.track_available) {
Angle bd = common_stats.vector_home.bearing - basic.track;
data.SetCommentFromBearingDifference(bd);
} else
data.SetCommentInvalid();
}
示例7:
void
UpdateInfoBoxGRCruise(InfoBoxData &data)
{
const auto &basic = CommonInterface::Basic();
const auto &calculated = CommonInterface::Calculated();
const auto cruise_gr = calculated.cruise_gr;
if (!::GradientValid(cruise_gr)) {
data.SetInvalid();
return;
}
// Set Value
data.SetValueFromGlideRatio(cruise_gr);
if (basic.location_available)
data.SetCommentFromDistance(basic.location.DistanceS(calculated.cruise_start_location));
else
data.SetCommentInvalid();
}
示例8: SetValueFromDistance
void
InfoBoxContentNextDistance::Update(InfoBoxData &data)
{
// use proper non-terminal next task stats
const NMEAInfo &basic = CommonInterface::Basic();
const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats;
const GeoVector &vector_remaining = task_stats.current_leg.vector_remaining;
if (!task_stats.task_valid || !vector_remaining.IsValid()) {
data.SetInvalid();
return;
}
// Set Value
SetValueFromDistance(data, vector_remaining.distance);
if (basic.track_available) {
Angle bd = vector_remaining.bearing - basic.track;
SetCommentBearingDifference(data, bd);
} else
data.SetCommentInvalid();
}
示例9: switch
void
UpdateInfoBoxBattery(InfoBoxData &data)
{
#ifdef HAVE_BATTERY
bool DisplaySupplyVoltageAsValue=false;
switch (Power::External::Status) {
case Power::External::OFF:
if (CommonInterface::Basic().battery_level_available)
data.UnsafeFormatComment(_T("%s; %d%%"),
_("AC Off"),
(int)CommonInterface::Basic().battery_level);
else
data.SetComment(_("AC Off"));
break;
case Power::External::ON:
if (!CommonInterface::Basic().voltage_available)
data.SetComment(_("AC ON"));
else{
DisplaySupplyVoltageAsValue = true;
data.SetValueFromVoltage(CommonInterface::Basic().voltage);
}
break;
case Power::External::UNKNOWN:
default:
data.SetCommentInvalid();
}
#ifndef ANDROID
switch (Power::Battery::Status){
case Power::Battery::HIGH:
case Power::Battery::LOW:
case Power::Battery::CRITICAL:
case Power::Battery::CHARGING:
if (Power::Battery::RemainingPercentValid){
#endif
if (!DisplaySupplyVoltageAsValue)
data.SetValueFromPercent(Power::Battery::RemainingPercent);
else
data.SetCommentFromPercent(Power::Battery::RemainingPercent);
#ifndef ANDROID
}
else
if (!DisplaySupplyVoltageAsValue)
data.SetValueInvalid();
else
data.SetCommentInvalid();
break;
case Power::Battery::NOBATTERY:
case Power::Battery::UNKNOWN:
if (!DisplaySupplyVoltageAsValue)
data.SetValueInvalid();
else
data.SetCommentInvalid();
}
#endif
return;
#endif
if (CommonInterface::Basic().voltage_available) {
data.SetValueFromVoltage(CommonInterface::Basic().voltage);
return;
} else if (CommonInterface::Basic().battery_level_available) {
data.SetValueFromPercent(CommonInterface::Basic().battery_level);
return;
}
data.SetInvalid();
}