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


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

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


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

示例1: test_task_fai

bool test_task_fai(TaskManager& task_manager,
                   const Waypoints &waypoints)
{
  task_manager.set_factory(TaskBehaviour::FACTORY_FAI_GENERAL);
  AbstractTaskFactory &fact = task_manager.get_factory();
  const Waypoint *wp;

  task_report(task_manager, "# adding start\n");
  wp = waypoints.lookup_id(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 intermdiate\n");
  wp = waypoints.lookup_id(2);
  if (wp) {
    OrderedTaskPoint *tp = fact.createIntermediate(*wp);
    if (!fact.append(*tp, false)) {
      return false;
    }
    delete tp;
  }

  task_report(task_manager, "# adding intermdiate\n");
  wp = waypoints.lookup_id(3);
  if (wp) {
    OrderedTaskPoint *tp = fact.createIntermediate(*wp);
    if (!fact.append(*tp,false)) {
      return false;
    }
    delete tp;
  }

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

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

  if (!task_manager.check_ordered_task()) {
    return false;
  }
  return true;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:60,代码来源:harness_task.cpp

示例2: test_task_or

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

  task_manager.set_factory(OrderedTask::FACTORY_TOURING);
  AbstractTaskFactory &fact = task_manager.get_factory();

  task_report(task_manager, "# adding start\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    if (!fact.append(fact.createStart(*wp))) {
      return false;
    }
  }

  task_manager.setActiveTaskPoint(0);
  task_manager.resume();

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(2);
  if (wp) {
    if (!fact.append(fact.createIntermediate(*wp))) {
      return false;
    }
  }

  task_report(task_manager, "# adding finish\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    if (!fact.append(fact.createFinish(*wp))) {
      return false;
    }
  }

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

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

}
开发者ID:galippi,项目名称:xcsoar,代码行数:46,代码来源:harness_task.cpp

示例3: test_task_random

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

  OrderedTaskPoint *tp;

  task_manager.set_factory(OrderedTask::FACTORY_MIXED);
  AbstractTaskFactory &fact = task_manager.get_factory();

  task_report(task_manager, "# adding start\n");
  wp = random_waypoint(waypoints);
  if (wp) {
    AbstractTaskFactory::LegalPointType_t s = 
      fact.getStartTypes()[(rand() % fact.getStartTypes().size())];

    tp = fact.createStart(s,*wp);
    if (!fact.append(tp,false)) {
      return false;
    }
  }

  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) {
      AbstractTaskFactory::LegalPointType_t s = 
        fact.getIntermediateTypes()[(rand() % fact.getIntermediateTypes().size())];

      tp = fact.createIntermediate(s,*wp);
      if (!fact.append(tp,false)) {
        return false;
      }
    }
  }

  task_report(task_manager, "# adding finish\n");
  wp = random_waypoint(waypoints);
  if (wp) {
    AbstractTaskFactory::LegalPointType_t s = 
      fact.getFinishTypes()[(rand() % fact.getFinishTypes().size())];

    tp = fact.createFinish(s,*wp);
    if (!fact.append(tp,false)) {
      return false;
    }
  }

  task_report(task_manager, "# validating task..\n");
  if (!fact.validate()) {
    return false;
  }
  task_report(task_manager, "# checking task..\n");
  if (!task_manager.check_ordered_task()) {
    return false;
  }
  return true;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:62,代码来源:harness_task.cpp

示例4: test_task_aat

bool test_task_aat(TaskManager& task_manager,
                   const Waypoints &waypoints)
{
  const TaskProjection &projection =
    task_manager.get_ordered_task().get_task_projection();

  task_manager.set_factory(OrderedTask::FACTORY_AAT);
  AbstractTaskFactory &fact = task_manager.get_factory();
  const Waypoint *wp;

  task_report(task_manager, "# adding start\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    if (!fact.append(fact.createStart(*wp),false)) {
      return false;
    }
  }

  task_manager.setActiveTaskPoint(0);
  task_manager.resume();

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(2);
  if (wp) {
    OrderedTaskPoint* tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(30000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(tp,false)) {
      return false;
    }
  }

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(3);
  if (wp) {
    OrderedTaskPoint* tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(40000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(tp,false)) {
      return false;
    }
  }

  task_report(task_manager, "# adding finish\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    if (!fact.append(fact.createFinish(*wp),false)) {
      return false;
    }
  }

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

  if (!task_manager.check_ordered_task()) {
    return false;
  }
  return true;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:67,代码来源:harness_task.cpp

示例5: test_task_manip


