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


C++ TaskManager::CheckOrderedTask方法代码示例

本文整理汇总了C++中TaskManager::CheckOrderedTask方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskManager::CheckOrderedTask方法的具体用法?C++ TaskManager::CheckOrderedTask怎么用?C++ TaskManager::CheckOrderedTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TaskManager的用法示例。


在下文中一共展示了TaskManager::CheckOrderedTask方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: chart

void
RenderSpeed(Canvas &canvas, const PixelRect rc,
            const ChartLook &chart_look,
            const FlightStatistics &fs,
            const NMEAInfo &nmea_info,
            const DerivedInfo &derived_info,
            const TaskManager &task)
{
  ChartRenderer chart(chart_look, canvas, rc);

  if (!fs.task_speed.HasResult() || !task.CheckOrderedTask()) {
    chart.DrawNoData();
    return;
  }

  chart.ScaleXFromData(fs.task_speed);
  chart.ScaleYFromData(fs.task_speed);
  chart.ScaleYFromValue(0);
  chart.ScaleXFromValue(fs.task_speed.GetMinX());

  DrawLegs(chart, task, nmea_info, derived_info, true);

  chart.DrawXGrid(0.5,
                  ChartLook::STYLE_THINDASHPAPER, 0.5, true);
  chart.DrawYGrid(Units::ToSysTaskSpeed(10),
                  ChartLook::STYLE_THINDASHPAPER, 10, true);
  chart.DrawLineGraph(fs.task_speed, ChartLook::STYLE_MEDIUMBLACK);
  chart.DrawTrend(fs.task_speed, ChartLook::STYLE_BLUETHIN);

  chart.DrawXLabel(_T("t"), _T("hr"));
  chart.DrawYLabel(_T("h"), Units::GetTaskSpeedName());
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:32,代码来源:BarographRenderer.cpp

示例2: test_task_or

bool test_task_or(TaskManager& task_manager,
                  const Waypoints &waypoints)
{
    const Waypoint *wp;

    task_manager.SetFactory(TaskFactoryType::FAI_OR);
    AbstractTaskFactory &fact = task_manager.GetFactory();

    task_report(task_manager, "# adding start\n");
    wp = waypoints.LookupId(1);
    if (wp) {
        OrderedTaskPoint *tp = fact.CreateStart(*wp);
        if (!fact.Append(*tp)) {
            return false;
        }
        delete tp;
    }

    task_manager.SetActiveTaskPoint(0);
    task_manager.Resume();

    task_report(task_manager, "# adding intermediate\n");
    wp = waypoints.LookupId(2);
    if (wp) {
        OrderedTaskPoint *tp = fact.CreateIntermediate(*wp);
        if (!fact.Append(*tp)) {
            return false;
        }
        delete tp;
    }

    task_report(task_manager, "# adding finish\n");
    wp = waypoints.LookupId(1);
    if (wp) {
        OrderedTaskPoint *tp = fact.CreateFinish(*wp);
        if (!fact.Append(*tp)) {
            return false;
        }
        delete tp;
    }

    fact.UpdateStatsGeometry();

    task_report(task_manager, "# checking task..\n");
    if (!fact.Validate()) {
        return false;
    }

    if (!task_manager.CheckOrderedTask()) {
        return false;
    }
    return true;

}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:54,代码来源:harness_task.cpp

示例3: test_task_dash

bool test_task_dash(TaskManager& task_manager,
                    const Waypoints &waypoints)
{
  WaypointPtr wp;

  task_manager.SetFactory(TaskFactoryType::TOURING);
  AbstractTaskFactory &fact = task_manager.GetFactory();

  task_report(task_manager, "# adding start\n");
  wp = waypoints.LookupId(1);
  if (wp) {
    OrderedTaskPoint *tp = fact.CreateStart(std::move(wp));
    if (!fact.Append(*tp)) {
      return false;
    }
    delete tp;
  }

  task_manager.SetActiveTaskPoint(0);
  task_manager.Resume();

  task_report(task_manager, "# adding finish\n");
  wp = waypoints.LookupId(3);
  if (wp) {
    OrderedTaskPoint *tp = fact.CreateFinish(std::move(wp));
    if (!fact.Append(*tp)) {
      return false;
    }
    delete tp;
  }

  fact.UpdateStatsGeometry();

  task_report(task_manager, "# checking task..\n");
  if (!fact.Validate()) {
    return false;
  }

  if (!task_manager.CheckOrderedTask()) {
    return false;
  }
  return true;

}
开发者ID:Advi42,项目名称:XCSoar,代码行数:44,代码来源:harness_task.cpp

示例4: test_task_random

bool test_task_random(TaskManager& task_manager,
                      const Waypoints &waypoints,
                      const unsigned num_points)
{
    const Waypoint *wp;

    OrderedTaskPoint *tp;

    task_manager.SetFactory(TaskFactoryType::MIXED);
    AbstractTaskFactory &fact = task_manager.GetFactory();

    task_report(task_manager, "# adding start\n");
    wp = random_waypoint(waypoints);
    if (wp) {
        const TaskPointFactoryType s = GetRandomType(fact.GetStartTypes());

        tp = fact.CreateStart(s,*wp);
        if (!fact.Append(*tp,false)) {
            return false;
        }
        delete tp;
    }

    task_manager.SetActiveTaskPoint(0);
    task_manager.Resume();

    for (unsigned i=0; i<num_points; i++) {
        task_report(task_manager, "# adding intermediate\n");
        wp = random_waypoint(waypoints);
        if (wp) {
            const TaskPointFactoryType s = GetRandomType(fact.GetIntermediateTypes());

            tp = fact.CreateIntermediate(s,*wp);
            if (!fact.Append(*tp,false)) {
                return false;
            }
            delete tp;
        }
    }

    task_report(task_manager, "# adding finish\n");
    wp = random_waypoint(waypoints);
    if (wp) {
        const TaskPointFactoryType s = GetRandomType(fact.GetFinishTypes());

        tp = fact.CreateFinish(s,*wp);
        if (!fact.Append(*tp,false)) {
            return false;
        }
        delete tp;
    }

    fact.UpdateStatsGeometry();

    task_report(task_manager, "# validating task..\n");
    if (!fact.Validate()) {
        return false;
    }
    task_report(task_manager, "# checking task..\n");
    if (!task_manager.CheckOrderedTask()) {
        return false;
    }
    return true;
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:64,代码来源:harness_task.cpp

示例5: test_task_aat

bool test_task_aat(TaskManager& task_manager,
                   const Waypoints &waypoints)
{
    task_manager.SetFactory(TaskFactoryType::AAT);
    AbstractTaskFactory &fact = task_manager.GetFactory();
    const Waypoint *wp;

    task_report(task_manager, "# adding start\n");
    wp = waypoints.LookupId(1);
    if (wp) {
        OrderedTaskPoint *tp = fact.CreateStart(*wp);
        if (!fact.Append(*tp,false)) {
            return false;
        }
        delete tp;
    }

    task_manager.SetActiveTaskPoint(0);
    task_manager.Resume();

    task_report(task_manager, "# adding intermediate\n");
    wp = waypoints.LookupId(2);
    if (wp) {
        OrderedTaskPoint* tp = fact.CreateIntermediate(TaskPointFactoryType::AAT_CYLINDER,*wp);
        if (tp->GetObservationZone().GetShape() == ObservationZone::Shape::CYLINDER) {
            CylinderZone &cz = (CylinderZone &)tp->GetObservationZone();
            cz.SetRadius(fixed(30000.0));
        }
        if (!fact.Append(*tp,false)) {
            return false;
        }
        delete tp;
    }

    task_report(task_manager, "# adding intermediate\n");
    wp = waypoints.LookupId(3);
    if (wp) {
        OrderedTaskPoint* tp = fact.CreateIntermediate(TaskPointFactoryType::AAT_CYLINDER,*wp);
        if (tp->GetObservationZone().GetShape() == ObservationZone::Shape::CYLINDER) {
            CylinderZone &cz = (CylinderZone &)tp->GetObservationZone();
            cz.SetRadius(fixed(40000.0));
        }
        if (!fact.Append(*tp,false)) {
            return false;
        }
        delete tp;
    }

    task_report(task_manager, "# adding finish\n");
    wp = waypoints.LookupId(1);
    if (wp) {
        OrderedTaskPoint *tp = fact.CreateFinish(*wp);
        if (!fact.Append(*tp,false)) {
            return false;
        }
        delete tp;
    }

    fact.UpdateStatsGeometry();

    task_report(task_manager, "# checking task..\n");
    if (!fact.Validate()) {
        return false;
    }

    if (!task_manager.CheckOrderedTask()) {
        return false;
    }
    return true;
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:70,代码来源:harness_task.cpp

示例6: test_task_type_manip

bool test_task_type_manip(TaskManager& task_manager,
                          const Waypoints &waypoints, unsigned n_points)
{
    if (!test_task_random_RT_AAT_FAI(task_manager, waypoints, n_points))
        return false;

    switch (rand() %4) {
    case 0:
        task_manager.SetFactory(TaskFactoryType::AAT);
        test_note("# switched FACTORY TYPE to AAT\n");
        break;
    case 1:
        task_manager.SetFactory(TaskFactoryType::RACING);
        test_note("# switched FACTORY TYPE to RT\n");
        break;
    case 2:
        task_manager.SetFactory(TaskFactoryType::FAI_GENERAL);
        test_note("# switched FACTORY TYPE to FAI GENERAL\n");
        break;
    case 3:
        task_manager.SetFactory(TaskFactoryType::MAT);
        test_note("# switched FACTORY TYPE to MAT\n");
        break;
    default:
        test_note("# unknown task type\n");
    }

    AbstractTaskFactory &fact = task_manager.GetFactory();
    fact.MutateTPsToTaskType();
    fact.UpdateStatsGeometry();

    test_note("# checking mutated start..\n");
    if (!fact.IsValidStartType(fact.GetType(task_manager.GetOrderedTask().GetTaskPoint(0))))
        return false;


    char tmp[255];
    sprintf(tmp, "# checking mutated intermediates.  task_size():%d..\n",
            task_manager.TaskSize());
    test_note(tmp);

    for (unsigned i = 1; i < (task_manager.TaskSize() - 1); i++) {
        sprintf(tmp, "# checking mutated intermediate point %d..\n", i);
        test_note(tmp);
        if (!fact.IsValidIntermediateType(fact.GetType(task_manager.GetOrderedTask().GetTaskPoint(i))))
            return false;
    }

    test_note("# checking mutated finish..\n");
    if (!fact.IsValidFinishType(
                fact.GetType(task_manager.GetOrderedTask().GetTaskPoint(task_manager.TaskSize() - 1))))
        return false;

    test_note("# validating task..\n");
    if (!fact.Validate()) {
        return false;
    }
    test_note("# checking task..\n");
    if (!task_manager.CheckOrderedTask()) {
        return false;
    }

    if (task_manager.GetOrderedTask().GetFactoryType() ==
            TaskFactoryType::FAI_GENERAL) {
        test_note("# checking OZs for FAI task..\n");
        if (!fact.ValidateFAIOZs())
            return false;
    }

    if (task_manager.GetOrderedTask().GetFactoryType() ==
            TaskFactoryType::MAT) {
        test_note("# checking OZs for MAT task..\n");
        if (!fact.ValidateMATOZs())
            return false;
    }
    return true;
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:77,代码来源:harness_task.cpp

示例7: test_task_manip


//.........这里部分代码省略.........
    }

    task_report(task_manager, "# removing tp 50 (illegal)\n");
    if (fact.Remove(50)) {
        return false;
    }

    OrderedTaskPoint *tp;
    const Waypoint *wp;

    task_report(task_manager, "# inserting at 3\n");
    wp = waypoints.LookupId(3);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Insert(*tp,3)) return false;
        delete tp;
    }

    task_report(task_manager, "# auto-replacing at 2 (no morph)\n");
    wp = waypoints.LookupId(9);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Replace(*tp,2)) return false;
        delete tp;
    }

    task_report(task_manager, "# auto-replacing at 2 (morph)\n");
    wp = waypoints.LookupId(9);
    if (wp) {
        tp = fact.CreateStart(*wp);
        if (!fact.Replace(*tp,2)) return false;
        delete tp;
    }

    task_report(task_manager, "# auto-replacing at 0 (morph this)\n");
    wp = waypoints.LookupId(12);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Replace(*tp,0)) return false;
        delete tp;
    }

    task_report(task_manager, "# auto-replacing at end (morph this)\n");
    wp = waypoints.LookupId(14);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Replace(*tp,task_manager.TaskSize()-1)) return false;
        delete tp;
    }

    task_report(task_manager, "# removing finish point\n");
    if (!fact.Remove(task_manager.TaskSize()-1)) {
        return false;
    }

    task_report(task_manager, "# inserting at 50 (equivalent to append)\n");
    wp = waypoints.LookupId(8);
    if (wp) {
        tp = fact.CreateFinish(*wp);
        if (!fact.Insert(*tp,50)) return false;
        delete tp;
    }

    task_report(task_manager, "# inserting at 0 (morph this)\n");
    wp = waypoints.LookupId(3);
    if (wp) {
        tp = fact.CreateFinish(*wp);
        if (!fact.Insert(*tp,0)) return false;
        delete tp;
    }

    task_report(task_manager, "# inserting at 2 (morph this)\n");
    wp = waypoints.LookupId(4);
    if (wp) {
        tp = fact.CreateStart(*wp);
        if (!fact.Insert(*tp,2)) return false;
        delete tp;
    }

    task_report(task_manager, "# inserting at 2 (direct)\n");
    wp = waypoints.LookupId(6);
    if (wp) {
        tp = fact.CreateIntermediate(*wp);
        if (!fact.Insert(*tp,2,false)) return false;
        delete tp;
    }

    task_report(task_manager, "# checking task\n");

    fact.UpdateStatsGeometry();

    if (task_manager.CheckOrderedTask()) {
        task_manager.Reset();
        task_manager.SetActiveTaskPoint(0);
        task_manager.Resume();
    } else {
        return false;
    }
    return true;
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:101,代码来源:harness_task.cpp


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