/*
********************************************************
Copyright 2000 MBARI.
MBARI Proprietary Information. All rights reserved.
NOTE: This file is automatically generated.
DO NOT MODIFY.
********************************************************
*/

#ifndef __VehicleConfigurationIF_H
#define __VehicleConfigurationIF_H

#include "TaskInterface.h"


#define VehicleConfigurationIFServerName "VehicleConfigurationIFServer"

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

DESCRIPTION
TaskInterface to VehicleConfiguration

AUTHOR
Tom O'Reilly and Rob McEwen
*/
class VehicleConfigurationIF : public TaskInterface {

  friend class VehicleConfigurationIF_SK;

  public:

  
  
  typedef char Name[32];
  typedef char Port[32];
  typedef char Driver[32];
  typedef double Vector[3];
  
  VehicleConfigurationIF(const char *name, int timeout = 10);

  VehicleConfigurationIF(const char *name, const char *serverName, int timeout = 10);

  ~VehicleConfigurationIF();

  ///////////////////////////////////////////////////////////////////
  // Retrieve the number of devices in the table
  short deviceCount();

  ///////////////////////////////////////////////////////////////////
  // Get a device index by name
  short findDevice(VehicleConfigurationIF::Name name);

  ///////////////////////////////////////////////////////////////////
  // 
  short getDeviceName(short index, VehicleConfigurationIF::Name name);

  ///////////////////////////////////////////////////////////////////
  // Get port info by name or index
  short getDeviceDriver(short index, VehicleConfigurationIF::Driver driver);

  short getDeviceDriver(VehicleConfigurationIF::Name name, VehicleConfigurationIF::Driver driver);

  ///////////////////////////////////////////////////////////////////
  // Get information on a  device by number
  short deviceInfo(short index, VehicleConfigurationIF::Name name, VehicleConfigurationIF::Port port, short *priority);

  ///////////////////////////////////////////////////////////////////
  // Get information on a device by name
  short deviceInfo(VehicleConfigurationIF::Name name, VehicleConfigurationIF::Port port, short *priority);

  ///////////////////////////////////////////////////////////////////
  // Get vehicle name
  void vehicleName(VehicleConfigurationIF::Name name);

  ///////////////////////////////////////////////////////////////////
  // Get propeller pitch
  double propPitch();

  ///////////////////////////////////////////////////////////////////
  // Get vehicle mass
  double mass();

  ///////////////////////////////////////////////////////////////////
  // Get vehicle buoyancy
  double buoyancy();

  ///////////////////////////////////////////////////////////////////
  // Get proportional gain for heading
  double kpHeading();

  ///////////////////////////////////////////////////////////////////
  // Get derivative gain for heading
  double kdHeading();

  ///////////////////////////////////////////////////////////////////
  // Get integral gain for heading
  double kiHeading();

  ///////////////////////////////////////////////////////////////////
  // Get the heading waypoint gain
  double kwpHeading();

  ///////////////////////////////////////////////////////////////////
  // Get the maximum heading rate
  double maxHdgRate();

  ///////////////////////////////////////////////////////////////////
  // Get maximum rudder angle
  double rudLimit();

  ///////////////////////////////////////////////////////////////////
  // Get rudder actuator limit
  double rudActLimit();

  ///////////////////////////////////////////////////////////////////
  // Get rudder actuator rate limit
  double rudActRateLimit();

  ///////////////////////////////////////////////////////////////////
  // Get proportional gain for pitch
  double kpPitch();

  ///////////////////////////////////////////////////////////////////
  // Get derivative gain for pitch
  double kdPitch();

  ///////////////////////////////////////////////////////////////////
  // Get integral gain for pitch
  double kiPitch();

  ///////////////////////////////////////////////////////////////////
  // Get pitch limit
  double pitchLimit();

  ///////////////////////////////////////////////////////////////////
  // Get the maximum dive rate
  double maxDiveRate();

  ///////////////////////////////////////////////////////////////////
  // Get the depth proportional gain
  double kpDepth();

  ///////////////////////////////////////////////////////////////////
  // Get the depth integral gain
  double kiDepth();

  ///////////////////////////////////////////////////////////////////
  // Get maximum elevator angle
  double elevLimit();

  ///////////////////////////////////////////////////////////////////
  // Get elevator actuator limit
  double elevActLimit();

  ///////////////////////////////////////////////////////////////////
  // Get elevator actuator rate limit
  double elevActRateLimit();

  ///////////////////////////////////////////////////////////////////
  // Get control system sampling period
  double Ts();

  ///////////////////////////////////////////////////////////////////
  // Get the effective drag coefficient
  double effDragCoef();

  ///////////////////////////////////////////////////////////////////
  // Get the propeller efficiency (Kt/Ke)
  double propEfficiency();

  ///////////////////////////////////////////////////////////////////
  // Get the command generator (whoi_traj) time constant tau
  double tau();

  ///////////////////////////////////////////////////////////////////
  // Get depth integrator limit
  double maxDepthInt();