//.........这里部分代码省略.........
    return false;
  }

  task_report(task_manager, "# removing tp 0\n");
  if (!fact.remove(0)) {
    return false;
  }

  task_report(task_manager, "# removing tp -1 (illegal)\n");
  if (fact.remove(0-1)) {
    return false;
  }

  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.lookup_id(3);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.insert(tp,3)) return false;
  }

  task_report(task_manager, "# auto-replacing at 2 (no morph)\n");
  wp = waypoints.lookup_id(9);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.replace(tp,2)) return false;
  }

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

  task_report(task_manager, "# auto-replacing at 0 (morph this)\n");
  wp = waypoints.lookup_id(12);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.replace(tp,0)) return false;
  }

  task_report(task_manager, "# auto-replacing at end (morph this)\n");
  wp = waypoints.lookup_id(14);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.replace(tp,task_manager.task_size()-1)) return false;
  }

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

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

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

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

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

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

  if (task_manager.check_ordered_task()) {
    task_manager.reset();
    task_manager.setActiveTaskPoint(0);
    task_manager.resume();
  } else {
    return false;
  }
  return true;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:101,代码来源:harness_task.cpp

示例6: test_task_random_RT_AAT_FAI

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

  OrderedTaskPoint *tp;
  AbstractTaskFactory &fact = task_manager.get_factory();
  char tmp[255];
  char tskType[20];
  tskType[0] = '\0';


  switch (rand() %3) {
  case 0:
    task_manager.set_factory(TaskBehaviour::FACTORY_AAT);
    strcpy(tskType,"AAT");
    test_note("# creating random AAT task\n");
    break;
  case 1:
    task_manager.set_factory(TaskBehaviour::FACTORY_RT);
    strcpy(tskType,"RT");
    test_note("# creating random RT task\n");
    break;
  case 2:
    task_manager.set_factory(TaskBehaviour::FACTORY_FAI_GENERAL);
    strcpy(tskType,"FAI");
    test_note("# creating random FAI GENERAL\n");
    break;
  }

  //max points includes start & finish
  const unsigned num_points_total = (
    max(task_manager.get_ordered_task_behaviour().min_points,
        (_num_points % task_manager.get_ordered_task_behaviour().max_points) + 1));
  const unsigned num_int_points = num_points_total - 2;

  test_note("# adding start\n");
  wp = random_waypoint(waypoints);
  if (wp) {
    AbstractTaskFactory::LegalPointType_t s =
      fact.getStartTypes()[(rand() % fact.getStartTypes().size())];

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

  for (unsigned i=0; i<num_int_points; i++) {
    test_note("# adding intermediate\n");
    wp = random_waypoint(waypoints);
    if (wp) {
      AbstractTaskFactory::LegalPointType_t s =
        fact.getIntermediateTypes()[(rand() % fact.getIntermediateTypes().size())];

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

  test_note("# adding finish\n");
  wp = random_waypoint(waypoints);
  if (wp) {
    AbstractTaskFactory::LegalPointType_t s =
      fact.getFinishTypes()[(rand() % fact.getFinishTypes().size())];

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

  test_note("# validating task..\n");
  if (!fact.validate()) {
    return false;
  }
  if (task_manager.get_ordered_task().get_factory_type()
      == TaskBehaviour::FACTORY_FAI_GENERAL)
  {
    test_note("# checking OZs for FAI General..\n");
    if (!fact.validateFAIOZs())
      return false;
  }

  task_manager.resume();
  sprintf(tmp, "# SUCCESS CREATING %s task! task_size():%d..\n",
      tskType,
      task_manager.task_size());
  test_note(tmp);
  return true;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:97,代码来源:harness_task.cpp

示例7: test_task_mixed

bool test_task_mixed(TaskManager& task_manager,
                     const Waypoints &waypoints)
{
  const TaskProjection &projection =
    task_manager.get_ordered_task().get_task_projection();

  OrderedTaskPoint *tp;
  const Waypoint *wp;

  task_manager.set_factory(TaskBehaviour::FACTORY_MIXED);
  AbstractTaskFactory &fact = task_manager.get_factory();

  task_report(task_manager, "# adding start\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    tp = fact.createStart(AbstractTaskFactory::START_LINE,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(5000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_manager.setActiveTaskPoint(0);
  task_manager.resume();

  task_report(task_manager, "# adding intermdiate\n");
  wp = waypoints.lookup_id(2);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding intermdiate\n");
  wp = waypoints.lookup_id(3);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(30000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(4);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(5);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(30000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding finish\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    tp = fact.createFinish(AbstractTaskFactory::FINISH_LINE,*wp);
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

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

  if (!task_manager.check_ordered_task()) {
    return false;
  }
  return true;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:100,代码来源:harness_task.cpp


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