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

#ifndef __SimulatorIF_SK_H
#define __SimulatorIF_SK_H

#include "TaskServer.h"
#include "SimulatorIF.h"

class SimulatorIF_SK : public TaskServer {

  public:

  // Constructor for server with default name
  SimulatorIF_SK();

  // Constructor for server with specific name
  SimulatorIF_SK(const char *serverName);

  virtual ~SimulatorIF_SK();
  
  protected:

  // These methods must be defined in subclass
  virtual long setCurrent(double north, double east) = 0;
  virtual long command(double propOmega, double elevator, double rudder) = 0;
  virtual long state(SimulatorIF::Vector position, SimulatorIF::Vector positionRate, SimulatorIF::Vector euler, SimulatorIF::Vector eulerRate) = 0;
  virtual long rotationalVelocity(SimulatorIF::Vector velocity, SimulatorIF::Vector backDiff) = 0;
  virtual long translationalVelocity(SimulatorIF::Vector velocity, SimulatorIF::Vector backDiff) = 0;
  virtual long translationalBottomVelocity(SimulatorIF::Vector vel_Bo_N_B) = 0;
  virtual long controlSurfaces(double *rudder, double *elevator) = 0;
  virtual long force(SimulatorIF::Vector vector) = 0;
  virtual long torque(SimulatorIF::Vector vector) = 0;
  virtual long propOmega(double *rpm) = 0;
  virtual long motorCurrent(double *motor) = 0;
  virtual long waterSpeed(double *waterSpeed) = 0;
  virtual double simTime() = 0;
  virtual double waterDepth() = 0;
  virtual long nTs() = 0;
  
  // Declare callbacks corresponding to each method
  Boolean setCurrentCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean commandCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean stateCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean rotationalVelocityCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean translationalVelocityCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean translationalBottomVelocityCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean controlSurfacesCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean forceCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean torqueCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean propOmegaCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean motorCurrentCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean waterSpeedCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean simTimeCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean waterDepthCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean nTsCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  
  // Message structure pointer for each method
  SimulatorIF::SetCurrentMsg *_setCurrentMsg;
  SimulatorIF::CommandMsg *_commandMsg;
  SimulatorIF::StateMsg *_stateMsg;
  SimulatorIF::RotationalVelocityMsg *_rotationalVelocityMsg;
  SimulatorIF::TranslationalVelocityMsg *_translationalVelocityMsg;
  SimulatorIF::TranslationalBottomVelocityMsg *_translationalBottomVelocityMsg;
  SimulatorIF::ControlSurfacesMsg *_controlSurfacesMsg;
  SimulatorIF::ForceMsg *_forceMsg;
  SimulatorIF::TorqueMsg *_torqueMsg;
  SimulatorIF::PropOmegaMsg *_propOmegaMsg;
  SimulatorIF::MotorCurrentMsg *_motorCurrentMsg;
  SimulatorIF::WaterSpeedMsg *_waterSpeedMsg;
  SimulatorIF::SimTimeMsg *_simTimeMsg;
  SimulatorIF::WaterDepthMsg *_waterDepthMsg;
  SimulatorIF::NTsMsg *_nTsMsg;
  
  // Determine max bytes required for message buffer
  virtual size_t maxRequestBytes();

  // Allocate buffer for messages, set pointers, etc
  virtual void allocateBuffers();

  private:

  // Initializer method called by constructors
  int init();

};

#endif