  ///////////////////////////////////////////////////////////////////
  // Get heading integrator limit
  double maxHdgInt();

  ///////////////////////////////////////////////////////////////////
  // Get pitch integrator limit
  double maxPitchInt();

  ///////////////////////////////////////////////////////////////////
  // Some kind of drag coefficient?
  double xuabu();

  ///////////////////////////////////////////////////////////////////
  // Center of mass, not including dropweights
  void centerOfMass(VehicleConfigurationIF::Vector v);

  ///////////////////////////////////////////////////////////////////
  // Center of buoyancy, not including dropweights
  void centerOfBuoyancy(VehicleConfigurationIF::Vector v);

  ///////////////////////////////////////////////////////////////////
  // Duct area
  double ductArea();

  ///////////////////////////////////////////////////////////////////
  // Number of drop weights
  short nDropWeights();

  ///////////////////////////////////////////////////////////////////
  // Drop weight characteristics
  short dropWeight(short weightNo, double *mass, double *buoyancy, VehicleConfigurationIF::Vector location);

  ///////////////////////////////////////////////////////////////////
  // Fin locations relative to vehicle frame
  void finLocations(VehicleConfigurationIF::Vector lowerRudder, VehicleConfigurationIF::Vector upperRudder, VehicleConfigurationIF::Vector portElevator, VehicleConfigurationIF::Vector stbdElevator);

  ///////////////////////////////////////////////////////////////////
  // Flag to tell DynamicControlServer to switch on the roll/yaw 
  // decoupling computation.
  double decouple();

  ///////////////////////////////////////////////////////////////////
  // Specify which instrument to use as the altimeter in Navigation.
  double altimeterInstrument();

  ///////////////////////////////////////////////////////////////////
  // Flag to select the Lbl for navigation
  double useLbl();

  double useIns();

  
  protected:

  // Message codes for each method
  enum VehicleConfigurationIFMsgCode {
    DeviceCountMsgCode,
    FindDeviceMsgCode,
    GetDeviceNameMsgCode,
    GetDeviceDriverMsgCode,
    GetDeviceDriver01MsgCode,
    DeviceInfoMsgCode,
    DeviceInfo01MsgCode,
    VehicleNameMsgCode,
    PropPitchMsgCode,
    MassMsgCode,
    BuoyancyMsgCode,
    KpHeadingMsgCode,
    KdHeadingMsgCode,
    KiHeadingMsgCode,
    KwpHeadingMsgCode,
    MaxHdgRateMsgCode,
    RudLimitMsgCode,
    RudActLimitMsgCode,
    RudActRateLimitMsgCode,
    KpPitchMsgCode,
    KdPitchMsgCode,
    KiPitchMsgCode,
    PitchLimitMsgCode,
    MaxDiveRateMsgCode,
    KpDepthMsgCode,
    KiDepthMsgCode,
    ElevLimitMsgCode,
    ElevActLimitMsgCode,
    ElevActRateLimitMsgCode,
    TsMsgCode,
    EffDragCoefMsgCode,
    PropEfficiencyMsgCode,
    TauMsgCode,
    MaxDepthIntMsgCode,
    MaxHdgIntMsgCode,
    MaxPitchIntMsgCode,
    XuabuMsgCode,
    CenterOfMassMsgCode,
    CenterOfBuoyancyMsgCode,
    DuctAreaMsgCode,
    NDropWeightsMsgCode,
    DropWeightMsgCode,
    FinLocationsMsgCode,
    DecoupleMsgCode,
    AltimeterInstrumentMsgCode,
    UseLblMsgCode,
    UseInsMsgCode
  };

  // Define message structure for each method
  struct DeviceCountMsg : Request, Reply {
    short returnVal;
  
  } _deviceCountMsg;

  struct FindDeviceMsg : Request, Reply {
    short returnVal;
    VehicleConfigurationIF::Name name;
  
  } _findDeviceMsg;

  struct GetDeviceNameMsg : Request, Reply {
    short returnVal;
    short index;
    VehicleConfigurationIF::Name name;
  
  } _getDeviceNameMsg;

  struct GetDeviceDriverMsg : Request, Reply {
    short returnVal;
    short index;
    VehicleConfigurationIF::Driver driver;
  
  } _getDeviceDriverMsg;

  struct GetDeviceDriver01Msg : Request, Reply {
    short returnVal;
    VehicleConfigurationIF::Name name;
    VehicleConfigurationIF::Driver driver;
  
  } _getDeviceDriver01Msg;

  struct DeviceInfoMsg : Request, Reply {
    short returnVal;
    short index;
    VehicleConfigurationIF::Name name;
    VehicleConfigurationIF::Port port;
    short priority;
  
  } _deviceInfoMsg;

  struct DeviceInfo01Msg : Request, Reply {
    short returnVal;
    VehicleConfigurationIF::Name name;
    VehicleConfigurationIF::Port port;
    short priority;
  
  } _deviceInfo01Msg;

