/** \file
 *
 *  Contains the ThrusterModel class declaration.
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef THRUSTERMODEL_H_
#define THRUSTERMODEL_H_

/**
 *  Though far simpler than ActuatorModel, the intent is the same, to
 *  encapsulate some of the complexity of the thruster modeling and
 *  remove it from the main simulator body.  Unlike the ActuatorModel
 *  there is no delay, but it has the same "project" and "advance"
 *  functions.  If given a dt of 0.0, the project() function will return
 *  the previous iteration's values, since the thruster can't change
 *  instantaneously.
 *
 *  \ingroup modules_simulator
 */
class ThrusterModel
{
public:
    ThrusterModel();

    ~ThrusterModel()
    {}
    ;

    void initialize( float designSpeed, float designPropEff, float designOmega, float designThrust, float designTorque );

    float currentPropOmega( void )
    {
        return currentPropOmega_;
    };

    void setPrevious( const float previous )
    {
        currentPropOmega_ = previous;
    }

    void project( float propOmega, float u, float dt, float &thrust, float &torque );
    void advance( float propOmega, float u, float dt );

    ///
    float thrusterTorque( float omegaP, float u );
    float thrusterForce( float omegaP, float u );

private:
    float prevThrust_;
    float prevTorque_;
    float currentPropOmega_;
    float kWash_;
    float kThrust_;
    float kTorque_;

};

#endif /*THRUSTERMODEL_H_*/
