/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : IpsStartProfile.cc                                            */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 10/13/2001                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/

#include "Syslog.h"
#include "IpsStartProfile.h"

IpsStartProfile::IpsStartProfile()
  : Behavior(IpsStartProfileBehaviorName, Sequential)
{
  _ips = NULL;
  _behaviorStarted = False;
}


IpsStartProfile::~IpsStartProfile()
{
}

Boolean IpsStartProfile::shouldBehaviorStart()
{
  return horizontalSequence();
}

void IpsStartProfile::execute()
{
  if (_behaviorStarted)
    return;

  _ips = new Ips4IF("Ips4IFServer");

  if (_ips == NULL)
  {
    Syslog::write("IpsStartProfile behavior: No Ips server found");
  }
  else
  {
    Syslog::write("IpsStartProfile behavior started");
    _behaviorStarted = True;
    _ips->startProfile();
    delete _ips;
  }
}

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

