/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : FireTheGulper.cc						    */
/* Author   : hjt                                                           */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 10/20/2005                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include "MissionTimeAttribute.h"
#include "IntegerAttribute.h"
#include "FireTheGulper.h"
#include "Syslog.h"

FireTheGulper::FireTheGulper()
   : Behavior(FireTheGulperBehaviorName, Sequential)
{
   Attribute::Input *input;

   attributes.add(new IntegerAttribute("gulperToFire",
				       "gulperToFire",
				       &_gulperToFire));
   try 
   {
      _gulper = new GulperIF(GulperIFServerName);
   } 
   catch(...)
   {
      Syslog::write("FireTheGulper:: -- Failed to initialize connection "
		    "to GulperIF\n");
   }
}


FireTheGulper::~FireTheGulper()
{
   delete _gulper ;
}

Boolean FireTheGulper::validInput()
{
  return True;
}

Boolean FireTheGulper::shouldBehaviorStart( )
{
     return bothSequence();
}

void FireTheGulper::execute()
{
   //
   // Nothing fancy here.  Just drop it.
   //
   _gulper->fireGulper(_gulperToFire);
   Syslog::write("The FireTheGulper Behavior has executed.  \n"
		 "FIRING THE GULPER NOW.");
   setState(Finished);
   return;
}