  struct VehicleNameMsg : Request, Reply {
    VehicleConfigurationIF::Name name;
  
  } _vehicleNameMsg;

  struct PropPitchMsg : Request, Reply {
    double returnVal;
  
  } _propPitchMsg;

  struct MassMsg : Request, Reply {
    double returnVal;
  
  } _massMsg;

  struct BuoyancyMsg : Request, Reply {
    double returnVal;
  
  } _buoyancyMsg;

  struct KpHeadingMsg : Request, Reply {
    double returnVal;
  
  } _kpHeadingMsg;

  struct KdHeadingMsg : Request, Reply {
    double returnVal;
  
  } _kdHeadingMsg;

  struct KiHeadingMsg : Request, Reply {
    double returnVal;
  
  } _kiHeadingMsg;

  struct KwpHeadingMsg : Request, Reply {
    double returnVal;
  
  } _kwpHeadingMsg;

  struct MaxHdgRateMsg : Request, Reply {
    double returnVal;
  
  } _maxHdgRateMsg;

  struct RudLimitMsg : Request, Reply {
    double returnVal;
  
  } _rudLimitMsg;

  struct RudActLimitMsg : Request, Reply {
    double returnVal;
  
  } _rudActLimitMsg;

  struct RudActRateLimitMsg : Request, Reply {
    double returnVal;
  
  } _rudActRateLimitMsg;

  struct KpPitchMsg : Request, Reply {
    double returnVal;
  
  } _kpPitchMsg;

  struct KdPitchMsg : Request, Reply {
    double returnVal;
  
  } _kdPitchMsg;

  struct KiPitchMsg : Request, Reply {
    double returnVal;
  
  } _kiPitchMsg;

  struct PitchLimitMsg : Request, Reply {
    double returnVal;
  
  } _pitchLimitMsg;

  struct MaxDiveRateMsg : Request, Reply {
    double returnVal;
  
  } _maxDiveRateMsg;

  struct KpDepthMsg : Request, Reply {
    double returnVal;
  
  } _kpDepthMsg;

  struct KiDepthMsg : Request, Reply {
    double returnVal;
  
  } _kiDepthMsg;

  struct ElevLimitMsg : Request, Reply {
    double returnVal;
  
  } _elevLimitMsg;

  struct ElevActLimitMsg : Request, Reply {
    double returnVal;
  
  } _elevActLimitMsg;

  struct ElevActRateLimitMsg : Request, Reply {
    double returnVal;
  
  } _elevActRateLimitMsg;

  struct TsMsg : Request, Reply {
    double returnVal;
  
  } _TsMsg;

  struct EffDragCoefMsg : Request, Reply {
    double returnVal;
  
  } _effDragCoefMsg;

  struct PropEfficiencyMsg : Request, Reply {
    double returnVal;
  
  } _propEfficiencyMsg;

  struct TauMsg : Request, Reply {
    double returnVal;
  
  } _tauMsg;

  struct MaxDepthIntMsg : Request, Reply {
    double returnVal;
  
  } _maxDepthIntMsg;

  struct MaxHdgIntMsg : Request, Reply {
    double returnVal;
  
  } _maxHdgIntMsg;

  struct MaxPitchIntMsg : Request, Reply {
    double returnVal;
  
  } _maxPitchIntMsg;

  struct XuabuMsg : Request, Reply {
    double returnVal;
  
  } _xuabuMsg;

  struct CenterOfMassMsg : Request, Reply {
    VehicleConfigurationIF::Vector v;
  
  } _centerOfMassMsg;

  struct CenterOfBuoyancyMsg : Request, Reply {
    VehicleConfigurationIF::Vector v;
  
  } _centerOfBuoyancyMsg;

  struct DuctAreaMsg : Request, Reply {
    double returnVal;
  
  } _ductAreaMsg;

  struct NDropWeightsMsg : Request, Reply {
    short returnVal;
  
  } _nDropWeightsMsg;

  struct DropWeightMsg : Request, Reply {
    short returnVal;
    short weightNo;
    double mass;
    double buoyancy;
    VehicleConfigurationIF::Vector location;
  
  } _dropWeightMsg;

  struct FinLocationsMsg : Request, Reply {
    VehicleConfigurationIF::Vector lowerRudder;
    VehicleConfigurationIF::Vector upperRudder;
    VehicleConfigurationIF::Vector portElevator;
    VehicleConfigurationIF::Vector stbdElevator;
  
  } _finLocationsMsg;

  struct DecoupleMsg : Request, Reply {
    double returnVal;
  
  } _decoupleMsg;

  struct AltimeterInstrumentMsg : Request, Reply {
    double returnVal;
  
  } _altimeterInstrumentMsg;

  struct UseLblMsg : Request, Reply {
    double returnVal;
  
  } _useLblMsg;

  struct UseInsMsg : Request, Reply {
    double returnVal;
  
  } _useInsMsg;

};

#endif

