Ejemplo n.º 1
0
OrderedTask::OrderedTask(const TaskBehaviour &tb)
  :AbstractTask(TaskType::ORDERED, tb),
   taskpoint_start(NULL),
   taskpoint_finish(NULL),
   factory_mode(tb.task_type_default),
   active_factory(NULL),
   ordered_behaviour(tb.ordered_defaults),
   dijkstra_min(NULL), dijkstra_max(NULL)
{
  active_factory = CreateTaskFactory(factory_mode, *this, task_behaviour);
  active_factory->UpdateOrderedTaskBehaviour(ordered_behaviour);
  task_advance.SetFactoryConstraints(active_factory->GetConstraints());
}
Ejemplo n.º 2
0
OrderedTask::OrderedTask(const TaskBehaviour &tb)
  :AbstractTask(TaskType::ORDERED, tb),
   taskpoint_start(nullptr),
   taskpoint_finish(nullptr),
   factory_mode(tb.task_type_default),
   active_factory(nullptr),
   ordered_settings(tb.ordered_defaults),
   dijkstra_min(nullptr), dijkstra_max(nullptr)
{
  ClearName();
  active_factory = CreateTaskFactory(factory_mode, *this, task_behaviour);
  active_factory->UpdateOrderedTaskSettings(ordered_settings);
}
Ejemplo n.º 3
0
void
OrderedTask::SetFactory(const TaskFactoryType the_factory)
{
  // detect no change
  if (factory_mode == the_factory)
    return;

  if (the_factory != TaskFactoryType::MIXED) {
    // can switch from anything to mixed, otherwise need reset
    Reset();

    /// @todo call into task_events to ask if reset is desired on
    /// factory change
  }
  factory_mode = the_factory;

  delete active_factory;
  active_factory = CreateTaskFactory(factory_mode, *this, task_behaviour);
  active_factory->UpdateOrderedTaskBehaviour(ordered_behaviour);
}