From: curt Date: Fri, 3 Nov 2000 23:02:47 +0000 (+0000) Subject: Sync with current JSBSim devel code. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=407dcaff6236e7217eff16ac253218d3e51bce6d;p=flightgear.git Sync with current JSBSim devel code. --- diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index 44058b127..68997a342 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -117,7 +117,7 @@ bool FGJSBsim::init( double dt ) { #endif if (result) { - FG_LOG( FG_FLIGHT, FG_INFO, " loaded aircraft" << globals->get_options()->get_aircraft() ); + FG_LOG( FG_FLIGHT, FG_INFO, " loaded aircraft " << globals->get_options()->get_aircraft() ); } else { FG_LOG( FG_FLIGHT, FG_INFO, " aircraft " << globals->get_options()->get_aircraft() @@ -210,10 +210,14 @@ bool FGJSBsim::update( int multiloop ) { set_Altitude( 0.0 ); } - - - if(needTrim) { - FGTrim *fgtrim=new FGTrim(fdmex,fgic,tLongitudinal); + if(needTrim && (globals->get_options()->get_trim_mode() > 0)) { + FGTrim *fgtrim; + if(fgic->GetVcalibratedKtsIC() < 10 ) { + fgic->SetVcalibratedKtsIC(0.0); + fgtrim=new FGTrim(fdmex,fgic,tGround); + } else { + fgtrim=new FGTrim(fdmex,fgic,tLongitudinal); + } if(!fgtrim->DoTrim()) { fgtrim->Report(); fgtrim->TrimStats(); @@ -223,6 +227,7 @@ bool FGJSBsim::update( int multiloop ) { needTrim=false; + controls.set_elevator_trim(fdmex->GetFCS()->GetPitchTrimCmd()); controls.set_elevator(fdmex->GetFCS()->GetDeCmd()); controls.set_throttle(FGControls::ALL_ENGINES, @@ -250,6 +255,8 @@ bool FGJSBsim::update( int multiloop ) { // autopilot (and the rest of the sim can use the updated values copy_from_JSBsim(); + + // but lets restore our original bogus altitude when we are done @@ -380,12 +387,14 @@ bool FGJSBsim::copy_from_JSBsim() { _set_Alpha( fdmex->GetTranslation()->Getalpha() ); _set_Beta( fdmex->GetTranslation()->Getbeta() ); + _set_Gamma_vert_rad( fdmex->GetPosition()->GetGamma() ); // set_Gamma_horiz_rad( Gamma_horiz_rad ); _set_Earth_position_angle( fdmex->GetAuxiliary()->GetEarthPositionAngle() ); _set_Climb_Rate( fdmex->GetPosition()->Gethdot() ); + for ( i = 1; i <= 3; i++ ) { for ( j = 1; j <= 3; j++ ) { diff --git a/src/FDM/JSBSim.hxx b/src/FDM/JSBSim.hxx index 4b9cf8e2f..7c56e1cf5 100644 --- a/src/FDM/JSBSim.hxx +++ b/src/FDM/JSBSim.hxx @@ -21,9 +21,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - Further information about the GNU General Public License can also be found on - the world wide web at http://www.gnu.org. - HISTORY -------------------------------------------------------------------------------- 02/01/1999 CLO Created @@ -63,7 +60,7 @@ COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] CLASS DOCUMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/** FGFS / JSBSim interface (aka "The Bus") +/** FGFS / JSBSim interface (aka "The Bus"). This class provides for an interface between FlightGear and its data structures and JSBSim and its data structures. This is the class which is used to command JSBSim when integrated with FlightGear. See the @@ -80,6 +77,17 @@ CLASS DECLARATION class FGJSBsim: public FGInterface { +#if 0 + // The aircraft for this instance + FGFDMExec *fdmex; + FGInitialCondition *fgic; + bool needTrim; + + bool trimmed; + float trim_elev; + float trim_throttle; +#endif + public: /// Constructor FGJSBsim::FGJSBsim(void); @@ -95,7 +103,7 @@ public: /// Reset flight params to a specific position bool init( double dt ); - /// Position Parameters + /// @name Position Parameter Set //@{ /** Set geocentric latitude @param lat latitude in radians measured from the 0 meridian where @@ -115,7 +123,7 @@ public: //void set_AltitudeAGL(double altagl); // and vice-versa - /// Velocity Parameters + /// @name Velocity Parameter Set //@{ /** Sets calibrated airspeed Setting this will trigger a recalc of the other velocity terms. @@ -142,13 +150,13 @@ public: void set_Velocities_Wind_Body( double u, double v, double w); //@} - /** Euler angle parameters + /** Euler Angle Parameter Set @param phi roll angle in radians @param theta pitch angle in radians @param psi heading angle in radians */ void set_Euler_Angles( double phi, double theta, double psi ); - /// Flight Path Parameters + /// @name Flight Path Parameter Set //@{ /** Sets rate of climb @param roc Rate of climb in ft/sec */ @@ -159,7 +167,7 @@ public: void set_Gamma_vert_rad( double gamma); //@} - /// Earth Parameters + /// @name Earth Parameter Set //@{ /** Sets the sea level radius in feet. @param slr Sea Level Radius in feet */ @@ -170,7 +178,7 @@ public: void set_Runway_altitude(double ralt); //@} - /// Atmospheric Parameters + /// @name Atmospheric Parameter Set //@{ /** Sets the atmospheric static pressure @param p pressure in psf */ diff --git a/src/FDM/JSBSim/FGAerodynamics.cpp b/src/FDM/JSBSim/FGAerodynamics.cpp index cbffadc97..d1a5a2564 100644 --- a/src/FDM/JSBSim/FGAerodynamics.cpp +++ b/src/FDM/JSBSim/FGAerodynamics.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGAerodynamics.cpp Author: Jon S. Berndt @@ -31,18 +31,18 @@ HISTORY -------------------------------------------------------------------------------- 09/13/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGAerodynamics.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_AERODYNAMICS; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGAerodynamics::FGAerodynamics(FGFDMExec* fgex) : FGModel(fgex) diff --git a/src/FDM/JSBSim/FGAerodynamics.h b/src/FDM/JSBSim/FGAerodynamics.h index f448203a3..842eba5f4 100644 --- a/src/FDM/JSBSim/FGAerodynamics.h +++ b/src/FDM/JSBSim/FGAerodynamics.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGAerodynamics.h Author: Jon S. Berndt @@ -27,20 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 09/13/00 JSB Created -******************************************************************************** -COMMENTS, REFERENCES, and NOTES -******************************************************************************** - -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGAERODYNAMICS_H #define FGAERODYNAMICS_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -54,23 +50,57 @@ INCLUDES #endif #include "FGModel.h" +#include "FGConfigFile.h" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_AERODYNAMICS "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Encapsulates the aerodynamic calculations. + This class owns and contains the list of coefficients that define the + aerodynamic properties of this aircraft. Here also, such unique phenomena + as ground effect and maximum lift curve tailoff are handled. + @author Jon S. Berndt + @version $Id$ + @see - +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGAerodynamics : public FGModel { public: + /** Constructor + @param Executive a pointer to the parent executive object */ FGAerodynamics(FGFDMExec*); + /// Destructor ~FGAerodynamics(void); + /** Runs the Aerodynamics model; called by the Executive + @return false if no error */ bool Run(void); + + /** Loads the Aerodynamics model + @return true if successful */ bool LoadAerodynamics(FGConfigFile* AC_cfg); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGAircraft.cpp b/src/FDM/JSBSim/FGAircraft.cpp index debb1d9ee..ccf5bfc46 100644 --- a/src/FDM/JSBSim/FGAircraft.cpp +++ b/src/FDM/JSBSim/FGAircraft.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGAircraft.cpp Author: Jon S. Berndt @@ -41,9 +41,10 @@ HISTORY point to config file. Added calculations for moments due to difference in cg and aero reference point -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate School, January 1994 @@ -97,9 +98,9 @@ Control CnDr - Yaw moment due to rudder CnDa - Yaw moment due to aileron -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include #include @@ -128,12 +129,20 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +GLOBAL DATA +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_AIRCRAFT; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex), vMoments(3), @@ -165,7 +174,7 @@ FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex), } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGAircraft::~FGAircraft(void) { @@ -187,7 +196,7 @@ FGAircraft::~FGAircraft(void) { delete[] Coeff; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string fname) { string path; @@ -234,7 +243,7 @@ bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string f return true; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGAircraft::Run(void) { if (!FGModel::Run()) { // if false then execute this Run() @@ -260,7 +269,7 @@ bool FGAircraft::Run(void) { return false; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::MassChange() { static FGColumnVector vXYZtank(3); @@ -354,7 +363,7 @@ void FGAircraft::MassChange() { } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::FMAero(void) { static FGColumnVector vDXYZcg(3); @@ -393,7 +402,7 @@ void FGAircraft::FMAero(void) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::FMGear(void) { @@ -409,7 +418,7 @@ void FGAircraft::FMGear(void) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::FMMass(void) { vForces(eX) += -GRAVITY*sin(vEuler(eTht)) * Mass; @@ -417,7 +426,7 @@ void FGAircraft::FMMass(void) { vForces(eZ) += GRAVITY*cos(vEuler(ePhi))*cos(vEuler(eTht)) * Mass; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::FMProp(void) { for (unsigned int i=0;iGetdt(); @@ -439,7 +448,7 @@ void FGAircraft::GetState(void) { vEuler = Rotation->GetEuler(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadMetrics(FGConfigFile* AC_cfg) { string token = ""; @@ -491,7 +500,7 @@ void FGAircraft::ReadMetrics(FGConfigFile* AC_cfg) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg) { string token; @@ -525,7 +534,7 @@ void FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg) { string token; @@ -533,7 +542,7 @@ void FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg) { FCS->LoadFCS(AC_cfg); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadAerodynamics(FGConfigFile* AC_cfg) { string token, axis; @@ -555,7 +564,7 @@ void FGAircraft::ReadAerodynamics(FGConfigFile* AC_cfg) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadUndercarriage(FGConfigFile* AC_cfg) { string token; @@ -567,7 +576,7 @@ void FGAircraft::ReadUndercarriage(FGConfigFile* AC_cfg) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadOutput(FGConfigFile* AC_cfg) { string token, parameter; @@ -635,7 +644,7 @@ void FGAircraft::ReadOutput(FGConfigFile* AC_cfg) { Output->SetRate( (int)(0.5 + 1.0/(State->Getdt()*OutRate)) ); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadPrologue(FGConfigFile* AC_cfg) { string token = AC_cfg->GetValue(); @@ -657,7 +666,7 @@ void FGAircraft::ReadPrologue(FGConfigFile* AC_cfg) { } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::DisplayCoeffFactors(vector multipliers) { cout << " Non-Dimensionalized by: "; @@ -668,7 +677,7 @@ void FGAircraft::DisplayCoeffFactors(vector multipliers) { cout << endl; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGAircraft::GetCoefficientStrings(void) { string CoeffStrings = ""; @@ -688,7 +697,7 @@ string FGAircraft::GetCoefficientStrings(void) { return CoeffStrings; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGAircraft::GetCoefficientValues(void) { string SDValues = ""; @@ -711,7 +720,7 @@ string FGAircraft::GetCoefficientValues(void) { ; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGAircraft::GetGroundReactionStrings(void) { string GroundReactionStrings = ""; @@ -730,7 +739,7 @@ string FGAircraft::GetGroundReactionStrings(void) { return GroundReactionStrings; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGAircraft::GetGroundReactionValues(void) { char buff[20]; diff --git a/src/FDM/JSBSim/FGAircraft.h b/src/FDM/JSBSim/FGAircraft.h index b8fe04ca5..05c9de0b4 100644 --- a/src/FDM/JSBSim/FGAircraft.h +++ b/src/FDM/JSBSim/FGAircraft.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGAircraft.h Author: Jon S. Berndt @@ -27,74 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 12/12/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGAIRCRAFT_H #define FGAIRCRAFT_H -/******************************************************************************* -COMMENTS, REFERENCES, and NOTES -*******************************************************************************/ -/* -The aerodynamic coefficients used in this model typically are: - -Longitudinal - CL0 - Reference lift at zero alpha - CD0 - Reference drag at zero alpha - CDM - Drag due to Mach - CLa - Lift curve slope (w.r.t. alpha) - CDa - Drag curve slope (w.r.t. alpha) - CLq - Lift due to pitch rate - CLM - Lift due to Mach - CLadt - Lift due to alpha rate - - Cmadt - Pitching Moment due to alpha rate - Cm0 - Reference Pitching moment at zero alpha - Cma - Pitching moment slope (w.r.t. alpha) - Cmq - Pitch damping (pitch moment due to pitch rate) - CmM - Pitch Moment due to Mach - -Lateral - Cyb - Side force due to sideslip - Cyr - Side force due to yaw rate - - Clb - Dihedral effect (roll moment due to sideslip) - Clp - Roll damping (roll moment due to roll rate) - Clr - Roll moment due to yaw rate - Cnb - Weathercocking stability (yaw moment due to sideslip) - Cnp - Rudder adverse yaw (yaw moment due to roll rate) - Cnr - Yaw damping (yaw moment due to yaw rate) - -Control - CLDe - Lift due to elevator - CDDe - Drag due to elevator - CyDr - Side force due to rudder - CyDa - Side force due to aileron - - CmDe - Pitch moment due to elevator - ClDa - Roll moment due to aileron - ClDr - Roll moment due to rudder - CnDr - Yaw moment due to rudder - CnDa - Yaw moment due to aileron - -[1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling - Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate - School, January 1994 -[2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices", - JSC 12960, July 1977 -[3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at - NASA-Ames", NASA CR-2497, January 1975 -[4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", - Wiley & Sons, 1979 ISBN 0-471-03032-5 -[5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons, - 1982 ISBN 0-471-08936-2 -*/ - -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -121,35 +63,49 @@ INCLUDES #include "FGConfigFile.h" #include "FGMatrix.h" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + #define ID_AIRCRAFT "$Header$" -/******************************************************************************* -DEFINITIONS -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ /** Encapsulates an Aircraft and its systems. - Owns all the parts (other classes) which make - up this aircraft. This includes the Engines, Tanks, Propellers, Nozzles, - aerodynamic and mass properties, landing gear, etc. + Owns all the parts (other classes) which make up this aircraft. This includes + the Engines, Tanks, Propellers, Nozzles, Aerodynamic and Mass properties, + landing gear, etc. These constituent parts may actually run as separate + JSBSim models themselves, but the responsibility for initializing them and + for retrieving their force and moment contributions falls to FGAircraft. @author Jon S. Berndt @version $Id$ @see - [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling +
  1. Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate - School, January 1994 - [2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices", - JSC 12960, July 1977 - [3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at - NASA-Ames", NASA CR-2497, January 1975 - [4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", - Wiley & Sons, 1979 ISBN 0-471-03032-5 - [5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons, - 1982 ISBN 0-471-08936-2 - */ + School, January 1994
  2. +
  3. D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices", + JSC 12960, July 1977
  4. +
  5. Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at + NASA-Ames", NASA CR-2497, January 1975
  6. +
  7. Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", + Wiley & Sons, 1979 ISBN 0-471-03032-5
  8. +
  9. Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons, + 1982 ISBN 0-471-08936-2
+*/ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGAircraft : public FGModel { enum {eL=1, eM, eN}; @@ -159,17 +115,15 @@ class FGAircraft : public FGModel { public: /** Constructor - @param Executive a pointer to the parent executive object - */ + @param Executive a pointer to the parent executive object */ FGAircraft(FGFDMExec *Executive); /// Destructor ~FGAircraft(void); - /** Runs the model; called by the Executive + /** Runs the Aircraft model; called by the Executive @see JSBSim.cpp documentation - @return bool returns false if no error - */ + @return false if no error */ bool Run(void); /** Loads the aircraft. @@ -177,24 +131,37 @@ public: @param apath path to the aircraft files (e.g. "aircraft/X15/") @param epath path to engine files (e.g. "engine/") @param acname name of aircraft (e.g. "X15") - @return true if succesful - */ + @return true if succesful */ bool LoadAircraft(string apath, string epath, string acname); - /** Retrieves the aircraft name - @return the name of the aircraft as a string type - */ + /** Gets the aircraft name + @return the name of the aircraft as a string type */ inline string GetAircraftName(void) { return AircraftName; } - inline void SetGearUp(bool tt) { GearUp = tt; } + /** Gets the gear status + @return true if gear is not deployed */ inline bool GetGearUp(void) { return GearUp; } + /** Gets the number of gear units defined for the aircraft + @return number of gear units defined */ inline int GetNumGearUnits(void) { return lGear.size(); } - inline FGLGear* GetGearUnit(int ii) { return &(lGear[ii]); } + /** Gets a gear instance + @param gear index of gear instance + @return a pointer to the FGLGear instance of the gear unit requested */ + inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); } + /// Gets the wing area inline float GetWingArea(void) { return WingArea; } + /// Gets the wing span inline float GetWingSpan(void) { return WingSpan; } + /// Gets the average wing chord inline float Getcbar(void) { return cbar; } - inline FGEngine* GetEngine(int tt) { return Engine[tt]; } - inline FGTank* GetTank(int tt) { return Tank[tt]; } + /** Gets an engine instance. + @param engine index of the engine instance + @return a pointer to the FGEngine instance of the requested engine */ + inline FGEngine* GetEngine(int engine) { return Engine[engine]; } + /** Gets a tank instance. + @param tank index of the tank instance + @return a pointer to the FGTank instance of the requested tank */ + inline FGTank* GetTank(int tank) { return Tank[tank]; } inline float GetWeight(void) { return Weight; } inline float GetMass(void) { return Mass; } inline FGColumnVector GetMoments(void) { return vMoments; } @@ -212,6 +179,7 @@ public: inline float GetAlphaCLMax(void) { return alphaclmax; } inline float GetAlphaCLMin(void) { return alphaclmin; } + inline void SetGearUp(bool tt) { GearUp = tt; } inline void SetAlphaCLMax(float tt) { alphaclmax=tt; } inline void SetAlphaCLMin(float tt) { alphaclmin=tt; } @@ -221,17 +189,20 @@ public: string GetGroundReactionStrings(void); string GetGroundReactionValues(void); - enum { ssSimulation = 1, - ssAerosurfaces = 2, - ssRates = 4, - ssVelocities = 8, - ssForces = 16, - ssMoments = 32, - ssAtmosphere = 64, - ssMassProps = 128, - ssCoefficients = 256, - ssPosition = 512, - ssGroundReactions = 1024 } subsystems; + /// Subsystem types for specifying which will be output in the FDM data logging + enum SubSystems { + /** Subsystem: Simulation (= 1) */ ssSimulation = 1, + /** Subsystem: Aerosurfaces (= 2) */ ssAerosurfaces = 2, + /** Subsystem: Body rates (= 4) */ ssRates = 4, + /** Subsystem: Velocities (= 8) */ ssVelocities = 8, + /** Subsystem: Forces (= 16) */ ssForces = 16, + /** Subsystem: Moments (= 32) */ ssMoments = 32, + /** Subsystem: Atmosphere (= 64) */ ssAtmosphere = 64, + /** Subsystem: Mass Properties (= 128) */ ssMassProps = 128, + /** Subsystem: Coefficients (= 256) */ ssCoefficients = 256, + /** Subsystem: Position (= 512) */ ssPosition = 512, + /** Subsystem: Ground Reactions (= 1024) */ ssGroundReactions = 1024 + } subsystems; private: void GetState(void); @@ -290,5 +261,5 @@ private: void ReadOutput(FGConfigFile*); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGAtmosphere.cpp b/src/FDM/JSBSim/FGAtmosphere.cpp index 3dc6810ac..170f5e232 100644 --- a/src/FDM/JSBSim/FGAtmosphere.cpp +++ b/src/FDM/JSBSim/FGAtmosphere.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGAtmosphere.cpp Author: Jon Berndt @@ -36,15 +36,15 @@ HISTORY 11/24/98 JSB Created 07/23/99 TP Added implementation of 1959 Standard Atmosphere Moved calculation of Mach number to FGTranslation -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [1] Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill, 1989, ISBN 0-07-001641-0 -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGAtmosphere.h" #include "FGState.h" @@ -62,9 +62,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_ATMOSPHERE; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGAtmosphere::FGAtmosphere(FGFDMExec* fdmex) : FGModel(fdmex), diff --git a/src/FDM/JSBSim/FGAuxiliary.cpp b/src/FDM/JSBSim/FGAuxiliary.cpp index 4b6d09169..3cd05ff0e 100644 --- a/src/FDM/JSBSim/FGAuxiliary.cpp +++ b/src/FDM/JSBSim/FGAuxiliary.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGAuxiliary.cpp Author: Jon Berndt @@ -36,9 +36,9 @@ HISTORY -------------------------------------------------------------------------------- 01/26/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGAuxiliary.h" #include "FGTranslation.h" @@ -55,9 +55,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_AUXILIARY; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex) { Name = "FGAuxiliary"; diff --git a/src/FDM/JSBSim/FGAuxiliary.h b/src/FDM/JSBSim/FGAuxiliary.h index 12cdabdd0..6d676ad58 100644 --- a/src/FDM/JSBSim/FGAuxiliary.h +++ b/src/FDM/JSBSim/FGAuxiliary.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGAuxiliary.h Author: Jon Berndt @@ -28,38 +28,61 @@ HISTORY 11/22/98 JSB Created 1/1/00 TP Added calcs and getters for VTAS, VCAS, VEAS, Vground, in knots -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGAUXILIARY_H #define FGAUXILIARY_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGModel.h" #include "FGMatrix.h" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + #define ID_AUXILIARY "$Header" -/******************************************************************************* -DEFINES -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/******************************************************************************* +/** Encapsulates various uncategorized scheduled functions. + @author Tony Peden, Jon Berndt + @version $Id$ + @see - +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGAuxiliary : public FGModel { public: + /** Constructor + @param Executive a pointer to the parent executive object */ FGAuxiliary(FGFDMExec*); + /// Destructor ~FGAuxiliary(void); + /** Runs the Auxiliary routines; called by the Executive + @return false if no error */ bool Run(void); - //use FGInitialCondition to set these speeds + // Use FGInitialCondition to set these speeds inline float GetVcalibratedFPS(void) { return vcas; } inline float GetVcalibratedKTS(void) { return vcas*FPSTOKTS; } inline float GetVequivalentFPS(void) { return veas; } @@ -78,15 +101,14 @@ private: float veas; float mach; float qbar,rhosl,rho,p,psl,pt; - //Don't add a getter for pt! - //pt above is freestream total pressure for subsonic only - //for supersonic it is the 1D total pressure behind a normal shock - //if a general freestream total is needed, e-mail Tony Peden + + // Don't add a getter for pt! + // pt above is freestream total pressure for subsonic only + // for supersonic it is the 1D total pressure behind a normal shock + // if a general freestream total is needed, e-mail Tony Peden // (apeden@earthlink.net) or you can add it your self using the // isentropic flow equations - - - + FGColumnVector vPilotAccel; float earthPosAngle; @@ -94,5 +116,5 @@ private: void GetState(void); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGCoefficient.cpp b/src/FDM/JSBSim/FGCoefficient.cpp index a87a0ff31..3f66bee0a 100644 --- a/src/FDM/JSBSim/FGCoefficient.cpp +++ b/src/FDM/JSBSim/FGCoefficient.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGCoefficient.cpp Author: Jon S. Berndt @@ -40,9 +40,9 @@ HISTORY -------------------------------------------------------------------------------- 12/28/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGCoefficient.h" #include "FGState.h" @@ -51,9 +51,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = "ID_COEFFICIENT"; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg) { @@ -177,13 +177,13 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGCoefficient::~FGCoefficient(void) { DeAllocate(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGCoefficient::DeAllocate(void) { @@ -196,7 +196,7 @@ bool FGCoefficient::DeAllocate(void) return true; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGCoefficient::Allocate(int r, int c) { @@ -207,7 +207,7 @@ bool FGCoefficient::Allocate(int r, int c) return true; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGCoefficient::Value(float rVal, float cVal) { @@ -238,7 +238,7 @@ float FGCoefficient::Value(float rVal, float cVal) return Value; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGCoefficient::Value(float Val) { @@ -269,7 +269,7 @@ float FGCoefficient::Value(float Val) return Value; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGCoefficient::Value(void) { @@ -285,7 +285,7 @@ float FGCoefficient::Value(void) return Value; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGCoefficient::TotalValue() { @@ -304,12 +304,12 @@ float FGCoefficient::TotalValue() return 0; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGCoefficient::DumpSD(void) { cout << " " << name << ": " << SD << endl; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGCoefficient.h b/src/FDM/JSBSim/FGCoefficient.h index cfb59f11f..ce8a21daf 100644 --- a/src/FDM/JSBSim/FGCoefficient.h +++ b/src/FDM/JSBSim/FGCoefficient.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGCoefficient.h Author: Jon Berndt @@ -27,16 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 12/28/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGCOEFFICIENT_H #define FGCOEFFICIENT_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -47,15 +47,17 @@ INCLUDES #include "FGConfigFile.h" #include "FGDefs.h" -/******************************************************************************* -DEFINES -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_COEFFICIENT "$Header" -/******************************************************************************* +using std::vector; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFDMExec; class FGState; @@ -68,18 +70,29 @@ class FGPosition; class FGAuxiliary; class FGOutput; -/******************************************************************************* -COMMENTS, REFERENCES, and NOTES -******************************************************************************** +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -This class models the stability derivative coefficient lookup tables or -equations. Note that the coefficients need not be calculated each delta-t. +Note that the coefficients need not be calculated each delta-t. This is +something that may be fixed someday. -******************************************************************************** -CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -using std::vector; +/** This class models the stability derivative coefficient lookup tables. + Each coefficient for an axis is stored in that axes' vector of coefficients. + Each FDM execution frame the Run() method of the [currently] FGAircraft model + is called and the coefficient value is calculated. + @author Jon S. Berndt + @version $Id$ + @see - +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DECLARATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGCoefficient { @@ -128,5 +141,5 @@ public: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGConfigFile.cpp b/src/FDM/JSBSim/FGConfigFile.cpp index 284326227..f74a1c128 100644 --- a/src/FDM/JSBSim/FGConfigFile.cpp +++ b/src/FDM/JSBSim/FGConfigFile.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGConfigFile.h Author: Jon Berndt @@ -13,9 +13,9 @@ HISTORY -------------------------------------------------------------------------------- 03/16/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGConfigFile.h" #include @@ -24,9 +24,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = "ID_CONFIGFILE"; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGConfigFile::FGConfigFile(string cfgFileName) { diff --git a/src/FDM/JSBSim/FGConfigFile.h b/src/FDM/JSBSim/FGConfigFile.h index 081b77dc7..f9106a2ed 100644 --- a/src/FDM/JSBSim/FGConfigFile.h +++ b/src/FDM/JSBSim/FGConfigFile.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGConfigFile.h Author: Jon Berndt @@ -27,16 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 03/29/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGCONFIGFILE_H #define FGCONFIGFILE_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -52,23 +52,45 @@ INCLUDES #include #include "FGDefs.h" -/******************************************************************************* -DEFINES -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_CONFIGFILE "$Header" using std::string; using std::ifstream; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Encapsulates reading a JSBSim config file. + JSBSim config files are in XML format. + @author Jon S. Berndt + @version $Id$ + @see - +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGConfigFile { public: - FGConfigFile(string); + /** Constructor + @param Filename the name of the config file to be read. */ + FGConfigFile(string Filename); + /// Destructor ~FGConfigFile(void); string GetLine(void); @@ -94,5 +116,5 @@ private: unsigned int CurrentIndex; }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGControls.cpp b/src/FDM/JSBSim/FGControls.cpp index 0bf85cb14..59bef9079 100644 --- a/src/FDM/JSBSim/FGControls.cpp +++ b/src/FDM/JSBSim/FGControls.cpp @@ -53,8 +53,8 @@ FGControls::~FGControls() { // $Log$ -// Revision 1.19 2000/10/14 00:10:12 curt -// Friday the 13th JSBSim update ... :-0 !!! +// Revision 1.20 2000/11/03 22:02:48 curt +// Sync with current JSBSim devel code. // // Revision 1.4 2000/10/13 19:21:02 jsb // ** JSB ** Added version identifiers for all files diff --git a/src/FDM/JSBSim/FGControls.h b/src/FDM/JSBSim/FGControls.h index bf7251767..04097f911 100644 --- a/src/FDM/JSBSim/FGControls.h +++ b/src/FDM/JSBSim/FGControls.h @@ -178,8 +178,8 @@ extern FGControls controls; // $Log$ -// Revision 1.18 2000/10/14 00:10:12 curt -// Friday the 13th JSBSim update ... :-0 !!! +// Revision 1.19 2000/11/03 22:02:48 curt +// Sync with current JSBSim devel code. // // Revision 1.7 2000/10/13 19:21:02 jsb // ** JSB ** Added version identifiers for all files diff --git a/src/FDM/JSBSim/FGDefs.h b/src/FDM/JSBSim/FGDefs.h index 5379593af..132b7470a 100644 --- a/src/FDM/JSBSim/FGDefs.h +++ b/src/FDM/JSBSim/FGDefs.h @@ -54,7 +54,7 @@ SENTRY #define FPSTOKTS 0.592484 #define INCHTOFT 0.08333333 #define OMEGA_EARTH .00007272205217 -#define NEEDED_CFG_VERSION "1.35" +#define NEEDED_CFG_VERSION "1.36" #define HPTOFTLBSSEC 550 #define METERS_TO_FEET 3.2808 diff --git a/src/FDM/JSBSim/FGEngine.cpp b/src/FDM/JSBSim/FGEngine.cpp index 5e673eabf..a00b3c906 100644 --- a/src/FDM/JSBSim/FGEngine.cpp +++ b/src/FDM/JSBSim/FGEngine.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGEngine.cpp Author: Jon Berndt @@ -34,9 +34,9 @@ HISTORY 09/03/99 JSB Changed Rocket thrust equation to correct -= Thrust instead of += Thrust (thanks to Tony Peden) -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -65,9 +65,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = "ID_ENGINE"; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGEngine::FGEngine(FGFDMExec* fdex, string enginePath, string engineName, int num) { diff --git a/src/FDM/JSBSim/FGEngine.h b/src/FDM/JSBSim/FGEngine.h index b75910dcc..e2f405fa9 100644 --- a/src/FDM/JSBSim/FGEngine.h +++ b/src/FDM/JSBSim/FGEngine.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGEngine.h Author: Jon S. Berndt @@ -33,16 +33,16 @@ HISTORY -------------------------------------------------------------------------------- 01/21/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGEngine_H #define FGEngine_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -52,17 +52,17 @@ FG_USING_STD(string); # include #endif -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_ENGINE "$Header" using std::string; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFDMExec; class FGState; @@ -149,5 +149,5 @@ protected: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGFCS.cpp b/src/FDM/JSBSim/FGFCS.cpp index 0725df45e..5e4f4259c 100644 --- a/src/FDM/JSBSim/FGFCS.cpp +++ b/src/FDM/JSBSim/FGFCS.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGFCS.cpp Author: Jon Berndt @@ -33,9 +33,9 @@ HISTORY -------------------------------------------------------------------------------- 12/12/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFCS.h" #include "FGState.h" @@ -59,11 +59,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = "ID_FCS"; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ - -char const *Id = "$Header$"; +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex) { Name = "FGFCS"; @@ -71,18 +69,18 @@ FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex) { ThrottleCmd[i] = 0.0; ThrottlePos[i] = 0.0; } - DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = 0.0; + DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = PTrimCmd = 0.0; DaPos = DePos = DrPos = DfPos = DsbPos = DspPos = 0.0; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGFCS::~FGFCS(void) { for(unsigned int i=0;iGetOutput(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGFCS::GetComponentName(int idx) { return Components[idx]->GetName(); } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGFCS::GetBrake(FGLGear::eBrakeGroup bg) { + switch (bg) { + case FGLGear::bgLeft: + return LeftBrake; + case FGLGear::bgRight: + return RightBrake; + case FGLGear::bgCenter: + return CenterBrake; + default: + cerr << "GetBrake asked to return a bogus brake value" << endl; + } +} diff --git a/src/FDM/JSBSim/FGFCS.h b/src/FDM/JSBSim/FGFCS.h index c2288fe16..c334935f0 100644 --- a/src/FDM/JSBSim/FGFCS.h +++ b/src/FDM/JSBSim/FGFCS.h @@ -1,5 +1,5 @@ -/******************************************************************************* - +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Header: FGGFCS.h Author: Jon S. Berndt Date started: 12/12/98 @@ -27,16 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 12/12/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGFCS_H #define FGFCS_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -52,76 +52,283 @@ INCLUDES #include #include "filtersjb/FGFCSComponent.h" #include "FGModel.h" +#include "FGLGear.h" #include "FGConfigFile.h" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + #define ID_FCS "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Encapsulates the Flight Control System (FCS) functionality. +
  • \URL[Source Code]{FGFCS.cpp.html}
  • +
  • \URL[Header File]{FGFCS.h.html}
+ This class owns and contains the list of \URL[components]{FGFCSComponent.html} + that define the control system for this aircraft. The config file for the + aircraft contains a description of the control path that starts at an input + or command and ends at an effector, e.g. an aerosurface. The FCS components + which comprise the control laws for an axis are defined sequentially in + the configuration file. For instance, for the X-15: + +
+    < FLIGHT_CONTROL NAME="X-15 SAS">
+
+    < COMPONENT NAME="Pitch Trim Sum" TYPE="SUMMER">
+      ID            0
+      INPUT        FG_ELEVATOR_CMD
+      INPUT        FG_PITCH_TRIM_CMD
+      CLIPTO       -1 1
+    </COMPONENT>
+
+    < COMPONENT NAME="Pitch Command Scale" TYPE="AEROSURFACE_SCALE">
+      ID           1
+      INPUT        0
+      MIN         -50
+      MAX          50
+    </COMPONENT>
+
+    < COMPONENT NAME="Pitch Gain 1" TYPE="PURE_GAIN">
+      ID           2
+      INPUT        1
+      GAIN         -0.36
+    </COMPONENT>
+
+    < COMPONENT NAME="Pitch Scheduled Gain 1" TYPE="SCHEDULED_GAIN">
+      ID           3
+      INPUT        2
+      GAIN         0.017
+      SCHEDULED_BY FG_ELEVATOR_POS
+      -0.35  -6.0
+      -0.17  -3.0
+       0.00  -2.0
+       0.09  -3.0
+       0.17  -5.0
+       0.60 -12.0
+    </COMPONENT>
+
+    ... etc.
+    
+ + In the above case we can see the first few components of the pitch channel + defined. The input to the first component, as can be seen in the "Pitch trim + sum" component, is really the sum of two parameters: elevator command (from + the stick - a pilot input), and pitch trim. The type of this component is + "Summer". Its ID is 0 - the ID is used by other components to reference it. + The next component created is an aerosurface scale component - a type of + gain (see the LoadFCS() method for insight on how the various types of + components map into the actual component classes). You can see the input of + the "Pitch Command Scale" component takes "0" as input. When a number is + specified as an input, it refers to the ID of another FCS component. In this + case, ID 0 refers to the previously defined and discussed "Pitch Trim Sum" + component. This continues until the final component for an axis when the + OUTPUT keyword specifies where the output is supposed to go. See the + individual components for more information on how they are mechanized. + + @author Jon S. Berndt + @version $Id$ + @see FGFCSComponent + @see FGConfigFile + @see FGGain + @see FGSummer + @see FGSwitch + @see FGGradient + @see FGFilter + @see FGFlaps + @see FGDeadBand +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFCS : public FGModel { -private: - float DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd; - float DaPos, DePos, DrPos, DfPos, DsbPos, DspPos; - float PTrimCmd; - float ThrottleCmd[MAX_ENGINES]; // Needs to be changed: no limit - float ThrottlePos[MAX_ENGINES]; // Needs to be changed: no limit - - vector Components; public: + /** Constructor + @param Executive a pointer to the parent executive object */ FGFCS(FGFDMExec*); + /// Destructor ~FGFCS(void); + /** Runs the Flight Controls model; called by the Executive + @return false if no error */ bool Run(void); + /// @name Pilot input command retrieval + //@{ + /** Gets the aileron command. + @return aileron command in radians */ inline float GetDaCmd(void) { return DaCmd; } + /** Gets the elevator command. + @return elevator command in radians */ inline float GetDeCmd(void) { return DeCmd; } + /** Gets the rudder command. + @return rudder command in radians */ inline float GetDrCmd(void) { return DrCmd; } + /** Gets the flaps command. + @return flaps command in radians */ inline float GetDfCmd(void) { return DfCmd; } + /** Gets the speedbrake command. + @return speedbrake command in radians */ inline float GetDsbCmd(void) { return DsbCmd; } + /** Gets the spoiler command. + @return spoiler command in radians */ inline float GetDspCmd(void) { return DspCmd; } - inline float GetThrottleCmd(int ii) { return ThrottleCmd[ii]; } + /** Gets the throttle command. + @param engine engine ID number + @return throttle command in percent ( 0 - 100) for the given engine */ + inline float GetThrottleCmd(int engine) { return ThrottleCmd[engine]; } + /** Gets the pitch trim command. + @return pitch trim command in radians */ inline float GetPitchTrimCmd(void) { return PTrimCmd; } - + //@} + + /// @name Aerosurface position retrieval + //@{ + /** Gets the aileron position. + @return aileron position in radians */ inline float GetDaPos(void) { return DaPos; } + /** Gets the elevator position. + @return elevator position in radians */ inline float GetDePos(void) { return DePos; } + /** Gets the rudder position. + @return rudder position in radians */ inline float GetDrPos(void) { return DrPos; } + /** Gets the flaps position. + @return flaps position in radians */ inline float GetDfPos(void) { return DfPos; } + /** Gets the speedbrake position. + @return speedbrake position in radians */ inline float GetDsbPos(void) { return DsbPos; } + /** Gets the spoiler position. + @return spoiler position in radians */ inline float GetDspPos(void) { return DspPos; } + /** Gets the throttle position. + @param engine engine ID number + @return throttle position for the given engine in percent ( 0 - 100)*/ + inline float GetThrottlePos(int engine) { return ThrottlePos[engine]; } + //@} - inline float GetThrottlePos(int ii) { return ThrottlePos[ii]; } + /** Retrieves the State object pointer. + This is used by the FGFCS-owned components. + @return pointer to the State object */ inline FGState* GetState(void) { return State; } + /** Retrieves a components output value + @param idx the index of the component (the component ID) + @return output value from the component */ float GetComponentOutput(eParam idx); + /** Retrieves the component name + @param idx the index of the component (the component ID) + @return name of the component */ string GetComponentName(int idx); - inline void SetDaCmd(float tt) { DaCmd = tt; } - inline void SetDeCmd(float tt) { DeCmd = tt; } - inline void SetDrCmd(float tt) { DrCmd = tt; } - inline void SetDfCmd(float tt) { DfCmd = tt; } - inline void SetDsbCmd(float tt) { DsbCmd = tt; } - inline void SetDspCmd(float tt) { DspCmd = tt; } - inline void SetPitchTrimCmd(float tt) { PTrimCmd = tt; } - - void SetThrottleCmd(int ii, float tt); - - inline void SetDaPos(float tt) { DaPos = tt; } - inline void SetDePos(float tt) { DePos = tt; } - inline void SetDrPos(float tt) { DrPos = tt; } - inline void SetDfPos(float tt) { DfPos = tt; } - inline void SetDsbPos(float tt) { DsbPos = tt; } - inline void SetDspPos(float tt) { DspPos = tt; } + /// @name Pilot input command setting + //@{ + /** Sets the aileron command + @param cmd aileron command in radians*/ + inline void SetDaCmd(float cmd) { DaCmd = cmd; } + /** Sets the elevator command + @param cmd elevator command in radians*/ + inline void SetDeCmd(float cmd) { DeCmd = cmd; } + /** Sets the rudder command + @param cmd rudder command in radians*/ + inline void SetDrCmd(float cmd) { DrCmd = cmd; } + /** Sets the flaps command + @param cmd flaps command in radians*/ + inline void SetDfCmd(float cmd) { DfCmd = cmd; } + /** Sets the speedbrake command + @param cmd speedbrake command in radians*/ + inline void SetDsbCmd(float cmd) { DsbCmd = cmd; } + /** Sets the spoilers command + @param cmd spoilers command in radians*/ + inline void SetDspCmd(float cmd) { DspCmd = cmd; } + /** Sets the pitch trim command + @param cmd pitch trim command in radians*/ + inline void SetPitchTrimCmd(float cmd) { PTrimCmd = cmd; } + /** Sets the throttle command for the specified engine + @param engine engine ID number + @param cmd throttle command in percent (0 - 100)*/ + inline void SetThrottleCmd(int engine, float cmd); + //@} - void SetLBrake(float); - void SetRBrake(float); - void SetCBrake(float); + /// @name Aerosurface position setting + //@{ + /** Sets the aileron position + @param cmd aileron position in radians*/ + inline void SetDaPos(float cmd) { DaPos = cmd; } + /** Sets the elevator position + @param cmd elevator position in radians*/ + inline void SetDePos(float cmd) { DePos = cmd; } + /** Sets the rudder position + @param cmd rudder position in radians*/ + inline void SetDrPos(float cmd) { DrPos = cmd; } + /** Sets the flaps position + @param cmd flaps position in radians*/ + inline void SetDfPos(float cmd) { DfPos = cmd; } + /** Sets the speedbrake position + @param cmd speedbrake position in radians*/ + inline void SetDsbPos(float cmd) { DsbPos = cmd; } + /** Sets the spoiler position + @param cmd spoiler position in radians*/ + inline void SetDspPos(float cmd) { DspPos = cmd; } + /** Sets the actual throttle setting for the specified engine + @param engine engine ID number + @param cmd throttle setting in percent (0 - 100)*/ + inline void SetThrottlePos(int engine, float cmd); + //@} - void SetThrottlePos(int ii, float tt); + /// @name Landing Gear brakes + //@{ + /** Sets the left brake group + @param cmd brake setting in percent (0.0 - 1.0) */ + void SetLBrake(float cmd) {LeftBrake = cmd;} + /** Sets the right brake group + @param cmd brake setting in percent (0.0 - 1.0) */ + void SetRBrake(float cmd) {RightBrake = cmd;} + /** Sets the center brake group + @param cmd brake setting in percent (0.0 - 1.0) */ + void SetCBrake(float cmd) {CenterBrake = cmd;} + /** Gets the brake for a specified group. + @param bg which brakegroup to retrieve the command for + @return the brake setting for the supplied brake group argument */ + float GetBrake(FGLGear::eBrakeGroup bg); + //@} + /** Loads the Flight Control System. + The FGAircraft instance is actually responsible for reading the config file + and calling the various Loadxx() methods of the other systems, passing in + the config file instance pointer. LoadFCS() is called from FGAircraft. + @param AC_cfg pointer to the config file instance + @return true if succesful */ bool LoadFCS(FGConfigFile* AC_cfg); + + /** The name of the flight control laws for this aircraft. + This is given in the config file, and is not used for anything currently.*/ string FCSName; + +private: + float DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd; + float DaPos, DePos, DrPos, DfPos, DsbPos, DspPos; + float PTrimCmd; + float ThrottleCmd[MAX_ENGINES]; // Needs to be changed: s/b no limit + float ThrottlePos[MAX_ENGINES]; // Needs to be changed: s/b no limit + float LeftBrake, RightBrake, CenterBrake; // Brake settings + + vector Components; + }; #include "FGState.h" diff --git a/src/FDM/JSBSim/FGFDMExec.cpp b/src/FDM/JSBSim/FGFDMExec.cpp index 9aa740f6a..6e8964c49 100644 --- a/src/FDM/JSBSim/FGFDMExec.cpp +++ b/src/FDM/JSBSim/FGFDMExec.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGFDMExec.cpp Author: Jon S. Berndt @@ -34,9 +34,9 @@ HISTORY -------------------------------------------------------------------------------- 11/17/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -66,9 +66,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = "ID_FDMEXEC"; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ // Constructor @@ -103,7 +103,6 @@ FGFDMExec::~FGFDMExec(void){ bool FGFDMExec::Allocate(void) { - cout << "FGFDMExec::Allocate ... "; bool result=true; Atmosphere = new FGAtmosphere(this); @@ -144,13 +143,11 @@ bool FGFDMExec::Allocate(void) { Schedule(Output, 1); modelLoaded = false; - cout << "done." << endl; return result; } bool FGFDMExec::DeAllocate(void) { - cout << "FGFDMExec::DeAllocate ... "; if ( Atmosphere != 0 ) delete Atmosphere; if ( FCS != 0 ) delete FCS; @@ -177,7 +174,6 @@ bool FGFDMExec::DeAllocate(void) { modelLoaded = false; - cout << "done" << endl; } @@ -240,7 +236,6 @@ bool FGFDMExec::RunIC(FGInitialCondition *fgic) bool FGFDMExec::LoadModel(string APath, string EPath, string model) { bool result=false; - cout << "FGFDMExec::LoadModel ..." << endl; if(modelLoaded) { DeAllocate(); Allocate(); @@ -248,12 +243,13 @@ bool FGFDMExec::LoadModel(string APath, string EPath, string model) AircraftPath = APath; EnginePath = EPath; result = Aircraft->LoadAircraft(AircraftPath, EnginePath, model); - if(result) { - modelLoaded=true; + + if (result) { + modelLoaded = true; } else { cerr << "FGFDMExec: Failed to load aircraft and/or engine model" << endl; - } - cout << "FGFDMExec::LoadModel complete." << endl;; + } + return result; } diff --git a/src/FDM/JSBSim/FGFDMExec.h b/src/FDM/JSBSim/FGFDMExec.h index b17b35057..7d36c4027 100644 --- a/src/FDM/JSBSim/FGFDMExec.h +++ b/src/FDM/JSBSim/FGFDMExec.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGFDMExec.h Author: Jon Berndt @@ -30,25 +30,25 @@ HISTORY begins with the IC values from the given FGInitialCondition object and dt=0. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGFDMEXEC_HEADER_H #define FGFDMEXEC_HEADER_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_FDMEXEC "$Header" #include "FGModel.h" #include "FGInitialCondition.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGState; class FGAtmosphere; @@ -92,8 +92,8 @@ public: inline FGPosition* GetPosition(void) {return Position;} inline FGAuxiliary* GetAuxiliary(void) {return Auxiliary;} inline FGOutput* GetOutput(void) {return Output;} - - + inline string GetEnginePath(void) {return EnginePath;} + inline string GetAircraftPath(void) {return AircraftPath;} private: bool frozen; @@ -105,7 +105,6 @@ private: string EnginePath; string ScriptPath; - FGState* State; FGAtmosphere* Atmosphere; FGFCS* FCS; @@ -122,5 +121,5 @@ private: protected: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGForce.cpp b/src/FDM/JSBSim/FGForce.cpp index 0b596d1a2..c73edd805 100644 --- a/src/FDM/JSBSim/FGForce.cpp +++ b/src/FDM/JSBSim/FGForce.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Source: FGForce.cpp Author: Tony Peden diff --git a/src/FDM/JSBSim/FGForce.h b/src/FDM/JSBSim/FGForce.h index 8bb2f5578..6a765876f 100644 --- a/src/FDM/JSBSim/FGForce.h +++ b/src/FDM/JSBSim/FGForce.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGForce.h Author: Tony Peden @@ -46,25 +46,25 @@ CAVEAT: if the custom transform is used for wind-to-body transforms then the provided by SetTransform(tWindBody) and is not subject to the same restriction. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGFORCE_H #define FGFORCE_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_FORCE "$Header" #include "FGFDMExec.h" #include "FGMatrix.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ typedef enum { tNone, tWindBody, tLocalBody, tCustom } TransformType; diff --git a/src/FDM/JSBSim/FGGroundReactions.cpp b/src/FDM/JSBSim/FGGroundReactions.cpp index 085c8e6fa..69520b6ea 100644 --- a/src/FDM/JSBSim/FGGroundReactions.cpp +++ b/src/FDM/JSBSim/FGGroundReactions.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGGroundReactions.cpp Author: Jon S. Berndt @@ -31,18 +31,18 @@ HISTORY -------------------------------------------------------------------------------- 09/13/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGGroundReactions.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_GROUNDREACTIONS; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGGroundReactions::FGGroundReactions(FGFDMExec* fgex) : FGModel(fgex) diff --git a/src/FDM/JSBSim/FGGroundReactions.h b/src/FDM/JSBSim/FGGroundReactions.h index 645556974..5c4135ad3 100644 --- a/src/FDM/JSBSim/FGGroundReactions.h +++ b/src/FDM/JSBSim/FGGroundReactions.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGGroundReactions.h Author: Jon S. Berndt @@ -27,20 +27,20 @@ HISTORY -------------------------------------------------------------------------------- 09/13/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGGROUNDREACTIONS_H #define FGGROUNDREACTIONS_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -54,12 +54,13 @@ INCLUDES #endif #include "FGModel.h" +#include "FGConfigFile.h" #define ID_GROUNDREACTIONS "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGGroundReactions : public FGModel { @@ -71,6 +72,6 @@ public: bool LoadGroundReactions(FGConfigFile* AC_cfg); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGInertial.cpp b/src/FDM/JSBSim/FGInertial.cpp index 36e54c69b..e72aa64ed 100644 --- a/src/FDM/JSBSim/FGInertial.cpp +++ b/src/FDM/JSBSim/FGInertial.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGInertial.cpp Author: Jon S. Berndt @@ -31,18 +31,18 @@ HISTORY -------------------------------------------------------------------------------- 09/13/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGInertial.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_INERTIAL; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGInertial::FGInertial(FGFDMExec* fgex) : FGModel(fgex) diff --git a/src/FDM/JSBSim/FGInertial.h b/src/FDM/JSBSim/FGInertial.h index 115dbb716..b1a0b299b 100644 --- a/src/FDM/JSBSim/FGInertial.h +++ b/src/FDM/JSBSim/FGInertial.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGInertial.h Author: Jon S. Berndt @@ -27,20 +27,20 @@ HISTORY -------------------------------------------------------------------------------- 09/13/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGINERTIAL_H #define FGINERTIAL_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -58,9 +58,9 @@ INCLUDES #define ID_INERTIAL "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ const char *Id_Inertial = "JSBSim $Header$"; @@ -74,6 +74,6 @@ public: bool LoadInertial(FGConfigFile* AC_cfg); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGInitialCondition.h b/src/FDM/JSBSim/FGInitialCondition.h index ccb5e9a96..a461bccb9 100644 --- a/src/FDM/JSBSim/FGInitialCondition.h +++ b/src/FDM/JSBSim/FGInitialCondition.h @@ -171,7 +171,8 @@ public: inline float GetMachIC(void) { return mach; } inline float GetAltitudeFtIC(void) { return altitude; } - + inline float GetAltitudeAGLFtIC(void) { return altitude - terrain_altitude; } + inline float GetFlightPathAngleDegIC(void) { return gamma*RADTODEG; } inline float GetFlightPathAngleRadIC(void) { return gamma; } diff --git a/src/FDM/JSBSim/FGLGear.cpp b/src/FDM/JSBSim/FGLGear.cpp index 6858c969c..6dc659162 100644 --- a/src/FDM/JSBSim/FGLGear.cpp +++ b/src/FDM/JSBSim/FGLGear.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGLGear.cpp Author: Jon S. Berndt @@ -32,20 +32,27 @@ HISTORY -------------------------------------------------------------------------------- 11/18/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGLGear.h" #include +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +GLOBAL DATA +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_LGEAR; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ - +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3), vMoment(3), @@ -55,7 +62,7 @@ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3), string tmp; *AC_cfg >> tmp >> name >> vXYZ(1) >> vXYZ(2) >> vXYZ(3) >> kSpring >> bDamp>> dynamicFCoeff >> staticFCoeff - >> SteerType >> BrakeType >> GroupMember >> maxSteerAngle; + >> SteerType >> BrakeGroup >> maxSteerAngle; cout << " Name: " << name << endl; cout << " Location: " << vXYZ << endl; @@ -63,11 +70,24 @@ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3), cout << " Damping Constant: " << bDamp << endl; cout << " Dynamic Friction: " << dynamicFCoeff << endl; cout << " Static Friction: " << staticFCoeff << endl; - cout << " Brake Type: " << BrakeType << endl; - cout << " Grouping: " << GroupMember << endl; + cout << " Grouping: " << BrakeGroup << endl; cout << " Steering Type: " << SteerType << endl; cout << " Max Steer Angle: " << maxSteerAngle << endl; - + + if (BrakeGroup == "LEFT" ) eBrakeGrp = bgLeft; + else if (BrakeGroup == "RIGHT" ) eBrakeGrp = bgRight; + else if (BrakeGroup == "CENTER") eBrakeGrp = bgCenter; + else if (BrakeGroup == "NOSE" ) eBrakeGrp = bgNose; + else if (BrakeGroup == "TAIL" ) eBrakeGrp = bgTail; + else if (BrakeGroup == "NONE" ) eBrakeGrp = bgNone; + else { + cerr << "Improper braking group specification in config file: " + << BrakeGroup << " is undefined." << endl; + } + +// add some AI here to determine if gear is located properly according to its +// brake group type + State = Exec->GetState(); Aircraft = Exec->GetAircraft(); Position = Exec->GetPosition(); @@ -79,23 +99,65 @@ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3), Reported = false; DistanceTraveled = 0.0; MaximumStrutForce = MaximumStrutTravel = 0.0; -} + + vWhlBodyVec = (vXYZ - Aircraft->GetXYZcg()) / 12.0; + vWhlBodyVec(eX) = -vWhlBodyVec(eX); + vWhlBodyVec(eZ) = -vWhlBodyVec(eZ); + vLocalGear = State->GetTb2l() * vWhlBodyVec; +} -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGLGear::~FGLGear(void) +FGLGear::FGLGear(const FGLGear& lgear) { - cout << "Destructing Landing Gear ..." << endl; + State = lgear.State; + Aircraft = lgear.Aircraft; + Position = lgear.Position; + Rotation = lgear.Rotation; + Exec = lgear.Exec; + + vXYZ = lgear.vXYZ; + vMoment = lgear.vMoment; + vWhlBodyVec = lgear.vWhlBodyVec; + vLocalGear = lgear.vLocalGear; + + WOW = lgear.WOW; + ReportEnable = lgear.ReportEnable; + FirstContact = lgear.FirstContact; + DistanceTraveled = lgear.DistanceTraveled; + MaximumStrutForce = lgear.MaximumStrutForce; + MaximumStrutTravel = lgear.MaximumStrutTravel; + + kSpring = lgear.kSpring; + bDamp = lgear.bDamp; + compressLength = lgear.compressLength; + compressSpeed = lgear.compressSpeed; + staticFCoeff = lgear.staticFCoeff; + dynamicFCoeff = lgear.dynamicFCoeff; + brakePct = lgear.brakePct; + maxCompLen = lgear.maxCompLen; + SinkRate = lgear.SinkRate; + GroundSpeed = lgear.GroundSpeed; + Reported = lgear.Reported; + name = lgear.name; + SteerType = lgear.SteerType; + BrakeGroup = lgear.BrakeGroup; + eBrakeGrp = lgear.eBrakeGrp; + maxSteerAngle = lgear.maxSteerAngle; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGLGear::~FGLGear(void) {} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGLGear::Force(void) { FGColumnVector vForce(3); FGColumnVector vLocalForce(3); - FGColumnVector vLocalGear(3); // Vector: CG to this wheel (Local) + //FGColumnVector vLocalGear(3); // Vector: CG to this wheel (Local) FGColumnVector vWhlVelVec(3); // Velocity of this wheel (Local) vWhlBodyVec = (vXYZ - Aircraft->GetXYZcg()) / 12.0; @@ -131,6 +193,26 @@ FGColumnVector FGLGear::Force(void) // the following needs work regarding friction coefficients and braking and steering + switch (eBrakeGrp) { + case bgLeft: + + break; + case bgRight: + break; + case bgCenter: + break; + case bgNose: + break; + case bgTail: + break; + case bgNone: + break; + default: + cerr << "Improper brake group membership detected for this gear." << endl; + break; + } +// + vLocalForce(eZ) = min(-compressLength * kSpring - compressSpeed * bDamp, (float)0.0); vLocalForce(eX) = fabs(vLocalForce(eZ) * staticFCoeff) * vWhlVelVec(eX); vLocalForce(eY) = fabs(vLocalForce(eZ) * staticFCoeff) * vWhlVelVec(eY); @@ -166,7 +248,7 @@ FGColumnVector FGLGear::Force(void) return vForce; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGLGear::Report(void) { diff --git a/src/FDM/JSBSim/FGLGear.h b/src/FDM/JSBSim/FGLGear.h index be4abad6f..0b2536a18 100644 --- a/src/FDM/JSBSim/FGLGear.h +++ b/src/FDM/JSBSim/FGLGear.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGLGear.h Author: Jon S. Berndt @@ -27,32 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 11/18/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGLGEAR_H #define FGLGEAR_H -/******************************************************************************* -COMMENTS, REFERENCES, and NOTES -******************************************************************************** - -[1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling - Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate - School, January 1994 -[2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices", - JSC 12960, July 1977 -[3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at - NASA-Ames", NASA CR-2497, January 1975 -[4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", - Wiley & Sons, 1979 ISBN 0-471-03032-5 -[5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons, - 1982 ISBN 0-471-08936-2 - -******************************************************************************** +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -64,47 +48,177 @@ INCLUDES #include "FGFDMExec.h" #include "FGState.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_LGEAR "$Header" -/******************************************************************************* -CLASS DECLARATION -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGAircraft; class FGPosition; class FGRotation; +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Landing gear model. + Calculates forces and moments due to landing gear reactions. This is done in + several steps, and is dependent on what kind of gear is being modeled. Here + are the parameters that can be specified in the config file for modeling + landing gear: +

+ Physical Characteristics
+

    +
  1. X, Y, Z location, in inches in structural coordinate frame
  2. +
  3. Spring constant, in lbs/ft
  4. +
  5. Damping coefficient, in lbs/ft/sec
  6. +
  7. Dynamic Friction Coefficient
  8. +
  9. Static Friction Coefficient
  10. +

+ Operational Properties
+

    +
  1. Name
  2. +
  3. Steerability attribute {one of STEERABLE | FIXED | CASTERED}
  4. +
  5. Brake Group Membership {one of LEFT | CENTER | RIGHT | NOSE | TAIL | NONE}
  6. +
  7. Max Steer Angle, in degrees
  8. +

+

+ Algorithm and Approach to Modeling
+

    +
  1. Find the location of the uncompressed landing gear relative to the CG of + the aircraft. Remember, the structural coordinate frame that the aircraft is + defined in is: X positive towards the tail, Y positive out the right side, Z + positive upwards. The locations of the various parts are given in inches in + the config file.
  2. +
  3. The vector giving the location of the gear (relative to the cg) is + rotated 180 degrees about the Y axis to put the coordinates in body frame (X + positive forwards, Y positive out the right side, Z positive downwards, with + the origin at the cg). The lengths are also now given in feet.
  4. +
  5. The new gear location is now transformed to the local coordinate frame + using the body-to-local matrix. (Mb2l).
  6. +
  7. Knowing the location of the center of gravity relative to the ground + (height above ground level or AGL) now enables gear deflection to be + calculated. The gear compression value is the local frame gear Z location + value minus the height AGL. [Currently, we make the assumption that the gear + is oriented - and the deflection occurs in - the Z axis only. Additionally, + the vector to the landing gear is currently not modified - which would + (correctly) move the point of contact to the actual compressed-gear point of + contact. Eventually, articulated gear may be modeled, but initially an + effort must be made to model a generic system.] As an example, say the + aircraft left main gear location (in local coordinates) is Z = 3 feet + (positive) and the height AGL is 2 feet. This tells us that the gear is + compressed 1 foot.
  8. +
  9. If the gear is compressed, a Weight-On-Wheels (WOW) flag is set.
  10. +
  11. With the compression length calculated, the compression velocity may now + be calculated. This will be used to determine the damping force in the + strut. The aircraft rotational rate is multiplied by the vector to the wheel + to get a wheel velocity in body frame. That velocity vector is then + transformed into the local coordinate frame.
  12. +
  13. The aircraft cg velocity in the local frame is added to the + just-calculated wheel velocity (due to rotation) to get a total wheel + velocity in the local frame.
  14. +
  15. The compression speed is the Z-component of the vector.
  16. +
  17. With the wheel velocity vector no longer needed, it is normalized and + multiplied by a -1 to reverse it. This will be used in the friction force + calculation.
  18. +
  19. Since the friction force takes place solely in the runway plane, the Z + coordinate of the normalized wheel velocity vector is set to zero.
  20. +
  21. The gear deflection force (the force on the aircraft acting along the + local frame Z axis) is now calculated given the spring and damper + coefficients, and the gear deflection speed and stroke length. Keep in mind + that gear forces always act in the negative direction (in both local and + body frames), and are not capable of generating a force in the positive + sense (one that would attract the aircraft to the ground). So, the gear + forces are always negative - they are limited to values of zero or less. The + gear force is simply the negative of the sum of the spring compression + length times the spring coefficient and the gear velocity times the damping + coefficient.
  22. +
  23. The lateral/directional force acting on the aircraft through the landing + gear (along the local frame X and Y axes) is calculated next. First, the + friction coefficient is multiplied by the recently calculated Z-force. This + is the friction force. It must be given direction in addition to magnitude. + We want the components in the local frame X and Y axes. From step 9, above, + the conditioned wheel velocity vector is taken and the X and Y parts are + multiplied by the friction force to get the X and Y components of friction. +
  24. +
  25. The wheel force in local frame is next converted to body frame.
  26. +
  27. The moment due to the gear force is calculated by multiplying r x F + (radius to wheel crossed into the wheel force). Both of these operands are + in body frame.
  28. +
+ @author Jon S. Berndt + @version $Id$ + @see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at + NASA-Ames", NASA CR-2497, January 1975 + @see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", + Wiley & Sons, 1979 ISBN 0-471-03032-5 +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DECLARATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + class FGLGear { public: - FGLGear(FGConfigFile*, FGFDMExec*); + /// Brake grouping enumerators + enum eBrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail }; + /** Constructor + @param Executive a pointer to the parent executive object + @param File a pointer to the config file instance */ + FGLGear(FGConfigFile* File, FGFDMExec* Executive); + /** Constructor + @param lgear a reference to an existing FGLGear object */ + FGLGear(const FGLGear& lgear); + /// Destructor ~FGLGear(void); + + /// The Force vector for this gear FGColumnVector Force(void); + /// The Moment vector for this gear FGColumnVector Moment(void) {return vMoment;} + /// Gets the location of the gear in Body axes FGColumnVector GetBodyLocation(void) { return vWhlBodyVec; } + + FGColumnVector GetLocalGear(void) { return vLocalGear; } + /// Gets the name of the gear inline string GetName(void) {return name; } + /// Gets the Weight On Wheels flag value inline bool GetWOW(void) {return WOW; } + /// Gets the current compressed length of the gear in feet inline float GetCompLen(void) {return compressLength;} + /// Gets the current gear compression velocity in ft/sec inline float GetCompVel(void) {return compressSpeed; } + /// Gets the gear compression force in pounds inline float GetCompForce(void) {return Force()(3); } + /// Sets the brake value in percent (0 - 100) inline void SetBrake(double bp) {brakePct = bp;} - - inline void SetReport(bool bb) { ReportEnable=bb; } + + /** Set the console touchdown reporting feature + @param flag true turns on touchdown reporting, false turns it off */ + inline void SetReport(bool flag) { ReportEnable = flag; } + /** Get the console touchdown reporting feature + @return true if reporting is turned on */ inline bool GetReport(void) { return ReportEnable; } - private: enum {eX=1, eY, eZ}; FGColumnVector vXYZ; FGColumnVector vMoment; FGColumnVector vWhlBodyVec; + FGColumnVector vLocalGear; float kSpring; float bDamp; float compressLength; @@ -122,9 +236,9 @@ private: bool Reported; bool ReportEnable; string name; - string BrakeType; string SteerType; - string GroupMember; + string BrakeGroup; + eBrakeGroup eBrakeGrp; float maxSteerAngle; FGFDMExec* Exec; @@ -140,5 +254,5 @@ private: #include "FGPosition.h" #include "FGRotation.h" -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGMassBalance.cpp b/src/FDM/JSBSim/FGMassBalance.cpp index f9cdd9cbc..300496454 100644 --- a/src/FDM/JSBSim/FGMassBalance.cpp +++ b/src/FDM/JSBSim/FGMassBalance.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGMassBalance.cpp Author: Jon S. Berndt @@ -34,18 +34,18 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGMassBalance.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_MASSBALANCE; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGMassBalance::FGMassBalance(FGFDMExec* fdmex) : FGModel(fdmex) diff --git a/src/FDM/JSBSim/FGMassBalance.h b/src/FDM/JSBSim/FGMassBalance.h index ca75b0fd7..1e69fd502 100644 --- a/src/FDM/JSBSim/FGMassBalance.h +++ b/src/FDM/JSBSim/FGMassBalance.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGMassBalance.h Author: Jon S. Berndt @@ -27,28 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGMASSBALANCE_H #define FGMASSBALANCE_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGModel.h" #define ID_MASSBALANCE "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGMassBalance : public FGModel { @@ -60,5 +60,5 @@ public: bool Run(void); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGMatrix.cpp b/src/FDM/JSBSim/FGMatrix.cpp index 6671a3e45..5660020fd 100644 --- a/src/FDM/JSBSim/FGMatrix.cpp +++ b/src/FDM/JSBSim/FGMatrix.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGMatrix.cpp Author: Originally by Tony Peden [formatted here (and broken??) by JSB] @@ -14,18 +14,18 @@ HISTORY ??/??/?? TP Created 03/16/2000 JSB Added exception throwing -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGMatrix.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_MATRIX; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ double** FGalloc(int rows, int cols) { @@ -41,7 +41,7 @@ double** FGalloc(int rows, int cols) return A; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void dealloc(double **A, int rows) { @@ -49,7 +49,7 @@ void dealloc(double **A, int rows) delete[] A; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix::FGMatrix(const unsigned int r, const unsigned int c) : rows(r), cols(c) { @@ -58,7 +58,7 @@ FGMatrix::FGMatrix(const unsigned int r, const unsigned int c) : rows(r), cols(c rowCtr = colCtr = 1; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix::FGMatrix(const FGMatrix& M) { @@ -67,7 +67,7 @@ FGMatrix::FGMatrix(const FGMatrix& M) *this = M; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix::~FGMatrix(void) { @@ -76,7 +76,7 @@ FGMatrix::~FGMatrix(void) rows = cols = 0; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ostream& operator<<(ostream& os, const FGMatrix& M) { @@ -91,7 +91,7 @@ ostream& operator<<(ostream& os, const FGMatrix& M) return os; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix& FGMatrix::operator<<(const float ff) { @@ -104,7 +104,7 @@ FGMatrix& FGMatrix::operator<<(const float ff) return *this; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% istream& operator>>(istream& is, FGMatrix& M) { @@ -116,7 +116,7 @@ istream& operator>>(istream& is, FGMatrix& M) return is; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix& FGMatrix::operator=(const FGMatrix& M) { @@ -140,21 +140,21 @@ FGMatrix& FGMatrix::operator=(const FGMatrix& M) return *this; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% unsigned int FGMatrix::Rows(void) const { return rows; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% unsigned int FGMatrix::Cols(void) const { return cols; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::SetOParams(char delim,int width,int prec,int origin) { @@ -164,7 +164,7 @@ void FGMatrix::SetOParams(char delim,int width,int prec,int origin) FGMatrix::origin = origin; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::InitMatrix(double value) { @@ -177,7 +177,7 @@ void FGMatrix::InitMatrix(double value) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::InitMatrix(void) { @@ -206,7 +206,7 @@ FGMatrix FGMatrix::operator-(const FGMatrix& M) return Diff; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::operator-=(const FGMatrix &M) { @@ -223,7 +223,7 @@ void FGMatrix::operator-=(const FGMatrix &M) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix FGMatrix::operator+(const FGMatrix& M) { @@ -243,7 +243,7 @@ FGMatrix FGMatrix::operator+(const FGMatrix& M) return Sum; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::operator+=(const FGMatrix &M) { @@ -260,7 +260,7 @@ void FGMatrix::operator+=(const FGMatrix &M) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix operator*(double scalar, FGMatrix &M) { @@ -274,7 +274,7 @@ FGMatrix operator*(double scalar, FGMatrix &M) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::operator*=(const double scalar) { @@ -285,7 +285,7 @@ void FGMatrix::operator*=(const double scalar) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix FGMatrix::operator*(const FGMatrix& M) { @@ -308,7 +308,7 @@ FGMatrix FGMatrix::operator*(const FGMatrix& M) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::operator*=(const FGMatrix& M) { @@ -334,7 +334,7 @@ void FGMatrix::operator*=(const FGMatrix& M) cols = M.cols; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix FGMatrix::operator/(const double scalar) { @@ -352,7 +352,7 @@ FGMatrix FGMatrix::operator/(const double scalar) return Quot; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::operator/=(const double scalar) { @@ -367,7 +367,7 @@ void FGMatrix::operator/=(const double scalar) cerr << "Attempt to divide by zero in method FGMatrix::operator/=(const double scalar), object " << this << endl; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::T(void) { @@ -377,7 +377,7 @@ void FGMatrix::T(void) TransposeNonSquare(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGMatrix::operator*(const FGColumnVector& Col) { @@ -398,7 +398,7 @@ FGColumnVector FGMatrix::operator*(const FGColumnVector& Col) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::TransposeSquare(void) { @@ -411,7 +411,7 @@ void FGMatrix::TransposeSquare(void) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGMatrix::TransposeNonSquare(void) { @@ -433,21 +433,21 @@ void FGMatrix::TransposeNonSquare(void) cols = m; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector::FGColumnVector(void):FGMatrix(3,1) { } FGColumnVector::FGColumnVector(int m):FGMatrix(m,1) { } FGColumnVector::FGColumnVector(const FGColumnVector& b):FGMatrix(b) { } FGColumnVector::~FGColumnVector() { } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% double& FGColumnVector::operator()(int m) const { return FGMatrix::operator()(m,1); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector operator*(const FGMatrix& Mat, const FGColumnVector& Col) { @@ -469,7 +469,7 @@ FGColumnVector operator*(const FGMatrix& Mat, const FGColumnVector& Col) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGColumnVector::operator+(const FGColumnVector& C) { @@ -488,7 +488,7 @@ FGColumnVector FGColumnVector::operator+(const FGColumnVector& C) return Sum; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGColumnVector::operator*(const double scalar) { @@ -499,7 +499,7 @@ FGColumnVector FGColumnVector::operator*(const double scalar) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGColumnVector::operator-(const FGColumnVector& V) { @@ -518,7 +518,7 @@ FGColumnVector FGColumnVector::operator-(const FGColumnVector& V) return Diff; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGColumnVector::operator/(const double scalar) { @@ -535,7 +535,7 @@ FGColumnVector FGColumnVector::operator/(const double scalar) } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector operator*(const double scalar, const FGColumnVector& C) { @@ -548,7 +548,7 @@ FGColumnVector operator*(const double scalar, const FGColumnVector& C) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGColumnVector::Magnitude(void) { @@ -565,7 +565,7 @@ float FGColumnVector::Magnitude(void) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGColumnVector::Normalize(void) { @@ -580,7 +580,7 @@ FGColumnVector FGColumnVector::Normalize(void) return *this; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGColumnVector::operator*(const FGColumnVector& V) { @@ -599,7 +599,7 @@ FGColumnVector FGColumnVector::operator*(const FGColumnVector& V) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGColumnVector::multElementWise(const FGColumnVector& V) { @@ -618,4 +618,4 @@ FGColumnVector FGColumnVector::multElementWise(const FGColumnVector& V) return Product; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGMatrix.h b/src/FDM/JSBSim/FGMatrix.h index 98a9f9457..4e19f652a 100644 --- a/src/FDM/JSBSim/FGMatrix.h +++ b/src/FDM/JSBSim/FGMatrix.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGMatrix.h Author: Originally by Tony Peden [formatted and adapted here by Jon Berndt] @@ -9,16 +9,16 @@ HISTORY ??/??/?? TP Created 03/16/2000 JSB Added exception throwing -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGMATRIX_H #define FGMATRIX_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include #ifdef FGFS @@ -40,17 +40,11 @@ INCLUDES #include -#define ID_MATRIX "$Header" - -/******************************************************************************* -FORWARD DECLARATIONS -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -class FGColumnVector; - -/******************************************************************************* -DECLARATION: MatrixException -*******************************************************************************/ +#define ID_MATRIX "$Header" using std::string; using std::ostream; @@ -58,15 +52,25 @@ using std::istream; using std::cerr; using std::endl; -class MatrixException /* : public exception */ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +class FGColumnVector; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DECLARATION: MatrixException +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +class MatrixException /* : public exception */ { public: string Message; }; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DECLARATION: FGMatrix -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGMatrix { @@ -118,9 +122,9 @@ public: void SetOParams(char delim,int width,int prec, int origin=0); }; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DECLARATION: FGColumnVector -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGColumnVector : public FGMatrix { @@ -146,5 +150,5 @@ public: FGColumnVector multElementWise(const FGColumnVector& V); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGModel.cpp b/src/FDM/JSBSim/FGModel.cpp index bc148164d..dc0a9d998 100644 --- a/src/FDM/JSBSim/FGModel.cpp +++ b/src/FDM/JSBSim/FGModel.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGModel.cpp Author: Jon Berndt @@ -34,9 +34,9 @@ HISTORY -------------------------------------------------------------------------------- 11/11/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGModel.h" #include "FGState.h" @@ -53,9 +53,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_MODEL; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGModel::FGModel(FGFDMExec* fdmex) { diff --git a/src/FDM/JSBSim/FGModel.h b/src/FDM/JSBSim/FGModel.h index 55aaffe1e..cfb00142e 100644 --- a/src/FDM/JSBSim/FGModel.h +++ b/src/FDM/JSBSim/FGModel.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGModel.h Author: Jon Berndt @@ -27,16 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 11/22/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGMODEL_H #define FGMODEL_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGDefs.h" @@ -55,15 +55,15 @@ INCLUDES #define ID_MODEL "$Header$" -/******************************************************************************* -DEFINES -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ using namespace std; -/******************************************************************************* -CLASS DECLARATION -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFDMExec; class FGState; @@ -76,14 +76,37 @@ class FGPosition; class FGAuxiliary; class FGOutput; +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Base class for all scheduled JSBSim models + @author Jon S. Berndt + */ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DECLARATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + class FGModel { public: + + /// Constructor FGModel(FGFDMExec*); + /// Destructor virtual ~FGModel(void); FGModel* NextModel; string Name; + + /** Runs the model; called by the Executive + @see JSBSim.cpp documentation + @return false if no error */ virtual bool Run(void); virtual bool InitModel(void); virtual void SetRate(int tt) {rate = tt;} @@ -114,5 +137,5 @@ protected: private: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGNozzle.cpp b/src/FDM/JSBSim/FGNozzle.cpp index 9c0edbf53..69141ceea 100644 --- a/src/FDM/JSBSim/FGNozzle.cpp +++ b/src/FDM/JSBSim/FGNozzle.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGNozzle.cpp Author: Jon S. Berndt @@ -31,18 +31,18 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGNozzle.h" static const char *IdSrc = "$Header$"; -static const char *IdHdr = ""; +static const char *IdHdr = ID_NOZZLE; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGNozzle::FGNozzle(FGFDMExec *FDMExec) : FGThruster(FDMExec) diff --git a/src/FDM/JSBSim/FGNozzle.h b/src/FDM/JSBSim/FGNozzle.h index 70aed14ae..cf3d14c63 100644 --- a/src/FDM/JSBSim/FGNozzle.h +++ b/src/FDM/JSBSim/FGNozzle.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGNozzle.h Author: Jon S. Berndt @@ -27,26 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGNOZZLE_H #define FGNOZZLE_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGThruster.h" -/******************************************************************************* +#define ID_NOZZLE "$Header$"; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGNozzle : public FGThruster { @@ -57,5 +59,5 @@ public: void Calculate(void); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGOutput.cpp b/src/FDM/JSBSim/FGOutput.cpp index e61bf5a40..8f28db203 100644 --- a/src/FDM/JSBSim/FGOutput.cpp +++ b/src/FDM/JSBSim/FGOutput.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGOutput.cpp Author: Jon Berndt @@ -34,9 +34,9 @@ HISTORY -------------------------------------------------------------------------------- 12/02/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGOutput.h" #include "FGState.h" @@ -52,9 +52,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_OUTPUT; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex) { @@ -71,14 +71,14 @@ FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex) #endif } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGOutput::~FGOutput(void) { if (socket) delete socket; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGOutput::Run(void) { @@ -107,7 +107,7 @@ bool FGOutput::Run(void) return false; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGOutput::SetType(string type) { @@ -125,7 +125,7 @@ void FGOutput::SetType(string type) } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGOutput::DelimitedOutput(void) { @@ -267,7 +267,7 @@ void FGOutput::DelimitedOutput(void) cout << endl; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGOutput::DelimitedOutput(string fname) { @@ -410,7 +410,7 @@ void FGOutput::DelimitedOutput(string fname) datafile.flush(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGOutput::SocketOutput(void) { @@ -501,7 +501,7 @@ void FGOutput::SocketOutput(void) socket->Send(); */ } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGOutput::SocketStatusOutput(string out_str) { @@ -515,5 +515,5 @@ void FGOutput::SocketStatusOutput(string out_str) socket->Send(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGOutput.h b/src/FDM/JSBSim/FGOutput.h index 60a3b99f9..0e090f165 100644 --- a/src/FDM/JSBSim/FGOutput.h +++ b/src/FDM/JSBSim/FGOutput.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGOutput.h Author: Jon Berndt @@ -27,16 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 12/02/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGOUTPUT_H #define FGOUTPUT_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGModel.h" @@ -58,9 +58,9 @@ INCLUDES #define ID_OUTPUT "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGOutput : public FGModel { @@ -91,6 +91,6 @@ private: FGfdmSocket* socket; }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGPiston.cpp b/src/FDM/JSBSim/FGPiston.cpp index 186ee1c3d..9acbf502a 100644 --- a/src/FDM/JSBSim/FGPiston.cpp +++ b/src/FDM/JSBSim/FGPiston.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGPiston.cpp Author: Jon S. Berndt @@ -34,18 +34,18 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGPiston.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_PISTON; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGPiston::FGPiston(FGFDMExec* fdex, string enginePath, string engineName, int num) : diff --git a/src/FDM/JSBSim/FGPiston.h b/src/FDM/JSBSim/FGPiston.h index 5e9c78cc7..579eb82de 100644 --- a/src/FDM/JSBSim/FGPiston.h +++ b/src/FDM/JSBSim/FGPiston.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGPiston.h Author: Jon S. Berndt @@ -27,26 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGPISTON_H #define FGPISTON_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" -/******************************************************************************* +#define ID_PISTON "$Header$"; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGPiston : public FGEngine { @@ -57,5 +59,5 @@ public: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGPosition.cpp b/src/FDM/JSBSim/FGPosition.cpp index 9fadd6ccb..c10bb83ee 100644 --- a/src/FDM/JSBSim/FGPosition.cpp +++ b/src/FDM/JSBSim/FGPosition.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGPosition.cpp Author: Jon S. Berndt @@ -34,9 +34,9 @@ HISTORY -------------------------------------------------------------------------------- 01/05/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate School, January 1994 @@ -49,9 +49,9 @@ COMMENTS, REFERENCES, and NOTES [5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons, 1982 ISBN 0-471-08936-2 -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -81,9 +81,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_POSITION; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ extern float globalTriNormal[3]; extern double globalSceneryAltitude; @@ -108,7 +108,7 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex), vRunwayNormal(3) = -1.0; // Initialized for standalone mode } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGPosition::~FGPosition(void) {} @@ -167,7 +167,7 @@ bool FGPosition:: Run(void) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGPosition::GetState(void) { dt = State->Getdt(); diff --git a/src/FDM/JSBSim/FGPosition.h b/src/FDM/JSBSim/FGPosition.h index 354f61944..0051817b2 100644 --- a/src/FDM/JSBSim/FGPosition.h +++ b/src/FDM/JSBSim/FGPosition.h @@ -1,5 +1,5 @@ -/******************************************************************************* - +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Header: FGPosition.h Author: Jon S. Berndt Date started: 1/5/99 @@ -27,65 +27,60 @@ HISTORY -------------------------------------------------------------------------------- 01/05/99 JSB Created -******************************************************************************** -COMMENTS, REFERENCES, and NOTES -******************************************************************************** - -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGPOSITION_H #define FGPOSITION_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGModel.h" #include "FGMatrix.h" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + #define ID_POSITION "$Header$" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/******************************************************************************* -DEFINITIONS -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ /** Models the lateral and longitudinal translational EOM. @author Jon S. Berndt @version $Id$ */ -/******************************************************************************* + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGPosition : public FGModel { - - FGColumnVector vUVW; - FGColumnVector vVel; - FGColumnVector vVelDot; - FGColumnVector vRunwayNormal; - - double Vee, invMass, invRadius; - double Radius, h; - double LatitudeDot, LongitudeDot, RadiusDot; - double lastLatitudeDot, lastLongitudeDot, lastRadiusDot; - double Longitude, Latitude; - float dt; - double RunwayRadius; - double DistanceAGL; - double SeaLevelRadius; - double gamma; - double Vt, Vground; - double hoverb,b; - - void GetState(void); - public: + /** Constructor + @param Executive a pointer to the parent executive object */ FGPosition(FGFDMExec*); + /// Destructor ~FGPosition(void); + /** Runs the Position model; called by the Executive + @see JSBSim.cpp documentation + @return false if no error */ + bool Run(void); + inline FGColumnVector GetVel(void) { return vVel; } inline FGColumnVector GetVelDot(void) { return vVelDot; } inline FGColumnVector GetUVW(void) { return vUVW; } @@ -117,8 +112,29 @@ public: vRunwayNormal << fgx << fgy << fgz; } - bool Run(void); +private: + FGColumnVector vUVW; + FGColumnVector vVel; + FGColumnVector vVelDot; + FGColumnVector vRunwayNormal; + + double Vee, invMass, invRadius; + double Radius, h; + double LatitudeDot, LongitudeDot, RadiusDot; + double lastLatitudeDot, lastLongitudeDot, lastRadiusDot; + double Longitude, Latitude; + float dt; + double RunwayRadius; + double DistanceAGL; + double SeaLevelRadius; + double gamma; + double Vt, Vground; + double hoverb,b; + + void GetState(void); + + }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGPropeller.cpp b/src/FDM/JSBSim/FGPropeller.cpp index 0f7442a01..5eefe09ff 100644 --- a/src/FDM/JSBSim/FGPropeller.cpp +++ b/src/FDM/JSBSim/FGPropeller.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGPropeller.cpp Author: Jon S. Berndt @@ -31,18 +31,18 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGPropeller.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_PROPELLER; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGPropeller::FGPropeller(FGFDMExec *FDMExec) : FGThruster(FDMExec) diff --git a/src/FDM/JSBSim/FGPropeller.h b/src/FDM/JSBSim/FGPropeller.h index 12b6330d3..5c2010eb0 100644 --- a/src/FDM/JSBSim/FGPropeller.h +++ b/src/FDM/JSBSim/FGPropeller.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGPropeller.h Author: Jon S. Berndt @@ -27,28 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGPROPELLER_H #define FGPROPELLER_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGThruster.h" #define ID_PROPELLER "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGPropeller : public FGThruster { @@ -59,5 +59,5 @@ public: void Calculate(void); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGPropulsion.cpp b/src/FDM/JSBSim/FGPropulsion.cpp index 818892df4..4536b5ed4 100644 --- a/src/FDM/JSBSim/FGPropulsion.cpp +++ b/src/FDM/JSBSim/FGPropulsion.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGPropulsion.cpp Author: Jon S. Berndt @@ -52,18 +52,18 @@ HISTORY -------------------------------------------------------------------------------- 08/20/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGPropulsion.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_PROPULSION; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGPropulsion::FGPropulsion(FGFDMExec* fgex) : FGModel(fgex) @@ -88,6 +88,7 @@ bool FGPropulsion::LoadPropulsion(FGConfigFile* AC_cfg) string token; string engine_name; string parameter; + int numEngines=0, numTanks=0; AC_cfg->GetNextConfigLine(); @@ -97,18 +98,18 @@ bool FGPropulsion::LoadPropulsion(FGConfigFile* AC_cfg) if (parameter == "AC_ENGINE") { *AC_cfg >> engine_name; - Engine[numEngines] = new FGEngine(FDMExec, EnginePath, engine_name, numEngines); + Engines[numEngines] = *(new FGEngine(FDMExec, FDMExec->GetEnginePath(), engine_name, numEngines)); numEngines++; } else if (parameter == "AC_TANK") { - Tank[numTanks] = new FGTank(AC_cfg); - switch(Tank[numTanks]->GetType()) { + Tanks[numTanks] = *(new FGTank(AC_cfg)); + switch(Tanks[numTanks].GetType()) { case FGTank::ttFUEL: - numSelectedFuelTanks++; +// numSelectedFuelTanks++; break; case FGTank::ttOXIDIZER: - numSelectedOxiTanks++; +// numSelectedOxiTanks++; break; } numTanks++; diff --git a/src/FDM/JSBSim/FGPropulsion.h b/src/FDM/JSBSim/FGPropulsion.h index c1255d671..d4b260d19 100644 --- a/src/FDM/JSBSim/FGPropulsion.h +++ b/src/FDM/JSBSim/FGPropulsion.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGPropulsion.h Author: Jon S. Berndt @@ -27,22 +27,22 @@ HISTORY -------------------------------------------------------------------------------- 08/20/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGPROPULSION_H #define FGPROPULSION_H -#declare ID_PROPULSION "$Header$" +#define ID_PROPULSION "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -62,9 +62,9 @@ INCLUDES #include "FGThruster.h" #include "FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGPropulsion : public FGModel { vector Engines; @@ -77,6 +77,6 @@ public: bool LoadPropulsion(FGConfigFile* AC_cfg); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGRocket.cpp b/src/FDM/JSBSim/FGRocket.cpp index 1957d1df7..962b5bb38 100644 --- a/src/FDM/JSBSim/FGRocket.cpp +++ b/src/FDM/JSBSim/FGRocket.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGRocket.cpp Author: Jon S. Berndt @@ -34,18 +34,18 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGRocket.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_ROCKET; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGRocket::FGRocket(FGFDMExec* fdex, string enginePath, string engineName, int num) : diff --git a/src/FDM/JSBSim/FGRocket.h b/src/FDM/JSBSim/FGRocket.h index 7336e959d..436971ea9 100644 --- a/src/FDM/JSBSim/FGRocket.h +++ b/src/FDM/JSBSim/FGRocket.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGRocket.h Author: Jon S. Berndt @@ -27,28 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGROCKET_H #define FGROCKET_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" #define ID_ROCKET "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGRocket : public FGEngine { @@ -59,5 +59,5 @@ public: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGRotation.cpp b/src/FDM/JSBSim/FGRotation.cpp index b482da41a..5a4f4c13b 100644 --- a/src/FDM/JSBSim/FGRotation.cpp +++ b/src/FDM/JSBSim/FGRotation.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGRotation.cpp Author: Jon Berndt @@ -33,9 +33,9 @@ HISTORY -------------------------------------------------------------------------------- 12/02/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate School, January 1994 @@ -51,9 +51,9 @@ COMMENTS, REFERENCES, and NOTES The order of rotations used in this class corresponds to a 3-2-1 sequence, or Y-P-R, or Z-Y-X, if you prefer. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGRotation.h" #include "FGAtmosphere.h" @@ -69,9 +69,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_ROTATION; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex), @@ -86,13 +86,13 @@ FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex), sTht=sPhi=sPsi=0.0; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGRotation::~FGRotation(void) { } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGRotation::Run(void) { @@ -136,7 +136,7 @@ bool FGRotation::Run(void) return false; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGRotation::GetState(void) { @@ -150,5 +150,5 @@ void FGRotation::GetState(void) Ixz = Aircraft->GetIxz(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGRotation.h b/src/FDM/JSBSim/FGRotation.h index a02b84032..deae5c7d5 100644 --- a/src/FDM/JSBSim/FGRotation.h +++ b/src/FDM/JSBSim/FGRotation.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGRotation.h Author: Jon Berndt @@ -27,9 +27,9 @@ HISTORY -------------------------------------------------------------------------------- 12/02/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate School, January 1994 @@ -45,16 +45,16 @@ COMMENTS, REFERENCES, and NOTES The order of rotations used in this class corresponds to a 3-2-1 sequence, or Y-P-R, or Z-Y-X, if you prefer. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGROTATION_H #define FGROTATION_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -77,9 +77,9 @@ INCLUDES #define ID_ROTATION "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGRotation : public FGModel { @@ -127,5 +127,5 @@ public: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGRotor.cpp b/src/FDM/JSBSim/FGRotor.cpp index f45e13328..de5ee60ba 100644 --- a/src/FDM/JSBSim/FGRotor.cpp +++ b/src/FDM/JSBSim/FGRotor.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGRotor.cpp Author: Jon S. Berndt @@ -31,18 +31,18 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGRotor.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_ROTOR; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGRotor::FGRotor(FGFDMExec *FDMExec) : FGThruster(FDMExec) diff --git a/src/FDM/JSBSim/FGRotor.h b/src/FDM/JSBSim/FGRotor.h index 14df54e41..9d22743f3 100644 --- a/src/FDM/JSBSim/FGRotor.h +++ b/src/FDM/JSBSim/FGRotor.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGRotor.h Author: Jon S. Berndt @@ -27,28 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGROTOR_H #define FGROTOR_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGThruster.h" #define ID_ROTOR "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGRotor : public FGThruster { @@ -59,5 +59,5 @@ public: void Calculate(void); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGState.cpp b/src/FDM/JSBSim/FGState.cpp index 4fe8aab56..454de5b2b 100644 --- a/src/FDM/JSBSim/FGState.cpp +++ b/src/FDM/JSBSim/FGState.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGState.cpp Author: Jon Berndt @@ -32,9 +32,9 @@ HISTORY -------------------------------------------------------------------------------- 11/17/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -66,17 +66,17 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_STATE; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MACROS -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define RegisterVariable(ID,DEF) coeffdef[#ID] = ID; paramdef[ID] = DEF -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // // For every term registered here there must be a corresponding handler in // GetParameter() below that retrieves that parameter. Also, there must be an @@ -127,11 +127,11 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3), RegisterVariable(FG_PITCH_TRIM_CMD, " pitch_trim_cmd " ); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGState::~FGState(void) {} -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGState::GetParameter(eParam val_idx) { switch(val_idx) { @@ -210,19 +210,19 @@ float FGState::GetParameter(eParam val_idx) { return 0; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGState::GetParameter(string val_string) { return GetParameter(coeffdef[val_string]); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% eParam FGState::GetParameterIndex(string val_string) { return coeffdef[val_string]; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGState::SetParameter(eParam val_idx, float val) { switch(val_idx) { @@ -341,7 +341,7 @@ void FGState::Initialize(float U, float V, float W, FDMExec->GetPosition()->SetvVel(vLocalVelNED); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGState::Initialize(FGInitialCondition *FGIC) { @@ -364,9 +364,10 @@ void FGState::Initialize(FGInitialCondition *FGIC) { FDMExec->GetPosition()->SetSeaLevelRadius( FGIC->GetSeaLevelRadiusFtIC() ); FDMExec->GetPosition()->SetRunwayRadius( FGIC->GetSeaLevelRadiusFtIC() + FGIC->GetTerrainAltitudeFtIC() ); + } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGState::StoreData(string fname) { ofstream datafile(fname.c_str()); @@ -389,7 +390,7 @@ bool FGState::StoreData(string fname) { } } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGState::InitMatrices(float phi, float tht, float psi) { float thtd2, psid2, phid2; @@ -425,7 +426,7 @@ void FGState::InitMatrices(float phi, float tht, float psi) { CalcMatrices(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGState::CalcMatrices(void) { float Q0Q0, Q1Q1, Q2Q2, Q3Q3; @@ -457,7 +458,7 @@ void FGState::CalcMatrices(void) { mTb2l.T(); } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGState::IntegrateQuat(FGColumnVector vPQR, int rate) { static FGColumnVector vlastQdot(4); @@ -475,7 +476,7 @@ void FGState::IntegrateQuat(FGColumnVector vPQR, int rate) { vlastQdot = vQdot; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGState::CalcEuler(void) { static FGColumnVector vEuler(3); @@ -492,7 +493,7 @@ FGColumnVector FGState::CalcEuler(void) { return vEuler; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix FGState::GetTs2b(float alpha, float beta) { float ca, cb, sa, sb; @@ -515,5 +516,5 @@ FGMatrix FGState::GetTs2b(float alpha, float beta) { return mTs2b; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGState.h b/src/FDM/JSBSim/FGState.h index 1d8183395..119fb34b4 100644 --- a/src/FDM/JSBSim/FGState.h +++ b/src/FDM/JSBSim/FGState.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGState.h Author: Jon S. Berndt @@ -33,16 +33,16 @@ HISTORY -------------------------------------------------------------------------------- 11/17/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGSTATE_H #define FGSTATE_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -61,15 +61,15 @@ INCLUDES #include "FGInitialCondition.h" #include "FGMatrix.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_STATE "$Header$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFDMExec; @@ -140,5 +140,5 @@ protected: enum {eP=1, eQ, eR}; }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGTank.cpp b/src/FDM/JSBSim/FGTank.cpp index 922ff8d0d..52f592e46 100644 --- a/src/FDM/JSBSim/FGTank.cpp +++ b/src/FDM/JSBSim/FGTank.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGTank.cpp Author: Jon Berndt @@ -32,18 +32,18 @@ HISTORY -------------------------------------------------------------------------------- 01/21/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGTank.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_TANK; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGTank::FGTank(FGConfigFile* AC_cfg) diff --git a/src/FDM/JSBSim/FGTank.h b/src/FDM/JSBSim/FGTank.h index 5e767c893..5919c473b 100644 --- a/src/FDM/JSBSim/FGTank.h +++ b/src/FDM/JSBSim/FGTank.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTank.h Author: Jon S. Berndt @@ -33,16 +33,16 @@ HISTORY -------------------------------------------------------------------------------- 01/21/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGTank_H #define FGTank_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -51,15 +51,15 @@ INCLUDES #include #include "FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_TANK "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGTank { @@ -90,5 +90,5 @@ private: protected: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGThruster.cpp b/src/FDM/JSBSim/FGThruster.cpp index 7391f2484..04c616625 100644 --- a/src/FDM/JSBSim/FGThruster.cpp +++ b/src/FDM/JSBSim/FGThruster.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGThruster.cpp Author: Jon S. Berndt @@ -31,18 +31,18 @@ HISTORY -------------------------------------------------------------------------------- 08/23/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGThruster.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_THRUSTER; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec) diff --git a/src/FDM/JSBSim/FGThruster.h b/src/FDM/JSBSim/FGThruster.h index 6ccf197ac..e340d2f06 100644 --- a/src/FDM/JSBSim/FGThruster.h +++ b/src/FDM/JSBSim/FGThruster.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGThruster.h Author: Jon S. Berndt @@ -27,28 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGTHRUSTER_H #define FGTHRUSTER_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGForce.h" #define ID_THRUSTER "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGThruster : public FGForce { @@ -61,5 +61,5 @@ public: virtual void Calculate(void); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGTranslation.cpp b/src/FDM/JSBSim/FGTranslation.cpp index 031d0961f..aa706890e 100644 --- a/src/FDM/JSBSim/FGTranslation.cpp +++ b/src/FDM/JSBSim/FGTranslation.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGTranslation.cpp Author: Jon Berndt @@ -35,9 +35,9 @@ HISTORY 7/23/99 TP Added data member and modified Run and PutState to calcuate Mach number -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate School, January 1994 @@ -53,9 +53,9 @@ COMMENTS, REFERENCES, and NOTES The order of rotations used in this class corresponds to a 3-2-1 sequence, or Y-P-R, or Z-Y-X, if you prefer. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGTranslation.h" #include "FGRotation.h" @@ -71,9 +71,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_TRANSLATION; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex), @@ -94,11 +94,11 @@ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex), rho = 0.002378; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGTranslation::~FGTranslation(void) {} -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGTranslation::Run(void) { static FGColumnVector vlastUVWdot(3); @@ -161,7 +161,7 @@ bool FGTranslation::Run(void) { return false; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGTranslation::GetState(void) { dt = State->Getdt(); diff --git a/src/FDM/JSBSim/FGTranslation.h b/src/FDM/JSBSim/FGTranslation.h index cb3696b46..1de210162 100644 --- a/src/FDM/JSBSim/FGTranslation.h +++ b/src/FDM/JSBSim/FGTranslation.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTranslation.h Author: Jon Berndt @@ -27,9 +27,9 @@ HISTORY -------------------------------------------------------------------------------- 12/02/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate School, January 1994 @@ -45,16 +45,16 @@ COMMENTS, REFERENCES, and NOTES The order of rotations used in this class corresponds to a 3-2-1 sequence, or Y-P-R, or Z-Y-X, if you prefer. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGTRANSLATION_H #define FGTRANSLATION_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -72,9 +72,9 @@ INCLUDES #define ID_TRANSLATION "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGTranslation : public FGModel { public: @@ -126,5 +126,5 @@ private: void GetState(void); }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGTrim.cpp b/src/FDM/JSBSim/FGTrim.cpp index 852cf38e2..5c2bf2d52 100644 --- a/src/FDM/JSBSim/FGTrim.cpp +++ b/src/FDM/JSBSim/FGTrim.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTrim.cpp Author: Tony Peden @@ -40,9 +40,9 @@ scheme. */ // !!!!!!! BEWARE ALL YE WHO ENTER HERE !!!!!!! -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include @@ -55,7 +55,7 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_TRIM; -/*******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGTrim::FGTrim(FGFDMExec *FDMExec,FGInitialCondition *FGIC, TrimMode tt ) { @@ -94,7 +94,7 @@ FGTrim::FGTrim(FGFDMExec *FDMExec,FGInitialCondition *FGIC, TrimMode tt ) { cout << " Ground Trim" << endl; TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAltAGL,Tolerance)); TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tTheta,A_Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tPhi,A_Tolerance)); + //TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tPhi,A_Tolerance)); break; } //cout << "NumAxes: " << TrimAxes.size() << endl; @@ -105,7 +105,7 @@ FGTrim::FGTrim(FGFDMExec *FDMExec,FGInitialCondition *FGIC, TrimMode tt ) { current_axis=0; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGTrim::~FGTrim(void) { for(current_axis=0; current_axisGetRotation()->Getpsi()*RADTODEG, fdmex->GetState()->GetParameter(FG_BETA)*RADTODEG ); cout << out; - sprintf(out, " Bank Angle: %3.0f deg\n", + sprintf(out, " Bank Angle: %5.2f deg\n", fdmex->GetRotation()->Getphi()*RADTODEG ); cout << out; sprintf(out, " Elevator: %5.2f deg Left Aileron: %5.2f deg Rudder: %5.2f deg\n", @@ -208,7 +208,7 @@ void FGTrim::ReportState(void) { cout << out; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGTrim::DoTrim(void) { @@ -225,6 +225,10 @@ bool FGTrim::DoTrim(void) { for(current_axis=0;current_axisGetAccelName() //<< " " << TrimAxes[current_axis]->GetControlName()<< endl; + if(TrimAxes[current_axis]->GetAccelType() == tQdot) { + if(mode == tGround) + TrimAxes[current_axis]->initTheta(); + } xlo=TrimAxes[current_axis]->GetControlMin(); xhi=TrimAxes[current_axis]->GetControlMax(); TrimAxes[current_axis]->SetControl((xlo+xhi)/2); @@ -314,7 +318,7 @@ bool FGTrim::DoTrim(void) { return !trim_failed; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGTrim::solve(void) { @@ -373,7 +377,7 @@ bool FGTrim::solve(void) { return success; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /* produces an interval (xlo..xhi) on one side or the other of the current control value in which a solution exists. This domain is, hopefully, @@ -453,7 +457,7 @@ bool FGTrim::findInterval(void) { return found; } -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //checks to see which side of the current control value the solution is on //and sets solutionDomain accordingly: // 1 if solution is between the current and max @@ -487,7 +491,7 @@ bool FGTrim::checkLimits(void) { solutionDomain=0; solutionExists=false; if(fabs(ahi-alo) > TrimAxes[current_axis]->GetTolerance()) { - if(alo*current_accel < 0) { + if(alo*current_accel <= 0) { solutionExists=true; solutionDomain=-1; xhi=current_control; diff --git a/src/FDM/JSBSim/FGTrim.h b/src/FDM/JSBSim/FGTrim.h index c7088fa1c..6f17a81cb 100644 --- a/src/FDM/JSBSim/FGTrim.h +++ b/src/FDM/JSBSim/FGTrim.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTrim.h Author: Tony Peden @@ -39,16 +39,16 @@ scheme. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGTRIM_H #define FGTRIM_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFDMExec.h" #include "FGRotation.h" @@ -67,9 +67,9 @@ INCLUDES #define ID_TRIM "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ typedef enum { tLongitudinal, tFull, tGround } TrimMode; diff --git a/src/FDM/JSBSim/FGTrimAxis.cpp b/src/FDM/JSBSim/FGTrimAxis.cpp index a4df73063..292454f04 100644 --- a/src/FDM/JSBSim/FGTrimAxis.cpp +++ b/src/FDM/JSBSim/FGTrimAxis.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTrimAxis.cpp Author: Tony Peden @@ -28,9 +28,9 @@ -------------------------------------------------------------------------------- 7/3/00 TP Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include #include @@ -103,13 +103,13 @@ FGTrimAxis::FGTrimAxis(FGFDMExec* fdex, FGInitialCondition* ic, Accel acc, solver_eps=tolerance/100; break; case tTheta: - control_min=-10*DEGTORAD; - control_max=10*DEGTORAD; + control_min=fdmex->GetRotation()->Gettht() - 5*DEGTORAD; + control_max=fdmex->GetRotation()->Gettht() + 5*DEGTORAD; accel_convert=RADTODEG; break; case tPhi: - control_min=-30*DEGTORAD; - control_max=30*DEGTORAD; + control_min=fdmex->GetRotation()->Getphi() - 5*DEGTORAD; + control_max=fdmex->GetRotation()->Getphi() + 5*DEGTORAD; accel_convert=RADTODEG; break; case tGamma: @@ -182,6 +182,10 @@ void FGTrimAxis::setControl(void) { } } + + + + /*****************************************************************************/ // the aircraft center of rotation is no longer the cg once the gear @@ -229,6 +233,68 @@ void FGTrimAxis::SetThetaOnGround(float ff) { /*****************************************************************************/ +bool FGTrimAxis::initTheta(void) { + int i,N,iAft, iForward; + float zAft,zForward,zDiff,theta; + bool level; + float saveAlt; + + saveAlt=fgic->GetAltitudeAGLFtIC(); + fgic->SetAltitudeAGLFtIC(100); + + + N=fdmex->GetAircraft()->GetNumGearUnits(); + + //find the first wheel unit forward of the cg + //the list is short so a simple linear search is fine + for( i=0; iGetAircraft()->GetGearUnit(i)->GetBodyLocation()(1) > 0 ) { + iForward=i; + break; + } + } + //now find the first wheel unit aft of the cg + for( i=0; iGetAircraft()->GetGearUnit(i)->GetBodyLocation()(1) < 0 ) { + iAft=i; + break; + } + } + + // now adjust theta till the wheels are the same distance from the ground + zAft=fdmex->GetAircraft()->GetGearUnit(1)->GetLocalGear()(3); + zForward=fdmex->GetAircraft()->GetGearUnit(0)->GetLocalGear()(3); + zDiff = zForward - zAft; + level=false; + theta=fgic->GetPitchAngleDegIC(); + while(!level && (i < 100)) { + theta+=2.0*zDiff; + fgic->SetPitchAngleDegIC(theta); + fdmex->RunIC(fgic); + zAft=fdmex->GetAircraft()->GetGearUnit(1)->GetLocalGear()(3); + zForward=fdmex->GetAircraft()->GetGearUnit(0)->GetLocalGear()(3); + zDiff = zForward - zAft; + //cout << endl << theta << " " << zDiff << endl; + //cout << "0: " << fdmex->GetAircraft()->GetGearUnit(0)->GetLocalGear() << endl; + //cout << "1: " << fdmex->GetAircraft()->GetGearUnit(1)->GetLocalGear() << endl; + + if(fabs(zDiff ) < 0.1) + level=true; + i++; + } + //cout << i << endl; + cout << " Initial Theta: " << fdmex->GetRotation()->Gettht()*RADTODEG << endl; + control_min=(theta+5)*DEGTORAD; + control_max=(theta-5)*DEGTORAD; + fgic->SetAltitudeAGLFtIC(saveAlt); + if(i < 100) + return true; + else + return false; +} + +/*****************************************************************************/ + void FGTrimAxis::SetPhiOnGround(float ff) { int i,ref; diff --git a/src/FDM/JSBSim/FGTrimAxis.h b/src/FDM/JSBSim/FGTrimAxis.h index 0bad11ddc..d03ac462b 100644 --- a/src/FDM/JSBSim/FGTrimAxis.h +++ b/src/FDM/JSBSim/FGTrimAxis.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTrimAxis.h Author: Tony Peden @@ -30,16 +30,16 @@ -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGTRIMAXIS_H #define FGTRIMAXIS_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include @@ -63,9 +63,9 @@ const string ControlNames[13]= { "Throttle","Sideslip","Angle of Attack", "Roll Angle", "Flight Path Angle", "Pitch Trim", "Roll Trim", "Yaw Trim" }; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ enum Accel { tUdot,tVdot,tWdot,tQdot,tPdot,tRdot }; enum Control { tThrottle, tBeta, tAlpha, tElevator, tAileron, tRudder, tAltAGL, @@ -78,7 +78,7 @@ public: ~FGTrimAxis(); void Run(void); - + float GetAccel(void) { getAccel(); return accel_value; } //Accels are not settable inline void SetControl(float value ) { control_value=value; } @@ -95,6 +95,11 @@ public: inline void SetControlToMin(void) { control_value=control_min; } inline void SetControlToMax(void) { control_value=control_max; } + + inline void SetControlLimits(float min, float max) { + control_min=min; + control_max=max; + } inline void SetTolerance(float ff) { tolerance=ff;} inline float GetTolerance(void) { return tolerance; } @@ -111,7 +116,9 @@ public: void SetThetaOnGround(float ff); void SetPhiOnGround(float ff); - + + bool initTheta(void); + void AxisReport(void); bool InTolerance(void) { getAccel(); return (fabs(accel_value) <= tolerance); } @@ -149,6 +156,8 @@ private: void getAccel(void); void getControl(void); void setControl(void); + + }; diff --git a/src/FDM/JSBSim/FGTurboJet.cpp b/src/FDM/JSBSim/FGTurboJet.cpp index 9e15172c1..6d04e394a 100644 --- a/src/FDM/JSBSim/FGTurboJet.cpp +++ b/src/FDM/JSBSim/FGTurboJet.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGTurboJet.cpp Author: Jon S. Berndt @@ -34,18 +34,18 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGTurboJet.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_TURBOJET; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGTurboJet::FGTurboJet(FGFDMExec* fdex, string enginePath, string engineName, int num) : diff --git a/src/FDM/JSBSim/FGTurboJet.h b/src/FDM/JSBSim/FGTurboJet.h index 2d3ceae65..d109f33bb 100644 --- a/src/FDM/JSBSim/FGTurboJet.h +++ b/src/FDM/JSBSim/FGTurboJet.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTurboJet.h Author: Jon S. Berndt @@ -27,28 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGTURBOJET_H #define FGTURBOJET_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" #define ID_TURBOJET "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGTurboJet : public FGEngine { @@ -59,5 +59,5 @@ public: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGTurboShaft.cpp b/src/FDM/JSBSim/FGTurboShaft.cpp index 222e19c99..f85d0a637 100644 --- a/src/FDM/JSBSim/FGTurboShaft.cpp +++ b/src/FDM/JSBSim/FGTurboShaft.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGTurboShaft.cpp Author: Jon S. Berndt @@ -34,18 +34,18 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGTurboShaft.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_TURBOSHAFT; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGTurboShaft::FGTurboShaft(FGFDMExec* fdex, string enginePath, string engineName, int num) : diff --git a/src/FDM/JSBSim/FGTurboShaft.h b/src/FDM/JSBSim/FGTurboShaft.h index 5b1bfd1ae..75f9b1d6e 100644 --- a/src/FDM/JSBSim/FGTurboShaft.h +++ b/src/FDM/JSBSim/FGTurboShaft.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGTurboShaft.h Author: Jon S. Berndt @@ -27,28 +27,28 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGTURBOSHAFT_H #define FGTURBOSHAFT_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" #define ID_TURBOSHAFT "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGTurboShaft : public FGEngine { @@ -59,5 +59,5 @@ public: }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGUtility.cpp b/src/FDM/JSBSim/FGUtility.cpp index bed3e719a..50b13a015 100644 --- a/src/FDM/JSBSim/FGUtility.cpp +++ b/src/FDM/JSBSim/FGUtility.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGUtility.cpp Author: Jon Berndt @@ -34,13 +34,13 @@ HISTORY -------------------------------------------------------------------------------- 01/09/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -60,9 +60,9 @@ INCLUDES static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_UTILITY; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGUtility::FGUtility() { diff --git a/src/FDM/JSBSim/FGUtility.h b/src/FDM/JSBSim/FGUtility.h index f4614f344..5457ee1d7 100644 --- a/src/FDM/JSBSim/FGUtility.h +++ b/src/FDM/JSBSim/FGUtility.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGUtility.h Author: Jon Berndt @@ -27,26 +27,26 @@ HISTORY -------------------------------------------------------------------------------- 01/09/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGUTILITY_H #define FGUTILITY_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_UTILITY "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFDMExec; class FGState; @@ -64,5 +64,5 @@ private: FGFDMExec* FDMExec; }; -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGfdmSocket.cpp b/src/FDM/JSBSim/FGfdmSocket.cpp index 97d731af9..19be402a7 100644 --- a/src/FDM/JSBSim/FGfdmSocket.cpp +++ b/src/FDM/JSBSim/FGfdmSocket.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGfdmSocket.cpp Author: Jon S. Berndt @@ -33,18 +33,18 @@ HISTORY -------------------------------------------------------------------------------- 11/08/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGfdmSocket.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_FDMSOCKET; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGfdmSocket::FGfdmSocket(string address, int port) { diff --git a/src/FDM/JSBSim/FGfdmSocket.h b/src/FDM/JSBSim/FGfdmSocket.h index d34d19610..0875c4355 100644 --- a/src/FDM/JSBSim/FGfdmSocket.h +++ b/src/FDM/JSBSim/FGfdmSocket.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGfdmSocket.h Author: Jon S. Berndt @@ -27,20 +27,20 @@ HISTORY -------------------------------------------------------------------------------- 11/08/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGfdmSocket_H #define FGfdmSocket_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include @@ -72,18 +72,18 @@ INCLUDES #include #endif -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_FDMSOCKET "$Header" using std::cout; using std::endl; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ using std::string; diff --git a/src/FDM/JSBSim/JSBSim.cpp b/src/FDM/JSBSim/JSBSim.cpp index a41a51e27..ad4a167db 100644 --- a/src/FDM/JSBSim/JSBSim.cpp +++ b/src/FDM/JSBSim/JSBSim.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: JSBSim.cpp Author: Jon S. Berndt @@ -35,9 +35,9 @@ HISTORY -------------------------------------------------------------------------------- 08/17/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #if __BCPLUSPLUS__ == 0x0540 // If compiling under Borland C++Builder #pragma hdrstop @@ -87,7 +87,7 @@ USEUNIT("FGTurboShaft.cpp"); USEUNIT("FGPropulsion.cpp"); USEUNIT("FGGroundReactions.cpp"); USEUNIT("FGAerodynamics.cpp"); -//--------------------------------------------------------------------------- + #pragma argsused #endif @@ -101,7 +101,6 @@ USEUNIT("FGAerodynamics.cpp"); #include "FGPosition.h" #include "FGAuxiliary.h" #include "FGOutput.h" -#include "FGInitialCondition.h" #ifdef FGFS #include @@ -116,8 +115,38 @@ USEUNIT("FGAerodynamics.cpp"); #include #endif +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +GLOBAL DATA +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + static const char *IdSrc = "$Header$"; +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Standalone JSBSim main program + This is the wrapper program used to instantiate the JSBSim system and control + it. Use this program to build a version of JSBSim that can be run from the + command line. This program is also designed to be built using Borland C++ + Builder, v4.0 or greater. + @author Jon S. Berndt + @version $Id$ + @see - +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + int main(int argc, char** argv) { FGFDMExec* FDMExec; @@ -132,38 +161,17 @@ int main(int argc, char** argv) FDMExec = new FGFDMExec(); - result = FDMExec->LoadModel("/home/tony/FlightGear/Aircraft", - "/home/tony/FlightGear/Engine", - string(argv[1])); + result = FDMExec->LoadModel("aircraft", "engine", string(argv[1])); if (!result) { cerr << "Aircraft file " << argv[1] << " was not found" << endl; exit(-1); } - if ( ! FDMExec->GetState()->Reset("/home/tony/FlightGear/Aircraft", - string(argv[1]), string(argv[2]))) + if ( ! FDMExec->GetState()->Reset("aircraft", string(argv[1]), string(argv[2]))) FDMExec->GetState()->Initialize(2000,0,0,0,0,0,0.5,0.5,40000); - - FGInitialCondition *fgic= new FGInitialCondition(FDMExec); - fgic->SetUBodyFpsIC(170); - fgic->SetTrueHeadingDegIC(275); - FDMExec->RunIC(fgic); - cout << "FDMExec->GetTranslation()->GetVt(): " << FDMExec->GetTranslation()->GetVt() << endl; - cout << "FDMExec->GetPosition()->GetVn(): " << FDMExec->GetPosition()->GetVn() << endl; - cout << "FDMExec->GetPosition()->GetVe(): " << FDMExec->GetPosition()->GetVe() << endl; - cout << "FDMExec->GetAuxiliary()->GetVcalibratedKTS(): " << FDMExec->GetAuxiliary()->GetVcalibratedKTS() << endl; - fgic->SetVnorthFpsIC(170); - cout << "fgic->GetUBodyFpsIC(): " << fgic->GetUBodyFpsIC() << endl; - cout << "fgic->GetVBodyFpsIC(): " << fgic->GetVBodyFpsIC() << endl; - cout << "fgic->GetWBodyFpsIC(): " << fgic->GetWBodyFpsIC() << endl; - FDMExec->RunIC(fgic); - cout << "FDMExec->GetTranslation()->GetVt(): " << FDMExec->GetTranslation()->GetVt() << endl; - cout << "FDMExec->GetPosition()->GetVn(): " << FDMExec->GetPosition()->GetVn() << endl; - cout << "FDMExec->GetPosition()->GetVe(): " << FDMExec->GetPosition()->GetVe() << endl; - cout << "FDMExec->GetAuxiliary()->GetVcalibratedKTS(): " << FDMExec->GetAuxiliary()->GetVcalibratedKTS() << endl; - - /* float cmd = 0.0; + + float cmd = 0.0; while (FDMExec->GetState()->Getsim_time() <= 10.0) { @@ -188,7 +196,6 @@ int main(int argc, char** argv) FDMExec->Run(); } - */ delete FDMExec; diff --git a/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp b/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp index 7ab308521..2130f9a70 100644 --- a/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp +++ b/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGDeadBand.cpp Author: Jon S. Berndt @@ -29,22 +29,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGDeadBand.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_DEADBAND; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ // ***************************************************************************** // Function: Run diff --git a/src/FDM/JSBSim/filtersjb/FGDeadBand.h b/src/FDM/JSBSim/filtersjb/FGDeadBand.h index e1a3224ec..3f3498d1d 100644 --- a/src/FDM/JSBSim/filtersjb/FGDeadBand.h +++ b/src/FDM/JSBSim/filtersjb/FGDeadBand.h @@ -1,5 +1,4 @@ - -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGDeadBand.h Author: @@ -27,35 +26,49 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** -COMMENTS, REFERENCES, and NOTES -******************************************************************************** - -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGDEADBAND_H #define FGDEADBAND_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFCSComponent.h" #include "../FGConfigFile.h" -/******************************************************************************* -DEFINES -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_DEADBAND "$Header" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + class FGFCS; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Models a deadband object. + Owned and Operated by the FGFCS class. + @author Jon S. Berndt + @see - + */ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGDeadBand : public FGFCSComponent { @@ -68,4 +81,6 @@ public: bool Run (void ) ; }; +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + #endif diff --git a/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp b/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp index 321f57c0e..2eba3c579 100644 --- a/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp +++ b/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGFCSComponent.cpp Author: Jon S. Berndt @@ -29,22 +29,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFCSComponent.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_FCSCOMPONENT; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGFCSComponent::FGFCSComponent(FGFCS* _fcs) : fcs(_fcs) { diff --git a/src/FDM/JSBSim/filtersjb/FGFCSComponent.h b/src/FDM/JSBSim/filtersjb/FGFCSComponent.h index ba79ed085..fb65abab1 100644 --- a/src/FDM/JSBSim/filtersjb/FGFCSComponent.h +++ b/src/FDM/JSBSim/filtersjb/FGFCSComponent.h @@ -1,9 +1,8 @@ - -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGFCSComponent.h - Author: - Date started: + Author: Jon S. Berndt + Date started: 05/01/2000 ------------- Copyright (C) ------------- @@ -27,20 +26,16 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** -COMMENTS, REFERENCES, and NOTES -******************************************************************************** - -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGFCSCOMPONENT_H #define FGFCSCOMPONENT_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -49,19 +44,50 @@ INCLUDES #include #include "../FGDefs.h" -/******************************************************************************* -DEFINES -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_FCSCOMPONENT "$Header" using std::string; +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + class FGFCS; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Base class for JSBSim Flight Control System Components. + The Flight Control System (FCS) for JSBSim consists of the FCS container + class (see \URL[FGFCS]{FGFCS.html}), the FGFCSComponent base class, and the + component classes from which can be constructed a string, or channel. See: +
    +
  • \URL[Switch Component]{FGSwitch.html}
  • +
  • \URL[Gain Component]{FGGain.html}
  • +
  • \URL[Flaps Component]{FGFlaps.html}
  • +
  • \URL[Filter Component]{FGFilter.html}
  • +
  • \URL[Deadband Component]{FGDeadBand.html}
  • +
  • \URL[Summer Component]{FGSummer.html}
  • +
  • \URL[Gradient Component]{FGGradient.html}
  • +
+ @author Jon S. Berndt + @version $Id$ + @see Documentation for the FGFCS class, and for the configuration file class + FGConfigFile. +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFCSComponent { @@ -71,7 +97,8 @@ protected: FGFCS* fcs; string Type; string Name; - enum {itPilotAC, itFCS, itAP} InputType; // Pilot/Aircraft, FCS, Autopilot inputs + /// Pilot/Aircraft, FCS, Autopilot inputs + enum eInputType {itPilotAC, itFCS, itAP} InputType; int ID; eParam InputIdx; float Input; @@ -81,7 +108,9 @@ protected: bool IsOutput; public: + /// Constructor FGFCSComponent(FGFCS*); + /// Destructor virtual ~FGFCSComponent ( ) { } //Destructor virtual bool Run (void); diff --git a/src/FDM/JSBSim/filtersjb/FGFilter.cpp b/src/FDM/JSBSim/filtersjb/FGFilter.cpp index a6da5b275..9bddef588 100644 --- a/src/FDM/JSBSim/filtersjb/FGFilter.cpp +++ b/src/FDM/JSBSim/filtersjb/FGFilter.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGFilter.cpp Author: Jon S. Berndt @@ -29,22 +29,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFilter.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_FILTER; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs), AC_cfg(AC_cfg) diff --git a/src/FDM/JSBSim/filtersjb/FGFilter.h b/src/FDM/JSBSim/filtersjb/FGFilter.h index a0a684575..9fdf4bd2c 100644 --- a/src/FDM/JSBSim/filtersjb/FGFilter.h +++ b/src/FDM/JSBSim/filtersjb/FGFilter.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGFilter.h Author: @@ -26,33 +26,33 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGFILTER_H #define FGFILTER_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFCSComponent.h" #include "../FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_FILTER "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFilter : public FGFCSComponent { diff --git a/src/FDM/JSBSim/filtersjb/FGFlaps.cpp b/src/FDM/JSBSim/filtersjb/FGFlaps.cpp index 3b22923f4..ee714527a 100644 --- a/src/FDM/JSBSim/filtersjb/FGFlaps.cpp +++ b/src/FDM/JSBSim/filtersjb/FGFlaps.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGFlap.cpp Author: Tony Peden, for flight control system authored by Jon S. Berndt @@ -29,22 +29,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFlaps.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_FLAPS; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ // ***************************************************************************** // Function: Constructor diff --git a/src/FDM/JSBSim/filtersjb/FGFlaps.h b/src/FDM/JSBSim/filtersjb/FGFlaps.h index f7c6692df..d26daaca6 100644 --- a/src/FDM/JSBSim/filtersjb/FGFlaps.h +++ b/src/FDM/JSBSim/filtersjb/FGFlaps.h @@ -1,5 +1,5 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGFlap.h Author: Tony Peden, for flight control system authored by Jon S. Berndt @@ -27,20 +27,20 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGFlap_H #define FGFlap_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -57,15 +57,15 @@ INCLUDES #include "FGFCSComponent.h" #include "../FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_FLAPS "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFlaps : public FGFCSComponent { FGConfigFile* AC_cfg; diff --git a/src/FDM/JSBSim/filtersjb/FGGain.cpp b/src/FDM/JSBSim/filtersjb/FGGain.cpp index 104b9540f..c5b54c7e2 100644 --- a/src/FDM/JSBSim/filtersjb/FGGain.cpp +++ b/src/FDM/JSBSim/filtersjb/FGGain.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGGain.cpp Author: Jon S. Berndt @@ -29,22 +29,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGGain.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_GAIN; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ // ***************************************************************************** // Function: Constructor diff --git a/src/FDM/JSBSim/filtersjb/FGGain.h b/src/FDM/JSBSim/filtersjb/FGGain.h index cab7ab5cd..7e6f47bf7 100644 --- a/src/FDM/JSBSim/filtersjb/FGGain.h +++ b/src/FDM/JSBSim/filtersjb/FGGain.h @@ -1,5 +1,5 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGGain.h Author: @@ -27,20 +27,20 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGGAIN_H #define FGGAIN_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -57,17 +57,17 @@ INCLUDES #include "FGFCSComponent.h" #include "../FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_GAIN "$Header" class FGFCS; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGGain : public FGFCSComponent { diff --git a/src/FDM/JSBSim/filtersjb/FGGradient.cpp b/src/FDM/JSBSim/filtersjb/FGGradient.cpp index 5203bf6f9..a1f09c022 100644 --- a/src/FDM/JSBSim/filtersjb/FGGradient.cpp +++ b/src/FDM/JSBSim/filtersjb/FGGradient.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGGradient.cpp Author: @@ -29,22 +29,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGGradient.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_GRADIENT; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGGradient::FGGradient(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs), AC_cfg(AC_cfg) diff --git a/src/FDM/JSBSim/filtersjb/FGGradient.h b/src/FDM/JSBSim/filtersjb/FGGradient.h index 9130c1c20..814944bd1 100644 --- a/src/FDM/JSBSim/filtersjb/FGGradient.h +++ b/src/FDM/JSBSim/filtersjb/FGGradient.h @@ -1,5 +1,5 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGGradient.h Author: @@ -27,35 +27,35 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGGRADIENT_H #define FGGRADIENT_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFCSComponent.h" #include "../FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_GRADIENT "$Header" class FGFCS; -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGGradient : public FGFCSComponent { diff --git a/src/FDM/JSBSim/filtersjb/FGSummer.cpp b/src/FDM/JSBSim/filtersjb/FGSummer.cpp index a013eee59..6abed084c 100644 --- a/src/FDM/JSBSim/filtersjb/FGSummer.cpp +++ b/src/FDM/JSBSim/filtersjb/FGSummer.cpp @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGSummer.cpp Author: Jon S. Berndt @@ -29,22 +29,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGSummer.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_SUMMER; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGSummer::FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs), AC_cfg(AC_cfg) diff --git a/src/FDM/JSBSim/filtersjb/FGSummer.h b/src/FDM/JSBSim/filtersjb/FGSummer.h index 749dc0c54..8872845b4 100644 --- a/src/FDM/JSBSim/filtersjb/FGSummer.h +++ b/src/FDM/JSBSim/filtersjb/FGSummer.h @@ -1,5 +1,5 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGSummer.h Author: @@ -27,20 +27,20 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGSUMMER_H #define FGSUMMER_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -57,15 +57,15 @@ INCLUDES #include "FGFCSComponent.h" #include "../FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_SUMMER "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGSummer : public FGFCSComponent { diff --git a/src/FDM/JSBSim/filtersjb/FGSwitch.cpp b/src/FDM/JSBSim/filtersjb/FGSwitch.cpp index 6687abbd9..db856cdf7 100644 --- a/src/FDM/JSBSim/filtersjb/FGSwitch.cpp +++ b/src/FDM/JSBSim/filtersjb/FGSwitch.cpp @@ -1,5 +1,5 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Module: FGSwitch.cpp Author: Jon S. Berndt @@ -30,22 +30,22 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGSwitch.h" static const char *IdSrc = "$Header$"; static const char *IdHdr = ID_SWITCH; -/******************************************************************************* -************************************ CODE ************************************** -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGSwitch::FGSwitch(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs), AC_cfg(AC_cfg) diff --git a/src/FDM/JSBSim/filtersjb/FGSwitch.h b/src/FDM/JSBSim/filtersjb/FGSwitch.h index 475cf7e66..04518f126 100644 --- a/src/FDM/JSBSim/filtersjb/FGSwitch.h +++ b/src/FDM/JSBSim/filtersjb/FGSwitch.h @@ -1,5 +1,5 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGSwitch.h Author: @@ -27,33 +27,33 @@ HISTORY -------------------------------------------------------------------------------- -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGSWITCH_H #define FGSWITCH_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGFCSComponent.h" #include "../FGConfigFile.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_SWITCH "$Header" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGSwitch : public FGFCSComponent {