/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : cameraDriver.cc                                               */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 05/2008                                                       */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include "CameraDriver.h"
#include "Syslog.h"
#include "System.h"

int main(int argc, char **argv)
{
  // Set task priority
  if (System::setTaskPriority(NonCriticalDriverPriority) == -1)
    return 1;

  Boolean test = False;
  Boolean sim  = False;
   for (int i = 1; i < argc; i++) 
   {
      if( !strcmp(argv[i], "-test") ) test = True;
      if( !strcmp(argv[i], "-sim") )  sim = True;
   }

  printf("_cameraDriver.cc test = %d\n", test);

  try 
  {
    SerialParameters params(&argc, argv);
    SerialDeviceExt *device = new SerialDeviceExt(&params);
    Camera *camera = new Camera(device, test, sim);
    camera->run();
  }
  catch (Exception e) 
  {
    Syslog::write("camera - caught Exception: %s\n", e.msg);
  }
  catch (...) 
  {
    Syslog::write("camera - caught exception!\n");
  }

  return 0;
}

