/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : StopCamera.cc						    */
/* Author   : rsm                                                           */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 22 October 2009                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include "MissionTimeAttribute.h"
#include "StopCamera.h"
#include "Syslog.h"

StopCamera::StopCamera()
   : Behavior(StopCameraBehaviorName, Sequential)
{
   try 
   {
      _camera = new CameraIF(CameraIFServerName);
   } 
   catch (Exception e) 
   {
      Syslog::write("StopCamera:: Caught exception on creation "
		    "of CameraIF:%s\n", e.msg);
      abortMission();
   }
   catch(...)
   {
      Syslog::write("StopCamera:: -- Failed to initialize connection "
		    "to CameraIF\n");
      abortMission();
   }
}

StopCamera::~StopCamera()
{
   delete _camera ;
}

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

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

void StopCamera::execute()
{
   _camera->stop();
   setState(Finished);
   return;
}






