/******************************************************************/
/*  Copyright (c) 2000 MIT Sea Grant AUV LAB                      */
/*                                                                */
/*  MIT proprietary information--All rights reserved              */
/******************************************************************/
/*                                                                */
/*  Summary:                                                      */
/*                                                                */
/*  FileName:  _scheduler.cc                                      */
/*                                                                */
/*  Author:    Don Eickstedt                                      */
/*                                                                */
/*  Created:    6 June 2000                                       */
/******************************************************************/

#include <string.h>

#include "Syslog.h"
#include "System.h"
#include "ScheduleServer.h"

int main ( int argc, char **argv )
{
  ScheduleServer *Schedule_Server;
  Boolean test;
  //
  // test = False => ScheduleServer is being started by Supervisor.
  // test = True  => ScheduleServer is being started by lblTest.
  //
  test = False;
  if( ( argc > 1 ) && ( stricmp( argv[1], "True" ) == 0 ) ) test = True; 


  if (System::setTaskPriority(CriticalServerPriority) == -1)
    return 1;

try
  {
    Schedule_Server = new ScheduleServer(200, test);
    Schedule_Server -> run();
  }

catch (char *message){
  Syslog::write(message);
}

catch( ... ) {
  Syslog::write("Schedule Server -- Caught unknown exception!");
}
delete Schedule_Server;
return 0;
}
