当前位置: 首页>>代码示例>>C++>>正文


C++ InfoBoxData::SetValue方法代码示例

本文整理汇总了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);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:28,代码来源:Team.cpp

示例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"));
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:25,代码来源:Task.cpp

示例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"));
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:26,代码来源:Task.cpp

示例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);
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例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);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:30,代码来源:Task.cpp

示例6:

void
InfoBoxContentThermalRatio::Update(InfoBoxData &data)
{
  // Set Value
  data.SetValue(_T("%2.0f%%"),
                    XCSoarInterface::Calculated().circling_percentage);
}
开发者ID:damianob,项目名称:xcsoar,代码行数:7,代码来源:Thermal.cpp

示例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);
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:8,代码来源:Weather.cpp

示例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));
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例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);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:8,代码来源:Thermal.cpp

示例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);
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:18,代码来源:Glide.cpp

示例11:

void
InfoBoxContentTrack::Update(InfoBoxData &data)
{
  if (!XCSoarInterface::Basic().track_available) {
    data.SetInvalid();
    return;
  }
  data.SetValue(XCSoarInterface::Basic().track);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:9,代码来源:Direction.cpp

示例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);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:11,代码来源:Thermal.cpp

示例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);
}
开发者ID:Exadios,项目名称:xcsoar-exp,代码行数:11,代码来源:Other.cpp

示例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);
}
开发者ID:damianob,项目名称:xcsoar,代码行数:11,代码来源:Other.cpp

示例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);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:13,代码来源:Task.cpp


注:本文中的InfoBoxData::SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。