/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : SystemInterfaces.cc                                           */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include "SystemInterfaces.h"
#include "LayeredControlIF.h"
#include "DynamicControlIF.h"
#include "NavigationIF.h"

SystemInterfaces::SystemInterfaces()
{
  // Create core Task interfaces
  _layeredControl = new LayeredControlIF("layeredControl");
  addTask(_layeredControl);

  _dynamicControl = new DynamicControlIF("dynamicControl");
  addTask(_dynamicControl);

  _navigation = new NavigationIF("navigation");
  addTask(_navigation);

  // And so on...

  // Now read system configuration file and create auxillary 
  // TaskInterface objects (instruments, devices, etc), adding them to Task
  // list.
  createAuxTasks();
}


SystemInterfaces::~SystemInterfaces()
{
}


void SystemInterfaces::addTask(TaskInterface *task)
{
  tasks.add(&task);
}


TaskInterface *SystemInterfaces::getTask(const char *name)
{
  TaskInterface *task;

  for (int i = 0; i < tasks.size(); i++) {
    tasks.get(i, &task);
    if (!strcmp(name, task->name()))
      return task;
  }

  return 0;
}


void SystemInterfaces::createAuxTasks()
{
  // Read config file and create appropriate tasks
}


