本文整理汇总了C++中InfoBoxData::SetCommentFromBearingDifference方法的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxData::SetCommentFromBearingDifference方法的具体用法?C++ InfoBoxData::SetCommentFromBearingDifference怎么用?C++ InfoBoxData::SetCommentFromBearingDifference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoBoxData
的用法示例。
在下文中一共展示了InfoBoxData::SetCommentFromBearingDifference方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
}
示例3:
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();
}