/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : _kearfott.cc                                                  */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*-----------------------------------------------------------------------*
  CLASS: kearfott

  DESCRIPTION: Main file for octans driver

  AUTHOR: Hans Thomas

  $Id: _kearfottAlign.cc,v 1.1 2001/07/09 14:23:15 hthomas Exp $
 *-----------------------------------------------------------------------*/
#include <sys/sched.h>
#include <errno.h>
#include "System.h"
#include "Kearfott.h"
#include "Syslog.h"
#include "Task.h"



int main(int argc, char **argv)
{
     Boolean debug = True;
     Kearfott *kearfott = 0;
     SerialDevice *device = 0;
     Kearfott::KEARFOTT_OP_TYPE opData;

     // Set task priority
     if (System::setTaskPriority(NonCriticalDriverPriority) == -1)
       return 1;

     if (argc == 2) {
       if (!strcmp(argv[1], "align")) {
	 opData.modes = GPSENAB|DOPPING|DOPENAB;
       }else if (!strcmp(argv[1], "operate")) {
	 opData.modes = DOPPING|DOPENAB;
       }
     }
       opData.validity = VDPTH;
       opData.init_lat = 0;
       opData.init_lon = 0;
       opData.idepth=0;
       opData.init_lat = opData.init_lon = opData.idepth = opData.inithdg = 0;
       opData.salinity = 0; opData.cepos = 0;
       opData.forcomm = 0;
     try {
       SerialParameters params(&argc, argv);
       device = new SerialDevice(&params);
       kearfott = new Kearfott(device);
       ins->sendOpData(&opData);
       kearfott->run();
     }
     catch(Exception e) {
       Syslog::write("kearfott - caught Exception: %s\n", e.msg);
     }
     catch(...) {
       Syslog::write("kearfott - Exception caught\n");
     }

     delete kearfott;
     delete device;

     return 0;
}
