/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : FuelCellIF.idl                                                */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/

/*
CLASS 
FuelCellIF

DESCRIPTION
TaskInterface to FuelCell device driver

AUTHOR
John Rieffel

*/
#include "InstrumentIF.idl"

interface FuelCellIF : InstrumentIF {

  ////////////////////////////////////////////////////////////
  // Events generated by FuelCell device driver
  // As specified on FCC Interface Document
  //  relevant FCC_STATUS Structure codes
  // These will be fleshed out later


  enum FCC_Cmd_Reply {
    FCC_ERR_OK = 1,
    FCC_ERR_INVALID_PARAM,
    FCC_ERR_NO_CLIENT,
    FCC_ERR_TOO_MANY_CLIENTS,
    FCC_ERR_COMM
  };


  enum Event {
    NewAlarm,
    ClearAlarm
  };

 enum FCC_Command
  { 
    FCC_CMD_NONE = 0,
    FCC_CMD_START,
    FCC_CMD_STOP,
    FCC_CMD_OFFLINE,
    FCC_CMD_RESUME
  };

  enum FC_Control_State
  {
    FC_STATE_IDLE,
    FC_STATE_OFFLINE,
    FC_STATE_RAMPING,
    FC_STATE_ONLINE
  };

  struct FCC_status
  {
    FC_Control_State fc_control_state;
    long health;
    short FC_remaining_kwh;
    short RB_remaining_wh;
    char BIT_status;
    char BIT_result;
  };

  struct FCC_data
  {
    short elapsed_time;
    short anolyte_pump_a_current;
    short anolyte_pump_b_current;
    short catholyte_pump_current;
    short peroxide_pump_current;
    short anolyte_temp;
    short catholyte_temp;
    short fwd_peroxide_temp;
    short aft_peroxide_temp;
    short stack_voltage;
    short stack_current;
    short battery_voltage;
    short battery_current;
    short peroxide_used;
    short v_setpoint;
    short makeup_injection_count;
    short base_injection_duration;
  };

  // Below are Commands that can be issued to the FCC in the form of a 
  // send_FCC_command function call;
  ///////////////////////////////////////////////////////////////////
  // Start generating power
  Status start();
  ///////////////////////////////////////////////////////////////////
  // Stop generating power
  Status stop();
  // Tkae FCC offline (?)
  Status offline();
  ///////////////////////////////////////////////////////////////////
  // Resume FCC
  Status resume();
  ///////////////////////////////////////////////////////////////////
  //Below are function calls to get data and status from the FCC
  Status get_status(out FCC_status fcc_status);
  Status get_data(out FCC_data fcc_data);

  //  FCC_Cmd_Reply send_simFCC_command(in FCC_Command fcc_command);
  //FCC_Cmd_Reply get_simFCC_status(out FCC_status fcc_status);
  //FCC_Cmd_Reply get_simFCC_data(out FCC_data fcc_data);
  //FCC_Cmd_Reply set_simFCC_data(in FCC_data fcc_data);
  //FCC_Cmd_Reply set_simFCC_status(in FCC_status fcc_status);

  
};
