本文整理汇总了C++中InfoBoxData::SetValueFromBearingDifference方法的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxData::SetValueFromBearingDifference方法的具体用法?C++ InfoBoxData::SetValueFromBearingDifference怎么用?C++ InfoBoxData::SetValueFromBearingDifference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoBoxData
的用法示例。
在下文中一共展示了InfoBoxData::SetValueFromBearingDifference方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
UpdateInfoBoxTeamBearingDiff(InfoBoxData &data)
{
const TeamCodeSettings &settings =
CommonInterface::GetComputerSettings().team_code;
const NMEAInfo &basic = CommonInterface::Basic();
const TrafficList &flarm = basic.flarm.traffic;
const TeamInfo &teamcode_info = CommonInterface::Calculated();
if (teamcode_info.teammate_available && basic.track_available) {
// Set Value
Angle Value = teamcode_info.teammate_vector.bearing - basic.track;
data.SetValueFromBearingDifference(Value);
} else
data.SetValueInvalid();
// Set Comment
if (!settings.team_flarm_id.IsDefined())
data.SetCommentInvalid();
else if (!StringIsEmpty(settings.team_flarm_callsign))
data.SetComment(settings.team_flarm_callsign);
else
data.SetComment(_T("???"));
if (flarm.FindTraffic(settings.team_flarm_id) != NULL)
data.SetCommentColor(2);
else
data.SetCommentColor(1);
}
示例2: fixed
void
InfoBoxContentBearingDiff::Update(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
const GeoVector &vector_remaining = task_stats.current_leg.vector_remaining;
if (!basic.track_available || !task_stats.task_valid ||
!vector_remaining.IsValid() || vector_remaining.distance <= fixed(10)) {
data.SetInvalid();
return;
}
Angle Value = vector_remaining.bearing - basic.track;
data.SetValueFromBearingDifference(Value);
}
示例3:
void
InfoBoxContentNextWaypoint::Update(InfoBoxData &data)
{
// use proper non-terminal next task stats
const Waypoint* way_point = protected_task_manager != NULL
? protected_task_manager->GetActiveWaypoint()
: NULL;
if (!way_point) {
data.SetTitle(_("Next"));
data.SetInvalid();
return;
}
data.SetTitle(way_point->name.c_str());
// Set Comment
if (way_point->radio_frequency.IsDefined()) {
const unsigned freq = way_point->radio_frequency.GetKiloHertz();
data.FormatComment(_T("%u.%03u %s"),
freq / 1000, freq % 1000, way_point->comment.c_str());
}
else
data.SetComment(way_point->comment.c_str());
const NMEAInfo &basic = CommonInterface::Basic();
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
const GlideResult &solution_remaining =
task_stats.current_leg.solution_remaining;
const GeoVector &vector_remaining = task_stats.current_leg.vector_remaining;
if (!basic.track_available || !task_stats.task_valid ||
!vector_remaining.IsValid()) {
data.SetValueInvalid();
return;
}
// Set Value
Angle Value = vector_remaining.bearing - basic.track;
data.SetValueFromBearingDifference(Value);
// Set Color (blue/black)
data.SetValueColor(solution_remaining.IsFinalGlide() ? 2 : 0);
}
示例4: 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);
}