/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : DropWeightBehavior                                            */
/* Author   : rsm                                                           */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/06/2004                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include "MissionTimeAttribute.h"
#include "IntegerAttribute.h"
#include "DropTheWeight.h"
#include "Syslog.h"

DropTheWeight::DropTheWeight()
   : Behavior(DropTheWeightBehaviorName, Sequential)
{
   Attribute::Input *input;

   attributes.add(new IntegerAttribute("dummy",
				       "dummy",
				       &_dummy));
   try 
   {
      _dropWeight = new DropWeightIF("dropWeight");
   } 
   catch(...)
   {
      Syslog::write("DropTheWeight:: -- Failed to initialize connection "
		    "to DropWeightIF");
   }
}


DropTheWeight::~DropTheWeight()
{
   delete _dropWeight;
}

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

Boolean DropTheWeight::shouldBehaviorStart( )
{
     return verticalSequence();
}

void DropTheWeight::execute()
{
   //
   // Nothing fancy here.  Just drop it.
   //
   if (_dropWeight) {
      _dropWeight->release();
      Syslog::write("The drop weight Behavior has executed.  \n"
		    "BURNING THE DROP WEIGHT WIRE NOW.");
   }else{
      Syslog::write("DropTheWeight::Cannot release. "
		    "No connection to DropWeightIF\n");
   }
   setState(Finished);
   return;
}






