本文整理汇总了C++中InfoBoxData::SetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxData::SetValue方法的具体用法?C++ InfoBoxData::SetValue怎么用?C++ InfoBoxData::SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoBoxData
的用法示例。
在下文中一共展示了InfoBoxData::SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: fixed
void
InfoBoxContentTaskTimeUnderMaxHeight::Update(InfoBoxData &data)
{
const CommonStats &common_stats = XCSoarInterface::Calculated().common_stats;
const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats;
const fixed maxheight = fixed(protected_task_manager->
GetOrderedTaskBehaviour().start_max_height);
if (!task_stats.task_valid || !positive(maxheight)
|| !protected_task_manager
|| !positive(common_stats.TimeUnderStartMaxHeight)) {
data.SetInvalid();
return;
}
const int dd = (int)(XCSoarInterface::Basic().time -
common_stats.TimeUnderStartMaxHeight);
TCHAR value[32];
TCHAR comment[32];
FormatTimeTwoLines(value, comment, dd);
data.SetValue(value);
data.SetComment(_("Time Below"));
}
示例3: fixed
void
UpdateInfoBoxTaskTimeUnderMaxHeight(InfoBoxData &data)
{
const auto &calculated = CommonInterface::Calculated();
const TaskStats &task_stats = calculated.ordered_task_stats;
const CommonStats &common_stats = calculated.common_stats;
const fixed maxheight = fixed(protected_task_manager->
GetOrderedTaskSettings().start_constraints.max_height);
if (!task_stats.task_valid || !positive(maxheight)
|| !protected_task_manager
|| !positive(common_stats.TimeUnderStartMaxHeight)) {
data.SetInvalid();
return;
}
const int dd = (int)(CommonInterface::Basic().time -
common_stats.TimeUnderStartMaxHeight);
TCHAR value[32];
TCHAR comment[32];
FormatTimeTwoLines(value, comment, dd);
data.SetValue(value);
data.SetComment(_("Time Below"));
}
示例4:
void
InfoBoxContentFinalETEVMG::Update(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
if (!basic.ground_speed_available || task_stats.task_valid ||
task_stats.total.remaining.IsDefined()) {
data.SetInvalid();
return;
}
const fixed d = task_stats.total.remaining.get_distance();
const fixed &v = basic.ground_speed;
if (!task_stats.task_valid ||
!positive(d) ||
!positive(v)) {
data.SetInvalid();
return;
}
TCHAR HHMMSSsmart[32];
TCHAR SSsmart[32];
const int dd = (int)(d/v);
Units::TimeToTextSmart(HHMMSSsmart, SSsmart, dd);
data.SetValue(HHMMSSsmart);
data.SetComment(SSsmart);
}
示例5: FormatTimeTwoLines
void
UpdateInfoBoxFinalETEVMG(InfoBoxData &data)
{
const NMEAInfo &basic = CommonInterface::Basic();
const TaskStats &task_stats = CommonInterface::Calculated().task_stats;
if (!basic.ground_speed_available || !task_stats.task_valid ||
!task_stats.total.remaining.IsDefined()) {
data.SetInvalid();
return;
}
const fixed d = task_stats.total.remaining.GetDistance();
const fixed v = basic.ground_speed;
if (!task_stats.task_valid ||
!positive(d) ||
!positive(v)) {
data.SetInvalid();
return;
}
TCHAR value[32];
TCHAR comment[32];
const int dd = (int)(d/v);
FormatTimeTwoLines(value, comment, dd);
data.SetValue(value);
data.SetComment(comment);
}
示例6:
void
InfoBoxContentThermalRatio::Update(InfoBoxData &data)
{
// Set Value
data.SetValue(_T("%2.0f%%"),
XCSoarInterface::Calculated().circling_percentage);
}
示例7:
void
InfoBoxContentTemperatureForecast::Update(InfoBoxData &data)
{
auto temperature = CommonInterface::GetComputerSettings().forecast_temperature;
data.SetValue(_T("%2.1f"), temperature.ToUser());
data.SetValueUnit(Units::current.temperature_unit);
}
示例8: if
void
InfoBoxContentLDAvg::Update(InfoBoxData &data)
{
if (XCSoarInterface::Calculated().average_ld == 0) {
data.SetInvalid();
return;
}
// Set Value
if (XCSoarInterface::Calculated().average_ld < 0)
data.SetValue(_T("^^^"));
else if (XCSoarInterface::Calculated().average_ld >= 999)
data.SetValue(_T("+++"));
else
SetValueFromFixed(data, _T("%2.0f"),
fixed(XCSoarInterface::Calculated().average_ld));
}
示例9: FormatUserVerticalSpeed
static void
SetVSpeed(InfoBoxData &data, fixed value)
{
TCHAR buffer[32];
FormatUserVerticalSpeed(value, buffer, false);
data.SetValue(buffer[0] == _T('+') ? buffer + 1 : buffer);
data.SetValueUnit(Units::current.vertical_speed_unit);
}
示例10: if
void
UpdateInfoBoxGRAvg(InfoBoxData &data)
{
const auto average_gr = CommonInterface::Calculated().average_gr;
if (average_gr == 0) {
data.SetInvalid();
return;
}
// Set Value
if (average_gr < 0)
data.SetValue(_T("^^^"));
else if (!::GradientValid(average_gr))
data.SetValue(_T("+++"));
else
data.SetValueFromGlideRatio(average_gr);
}
示例11:
void
InfoBoxContentTrack::Update(InfoBoxData &data)
{
if (!XCSoarInterface::Basic().track_available) {
data.SetInvalid();
return;
}
data.SetValue(XCSoarInterface::Basic().track);
}
示例12:
void
UpdateInfoBoxThermalRatio(InfoBoxData &data)
{
// Set Value
if (negative(CommonInterface::Calculated().circling_percentage))
data.SetInvalid();
else
data.SetValue(_T("%2.0f%%"),
CommonInterface::Calculated().circling_percentage);
}
示例13:
void
UpdateInfoBoxGLoad(InfoBoxData &data)
{
if (!CommonInterface::Basic().acceleration.available) {
data.SetInvalid();
return;
}
// Set Value
data.SetValue(_T("%2.2f"), CommonInterface::Basic().acceleration.g_load);
}
示例14:
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);
}
示例15:
void
UpdateInfoBoxTaskSpeedHour(InfoBoxData &data)
{
const WindowStats &window =
CommonInterface::Calculated().task_stats.last_hour;
if (negative(window.duration)) {
data.SetInvalid();
return;
}
data.SetValue(_T("%2.0f"), Units::ToUserTaskSpeed(window.speed));
data.SetValueUnit(Units::current.task_speed_unit);
}