コード例 #1
0
bool
ConditionMonitorStartRules::CheckCondition(const GlideComputer& cmp)
{
#ifdef OLD_TASK // start condition warnings
  if (!task.Valid()
      || !cmp.Basic().flying
      || (task.getActiveIndex() > 0)
      || !task.ValidTaskPoint(task.getActiveIndex() + 1))
    return false;

  if (cmp.Calculated().LegDistanceToGo > task.getSettings().StartRadius)
    return false;

  if (cmp.ValidStartSpeed(task.getSettings().StartMaxSpeedMargin)
      && cmp.InsideStartHeight(task.getSettings().StartMaxHeightMargin))
    withinMargin = true;
  else
    withinMargin = false;
  }
コード例 #2
0
ファイル: RunAnalysis.cpp プロジェクト: j-konopka/XCSoar-TE
static void
LoadReplay(DebugReplay *replay, GlideComputer &glide_computer,
           InterfaceBlackboard &blackboard)
{
  unsigned i = 0;
  while (replay->Next()) {
    const MoreData &basic = replay->Basic();

    glide_computer.ReadBlackboard(basic);
    glide_computer.ProcessGPS();

    if (++i == 8) {
      i = 0;
      glide_computer.ProcessIdle();
    }
  }

  glide_computer.ProcessExhaustive();

  blackboard.ReadBlackboardBasic(glide_computer.Basic());
  blackboard.ReadBlackboardCalculated(glide_computer.Calculated());
}
コード例 #3
0
void
ConditionMonitor::Update(const GlideComputer& cmp)
{
  if (!cmp.Calculated().flight.flying)
    return;

  bool restart = false;
  const fixed Time = cmp.Basic().time;
  if (Ready_Time_Check(Time, &restart)) {
    LastTime_Check = Time;
    if (CheckCondition(cmp)) {
      if (Ready_Time_Notification(Time) && !restart) {
        LastTime_Notification = Time;
        Notify();
        SaveLast();
      }
    }

    if (restart)
      SaveLast();
  }
}