//  Definition:
//  This class represents the OCP Component Abstraction for GtmaxLink
//
//  Execution Category:
//  Passive
//
//  Revision History:
//  This class was Automatically Generated on 03/18/2003 @ 22:10:22 from the
//  Component Information file.
//
//  Notes:
//  This namespace is automatically generated using
//  xml2ocp version 2.2 from the following
//  input file: ComponentInfo.xml
//
//  WARNING: Any manual modifications outside of Preserve regions will be
//           overwritten the next time the code generation tool is run.

#ifndef GtmaxLink_h
#define GtmaxLink_h 1

#include "OCP_Component_i.h"

#include "OCP_InputPortT.h"
#include "OCP_OutputPortT.h"

#include "GtmaxCommand.h"
#include "GtmaxState.h"


#include "InfrastructureUtilities/EventServiceUtilities/UUEventConsumer.h"

// This is the user specified includes section.  Includes added within the 
// following Preserve Region will be preserved when this component is regenerated.

// User specified includes and forward declarations section - Preserve Region
/*** BeginCopyright
 * Copyright 2002, Georgia Institute of Technology, All Rights Reserved.
 * Unauthorized use and/or redistribution is disallowed.
 * This library is distributed without any warranty; without even
 * the implied warranty of fitness for a particular purpose.
 *
 * UAV Laboratory
 * School of Aerospace Engineering
 * Georgia Institute of Technology
 * Atlanta, GA 30332
 * http://controls.ae.gatech.edu/uavrf
 *
 * Contact Information:
 * Prof. Eric N. Johnson
 * http://controls.ae.gatech.edu
 * Tel : 404 385 2519
 * EndCopyright
 ***/
/***
 * Header       : $Header: /home/cvs/cvsroot/gtmaxocp/ComponentDatabase/GtmaxLink.h,v 1.4 2003/03/19 02:54:03 kannan Exp $ 
 * Authors      : Kannan, Gutierrez
 * LastModified : $Author: kannan $
 * Purpose      : An OCP component that serves as an interface to the GTMax helicopter
 *              : Do not modify this component, any change requests should be made
 *              : to the uavlab through suresh_kannan@ae.gatech.edu or eric.johnson@ae.gatech.edu
 ***/
//********************* My code *********************
#define GTMAX_TRAJ_COMMAND       0
#define GTMAX_ACTUATOR_COMMAND   1
//***************** End of my code ******************

// User specified includes and forward declarations section - End Preserve Region

class GtmaxLink : public OCP_Component_i
{
public:
   // Public typedefs and enums
   enum BEHAVIOR_ID
   {
      TriggerAvailableId,
      CommandAvailableId,
      NUM_BEHAVIORS
   };

   enum INPUT_ID
   {
      triggerInId,
      commandInId,
      NUM_INPUTS
   };

public:
   GtmaxLink(const char* componentName, const OCP_InputPorts &inputs, const OCP_OutputPorts &outputs);
   virtual ~GtmaxLink();

   // Register the component with the ControlsAPI (Establish inter-component dependencies)
   virtual void RegisterComponent();

   // Create the internal structure of the component.
   virtual void WireComponent();

   // Initialize the component
   virtual void Initialize();

   void On(const char* inputs, const char* outputs);
   void Off(const char* inputs, const char* outputs);

   virtual void EnableBehavior(long behaviorId);
   virtual void DisableBehavior(long behaviorId);

   virtual void ExecuteBehavior(long behavior_id);

   void Push(const UUEventSet& events);

   // Component Behaviors
   void TriggerAvailable();
   void CommandAvailable();

   void SendStateOut();

private:
   // Component Inputs
   OCP_InputPort *triggerIn;
   OCP_InputPortT<GtmaxCommand> *commandIn;

   // Component Outputs
   OCP_OutputPortT<GtmaxState> *stateOut;

   // Component Behavior states
   bool triggerAvailableEnabled_;
   bool commandAvailableEnabled_;




   // This is the user data section.  Add any attributes or user methods within the Preserve Region
   // User specified data section - Preserve Region
public:
   static void SetFlightComputerName(const char *name);
   // User specified data section - End Preserve Region

};

inline void GtmaxLink::Push(const UUEventSet& events)
{
   ACE_UNUSED_ARG(events);

}


#endif
