Ejemplo n.º 1
0
OrderedTask* 
TaskFileXCSoar::GetTask(const Waypoints *waypoints, unsigned index) const
{
  assert(index == 0);

  if (protected_task_manager == NULL)
    return NULL;

  DataNode* root = DataNodeXML::load(path);
  if (!root)
    return NULL;

  if (_tcscmp(root->get_name().c_str(),_T("Task")) == 0) {
    OrderedTask* task = protected_task_manager->task_blank();
    Deserialiser des(*root, waypoints);
    des.deserialise(*task);
    if (task->check_task()) {
      delete root;
      return task;
    }
    delete task;
    delete root;
    return NULL;
  }
  delete root;
  return NULL;
}
Ejemplo n.º 2
0
void
ExternalLogger::Declare(const OrderedTask& task)
{
  DeclaredToDevice = false;
  bool found_logger = false;

  // don't do anything if task is not valid
  if (!task.check_task())
    return;

  const Declaration decl(&task);

  for (unsigned i = 0; i < NUMDEV; ++i)
    if (DeviceDeclare(&DeviceList[i], decl))
      found_logger = true;

  if (!found_logger)
    MessageBoxX(_("No logger connected"),
                _("Declare task"), MB_OK | MB_ICONINFORMATION);
}