Exemplo n.º 1
0
void
InfoBoxContentOLCSpeed::Update(InfoBoxData &data)
{
  const ComputerSettings &settings_computer =
    CommonInterface::GetComputerSettings();

  if (!settings_computer.contest.enable || !protected_task_manager) {
    data.SetInvalid();
    return;
  }

  int result_index =
    (settings_computer.contest.contest == Contest::OLC_LEAGUE) ? 0 : -1;

  const ContestResult& result_olc =
    CommonInterface::Calculated().contest_stats.GetResult(result_index);

  if (result_olc.score < fixed(1)) {
    data.SetInvalid();
    return;
  }

  // Set Value
  data.SetValueFromSpeed(result_olc.GetSpeed());

  data.UnsafeFormatComment(_T("%.1f pts"), (double)result_olc.score);
}
Exemplo n.º 2
0
void
InfoBoxContentSpeed::Update(InfoBoxData &data)
{
  const NMEAInfo &basic = CommonInterface::Basic();
  if (!basic.airspeed_available) {
    data.SetInvalid();
    return;
  }

  data.SetValueFromSpeed(basic.true_airspeed, false);
}
Exemplo n.º 3
0
void
InfoBoxContentSpeedGround::Update(InfoBoxData &data)
{
  const NMEAInfo &basic = CommonInterface::Basic();
  if (!basic.ground_speed_available) {
    data.SetInvalid();
    return;
  }

  data.SetValueFromSpeed(basic.ground_speed);
}
Exemplo n.º 4
0
void
UpdateInfoBoxSpeedIndicated(InfoBoxData &data)
{
  const NMEAInfo &basic = CommonInterface::Basic();
  if (!basic.airspeed_available) {
    data.SetInvalid();
    return;
  }

  data.SetValueFromSpeed(basic.indicated_airspeed, false);
}
Exemplo n.º 5
0
void
InfoBoxContentSpeedDolphin::Update(InfoBoxData &data)
{
  // Set Value
  const DerivedInfo &calculated = CommonInterface::Calculated();
  data.SetValueFromSpeed(calculated.V_stf, false);

  // Set Comment
  if (XCSoarInterface::GetComputerSettings().features.block_stf_enabled)
    data.SetComment(_("BLOCK"));
  else
    data.SetComment(_("DOLPHIN"));

}
Exemplo n.º 6
0
void
InfoBoxContentSpeedMacCready::Update(InfoBoxData &data)
{
  const CommonStats &common_stats = CommonInterface::Calculated().common_stats;
  data.SetValueFromSpeed(common_stats.V_block, false);
}