From 74fbaa8f5e085d1c7a70e9ecd9e0494b75b5908c Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 30 Mar 2001 01:04:50 +0000 Subject: [PATCH] Latest round of JSBSim updates. --- FlightGear.dsp | 4024 +++++++++++++++++++++---- src/FDM/JSBSim.cxx | 44 +- src/FDM/JSBSim.hxx | 3 +- src/FDM/JSBSim/FGAerodynamics.cpp | 21 +- src/FDM/JSBSim/FGAerodynamics.h | 9 +- src/FDM/JSBSim/FGAircraft.cpp | 154 +- src/FDM/JSBSim/FGAircraft.h | 37 +- src/FDM/JSBSim/FGAtmosphere.cpp | 251 +- src/FDM/JSBSim/FGAtmosphere.h | 25 +- src/FDM/JSBSim/FGAuxiliary.cpp | 65 +- src/FDM/JSBSim/FGAuxiliary.h | 10 +- src/FDM/JSBSim/FGCoefficient.cpp | 212 +- src/FDM/JSBSim/FGCoefficient.h | 23 +- src/FDM/JSBSim/FGConfigFile.cpp | 41 +- src/FDM/JSBSim/FGConfigFile.h | 10 +- src/FDM/JSBSim/FGControls.cpp | 15 +- src/FDM/JSBSim/FGControls.h | 15 +- src/FDM/JSBSim/FGDefs.h | 21 +- src/FDM/JSBSim/FGEngine.cpp | 209 +- src/FDM/JSBSim/FGEngine.h | 149 +- src/FDM/JSBSim/FGFCS.cpp | 68 +- src/FDM/JSBSim/FGFCS.h | 21 +- src/FDM/JSBSim/FGFDMExec.cpp | 443 ++- src/FDM/JSBSim/FGFDMExec.h | 456 ++- src/FDM/JSBSim/FGForce.cpp | 65 +- src/FDM/JSBSim/FGForce.h | 13 +- src/FDM/JSBSim/FGGroundReactions.cpp | 16 +- src/FDM/JSBSim/FGGroundReactions.h | 9 +- src/FDM/JSBSim/FGInertial.cpp | 16 +- src/FDM/JSBSim/FGInertial.h | 7 +- src/FDM/JSBSim/FGInitialCondition.cpp | 323 +- src/FDM/JSBSim/FGInitialCondition.h | 156 +- src/FDM/JSBSim/FGLGear.cpp | 193 +- src/FDM/JSBSim/FGLGear.h | 33 +- src/FDM/JSBSim/FGMassBalance.cpp | 16 +- src/FDM/JSBSim/FGMassBalance.h | 5 +- src/FDM/JSBSim/FGMatrix.cpp | 91 +- src/FDM/JSBSim/FGMatrix.h | 72 +- src/FDM/JSBSim/FGModel.cpp | 27 +- src/FDM/JSBSim/FGModel.h | 14 +- src/FDM/JSBSim/FGNozzle.cpp | 61 +- src/FDM/JSBSim/FGNozzle.h | 19 +- src/FDM/JSBSim/FGOutput.cpp | 13 +- src/FDM/JSBSim/FGOutput.h | 7 +- src/FDM/JSBSim/FGPiston.cpp | 77 +- src/FDM/JSBSim/FGPiston.h | 17 +- src/FDM/JSBSim/FGPosition.cpp | 52 +- src/FDM/JSBSim/FGPosition.h | 11 +- src/FDM/JSBSim/FGPropeller.cpp | 134 +- src/FDM/JSBSim/FGPropeller.h | 123 +- src/FDM/JSBSim/FGPropulsion.cpp | 215 +- src/FDM/JSBSim/FGPropulsion.h | 127 +- src/FDM/JSBSim/FGRocket.cpp | 92 +- src/FDM/JSBSim/FGRocket.h | 83 +- src/FDM/JSBSim/FGRotation.cpp | 23 +- src/FDM/JSBSim/FGRotation.h | 39 +- src/FDM/JSBSim/FGRotor.cpp | 24 +- src/FDM/JSBSim/FGRotor.h | 9 +- src/FDM/JSBSim/FGState.cpp | 73 +- src/FDM/JSBSim/FGState.h | 11 +- src/FDM/JSBSim/FGTank.cpp | 57 +- src/FDM/JSBSim/FGTank.h | 8 +- src/FDM/JSBSim/FGThruster.cpp | 16 +- src/FDM/JSBSim/FGThruster.h | 18 +- src/FDM/JSBSim/FGTranslation.cpp | 81 +- src/FDM/JSBSim/FGTranslation.h | 12 +- src/FDM/JSBSim/FGTrim.cpp | 217 +- src/FDM/JSBSim/FGTrim.h | 173 +- src/FDM/JSBSim/FGTrimAxis.cpp | 120 +- src/FDM/JSBSim/FGTrimAxis.h | 44 +- src/FDM/JSBSim/FGTurboJet.cpp | 31 +- src/FDM/JSBSim/FGTurboJet.h | 11 +- src/FDM/JSBSim/FGTurboShaft.cpp | 28 +- src/FDM/JSBSim/FGTurboShaft.h | 10 +- src/FDM/JSBSim/FGUtility.cpp | 16 +- src/FDM/JSBSim/FGUtility.h | 7 +- src/FDM/JSBSim/FGfdmSocket.cpp | 8 +- src/FDM/JSBSim/FGfdmSocket.h | 8 +- src/FDM/JSBSim/JSBSim.cpp | 131 +- src/FDM/JSBSim/Makefile.am | 11 + src/FDM/flight.cxx | 38 +- src/Main/main.cxx | 6 +- 82 files changed, 7477 insertions(+), 2166 deletions(-) diff --git a/FlightGear.dsp b/FlightGear.dsp index 641015b58..81baa8875 100644 --- a/FlightGear.dsp +++ b/FlightGear.dsp @@ -112,6 +112,21 @@ SOURCE=.\src\Aircraft\aircraft.cxx !ENDIF +# End Source File +# Begin Source File + +SOURCE=.\src\Aircraft\aircraft.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Aircraft" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Aircraft" + +!ENDIF + # End Source File # End Group # Begin Group "Lib_Airports" @@ -134,6 +149,21 @@ SOURCE=.\src\Airports\runways.cxx # End Source File # Begin Source File +SOURCE=.\src\Airports\runways.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Airports" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Airports" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\src\Airports\simple.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -146,6 +176,21 @@ SOURCE=.\src\Airports\simple.cxx !ENDIF +# End Source File +# Begin Source File + +SOURCE=.\src\Airports\simple.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Airports" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Airports" + +!ENDIF + # End Source File # End Group # Begin Group "Lib_Autopilot" @@ -168,6 +213,21 @@ SOURCE=.\src\Autopilot\auto_gui.cxx # End Source File # Begin Source File +SOURCE=.\src\Autopilot\auto_gui.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Autopilot" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Autopilot" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\src\Autopilot\newauto.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -180,6 +240,21 @@ SOURCE=.\src\Autopilot\newauto.cxx !ENDIF +# End Source File +# Begin Source File + +SOURCE=.\src\Autopilot\newauto.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Autopilot" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Autopilot" + +!ENDIF + # End Source File # End Group # Begin Group "Lib_Cockpit" @@ -202,6 +277,21 @@ SOURCE=.\src\Cockpit\cockpit.cxx # End Source File # Begin Source File +SOURCE=.\src\Cockpit\cockpit.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Cockpit" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Cockpit" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\src\Cockpit\hud.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -217,6 +307,36 @@ SOURCE=.\src\Cockpit\hud.cxx # End Source File # Begin Source File +SOURCE=.\src\Cockpit\hud.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Cockpit" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Cockpit" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Cockpit\hud_opts.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Cockpit" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Cockpit" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\src\Cockpit\hud_card.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -382,7 +502,7 @@ SOURCE=.\src\Cockpit\panel.cxx # End Source File # Begin Source File -SOURCE=.\src\Cockpit\panel_io.cxx +SOURCE=.\src\Cockpit\panel.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -397,7 +517,7 @@ SOURCE=.\src\Cockpit\panel_io.cxx # End Source File # Begin Source File -SOURCE=.\src\Cockpit\radiostack.cxx +SOURCE=.\src\Cockpit\panel_io.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -412,7 +532,7 @@ SOURCE=.\src\Cockpit\radiostack.cxx # End Source File # Begin Source File -SOURCE=.\src\Cockpit\steam.cxx +SOURCE=.\src\Cockpit\panel_io.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -425,141 +545,141 @@ SOURCE=.\src\Cockpit\steam.cxx !ENDIF # End Source File -# End Group -# Begin Group "Lib_Controls" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Controls\controls.cxx +SOURCE=.\src\Cockpit\radiostack.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Controls" +# PROP Intermediate_Dir "Release\Lib_Cockpit" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Controls" +# PROP Intermediate_Dir "Debug\Lib_Cockpit" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Balloon" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\Balloon\BalloonSim.cpp +SOURCE=.\src\Cockpit\radiostack.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Balloon" +# PROP Intermediate_Dir "Release\Lib_Cockpit" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Balloon" +# PROP Intermediate_Dir "Debug\Lib_Cockpit" !ENDIF # End Source File -# End Group -# Begin Group "Lib_JSBSim" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGAircraft.cpp +SOURCE=.\src\Cockpit\steam.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_JSBSim" +# PROP Intermediate_Dir "Release\Lib_Cockpit" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_JSBSim" +# PROP Intermediate_Dir "Debug\Lib_Cockpit" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGAtmosphere.cpp +SOURCE=.\src\Cockpit\steam.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_JSBSim" +# PROP Intermediate_Dir "Release\Lib_Cockpit" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_JSBSim" +# PROP Intermediate_Dir "Debug\Lib_Cockpit" !ENDIF # End Source File +# End Group +# Begin Group "Lib_Controls" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGAuxiliary.cpp +SOURCE=.\src\Controls\controls.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_JSBSim" +# PROP Intermediate_Dir "Release\Lib_Controls" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_JSBSim" +# PROP Intermediate_Dir "Debug\Lib_Controls" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGCoefficient.cpp +SOURCE=.\src\Controls\controls.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_JSBSim" +# PROP Intermediate_Dir "Release\Lib_Controls" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_JSBSim" +# PROP Intermediate_Dir "Debug\Lib_Controls" !ENDIF # End Source File +# End Group +# Begin Group "Lib_Balloon" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGConfigFile.cpp +SOURCE=.\src\FDM\Balloon\BalloonSim.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_JSBSim" +# PROP Intermediate_Dir "Release\Lib_Balloon" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_JSBSim" +# PROP Intermediate_Dir "Debug\Lib_Balloon" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGControls.cpp +SOURCE=.\src\FDM\Balloon\BalloonSim.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_JSBSim" +# PROP Intermediate_Dir "Release\Lib_Balloon" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_JSBSim" +# PROP Intermediate_Dir "Debug\Lib_Balloon" !ENDIF # End Source File +# End Group +# Begin Group "Lib_JSBSim" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGFCS.cpp +SOURCE=.\src\FDM\JSBSim\FGAircraft.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -574,7 +694,7 @@ SOURCE=.\src\FDM\JSBSim\FGFCS.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGFDMExec.cpp +SOURCE=.\src\FDM\JSBSim\FGAircraft.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -589,7 +709,7 @@ SOURCE=.\src\FDM\JSBSim\FGFDMExec.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGInitialCondition.cpp +SOURCE=.\src\FDM\JSBSim\FGAtmosphere.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -604,7 +724,7 @@ SOURCE=.\src\FDM\JSBSim\FGInitialCondition.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGLGear.cpp +SOURCE=.\src\FDM\JSBSim\FGAtmosphere.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -619,7 +739,7 @@ SOURCE=.\src\FDM\JSBSim\FGLGear.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGMatrix.cpp +SOURCE=.\src\FDM\JSBSim\FGAuxiliary.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -634,7 +754,7 @@ SOURCE=.\src\FDM\JSBSim\FGMatrix.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGModel.cpp +SOURCE=.\src\FDM\JSBSim\FGAuxiliary.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -649,7 +769,7 @@ SOURCE=.\src\FDM\JSBSim\FGModel.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGOutput.cpp +SOURCE=.\src\FDM\JSBSim\FGCoefficient.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -664,7 +784,7 @@ SOURCE=.\src\FDM\JSBSim\FGOutput.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGPosition.cpp +SOURCE=.\src\FDM\JSBSim\FGCoefficient.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -679,7 +799,7 @@ SOURCE=.\src\FDM\JSBSim\FGPosition.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGRotation.cpp +SOURCE=.\src\FDM\JSBSim\FGConfigFile.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -694,7 +814,7 @@ SOURCE=.\src\FDM\JSBSim\FGRotation.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGState.cpp +SOURCE=.\src\FDM\JSBSim\FGConfigFile.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -709,7 +829,7 @@ SOURCE=.\src\FDM\JSBSim\FGState.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGTranslation.cpp +SOURCE=.\src\FDM\JSBSim\FGControls.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -724,7 +844,7 @@ SOURCE=.\src\FDM\JSBSim\FGTranslation.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGTrim.cpp +SOURCE=.\src\FDM\JSBSim\FGControls.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -739,7 +859,7 @@ SOURCE=.\src\FDM\JSBSim\FGTrim.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGTrimAxis.cpp +SOURCE=.\src\FDM\JSBSim\FGDefs.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -754,7 +874,7 @@ SOURCE=.\src\FDM\JSBSim\FGTrimAxis.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGUtility.cpp +SOURCE=.\src\FDM\JSBSim\FGFCS.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -769,7 +889,7 @@ SOURCE=.\src\FDM\JSBSim\FGUtility.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGEngine.cpp +SOURCE=.\src\FDM\JSBSim\FGFCS.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -784,7 +904,7 @@ SOURCE=.\src\FDM\JSBSim\FGEngine.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGTank.cpp +SOURCE=.\src\FDM\JSBSim\FGFDMExec.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -799,7 +919,7 @@ SOURCE=.\src\FDM\JSBSim\FGTank.cpp # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\FGfdmSocket.cpp +SOURCE=.\src\FDM\JSBSim\FGFDMExec.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -812,2218 +932,5008 @@ SOURCE=.\src\FDM\JSBSim\FGfdmSocket.cpp !ENDIF # End Source File -# End Group -# Begin Group "Lib_filtersjb" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGDeadBand.cpp +SOURCE=.\src\FDM\JSBSim\FGInitialCondition.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGFCSComponent.cpp +SOURCE=.\src\FDM\JSBSim\FGInitialCondition.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGFilter.cpp +SOURCE=.\src\FDM\JSBSim\FGLGear.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGFlaps.cpp +SOURCE=.\src\FDM\JSBSim\FGLGear.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGGain.cpp +SOURCE=.\src\FDM\JSBSim\FGMatrix.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGGradient.cpp +SOURCE=.\src\FDM\JSBSim\FGMatrix.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGSummer.cpp +SOURCE=.\src\FDM\JSBSim\FGModel.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim\filtersjb\FGSwitch.cpp +SOURCE=.\src\FDM\JSBSim\FGModel.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_filtersjb" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_filtersjb" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File -# End Group -# Begin Group "Lib_LaRCsim" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\LaRCsim\atmos_62.c +SOURCE=.\src\FDM\JSBSim\FGOutput.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\default_model_routines.c +SOURCE=.\src\FDM\JSBSim\FGOutput.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_accel.c +SOURCE=.\src\FDM\JSBSim\FGPosition.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_aux.c +SOURCE=.\src\FDM\JSBSim\FGPosition.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_geodesy.c +SOURCE=.\src\FDM\JSBSim\FGRotation.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_gravity.c +SOURCE=.\src\FDM\JSBSim\FGRotation.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_init.c +SOURCE=.\src\FDM\JSBSim\FGState.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_matrix.c +SOURCE=.\src\FDM\JSBSim\FGState.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_model.c +SOURCE=.\src\FDM\JSBSim\FGTranslation.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_step.c +SOURCE=.\src\FDM\JSBSim\FGTranslation.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_trim.c +SOURCE=.\src\FDM\JSBSim\FGTrim.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\c172_aero.c +SOURCE=.\src\FDM\JSBSim\FGTrim.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\c172_engine.c +SOURCE=.\src\FDM\JSBSim\FGTrimAxis.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\c172_gear.c +SOURCE=.\src\FDM\JSBSim\FGTrimAxis.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\c172_init.c +SOURCE=.\src\FDM\JSBSim\FGUtility.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\navion_init.h +SOURCE=.\src\FDM\JSBSim\FGUtility.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\navion_aero.c +SOURCE=.\src\FDM\JSBSim\FGEngine.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\navion_engine.c +SOURCE=.\src\FDM\JSBSim\FGEngine.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\navion_gear.c +SOURCE=.\src\FDM\JSBSim\FGTank.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\navion_init.c +SOURCE=.\src\FDM\JSBSim\FGTank.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\uiuc_aero.c +SOURCE=.\src\FDM\JSBSim\FGfdmSocket.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\cherokee_aero.c +SOURCE=.\src\FDM\JSBSim\FGfdmSocket.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_JSBSim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_JSBSim" !ENDIF # End Source File +# End Group +# Begin Group "Lib_filtersjb" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\LaRCsim\cherokee_engine.c +SOURCE=.\src\FDM\JSBSim\filtersjb\FGDeadBand.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\cherokee_gear.c +SOURCE=.\src\FDM\JSBSim\filtersjb\FGDeadBand.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\cherokee_init.c +SOURCE=.\src\FDM\JSBSim\filtersjb\FGFCSComponent.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim\ls_interface.c +SOURCE=.\src\FDM\JSBSim\filtersjb\FGFCSComponent.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_LaRCsim" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_LaRCsim" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File -# End Group -# Begin Group "Lib_UIUCModel" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_1DdataFileReader.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGFilter.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_1Dinterpolation.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGFilter.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_2DdataFileReader.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGFlaps.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_2Dinterpolation.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGFlaps.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_aerodeflections.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGGain.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_betaprobe.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGGain.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_coef_drag.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGGradient.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_coef_lift.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGGradient.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_coef_pitch.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGSummer.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_coef_roll.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGSummer.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_coef_sideforce.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGSwitch.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_coef_yaw.cpp +SOURCE=.\src\FDM\JSBSim\filtersjb\FGSwitch.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_filtersjb" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_filtersjb" !ENDIF # End Source File +# End Group +# Begin Group "Lib_LaRCsim" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_coefficients.cpp +SOURCE=.\src\FDM\LaRCsim\atmos_62.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_controlInput.cpp +SOURCE=.\src\FDM\LaRCsim\atmos_62.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_convert.cpp +SOURCE=.\src\FDM\LaRCsim\default_model_routines.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_engine.cpp +SOURCE=.\src\FDM\LaRCsim\default_model_routines.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_ice.cpp +SOURCE=.\src\FDM\LaRCsim\ls_accel.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_initializemaps.cpp +SOURCE=.\src\FDM\LaRCsim\ls_accel.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_CD.cpp +SOURCE=.\src\FDM\LaRCsim\ls_aux.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_CL.cpp +SOURCE=.\src\FDM\LaRCsim\ls_aux.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_CY.cpp +SOURCE=.\src\FDM\LaRCsim\ls_cockpit.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cm.cpp +SOURCE=.\src\FDM\LaRCsim\ls_constants.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cn.cpp +SOURCE=.\src\FDM\LaRCsim\ls_generic.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_Croll.cpp +SOURCE=.\src\FDM\LaRCsim\ls_geodesy.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_controlSurface.cpp +SOURCE=.\src\FDM\LaRCsim\ls_geodesy.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_engine.cpp +SOURCE=.\src\FDM\LaRCsim\ls_gravity.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_geometry.cpp +SOURCE=.\src\FDM\LaRCsim\ls_gravity.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_ice.cpp +SOURCE=.\src\FDM\LaRCsim\ls_init.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_init.cpp +SOURCE=.\src\FDM\LaRCsim\ls_init.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_keyword.cpp +SOURCE=.\src\FDM\LaRCsim\ls_matrix.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_mass.cpp +SOURCE=.\src\FDM\LaRCsim\ls_matrix.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_misc.cpp +SOURCE=.\src\FDM\LaRCsim\ls_model.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_record1.cpp +SOURCE=.\src\FDM\LaRCsim\ls_model.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_record2.cpp +SOURCE=.\src\FDM\LaRCsim\ls_sim_control.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_record3.cpp +SOURCE=.\src\FDM\LaRCsim\ls_step.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_record4.cpp +SOURCE=.\src\FDM\LaRCsim\ls_step.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_map_record5.cpp +SOURCE=.\src\FDM\LaRCsim\ls_sym.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_menu.cpp +SOURCE=.\src\FDM\LaRCsim\ls_trim.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_parsefile.cpp +SOURCE=.\src\FDM\LaRCsim\ls_types.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_recorder.cpp +SOURCE=.\src\FDM\LaRCsim\c172_aero.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_warnings_errors.cpp +SOURCE=.\src\FDM\LaRCsim\c172_engine.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\UIUCModel\uiuc_wrapper.cpp +SOURCE=.\src\FDM\LaRCsim\c172_gear.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_UIUCModel" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_UIUCModel" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Flight" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\FDM\ADA.cxx +SOURCE=.\src\FDM\LaRCsim\c172_init.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\Balloon.cxx +SOURCE=.\src\FDM\LaRCsim\navion_init.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\External.cxx +SOURCE=.\src\FDM\LaRCsim\navion_aero.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\flight.cxx +SOURCE=.\src\FDM\LaRCsim\navion_engine.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\IO360.cxx +SOURCE=.\src\FDM\LaRCsim\navion_gear.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\JSBSim.cxx +SOURCE=.\src\FDM\LaRCsim\navion_init.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsim.cxx +SOURCE=.\src\FDM\LaRCsim\uiuc_aero.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\LaRCsimIC.cxx +SOURCE=.\src\FDM\LaRCsim\cherokee_aero.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\FDM\MagicCarpet.cxx +SOURCE=.\src\FDM\LaRCsim\cherokee_engine.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Flight" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Flight" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File -# End Group -# Begin Group "Lib_GUI" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\GUI\apt_dlg.cxx +SOURCE=.\src\FDM\LaRCsim\cherokee_gear.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_GUI" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_GUI" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\GUI\gui.cxx +SOURCE=.\src\FDM\LaRCsim\cherokee_init.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_GUI" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_GUI" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\GUI\gui_local.cxx +SOURCE=.\src\FDM\LaRCsim\ls_interface.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_GUI" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_GUI" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\GUI\mouse.cxx +SOURCE=.\src\FDM\LaRCsim\ls_interface.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_GUI" +# PROP Intermediate_Dir "Release\Lib_LaRCsim" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_GUI" +# PROP Intermediate_Dir "Debug\Lib_LaRCsim" !ENDIF # End Source File +# End Group +# Begin Group "Lib_UIUCModel" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\GUI\net_dlg.cxx +SOURCE=.\src\FDM\UIUCModel\uiuc_1DdataFileReader.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_GUI" +# PROP Intermediate_Dir "Release\Lib_UIUCModel" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_GUI" +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\GUI\sgVec3Slider.cxx +SOURCE=.\src\FDM\UIUCModel\uiuc_1DdataFileReader.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_GUI" +# PROP Intermediate_Dir "Release\Lib_UIUCModel" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_GUI" +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\GUI\trackball.c +SOURCE=.\src\FDM\UIUCModel\uiuc_1Dinterpolation.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_GUI" +# PROP Intermediate_Dir "Release\Lib_UIUCModel" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_GUI" +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Joystick" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Joystick\joystick.cxx +SOURCE=.\src\FDM\UIUCModel\uiuc_1Dinterpolation.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Joystick" +# PROP Intermediate_Dir "Release\Lib_UIUCModel" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Joystick" +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" !ENDIF # End Source File -# End Group -# Begin Group "main" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Main\main.cxx +SOURCE=.\src\FDM\UIUCModel\uiuc_2DdataFileReader.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_2DdataFileReader.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_2Dinterpolation.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_2Dinterpolation.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_aerodeflections.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_aerodeflections.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_aircraftdir.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_aircraft.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_betaprobe.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_betaprobe.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_drag.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_drag.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_lift.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_lift.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_pitch.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_pitch.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_roll.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_roll.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_sideforce.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_sideforce.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_yaw.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coef_yaw.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coefficients.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_coefficients.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_controlInput.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_controlInput.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_convert.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_convert.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_engine.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_engine.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_ice.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_ice.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_initializemaps.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_initializemaps.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_CD.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_CD.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_CL.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_CL.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_CY.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_CY.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cm.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cm.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cn.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cn.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_Croll.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_Croll.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_controlSurface.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_controlSurface.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_engine.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_engine.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_geometry.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_geometry.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_ice.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_ice.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_init.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_init.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_keyword.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_keyword.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_mass.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_mass.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_misc.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_misc.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record1.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record1.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record2.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record2.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record3.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record3.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record4.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record4.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record5.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_map_record5.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_menu.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_menu.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_parsefile.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_parsefile.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_recorder.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_recorder.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_warnings_errors.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_warnings_errors.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_wrapper.cpp + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\UIUCModel\uiuc_wrapper.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_UIUCModel" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_UIUCModel" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Lib_Flight" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\FDM\ADA.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\ADA.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\Balloon.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\Balloon.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\External.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\External.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\flight.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\flight.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\IO360.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\IO360.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\JSBSim.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\JSBSim.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\LaRCsim.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\LaRCsim.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\LaRCsimIC.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\LaRCsimIC.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\MagicCarpet.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\FDM\MagicCarpet.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Flight" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Flight" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Lib_GUI" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\GUI\apt_dlg.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\apt_dlg.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\gui.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\gui.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\gui_local.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\gui_local.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\mouse.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\net_dlg.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\net_dlg.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\sgVec3Slider.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\sgVec3Slider.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\trackball.c + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\GUI\trackball.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_GUI" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_GUI" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Lib_Joystick" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\Joystick\joystick.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Joystick" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Joystick" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Joystick\joystick.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Joystick" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Joystick" + +!ENDIF + +# End Source File +# End Group +# Begin Group "main" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\Main\main.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\bfi.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\bfi.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fg_init.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fg_init.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fg_io.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fg_io.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fg_props.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fg_props.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fgfs.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\fgfs.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\globals.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\globals.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\keyboard.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\keyboard.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\options.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\options.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\splash.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\splash.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewer.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewer.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewer_lookat.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewer_lookat.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewer_rph.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewer_rph.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewmgr.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Main\viewmgr.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\main" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\main" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Lib_Navaids" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\Navaids\fix.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\fixlist.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\fixlist.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\ils.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\ilslist.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\ilslist.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\mkrbeacons.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\mkrbeacons.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\nav.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\navlist.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Navaids\navlist.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Navaids" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Navaids" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Lib_Network" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\Network\protocol.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\protocol.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\atlas.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\atlas.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\garmin.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\garmin.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\joyclient.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\joyclient.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\native.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\native.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\nmea.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\nmea.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\props.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\props.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\pve.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\pve.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\ray.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\ray.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\rul.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Network\rul.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Network" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Network" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Lib_NetworkOLK" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\NetworkOLK\net_send.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_NetworkOLK" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\NetworkOLK\net_hud.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_NetworkOLK" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\bfi.cxx +SOURCE=.\src\NetworkOLK\network.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_NetworkOLK" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\fg_init.cxx +SOURCE=.\src\NetworkOLK\network.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_NetworkOLK" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\fg_io.cxx +SOURCE=.\src\NetworkOLK\fgd.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_NetworkOLK" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\fg_props.cxx +SOURCE=.\src\NetworkOLK\features.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_NetworkOLK" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\fgfs.cxx +SOURCE=.\src\NetworkOLK\features.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_NetworkOLK" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" !ENDIF # End Source File +# End Group +# Begin Group "Lib_Objects" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Main\globals.cxx +SOURCE=.\src\Objects\newmat.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\keyboard.cxx +SOURCE=.\src\Objects\newmat.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\options.cxx +SOURCE=.\src\Objects\matlib.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\splash.cxx +SOURCE=.\src\Objects\matlib.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\viewer.cxx +SOURCE=.\src\Objects\obj.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\viewer_lookat.cxx +SOURCE=.\src\Objects\obj.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\viewer_rph.cxx +SOURCE=.\src\Objects\texload.c !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Main\viewmgr.cxx +SOURCE=.\src\Objects\texload.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\main" +# PROP Intermediate_Dir "Release\Lib_Objects" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\main" +# PROP Intermediate_Dir "Debug\Lib_Objects" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Objects\colours.h + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Objects" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Objects" !ENDIF # End Source File # End Group -# Begin Group "Lib_Navaids" +# Begin Group "Lib_Scenery" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\Scenery\hitlist.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\hitlist.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\newcache.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\newcache.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\scenery.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\scenery.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\tileentry.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\tileentry.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\tilemgr.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Scenery\tilemgr.hxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Scenery" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Scenery" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Lib_Sound" # PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Navaids\fixlist.cxx +SOURCE=.\src\Sound\beacon.cxx + +!IF "$(CFG)" == "FlightGear - Win32 Release" + +# PROP Intermediate_Dir "Release\Lib_Sound" + +!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Lib_Sound" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\Sound\beacon.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Navaids" +# PROP Intermediate_Dir "Release\Lib_Sound" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Navaids" +# PROP Intermediate_Dir "Debug\Lib_Sound" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Navaids\ilslist.cxx +SOURCE=.\src\Sound\morse.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Navaids" +# PROP Intermediate_Dir "Release\Lib_Sound" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Navaids" +# PROP Intermediate_Dir "Debug\Lib_Sound" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Navaids\mkrbeacons.cxx +SOURCE=.\src\Sound\morse.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Navaids" +# PROP Intermediate_Dir "Release\Lib_Sound" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Navaids" +# PROP Intermediate_Dir "Debug\Lib_Sound" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Navaids\navlist.cxx +SOURCE=.\src\Sound\soundmgr.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Navaids" +# PROP Intermediate_Dir "Release\Lib_Sound" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Navaids" +# PROP Intermediate_Dir "Debug\Lib_Sound" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Network" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Network\protocol.cxx +SOURCE=.\src\Sound\soundmgr.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Sound" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Sound" !ENDIF # End Source File +# End Group +# Begin Group "Lib_Time" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Network\atlas.cxx +SOURCE=.\src\Time\event.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\garmin.cxx +SOURCE=.\src\Time\event.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\joyclient.cxx +SOURCE=.\src\Time\fg_timer.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\native.cxx +SOURCE=.\src\Time\fg_timer.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\nmea.cxx +SOURCE=.\src\Time\light.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\props.cxx +SOURCE=.\src\Time\light.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\pve.cxx +SOURCE=.\src\Time\moonpos.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\ray.cxx +SOURCE=.\src\Time\moonpos.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Network\rul.cxx +SOURCE=.\src\Time\sunpos.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Network" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Network" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File -# End Group -# Begin Group "Lib_NetworkOLK" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\NetworkOLK\net_send.cxx +SOURCE=.\src\Time\sunpos.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_NetworkOLK" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\NetworkOLK\net_hud.cxx +SOURCE=.\src\Time\tmp.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_NetworkOLK" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\NetworkOLK\network.cxx +SOURCE=.\src\Time\tmp.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_NetworkOLK" +# PROP Intermediate_Dir "Release\Lib_Time" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" +# PROP Intermediate_Dir "Debug\Lib_Time" !ENDIF # End Source File +# End Group +# Begin Group "Lib_Weather" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\NetworkOLK\features.cxx +SOURCE=.\src\Weather\weather.cxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_NetworkOLK" +# PROP Intermediate_Dir "Release\Lib_Weather" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_NetworkOLK" +# PROP Intermediate_Dir "Debug\Lib_Weather" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Objects" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Objects\newmat.cxx +SOURCE=.\src\Weather\weather.hxx !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Objects" +# PROP Intermediate_Dir "Release\Lib_Weather" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Objects" +# PROP Intermediate_Dir "Debug\Lib_Weather" !ENDIF # End Source File +# End Group +# Begin Group "Lib_WeatherCM" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Objects\matlib.cxx +SOURCE=.\src\WeatherCM\FGAirPressureItem.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Objects" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Objects" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Objects\obj.cxx +SOURCE=.\src\WeatherCM\FGAirPressureItem.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Objects" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Objects" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Objects\texload.c +SOURCE=.\src\WeatherCM\FGCloud.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Objects" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Objects" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Scenery" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Scenery\hitlist.cxx +SOURCE=.\src\WeatherCM\FGCloudItem.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Scenery" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Scenery" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Scenery\newcache.cxx +SOURCE=.\src\WeatherCM\FGCloudItem.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Scenery" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Scenery" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Scenery\scenery.cxx +SOURCE=.\src\WeatherCM\FGLocalWeatherDatabase.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Scenery" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Scenery" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Scenery\tileentry.cxx +SOURCE=.\src\WeatherCM\FGLocalWeatherDatabase.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Scenery" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Scenery" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Scenery\tilemgr.cxx +SOURCE=.\src\WeatherCM\FGPhysicalProperties.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Scenery" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Scenery" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Sound" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Sound\morse.cxx +SOURCE=.\src\WeatherCM\FGPhysicalProperties.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Sound" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Sound" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Sound\soundmgr.cxx +SOURCE=.\src\WeatherCM\FGPhysicalProperty.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Sound" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Sound" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Time" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Time\event.cxx +SOURCE=.\src\WeatherCM\FGPhysicalProperty.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Time" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Time" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Time\fg_timer.cxx +SOURCE=.\src\WeatherCM\FGSnowRain.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Time" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Time" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Time\light.cxx +SOURCE=.\src\WeatherCM\FGTemperatureItem.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Time" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Time" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Time\moonpos.cxx +SOURCE=.\src\WeatherCM\FGTemperatureItem.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Time" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Time" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Time\sunpos.cxx +SOURCE=.\src\WeatherCM\FGThunderstorm.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Time" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Time" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File # Begin Source File -SOURCE=.\src\Time\tmp.cxx +SOURCE=.\src\WeatherCM\FGThunderstorm.h !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Time" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Time" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File -# End Group -# Begin Group "Lib_Weather" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\Weather\weather.cxx +SOURCE=.\src\WeatherCM\FGTurbulenceItem.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" -# PROP Intermediate_Dir "Release\Lib_Weather" +# PROP Intermediate_Dir "Release\Lib_WeatherCM" !ELSEIF "$(CFG)" == "FlightGear - Win32 Debug" -# PROP Intermediate_Dir "Debug\Lib_Weather" +# PROP Intermediate_Dir "Debug\Lib_WeatherCM" !ENDIF # End Source File -# End Group -# Begin Group "Lib_WeatherCM" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\src\WeatherCM\FGAirPressureItem.cpp +SOURCE=.\src\WeatherCM\FGTurbulenceItem.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3038,7 +5948,7 @@ SOURCE=.\src\WeatherCM\FGAirPressureItem.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGCloudItem.cpp +SOURCE=.\src\WeatherCM\FGVaporPressureItem.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3053,7 +5963,7 @@ SOURCE=.\src\WeatherCM\FGCloudItem.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGLocalWeatherDatabase.cpp +SOURCE=.\src\WeatherCM\FGVaporPressureItem.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3068,7 +5978,7 @@ SOURCE=.\src\WeatherCM\FGLocalWeatherDatabase.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGPhysicalProperties.cpp +SOURCE=.\src\WeatherCM\FGWeatherDefs.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3083,7 +5993,7 @@ SOURCE=.\src\WeatherCM\FGPhysicalProperties.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGPhysicalProperty.cpp +SOURCE=.\src\WeatherCM\FGWeatherFeature.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3098,7 +6008,7 @@ SOURCE=.\src\WeatherCM\FGPhysicalProperty.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGTemperatureItem.cpp +SOURCE=.\src\WeatherCM\FGWeatherUtils.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3113,7 +6023,7 @@ SOURCE=.\src\WeatherCM\FGTemperatureItem.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGThunderstorm.cpp +SOURCE=.\src\WeatherCM\FGWeatherParse.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3128,7 +6038,7 @@ SOURCE=.\src\WeatherCM\FGThunderstorm.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGTurbulenceItem.cpp +SOURCE=.\src\WeatherCM\FGWeatherParse.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3143,7 +6053,7 @@ SOURCE=.\src\WeatherCM\FGTurbulenceItem.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGVaporPressureItem.cpp +SOURCE=.\src\WeatherCM\FGWeatherVectorWrap.h !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3158,7 +6068,7 @@ SOURCE=.\src\WeatherCM\FGVaporPressureItem.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGWeatherParse.cpp +SOURCE=.\src\WeatherCM\FGWindItem.cpp !IF "$(CFG)" == "FlightGear - Win32 Release" @@ -3173,7 +6083,7 @@ SOURCE=.\src\WeatherCM\FGWeatherParse.cpp # End Source File # Begin Source File -SOURCE=.\src\WeatherCM\FGWindItem.cpp +SOURCE=.\src\WeatherCM\FGWindItem.h !IF "$(CFG)" == "FlightGear - Win32 Release" diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index 1ca1edcce..3a040597f 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -58,7 +58,9 @@ /******************************************************************************/ -FGJSBsim::FGJSBsim( double dt ) { +FGJSBsim::FGJSBsim( double dt ) + : FGInterface(dt) +{ bool result; fdmex=new FGFDMExec; @@ -76,11 +78,24 @@ FGJSBsim::FGJSBsim( double dt ) { result = fdmex->LoadModel( aircraft_path.str(), engine_path.str(), fgGetString("/sim/aircraft") ); - int Neng=fdmex->GetAircraft()->GetNumEngines(); + int Neng=fdmex->GetPropulsion()->GetNumEngines(); +// int Neng=fdmex->GetAircraft()->GetNumEngines(); SG_LOG(SG_FLIGHT,SG_INFO, "Neng: " << Neng ); for(int i=0;iGetFCS()->GetPitchTrimCmd()); + fgSetDouble("/fdm/trim/throttle", + fdmex->GetFCS()->GetThrottleCmd(0)/100.0); + fgSetDouble("/fdm/trim/aileron", + fdmex->GetFCS()->GetDaCmd()); + fgSetDouble("/fdm/trim/rudder", + fdmex->GetFCS()->GetDrCmd()); + + trimmed = fgGetValue("/fdm/trim/trimmed",true); + trimmed->setBoolValue(false); } @@ -203,7 +218,9 @@ bool FGJSBsim::update( int multiloop ) { copy_to_JSBsim(); - + + trimmed->setBoolValue(false); + if(needTrim && fgGetBool("/sim/startup/trim")) { //fgic->SetSeaLevelRadiusFtIC( get_Sea_level_radius() ); //fgic->SetTerrainAltitudeFtIC( scenery.cur_elev * SG_METER_TO_FEET ); @@ -217,15 +234,24 @@ bool FGJSBsim::update( int multiloop ) { if(!fgtrim->DoTrim()) { fgtrim->Report(); fgtrim->TrimStats(); - } + } else { + trimmed->setBoolValue(true); + } fgtrim->ReportState(); delete fgtrim; - - needTrim=false; - - - controls.set_elevator_trim(fdmex->GetFCS()->GetPitchTrimCmd()); + needTrim=false; + + fgSetDouble("/fdm/trim/pitch-trim", + fdmex->GetFCS()->GetPitchTrimCmd()); + fgSetDouble("/fdm/trim/throttle", + fdmex->GetFCS()->GetThrottleCmd(0)/100.0); + fgSetDouble("/fdm/trim/aileron", + fdmex->GetFCS()->GetDaCmd()); + fgSetDouble("/fdm/trim/rudder", + fdmex->GetFCS()->GetDrCmd()); + + controls.set_elevator_trim(fdmex->GetFCS()->GetPitchTrimCmd()); controls.set_elevator(fdmex->GetFCS()->GetDeCmd()); controls.set_throttle(FGControls::ALL_ENGINES, fdmex->GetFCS()->GetThrottleCmd(0)/100.0); diff --git a/src/FDM/JSBSim.hxx b/src/FDM/JSBSim.hxx index 89b66ff5f..b6f50b435 100644 --- a/src/FDM/JSBSim.hxx +++ b/src/FDM/JSBSim.hxx @@ -201,10 +201,11 @@ private: bool needTrim; int runcount; - bool trimmed; float trim_elev; float trim_throttle; + SGValue *trimmed; + void snap_shot(void); }; diff --git a/src/FDM/JSBSim/FGAerodynamics.cpp b/src/FDM/JSBSim/FGAerodynamics.cpp index d1a5a2564..6889ca275 100644 --- a/src/FDM/JSBSim/FGAerodynamics.cpp +++ b/src/FDM/JSBSim/FGAerodynamics.cpp @@ -37,9 +37,11 @@ INCLUDES #include "FGAerodynamics.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_AERODYNAMICS; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -47,9 +49,17 @@ CLASS IMPLEMENTATION FGAerodynamics::FGAerodynamics(FGFDMExec* fgex) : FGModel(fgex) { + if (debug_lvl & 2) cout << "Instantiated: FGAerodynamics" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FGAerodynamics::~FGAerodynamics() +{ + if (debug_lvl & 2) cout << "Destroyed: FGAerodynamics" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGAerodynamics:: Run(void) { @@ -61,8 +71,17 @@ bool FGAerodynamics:: Run(void) { } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + bool FGAerodynamics::LoadAerodynamics(FGConfigFile* AC_cfg) { // } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGAerodynamics::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGAerodynamics.h b/src/FDM/JSBSim/FGAerodynamics.h index cc29cb7e6..beb7d209f 100644 --- a/src/FDM/JSBSim/FGAerodynamics.h +++ b/src/FDM/JSBSim/FGAerodynamics.h @@ -40,7 +40,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -56,7 +56,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_AERODYNAMICS "$Header$" +#define ID_AERODYNAMICS "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -90,7 +90,7 @@ public: @param Executive a pointer to the parent executive object */ FGAerodynamics(FGFDMExec*); /// Destructor - ~FGAerodynamics(void); + ~FGAerodynamics(); /** Runs the Aerodynamics model; called by the Executive @return false if no error */ @@ -99,6 +99,9 @@ public: /** Loads the Aerodynamics model @return true if successful */ bool LoadAerodynamics(FGConfigFile* AC_cfg); + +private: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGAircraft.cpp b/src/FDM/JSBSim/FGAircraft.cpp index 566d324ec..ed10a42db 100644 --- a/src/FDM/JSBSim/FGAircraft.cpp +++ b/src/FDM/JSBSim/FGAircraft.cpp @@ -109,7 +109,7 @@ INCLUDES # ifndef __BORLANDC__ # include # endif -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -137,9 +137,23 @@ DEFINITIONS GLOBAL DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_AIRCRAFT; +extern char highint[5]; +extern char halfint[5]; +extern char normint[6]; +extern char reset[5]; +extern char underon[5]; +extern char underoff[6]; +extern char fgblue[6]; +extern char fgcyan[6]; +extern char fgred[6]; +extern char fggreen[6]; +extern char fgdef[6]; + +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -153,7 +167,7 @@ FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex), vXYZcg(3), vXYZep(3), vEuler(3) - + { Name = "FGAircraft"; @@ -163,37 +177,30 @@ FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex), AxisIdx["ROLL"] = 3; AxisIdx["PITCH"] = 4; AxisIdx["YAW"] = 5; - + Coeff = new CoeffArray[6]; GearUp = false; - + alphaclmin = alphaclmax = 0; - numTanks = numEngines = numSelectedFuelTanks = numSelectedOxiTanks = 0; + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGAircraft::~FGAircraft(void) { +FGAircraft::~FGAircraft() { unsigned int i,j; - - if (Engine != NULL) { - for (i=0; iSetStarved(); else Engine[e]->SetStarved(false); } - +*/ Weight = EmptyWeight; - for (t=0; tGetContents(); +// for (t=0; tGetContents(); Mass = Weight / GRAVITY; // Calculate new CG here. Tw = 0; - for (t=0; tGetX()*Tank[t]->GetContents(); - vXYZtank(eY) += Tank[t]->GetY()*Tank[t]->GetContents(); - vXYZtank(eZ) += Tank[t]->GetZ()*Tank[t]->GetContents(); - - Tw += Tank[t]->GetContents(); - } +// for (t=0; tGetX()*Tank[t]->GetContents(); +// vXYZtank(eY) += Tank[t]->GetY()*Tank[t]->GetContents(); +// vXYZtank(eZ) += Tank[t]->GetZ()*Tank[t]->GetContents(); +// +// Tw += Tank[t]->GetContents(); +// } vXYZcg = (vXYZtank + EmptyWeight*vbaseXYZcg) / (Tw + EmptyWeight); // Calculate new moments of inertia here IXXt = IYYt = IZZt = IXZt = 0.0; - for (t=0; tGetX()-vXYZcg(eX))/12.0)*((Tank[t]->GetX() - vXYZcg(eX))/12.0)*Tank[t]->GetContents()/GRAVITY; - IYYt += ((Tank[t]->GetY()-vXYZcg(eY))/12.0)*((Tank[t]->GetY() - vXYZcg(eY))/12.0)*Tank[t]->GetContents()/GRAVITY; - IZZt += ((Tank[t]->GetZ()-vXYZcg(eZ))/12.0)*((Tank[t]->GetZ() - vXYZcg(eZ))/12.0)*Tank[t]->GetContents()/GRAVITY; - IXZt += ((Tank[t]->GetX()-vXYZcg(eX))/12.0)*((Tank[t]->GetZ() - vXYZcg(eZ))/12.0)*Tank[t]->GetContents()/GRAVITY; - } +// for (t=0; tGetX()-vXYZcg(eX))/12.0)*((Tank[t]->GetX() - vXYZcg(eX))/12.0)*Tank[t]->GetContents()/GRAVITY; +// IYYt += ((Tank[t]->GetY()-vXYZcg(eY))/12.0)*((Tank[t]->GetY() - vXYZcg(eY))/12.0)*Tank[t]->GetContents()/GRAVITY; +// IZZt += ((Tank[t]->GetZ()-vXYZcg(eZ))/12.0)*((Tank[t]->GetZ() - vXYZcg(eZ))/12.0)*Tank[t]->GetContents()/GRAVITY; +// IXZt += ((Tank[t]->GetX()-vXYZcg(eX))/12.0)*((Tank[t]->GetZ() - vXYZcg(eZ))/12.0)*Tank[t]->GetContents()/GRAVITY; +// } Ixx = baseIxx + IXXt; Iyy = baseIyy + IYYt; @@ -425,13 +433,8 @@ void FGAircraft::FMMass(void) { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::FMProp(void) { - for (unsigned int i=0;iCalcThrust(); - } - + vForces += Propulsion->GetForces(); + vMoments += Propulsion->GetMoments(); } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -499,43 +502,17 @@ void FGAircraft::ReadMetrics(FGConfigFile* AC_cfg) { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg) { - string token; - string engine_name; - string parameter; - - AC_cfg->GetNextConfigLine(); - - while ((token = AC_cfg->GetValue()) != "/PROPULSION") { - *AC_cfg >> parameter; - - if (parameter == "AC_ENGINE") { - - *AC_cfg >> engine_name; - Engine[numEngines] = new FGEngine(FDMExec, EnginePath, engine_name, numEngines); - numEngines++; - - } else if (parameter == "AC_TANK") { - - Tank[numTanks] = new FGTank(AC_cfg); - switch(Tank[numTanks]->GetType()) { - case FGTank::ttFUEL: - numSelectedFuelTanks++; - break; - case FGTank::ttOXIDIZER: - numSelectedOxiTanks++; - break; - } - numTanks++; - } + if (!Propulsion->LoadPropulsion(AC_cfg)) { + cerr << "Propulsion not successfully loaded" << endl; } } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg) { - string token; - - FCS->LoadFCS(AC_cfg); + if (!FCS->LoadFCS(AC_cfg)) { + cerr << "Flight Controls not successfully loaded" << endl; + } } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -650,16 +627,18 @@ void FGAircraft::ReadPrologue(FGConfigFile* AC_cfg) { string token = AC_cfg->GetValue(); string scratch; AircraftName = AC_cfg->GetValue("NAME"); - cout << "Reading Aircraft Configuration File: " << AircraftName << endl; - scratch=AC_cfg->GetValue("VERSION").c_str(); + cout << underon << "Reading Aircraft Configuration File" << underoff << ": " + << highint << AircraftName << normint << endl; + scratch = AC_cfg->GetValue("VERSION").c_str(); CFGVersion = AC_cfg->GetValue("VERSION"); - cout << " Version: " << CFGVersion << endl; + cout << " Version: " << highint << CFGVersion + << normint << endl; if (CFGVersion != NEEDED_CFG_VERSION) { - cout << endl << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT." + cout << endl << fgred << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT." " RESULTS WILL BE UNPREDICTABLE !!" << endl; cout << "Current version needed is: " << NEEDED_CFG_VERSION << endl; - cout << " You have version: " << CFGVersion << endl << endl; + cout << " You have version: " << CFGVersion << endl << fgdef << endl; //exit(-1); } @@ -759,3 +738,10 @@ string FGAircraft::GetGroundReactionValues(void) { return GroundReactionValues; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGAircraft::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGAircraft.h b/src/FDM/JSBSim/FGAircraft.h index c1b22e590..db1d62d7c 100644 --- a/src/FDM/JSBSim/FGAircraft.h +++ b/src/FDM/JSBSim/FGAircraft.h @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. @@ -40,7 +40,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # include # include @@ -57,8 +57,7 @@ INCLUDES #include "FGModel.h" #include "FGCoefficient.h" -#include "FGEngine.h" -#include "FGTank.h" +#include "FGPropulsion.h" #include "FGLGear.h" #include "FGConfigFile.h" #include "FGMatrix.h" @@ -67,7 +66,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_AIRCRAFT "$Header$" +#define ID_AIRCRAFT "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -86,7 +85,11 @@ CLASS DOCUMENTATION 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. + for retrieving their force and moment contributions falls to FGAircraft.
+ When an aircraft model is loaded the config file is parsed and for each of the + sections of the config file (propulsion, flight control, etc.) the + corresponding "ReadXXX()" method is called. From within this method the + "Load()" method of that system is called (e.g. LoadFCS). @author Jon S. Berndt @version $Id$ @see @@ -119,7 +122,7 @@ public: FGAircraft(FGFDMExec *Executive); /// Destructor - ~FGAircraft(void); + ~FGAircraft(); /** Runs the Aircraft model; called by the Executive @see JSBSim.cpp documentation @@ -154,14 +157,6 @@ public: inline float GetWingSpan(void) { return WingSpan; } /// Gets the average wing chord inline float Getcbar(void) { return cbar; } - /** 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; } @@ -171,7 +166,6 @@ public: inline float GetIyy(void) { return Iyy; } inline float GetIzz(void) { return Izz; } inline float GetIxz(void) { return Ixz; } - inline unsigned int GetNumEngines(void) { return numEngines; } inline FGColumnVector GetXYZcg(void) { return vXYZcg; } inline FGColumnVector GetXYZrp(void) { return vXYZrp; } inline FGColumnVector GetXYZep(void) { return vXYZep; } @@ -230,18 +224,11 @@ private: string CFGVersion; string AircraftName; - unsigned int numTanks; - unsigned int numEngines; - unsigned int numSelectedOxiTanks; - unsigned int numSelectedFuelTanks; - FGTank* Tank[MAX_TANKS]; // need to make a vector - FGEngine *Engine[MAX_ENGINES]; // need to make a vector - typedef map AxisIndex; AxisIndex AxisIdx; typedef vector CoeffArray; - + CoeffArray* Coeff; void DisplayCoeffFactors(vector multipliers); @@ -260,7 +247,9 @@ private: void ReadUndercarriage(FGConfigFile*); void ReadPrologue(FGConfigFile*); void ReadOutput(FGConfigFile*); + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGAtmosphere.cpp b/src/FDM/JSBSim/FGAtmosphere.cpp index 170f5e232..2862dfc6d 100644 --- a/src/FDM/JSBSim/FGAtmosphere.cpp +++ b/src/FDM/JSBSim/FGAtmosphere.cpp @@ -59,159 +59,160 @@ INCLUDES #include "FGDefs.h" #include "FGMatrix.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_ATMOSPHERE; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGAtmosphere::FGAtmosphere(FGFDMExec* fdmex) : FGModel(fdmex), - vWindNED(3), - vWindUVW(3) + vWindNED(3) { - Name = "FGAtmosphere"; - h = 0; - Calculate(h); - SLtemperature = temperature; - SLpressure = pressure; - SLdensity = density; - SLsoundspeed = sqrt(SHRATIO*Reng*temperature); - useExternal=false; - vWindUVW(1)=0;vWindUVW(2)=0;vWindUVW(3)=0; - vWindNED(1)=0;vWindNED(2)=0;vWindNED(3)=0; + Name = "FGAtmosphere"; + h = 0; + Calculate(h); + SLtemperature = temperature; + SLpressure = pressure; + SLdensity = density; + SLsoundspeed = sqrt(SHRATIO*Reng*temperature); + useExternal=false; + vWindNED(1)=0;vWindNED(2)=0;vWindNED(3)=0; + + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGAtmosphere::~FGAtmosphere() { + if (debug_lvl & 2) cout << "Destroyed: FGAtmosphere" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGAtmosphere::Run(void) { - //cout << "In FGAtmosphere::Run(void)" << endl; - if (!FGModel::Run()) { // if false then execute this Run() - //do temp, pressure, and density first - if (!useExternal) { - //cout << "Atmosphere: Using internal model, altitude= "; - h = Position->Geth(); - - Calculate(h); - } else { - density = exDensity; - pressure = exPressure; - temperature = exTemperature; - //switch sign of wind components so that they are - //in aircraft reference frame. The classic example is - //takeoff or landing where you always want to fly - //into the wind. Suppose that an aircraft is - //taking off into the wind on the runway heading - //of pure north. Into the wind means the wind is - //flowing to the south (or negative) direction, - //and we know that headwinds increase the relative - //velocity, so to make a positive delta U from the - //southerly wind the sign must be switched. - vWindNED *= -1; - vWindUVW = State->GetTl2b()*vWindNED; - } - soundspeed = sqrt(SHRATIO*Reng*temperature); - //cout << "Atmosphere: soundspeed: " << soundspeed << endl; - State->Seta(soundspeed); - - - } else { // skip Run() execution this time + //cout << "In FGAtmosphere::Run(void)" << endl; + if (!FGModel::Run()) { // if false then execute this Run() + //do temp, pressure, and density first + if (!useExternal) { + //cout << "Atmosphere: Using internal model, altitude= "; + h = Position->Geth(); + + Calculate(h); + } else { + density = exDensity; + pressure = exPressure; + temperature = exTemperature; } - return false; -} + psiw = atan2( vWindNED(2), vWindNED(1) ); -void FGAtmosphere::Calculate(float altitude) -{ - //see reference [1] - - float slope,reftemp,refpress,refdens; - int i=0; - float htab[]={0,36089,82020,154198,173882,259183,295272,344484}; //ft. - // cout << "Atmosphere: h=" << altitude << " rho= " << density << endl; - if (altitude <= htab[0]) { - altitude=0; - } else if (altitude >= htab[7]){ - i = 7; - altitude = htab[7]; - } else { - while (htab[i+1] < altitude) { - i++; - } - } + if (psiw < 0) psiw += 2*M_PI; - switch(i) { - case 0: // sea level - slope = -0.0035662; // R/ft. - reftemp = 518.688; // R - refpress = 2116.17; // psf - refdens = 0.0023765; // slugs/cubic ft. - break; - case 1: // 36089 ft. - slope = 0; - reftemp = 389.988; - refpress = 474.1; - refdens = 0.0007078; - break; - case 2: // 82020 ft. - slope = 0.00164594; - reftemp = 389.988; - refpress = 52.7838; - refdens = 7.8849E-5; - break; - case 3: // 154198 ft. - slope = 0; - reftemp = 508.788; - refpress = 2.62274; - refdens = 3.01379E-6; - break; - case 4: // 173882 ft. - slope = -0.00246891; - reftemp = 508.788; - refpress = 1.28428; - refdens = 1.47035e-06; - break; - case 5: // 259183 ft. - slope = 0; - reftemp = 298.188; - refpress = 0.0222008; - refdens = 4.33396e-08; - break; - case 6: // 295272 ft. - slope = 0.00219459; - reftemp = 298.188; - refpress = 0.00215742; - refdens = 4.21368e-09; - break; - case 7: // 344484 ft. - slope = 0; - reftemp = 406.188; - refpress = 0.000153755; - refdens = 2.20384e-10; - break; - } + soundspeed = sqrt(SHRATIO*Reng*temperature); + //cout << "Atmosphere: soundspeed: " << soundspeed << endl; + State->Seta(soundspeed); + } else { // skip Run() execution this time + } + return false; +} - if (slope == 0) { - temperature = reftemp; - pressure = refpress*exp(-GRAVITY/(reftemp*Reng)*(altitude-htab[i])); - density = refdens*exp(-GRAVITY/(reftemp*Reng)*(altitude-htab[i])); - } else { - temperature = reftemp+slope*(altitude-htab[i]); - pressure = refpress*pow(temperature/reftemp,-GRAVITY/(slope*Reng)); - density = refdens*pow(temperature/reftemp,-(GRAVITY/(slope*Reng)+1)); - } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //cout << "Atmosphere: h=" << altitude << " rho= " << density << endl; +void FGAtmosphere::Calculate(float altitude) +{ + //see reference [1] + + float slope,reftemp,refpress,refdens; + int i=0; + float htab[]={0,36089,82020,154198,173882,259183,295272,344484}; //ft. + // cout << "Atmosphere: h=" << altitude << " rho= " << density << endl; + if (altitude <= htab[0]) { + altitude=0; + } else if (altitude >= htab[7]){ + i = 7; + altitude = htab[7]; + } else { + while (htab[i+1] < altitude) { + i++; + } + } + + switch(i) { + case 0: // sea level + slope = -0.0035662; // R/ft. + reftemp = 518.688; // R + refpress = 2116.17; // psf + refdens = 0.0023765; // slugs/cubic ft. + break; + case 1: // 36089 ft. + slope = 0; + reftemp = 389.988; + refpress = 474.1; + refdens = 0.0007078; + break; + case 2: // 82020 ft. + slope = 0.00164594; + reftemp = 389.988; + refpress = 52.7838; + refdens = 7.8849E-5; + break; + case 3: // 154198 ft. + slope = 0; + reftemp = 508.788; + refpress = 2.62274; + refdens = 3.01379E-6; + break; + case 4: // 173882 ft. + slope = -0.00246891; + reftemp = 508.788; + refpress = 1.28428; + refdens = 1.47035e-06; + break; + case 5: // 259183 ft. + slope = 0; + reftemp = 298.188; + refpress = 0.0222008; + refdens = 4.33396e-08; + break; + case 6: // 295272 ft. + slope = 0.00219459; + reftemp = 298.188; + refpress = 0.00215742; + refdens = 4.21368e-09; + break; + case 7: // 344484 ft. + slope = 0; + reftemp = 406.188; + refpress = 0.000153755; + refdens = 2.20384e-10; + break; + } + + if (slope == 0) { + temperature = reftemp; + pressure = refpress*exp(-GRAVITY/(reftemp*Reng)*(altitude-htab[i])); + density = refdens*exp(-GRAVITY/(reftemp*Reng)*(altitude-htab[i])); + } else { + temperature = reftemp+slope*(altitude-htab[i]); + pressure = refpress*pow(temperature/reftemp,-GRAVITY/(slope*Reng)); + density = refdens*pow(temperature/reftemp,-(GRAVITY/(slope*Reng)+1)); + } + + //cout << "Atmosphere: h=" << altitude << " rho= " << density << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - +void FGAtmosphere::Debug(void) +{ + //TODO: Add your source code here +} diff --git a/src/FDM/JSBSim/FGAtmosphere.h b/src/FDM/JSBSim/FGAtmosphere.h index 964c0a5dd..1a1bd1aa2 100644 --- a/src/FDM/JSBSim/FGAtmosphere.h +++ b/src/FDM/JSBSim/FGAtmosphere.h @@ -45,13 +45,13 @@ INCLUDES #include "FGModel.h" #include "FGMatrix.h" -#define ID_ATMOSPHERE "$Header$" +#define ID_ATMOSPHERE "$Id$" /******************************************************************************* COMMENTS, REFERENCES, and NOTES ******************************************************************************** -[1] Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill, +[1] Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill, 1989, ISBN 0-07-001641-0 ******************************************************************************* @@ -62,7 +62,7 @@ class FGAtmosphere : public FGModel { public: FGAtmosphere(FGFDMExec*); - ~FGAtmosphere(void); + ~FGAtmosphere(); bool Run(void); inline float GetTemperature(void) {return temperature;} @@ -90,12 +90,10 @@ public: inline void SetWindNED(float wN, float wE, float wD) { vWindNED(1)=wN; vWindNED(2)=wE; vWindNED(3)=wD;} - inline float GetWindN(void) { return vWindNED(1); } - inline float GetWindE(void) { return vWindNED(2); } - inline float GetWindD(void) { return vWindNED(3); } - - inline FGColumnVector GetWindUVW(void) { return vWindUVW; } - + inline FGColumnVector GetWindNED(void) { return vWindNED; } + + inline float GetWindPsi(void) { return psiw; } + protected: private: @@ -106,13 +104,14 @@ private: float temperature,density,pressure,soundspeed; bool useExternal; float exTemperature,exDensity,exPressure; - FGColumnVector vWindNED,vWindUVW; + + FGColumnVector vWindNED; + float psiw; void Calculate(float altitude); - + void Debug(void); }; - - /******************************************************************************/ #endif + diff --git a/src/FDM/JSBSim/FGAuxiliary.cpp b/src/FDM/JSBSim/FGAuxiliary.cpp index 3cd05ff0e..0fdc05732 100644 --- a/src/FDM/JSBSim/FGAuxiliary.cpp +++ b/src/FDM/JSBSim/FGAuxiliary.cpp @@ -17,25 +17,25 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. - + FUNCTIONAL DESCRIPTION -------------------------------------------------------------------------------- This class calculates various auxiliary parameters. - + REFERENCES Anderson, John D. "Introduction to Flight", 3rd Edition, McGraw-Hill, 1989 pgs. 112-126 HISTORY -------------------------------------------------------------------------------- 01/26/99 JSB Created - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -52,24 +52,33 @@ INCLUDES #include "FGOutput.h" #include "FGMatrix.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_AUXILIARY; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex) { Name = "FGAuxiliary"; vcas = veas = mach = qbar = pt = 0; psl = rhosl = 1; earthPosAngle = 0.0; + + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGAuxiliary::~FGAuxiliary() {} - +FGAuxiliary::~FGAuxiliary() +{ + if (debug_lvl & 2) cout << "Destroyed: FGAuxiliary" << endl; +} +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGAuxiliary::Run() { float A,B,D; @@ -95,20 +104,43 @@ bool FGAuxiliary::Run() { A = pow(((pt-p)/psl+1),0.28571); vcas = sqrt(7*psl/rhosl*(A-1)); veas = sqrt(2*qbar/rhosl); - + vPilotAccel = Translation->GetUVWdot() + Aircraft->GetXYZep() * Rotation->GetPQRdot(); - - - + earthPosAngle += State->Getdt()*OMEGA_EARTH; } else { } - return false; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGAuxiliary::GetHeadWind(void) { + + float psiw,vw,psi; + + psiw = Atmosphere->GetWindPsi(); + psi = Rotation->Getpsi(); + vw = Atmosphere->GetWindNED().Magnitude(); + return -vw*cos(psiw - psi); +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGAuxiliary::GetCrossWind(void) { + + float psiw,vw,psi; + + psiw = Atmosphere->GetWindPsi(); + psi = Rotation->Getpsi(); + vw = Atmosphere->GetWindNED().Magnitude(); + return vw*sin(psiw - psi); +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + void FGAuxiliary::GetState(void) { qbar = Translation->Getqbar(); mach = Translation->GetMach(); @@ -118,3 +150,10 @@ void FGAuxiliary::GetState(void) { } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGAuxiliary::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGAuxiliary.h b/src/FDM/JSBSim/FGAuxiliary.h index 6d676ad58..b386896dc 100644 --- a/src/FDM/JSBSim/FGAuxiliary.h +++ b/src/FDM/JSBSim/FGAuxiliary.h @@ -46,7 +46,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_AUXILIARY "$Header" +#define ID_AUXILIARY "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -76,7 +76,7 @@ public: @param Executive a pointer to the parent executive object */ FGAuxiliary(FGFDMExec*); /// Destructor - ~FGAuxiliary(void); + ~FGAuxiliary(); /** Runs the Auxiliary routines; called by the Executive @return false if no error */ @@ -93,6 +93,9 @@ public: inline float GetEarthPositionAngle(void) { return earthPosAngle; } + float GetHeadWind(void); + float GetCrossWind(void); + protected: @@ -112,9 +115,12 @@ private: FGColumnVector vPilotAccel; float earthPosAngle; + void GetState(void); + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGCoefficient.cpp b/src/FDM/JSBSim/FGCoefficient.cpp index d29812e62..f3c7bd1be 100644 --- a/src/FDM/JSBSim/FGCoefficient.cpp +++ b/src/FDM/JSBSim/FGCoefficient.cpp @@ -50,26 +50,35 @@ INCLUDES #include -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = "ID_COEFFICIENT"; +extern char highint[5]; +extern char halfint[5]; +extern char normint[6]; +extern char reset[5]; +extern char underon[5]; +extern char underoff[6]; +extern char fgblue[6]; +extern char fgcyan[6]; +extern char fgred[6]; +extern char fggreen[6]; +extern char fgdef[6]; + +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg) { - int r, c, start, end, n; - float ftrashcan; + int start, end, n; string multparms; - char nullstring[13] = " "; - - bias =0.0; - gain = 1.0; - - FDMExec = fdex; - State = FDMExec->GetState(); - Table = 0; + + FDMExec = fdex; + State = FDMExec->GetState(); + Table = 0; if (AC_cfg) { name = AC_cfg->GetValue("NAME"); @@ -78,22 +87,7 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg) AC_cfg->GetNextConfigLine(); *AC_cfg >> description; - char bolden[5]; - char unbolden[5]; - - bolden[0] = 27; - bolden[1] = '['; - bolden[2] = '1'; - bolden[3] = 'm'; - bolden[4] = '\0'; - - unbolden[0] = 27; - unbolden[1] = '['; - unbolden[2] = '0'; - unbolden[3] = 'm'; - unbolden[4] = '\0'; - - cout << " " << bolden << name << unbolden << endl; + cout << "\n " << highint << underon << name << underoff << normint << endl; cout << " " << description << endl; cout << " " << method << endl; @@ -109,6 +103,9 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg) if (type == TABLE) { *AC_cfg >> columns; cout << "Cols: " << columns; + Table = new FGTable(rows, columns); + } else { + Table = new FGTable(rows); } cout << endl; @@ -151,136 +148,41 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg) cout << " Value = " << StaticValue << endl; break; case VECTOR: - Allocate(rows,2); - - for (r=1;r<=rows;r++) { - *AC_cfg >> Table[r][0]; - *AC_cfg >> Table[r][1]; - } - - for (r=1;r<=rows;r++) { - cout << " "; - for (c=0;c> Table[r][c]; - } - } - } - - /* for (c=1;c<=columns;c++) { - *AC_cfg >> Table[0][c]; - for (r=1;r<=rows;r++) { - if ( c==1 ) *AC_cfg >> Table[r][0]; - else *AC_cfg >> ftrashcan; - *AC_cfg >> Table[r][c]; - } - } */ - - for (r=0;r<=rows;r++) { - cout << " "; - for (c=0;c<=columns;c++) { - if( ((r == 0) && (c == 0)) ) { - cout << nullstring; - } else { - cout.flags(ios::left); - cout << setw(12) << Table[r][c]; - } - } - cout << endl; - } + *Table << *AC_cfg; + Table->Print(); break; case EQUATION: case UNKNOWN: cerr << "Unimplemented coefficient type: " << type << endl; - break; + break; } AC_cfg->GetNextConfigLine(); } + if (debug_lvl & 2) cout << "Instantiated: FGCoefficient" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGCoefficient::~FGCoefficient(void) { - DeAllocate(); -} - -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -bool FGCoefficient::DeAllocate(void) -{ - if (Table != NULL ) { - for (unsigned int i=0; i<=rows; i++) delete[] Table[i]; - - delete[] Table; - } - - return true; -} - -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -bool FGCoefficient::Allocate(int r, int c) +FGCoefficient::~FGCoefficient() { - rows = r; - columns = c; - Table = new float*[r+1]; - for (int i=0;i<=r;i++) Table[i] = new float[c+1]; - return true; + if (Table) delete Table; + if (debug_lvl & 2) cout << "Destroyed: FGCoefficient" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGCoefficient::Value(float rVal, float cVal) { - float rFactor, cFactor, col1temp, col2temp, Value; - int r, c; - unsigned midx; - - if (rows < 2 || columns < 2) return 0.0; - - for (r=1;r<=rows;r++) if (Table[r][0] >= rVal) break; - for (c=1;c<=columns;c++) if (Table[0][c] >= cVal) break; - //cout << "Value(): rVal: " << rVal << " cVal: " << cVal << endl; - //cout << "Value(): r: " << r << " c: " << c << endl; - c = c < 2 ? 2 : (c > columns ? columns : c); - r = r < 2 ? 2 : (r > rows ? rows : r); - - rFactor = (rVal - Table[r-1][0]) / (Table[r][0] - Table[r-1][0]); - cFactor = (cVal - Table[0][c-1]) / (Table[0][c] - Table[0][c-1]); + float Value; + unsigned int midx; - col1temp = rFactor*(Table[r][c-1] - Table[r-1][c-1]) + Table[r-1][c-1]; - col2temp = rFactor*(Table[r][c] - Table[r-1][c]) + Table[r-1][c]; + SD = Value = Table->GetValue(rVal, cVal); - Value = col1temp + cFactor*(col2temp - col1temp); - Value = (Value + bias)*gain; - SD = Value; - for (midx=0; midx < multipliers.size(); midx++) { - Value *= State->GetParameter(multipliers[midx]); + Value *= State->GetParameter(multipliers[midx]); } - return Value; } @@ -288,33 +190,13 @@ float FGCoefficient::Value(float rVal, float cVal) float FGCoefficient::Value(float Val) { + float Value; + + SD = Value = Table->GetValue(Val); + for (unsigned int midx=0; midx < multipliers.size(); midx++) + Value *= State->GetParameter(multipliers[midx]); - float Factor, Value; - int r; - unsigned midx; - - if (rows < 2) return 0.0; - - for (r=1;r<=rows;r++) if (Table[r][0] >= Val) break; - r = r < 2 ? 2 : (r > rows ? rows : r); - - // make sure denominator below does not go to zero. - if (Table[r][0] != Table[r-1][0]) { - Factor = (Val - Table[r-1][0]) / (Table[r][0] - Table[r-1][0]); - } else { - Factor = 1.0; - } - - Value = Factor*(Table[r][1] - Table[r-1][1]) + Table[r-1][1]; - Value = (Value + bias)*gain; - SD = Value; - - for (midx=0; midx < multipliers.size(); midx++) { - Value *= State->GetParameter(multipliers[midx]); - - } - return Value; } @@ -323,15 +205,11 @@ float FGCoefficient::Value(float Val) float FGCoefficient::Value(void) { float Value; - unsigned midx; - Value = StaticValue; - Value = (Value + bias)*gain; - SD = Value; + SD = Value = StaticValue; - for (midx=0; midx < multipliers.size(); midx++) { + for (unsigned int midx=0; midx < multipliers.size(); midx++) Value *= State->GetParameter(multipliers[midx]); - } return Value; } @@ -340,6 +218,7 @@ float FGCoefficient::Value(void) float FGCoefficient::TotalValue() { + switch(type) { case 0: return -1; @@ -364,3 +243,8 @@ void FGCoefficient::DumpSD(void) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +void FGCoefficient::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGCoefficient.h b/src/FDM/JSBSim/FGCoefficient.h index 9c8bdf3ad..5cd6799c3 100644 --- a/src/FDM/JSBSim/FGCoefficient.h +++ b/src/FDM/JSBSim/FGCoefficient.h @@ -46,12 +46,13 @@ INCLUDES #include #include "FGConfigFile.h" #include "FGDefs.h" +#include "FGTable.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_COEFFICIENT "$Header" +#define ID_COEFFICIENT "$Id$" using std::vector; @@ -105,13 +106,12 @@ class FGCoefficient string name; string method; float StaticValue; - float **Table; eParam LookupR, LookupC; MultVec multipliers; int rows, columns; Type type; float SD; // Actual stability derivative (or other coefficient) value - float gain,bias; + FGTable *Table; FGFDMExec* FDMExec; FGState* State; @@ -123,14 +123,11 @@ class FGCoefficient FGPosition* Position; FGAuxiliary* Auxiliary; FGOutput* Output; - - bool DeAllocate(void); - bool Allocate(int, int); public: FGCoefficient(FGFDMExec*, FGConfigFile*); - ~FGCoefficient(void); - + ~FGCoefficient(); + float Value(float, float); float Value(float); float Value(void); @@ -139,14 +136,10 @@ public: inline float GetSD(void) {return SD;} inline MultVec Getmultipliers(void) {return multipliers;} void DumpSD(void); - - inline float GetGain(void) { return gain; } - inline float GetBias(void) { return bias; } - inline void SetGain(float tt) { gain = tt; } - inline void SetBias(float tt) { bias = tt; } - inline void ResetGB(void) { gain = 1.0; bias = 0.0; } - +private: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGConfigFile.cpp b/src/FDM/JSBSim/FGConfigFile.cpp index f74a1c128..4d756992f 100644 --- a/src/FDM/JSBSim/FGConfigFile.cpp +++ b/src/FDM/JSBSim/FGConfigFile.cpp @@ -21,9 +21,11 @@ INCLUDES #include #include -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = "ID_CONFIGFILE"; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -36,21 +38,28 @@ FGConfigFile::FGConfigFile(string cfgFileName) Opened = true; if (cfgfile.is_open()) GetNextConfigLine(); else Opened = false; + + if (debug_lvl & 2) cout << "Instantiated: FGConfigFile" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGConfigFile::~FGConfigFile(void) +FGConfigFile::~FGConfigFile() { cfgfile.close(); + if (debug_lvl & 2) cout << "Destroyed: FGConfigFile" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGConfigFile::GetNextConfigLine(void) { do { CurrentLine = GetLine(); - if (CurrentLine.find("") != CurrentLine.npos) CommentsOn = true; - if (CurrentLine.find("") != CurrentLine.npos) { + if ((CurrentLine.find("") != CurrentLine.npos) || + (CurrentLine.find("") != CurrentLine.npos)) { CommentsOn = false; GetNextConfigLine(); } @@ -60,6 +69,7 @@ string FGConfigFile::GetNextConfigLine(void) return CurrentLine; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGConfigFile::GetValue(string val) { @@ -128,12 +138,14 @@ string FGConfigFile::GetValue(string val) return string(""); } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGConfigFile::GetValue(void) { return GetValue(""); } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGConfigFile::IsCommentLine(void) { @@ -143,11 +155,12 @@ bool FGConfigFile::IsCommentLine(void) return false; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% string FGConfigFile::GetLine(void) { string scratch = ""; - unsigned int test; + int test; while ((test = cfgfile.get()) != EOF) { if (test >= 0x20) { @@ -163,6 +176,8 @@ string FGConfigFile::GetLine(void) return scratch; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FGConfigFile& FGConfigFile::operator>>(double& val) { unsigned int pos, end; @@ -178,6 +193,8 @@ FGConfigFile& FGConfigFile::operator>>(double& val) return *this; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FGConfigFile& FGConfigFile::operator>>(float& val) { unsigned int pos, end; @@ -193,6 +210,8 @@ FGConfigFile& FGConfigFile::operator>>(float& val) return *this; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FGConfigFile& FGConfigFile::operator>>(int& val) { unsigned int pos, end; @@ -208,6 +227,8 @@ FGConfigFile& FGConfigFile::operator>>(int& val) return *this; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FGConfigFile& FGConfigFile::operator>>(eParam& val) { unsigned int pos, end; @@ -223,6 +244,8 @@ FGConfigFile& FGConfigFile::operator>>(eParam& val) return *this; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FGConfigFile& FGConfigFile::operator>>(string& str) { unsigned int pos, end; @@ -237,9 +260,17 @@ FGConfigFile& FGConfigFile::operator>>(string& str) return *this; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGConfigFile::ResetLineIndexToZero(void) { CurrentIndex = 0; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGConfigFile::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGConfigFile.h b/src/FDM/JSBSim/FGConfigFile.h index 60e2d57e5..e5064cbcb 100644 --- a/src/FDM/JSBSim/FGConfigFile.h +++ b/src/FDM/JSBSim/FGConfigFile.h @@ -40,7 +40,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -56,7 +56,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_CONFIGFILE "$Header" +#define ID_CONFIGFILE "$Id$" using std::string; using std::ifstream; @@ -91,7 +91,7 @@ public: @param Filename the name of the config file to be read. */ FGConfigFile(string Filename); /// Destructor - ~FGConfigFile(void); + ~FGConfigFile(); string GetLine(void); string GetNextConfigLine(void); @@ -106,15 +106,15 @@ public: FGConfigFile& operator>>(eParam&); void ResetLineIndexToZero(void); -protected: - private: ifstream cfgfile; string CurrentLine; bool CommentsOn; bool Opened; unsigned int CurrentIndex; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGControls.cpp b/src/FDM/JSBSim/FGControls.cpp index d1206f921..586651538 100644 --- a/src/FDM/JSBSim/FGControls.cpp +++ b/src/FDM/JSBSim/FGControls.cpp @@ -24,7 +24,7 @@ #include "FGControls.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = "ID_CONTROLS"; FGControls controls; @@ -53,8 +53,17 @@ FGControls::~FGControls() { // $Log$ -// Revision 1.21 2000/11/14 19:32:03 curt -// Nov. 14, 2000 JSBSim updates +// Revision 1.22 2001/03/29 23:04:51 curt +// Latest round of JSBSim updates. +// +// Revision 1.7 2001/03/22 14:10:24 jberndt +// Fixed ID comment +// +// Revision 1.6 2001/02/04 13:16:13 jsb +// ** JSB ** Got rid of extra carriage return in code +// +// Revision 1.5 2001/02/02 01:16:57 jsb +// ** JSB ** trim, prop, gear changes // // 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 52a5a557f..ea9078356 100644 --- a/src/FDM/JSBSim/FGControls.h +++ b/src/FDM/JSBSim/FGControls.h @@ -29,7 +29,7 @@ # error This library requires C++ #endif -#define ID_CONTROLS "$Header" +#define ID_CONTROLS "$Id" // Define a structure containing the control parameters @@ -178,8 +178,17 @@ extern FGControls controls; // $Log$ -// Revision 1.20 2000/11/14 19:32:03 curt -// Nov. 14, 2000 JSBSim updates +// Revision 1.21 2001/03/29 23:04:51 curt +// Latest round of JSBSim updates. +// +// Revision 1.10 2001/03/22 14:10:24 jberndt +// Fixed ID comment +// +// Revision 1.9 2001/02/04 13:16:13 jsb +// ** JSB ** Got rid of extra carriage return in code +// +// Revision 1.8 2001/02/02 01:16:57 jsb +// ** JSB ** trim, prop, gear changes // // 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 07c86c0b0..1de1ba3db 100644 --- a/src/FDM/JSBSim/FGDefs.h +++ b/src/FDM/JSBSim/FGDefs.h @@ -54,13 +54,15 @@ SENTRY #define FPSTOKTS 0.592484 #define INCHTOFT 0.08333333 #define OMEGA_EARTH .00007272205217 -#define NEEDED_CFG_VERSION "1.36" +#define NEEDED_CFG_VERSION "1.38" +#define JSBSIM_VERSION "0.8.2" #define HPTOFTLBSSEC 550 #define METERS_TO_FEET 3.2808 enum eParam { FG_UNDEF = 0, + FG_TIME, FG_QBAR, FG_WINGAREA, FG_WINGSPAN, @@ -69,7 +71,7 @@ enum eParam { FG_ALPHADOT, FG_BETA, FG_BETADOT, - SGD_PITCHRATE, + FG_PITCHRATE, FG_ROLLRATE, FG_YAWRATE, FG_MACH, @@ -90,8 +92,21 @@ enum eParam { FG_FLAPS_CMD, FG_THROTTLE_CMD, FG_THROTTLE_POS, + FG_ACTIVE_ENGINE, FG_HOVERB, - SGD_PITCH_TRIM_CMD + FG_PITCH_TRIM_CMD +}; + +enum eAction { + FG_RAMP = 1, + FG_STEP = 2, + FG_EXP = 3 +}; + +enum eType { + FG_VALUE = 1, + FG_DELTA = 2, + FG_BOOL = 3 }; /******************************************************************************/ diff --git a/src/FDM/JSBSim/FGEngine.cpp b/src/FDM/JSBSim/FGEngine.cpp index 38b16a909..7e94a01a7 100644 --- a/src/FDM/JSBSim/FGEngine.cpp +++ b/src/FDM/JSBSim/FGEngine.cpp @@ -40,7 +40,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -50,35 +50,24 @@ INCLUDES #endif #include "FGEngine.h" -#include "FGState.h" -#include "FGFDMExec.h" -#include "FGAtmosphere.h" -#include "FGFCS.h" -#include "FGAircraft.h" -#include "FGTranslation.h" -#include "FGRotation.h" -#include "FGPosition.h" -#include "FGAuxiliary.h" -#include "FGOutput.h" -#include "FGDefs.h" - -static const char *IdSrc = "$Header$"; +#include "FGTank.h" + +static const char *IdSrc = "$Id$"; static const char *IdHdr = "ID_ENGINE"; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -FGEngine::FGEngine(FGFDMExec* fdex, string enginePath, string engineName, int num) { - string fullpath; - string tag; - - FDMExec = fdex; - +FGEngine::FGEngine(FGFDMExec* exec) { + FDMExec = exec; State = FDMExec->GetState(); Atmosphere = FDMExec->GetAtmosphere(); FCS = FDMExec->GetFCS(); + Propulsion = FDMExec->GetPropulsion(); Aircraft = FDMExec->GetAircraft(); Translation = FDMExec->GetTranslation(); Rotation = FDMExec->GetRotation(); @@ -86,152 +75,82 @@ FGEngine::FGEngine(FGFDMExec* fdex, string enginePath, string engineName, int nu Auxiliary = FDMExec->GetAuxiliary(); Output = FDMExec->GetOutput(); - Name = engineName; - -# ifndef macintosh - fullpath = enginePath + "/" + engineName + ".xml"; -# else - fullpath = enginePath + ";" + engineName + ".xml"; -# endif - - cout << " Reading engine: " << engineName << " from file: " << fullpath << endl; - ifstream enginefile(fullpath.c_str()); - - if (enginefile) { - enginefile >> tag; - - if (tag == "ROCKET") Type = etRocket; - else if (tag == "PISTON") Type = etPiston; - else if (tag == "TURBOPROP") Type = etTurboProp; - else if (tag == "TURBOJET") Type = etTurboJet; - else Type = etUnknown; - - switch(Type) { - case etTurboProp: - case etTurboJet: - cerr << "Unsupported Engine type" << tag << endl; - break; - case etUnknown: - cerr << "Unknown engine type: " << tag << endl; - break; - case etPiston: - enginefile >> X; - enginefile >> Y; - enginefile >> Z; - enginefile >> EnginePitch; - enginefile >> EngineYaw; - enginefile >> BrakeHorsePower; - enginefile >> MaxThrottle; - enginefile >> MinThrottle; - enginefile >> SLFuelFlowMax; - enginefile >> SpeedSlope; - enginefile >> SpeedIntercept; - enginefile >> AltitudeSlope; - - break; - case etRocket: - enginefile >> X; - enginefile >> Y; - enginefile >> Z; - enginefile >> EnginePitch; - enginefile >> EngineYaw; - enginefile >> SLThrustMax; - enginefile >> VacThrustMax; - enginefile >> MaxThrottle; - enginefile >> MinThrottle; - enginefile >> SLFuelFlowMax; - enginefile >> SLOxiFlowMax; - break; - } - - enginefile.close(); - } else { - cerr << "Unable to open engine definition file " << fullpath.c_str() << endl; - } - - EngineNumber = num; Thrust = PctPower = 0.0; Starved = Flameout = false; Running = true; -} - - -FGEngine::~FGEngine(void) {} - -float FGEngine::CalcRocketThrust(void) { - float lastThrust; - - Throttle = FCS->GetThrottlePos(EngineNumber); - lastThrust = Thrust; // last actual thrust + if (debug_lvl & 2) cout << "Instantiated: FGEngine" << endl; + TrimMode = false; +} - if (Throttle < MinThrottle || Starved) { - PctPower = Thrust = 0.0; // desired thrust - Flameout = true; - } else { - PctPower = Throttle / MaxThrottle; - Thrust = PctPower*((1.0 - Atmosphere->GetDensityRatio())*(VacThrustMax - SLThrustMax) + - SLThrustMax); // desired thrust - Flameout = false; - } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FGEngine::~FGEngine() +{ + if (debug_lvl & 2) cout << "Destroyed: FGEngine" << endl; +} - if(State->Getdt() > 0.0) { - Thrust -= 0.8*(Thrust - lastThrust); // actual thrust +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +// This base class function should be called from within the +// derived class' Calculate() function before any other calculations are done. +// This base class method removes fuel from the fuel tanks as appropriate, +// and sets the starved flag if necessary. + +void FGEngine::ConsumeFuel(void) { + float Fshortage, Oshortage; + FGTank* Tank; + + if (TrimMode) return; + + Fshortage = Oshortage = 0.0; + for (unsigned int i=0; iGetTank(i); + if (Tank->GetType() == FGTank::ttFUEL) { + Fshortage += Tank->Reduce(CalcFuelNeed()/Propulsion->GetnumSelectedFuelTanks()); + } else { + Oshortage += Tank->Reduce(CalcOxidizerNeed()/Propulsion->GetnumSelectedOxiTanks()); + } } - return Thrust; + if (Fshortage < 0.00 || Oshortage < 0.00) Starved = true; + else Starved = false; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -float FGEngine::CalcPistonThrust(void) { - float v,h,pa; - - Throttle = FCS->GetThrottlePos(EngineNumber); - Throttle /= 100; - - v = Translation->GetVt(); - h = Position->Geth(); - - if (v < 10) - v = 10; - if (h < 0) - h = 0; - - pa=(SpeedSlope*v + SpeedIntercept)*(1 +AltitudeSlope*h)*BrakeHorsePower; +float FGEngine::CalcFuelNeed(void) { + FuelNeed = SLFuelFlowMax*PctPower*State->Getdt()*Propulsion->GetRate(); + return FuelNeed; +} - Thrust = Throttle*(pa*HPTOFTLBSSEC)/v; +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - return Thrust; +float FGEngine::CalcOxidizerNeed(void) { + OxidizerNeed = SLOxiFlowMax*PctPower*State->Getdt()*Propulsion->GetRate(); + return OxidizerNeed; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -float FGEngine::CalcThrust(void) { - if(Running) { - switch(Type) { - case etRocket: - return CalcRocketThrust(); - // break; - case etPiston: - return CalcPistonThrust(); - // break; - default: - return 9999.0; - // break; - } - } else { - return 0; - } +void FGEngine::SetPlacement(float x, float y, float z, float pitch, float yaw) { + X = x; + Y = y; + Z = z; + EnginePitch = pitch; + EngineYaw = yaw; } -float FGEngine::CalcFuelNeed() { - FuelNeed = SLFuelFlowMax*PctPower; - return FuelNeed; +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGEngine::AddFeedTank(int tkID) +{ + SourceTanks.push_back(tkID); } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -float FGEngine::CalcOxidizerNeed() { - OxidizerNeed = SLOxiFlowMax*PctPower; - return OxidizerNeed; +void FGEngine::Debug(void) +{ + //TODO: Add your source code here } diff --git a/src/FDM/JSBSim/FGEngine.h b/src/FDM/JSBSim/FGEngine.h index 8c86c2d85..fb23f9751 100644 --- a/src/FDM/JSBSim/FGEngine.h +++ b/src/FDM/JSBSim/FGEngine.h @@ -1,44 +1,44 @@ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - + Header: FGEngine.h Author: Jon S. Berndt Date started: 01/21/99 - + ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) ------------- - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. - + FUNCTIONAL DESCRIPTION -------------------------------------------------------------------------------- - + Based on Flightgear code, which is based on LaRCSim. This class simulates a generic engine. - + HISTORY -------------------------------------------------------------------------------- 01/21/99 JSB Created - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#ifndef FGEngine_H -#define FGEngine_H +#ifndef FGENGINE_H +#define FGENGINE_H /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES @@ -47,21 +47,27 @@ INCLUDES #ifdef FGFS # include # include STL_STRING -SG_USING_STD(string); + SG_USING_STD(string); +# ifdef FG_HAVE_STD_INCLUDES +# include +# else +# include +# endif #else +# include # include #endif /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -DEFINES +DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_ENGINE "$Header" +#define ID_ENGINE "$Id$" using std::string; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -CLASS DECLARATION +FORWARD DECLARATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGFDMExec; @@ -71,58 +77,101 @@ class FGFCS; class FGAircraft; class FGTranslation; class FGRotation; +class FGPropulsion; class FGPosition; class FGAuxiliary; class FGOutput; +using std::vector; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Base class for all engines. + This base class contains methods and members common to all engines, such as + logic to drain fuel from the appropriate tank, etc. + @author Jon S. Berndt + @version $Id$ +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DECLARATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + class FGEngine { public: - FGEngine(FGFDMExec*, string, string, int); - ~FGEngine(void); + FGEngine(FGFDMExec* exec); + virtual ~FGEngine(); enum EngineType {etUnknown, etRocket, etPiston, etTurboProp, etTurboJet}; + virtual float GetThrottleMin(void) { return MinThrottle; } + virtual float GetThrottleMax(void) { return MaxThrottle; } float GetThrottle(void) { return Throttle; } float GetThrust(void) { return Thrust; } - float GetThrottleMin(void) { return MinThrottle; } - float GetThrottleMax(void) { return MaxThrottle; } bool GetStarved(void) { return Starved; } bool GetFlameout(void) { return Flameout; } bool GetRunning(void) { return Running; } int GetType(void) { return Type; } - string GetName() { return Name; } - - void SetStarved(bool tt) { - Starved = tt; - } - void SetStarved(void) { - Starved = true; - } - + string GetName(void) { return Name; } + + void SetStarved(bool tt) {Starved = tt;} + void SetStarved(void) {Starved = true;} + void SetRunning(bool bb) { Running=bb; } - - float CalcThrust(void); + void SetName(string name) {Name = name;} + void AddFeedTank(int tkID); + + /** Calculates the thrust of the engine, and other engine functions. + @param PowerRequired this is the power required to run the thrusting device + such as a propeller. This resisting effect must be provided to the + engine model. + @return Thrust in pounds */ + virtual float Calculate(float PowerRequired) {return 0.0;}; + + /** Reduces the fuel in the active tanks by the amount required. + This function should be called from within the + derived class' Calculate() function before any other calculations are + done. This base class method removes fuel from the fuel tanks as + appropriate, and sets the starved flag if necessary. */ + void ConsumeFuel(void); + + /** The fuel need is calculated based on power levels and flow rate for that + power level. It is also turned from a rate into an actual amount (pounds) + by multiplying it by the delta T and the rate. + @return Total fuel requirement for this engine in pounds. */ float CalcFuelNeed(void); + + /** The oxidizer need is calculated based on power levels and flow rate for that + power level. It is also turned from a rate into an actual amount (pounds) + by multiplying it by the delta T and the rate. + @return Total oxidizer requirement for this engine in pounds. */ float CalcOxidizerNeed(void); -private: + /// Sets engine placement information + void SetPlacement(float x, float y, float z, float pitch, float yaw); + + virtual float GetPowerAvailable(void) {return 0.0;}; + + bool GetTrimMode(void) {return TrimMode;} + void SetTrimMode(bool state) {TrimMode = state;} + +protected: string Name; EngineType Type; float X, Y, Z; float EnginePitch; float EngineYaw; - float SLThrustMax; - float VacThrustMax; float SLFuelFlowMax; float SLOxiFlowMax; float MaxThrottle; float MinThrottle; - float BrakeHorsePower; - float SpeedSlope; - float SpeedIntercept; - float AltitudeSlope; - float Thrust; float Throttle; float FuelNeed, OxidizerNeed; @@ -131,11 +180,13 @@ private: bool Running; float PctPower; int EngineNumber; + bool TrimMode; FGFDMExec* FDMExec; FGState* State; FGAtmosphere* Atmosphere; FGFCS* FCS; + FGPropulsion* Propulsion; FGAircraft* Aircraft; FGTranslation* Translation; FGRotation* Rotation; @@ -143,11 +194,23 @@ private: FGAuxiliary* Auxiliary; FGOutput* Output; -protected: - float CalcRocketThrust(void); - float CalcPistonThrust(void); - + vector SourceTanks; + void Debug(void); }; +#include "FGState.h" +#include "FGFDMExec.h" +#include "FGAtmosphere.h" +#include "FGFCS.h" +#include "FGAircraft.h" +#include "FGTranslation.h" +#include "FGRotation.h" +#include "FGPropulsion.h" +#include "FGPosition.h" +#include "FGAuxiliary.h" +#include "FGOutput.h" +#include "FGDefs.h" + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGFCS.cpp b/src/FDM/JSBSim/FGFCS.cpp index e434759fb..21bb6b232 100644 --- a/src/FDM/JSBSim/FGFCS.cpp +++ b/src/FDM/JSBSim/FGFCS.cpp @@ -56,43 +56,45 @@ INCLUDES #include "filtersjb/FGSummer.h" #include "filtersjb/FGFlaps.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = "ID_FCS"; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex) { Name = "FGFCS"; - for (int i=0; i < MAX_ENGINES; i++) { // needs to be changed: no limit - ThrottleCmd[i] = 0.0; - ThrottlePos[i] = 0.0; - } + DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = PTrimCmd = 0.0; DaPos = DePos = DrPos = DfPos = DsbPos = DspPos = 0.0; + LeftBrake = RightBrake = CenterBrake = 0.0; + + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGFCS::~FGFCS(void) { - for(unsigned int i=0;iGetNumEngines(); i++) ThrottlePos[i]=ThrottleCmd[i]; - - for (unsigned int i=0; iRun(); - } - - } else {} - + for (unsigned int i=0; iRun(); + } else { + } return false; } @@ -101,7 +103,7 @@ bool FGFCS::Run(void) { void FGFCS::SetThrottleCmd(int engineNum, float setting) { if (engineNum < 0) { - for (unsigned int ctr=0;ctrGetNumEngines();ctr++) ThrottleCmd[ctr] = setting; + for (unsigned int ctr=0;ctrGetNumEngines();ctr++) ThrottlePos[ctr] = ThrottleCmd[ctr]; + for (unsigned int ctr=0;ctr<=ThrottleCmd.size();ctr++) ThrottlePos[ctr] = ThrottleCmd[ctr]; } else { ThrottlePos[engineNum] = setting; } @@ -130,7 +132,6 @@ bool FGFCS::LoadFCS(FGConfigFile* AC_cfg) { token = AC_cfg->GetValue("TYPE"); cout << " Loading Component \"" << AC_cfg->GetValue("NAME") << "\" of type: " << token << endl; if ((token == "LAG_FILTER") || - (token == "RECT_LAG_FILTER") || (token == "LEAD_LAG_FILTER") || (token == "SECOND_ORDER_FILTER") || (token == "WASHOUT_FILTER") || @@ -152,6 +153,9 @@ bool FGFCS::LoadFCS(FGConfigFile* AC_cfg) { Components.push_back(new FGSwitch(this, AC_cfg)); } else if (token == "FLAPS") { Components.push_back(new FGFlaps(this, AC_cfg)); + } else { + cerr << "Unknown token [" << token << "] in FCS portion of config file" << endl; + return false; } AC_cfg->GetNextConfigLine(); } @@ -173,7 +177,7 @@ string FGFCS::GetComponentName(int idx) { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -float FGFCS::GetBrake(FGLGear::eBrakeGroup bg) { +float FGFCS::GetBrake(FGLGear::BrakeGroup bg) { switch (bg) { case FGLGear::bgLeft: return LeftBrake; @@ -184,6 +188,7 @@ float FGFCS::GetBrake(FGLGear::eBrakeGroup bg) { default: cerr << "GetBrake asked to return a bogus brake value" << endl; } + return 0.0; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -204,7 +209,8 @@ string FGFCS::GetComponentStrings(void){ //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -string FGFCS::GetComponentValues(void){ +string FGFCS::GetComponentValues(void) +{ string CompValues = ""; char buffer[10]; bool firstime = true; @@ -219,3 +225,19 @@ string FGFCS::GetComponentValues(void){ return CompValues; } + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGFCS::AddThrottle(void) +{ + ThrottleCmd.push_back(0.0); + ThrottlePos.push_back(0.0); +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGFCS::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGFCS.h b/src/FDM/JSBSim/FGFCS.h index 4643e1c35..2b9899888 100644 --- a/src/FDM/JSBSim/FGFCS.h +++ b/src/FDM/JSBSim/FGFCS.h @@ -40,7 +40,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -59,7 +59,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_FCS "$Header" +#define ID_FCS "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -89,7 +89,7 @@ CLASS DOCUMENTATION < COMPONENT NAME="Pitch Trim Sum" TYPE="SUMMER"> ID 0 INPUT FG_ELEVATOR_CMD - INPUT SGD_PITCH_TRIM_CMD + INPUT FG_PITCH_TRIM_CMD CLIPTO -1 1 </COMPONENT> @@ -161,7 +161,7 @@ public: @param Executive a pointer to the parent executive object */ FGFCS(FGFDMExec*); /// Destructor - ~FGFCS(void); + ~FGFCS(); /** Runs the Flight Controls model; called by the Executive @return false if no error */ @@ -308,7 +308,7 @@ public: /** 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); + float GetBrake(FGLGear::BrakeGroup bg); //@} /** Loads the Flight Control System. @@ -322,19 +322,22 @@ public: /** 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; - + + void AddThrottle(void); + 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 + vector ThrottleCmd; + vector ThrottlePos; float LeftBrake, RightBrake, CenterBrake; // Brake settings vector Components; - + void Debug(void); }; #include "FGState.h" #endif + diff --git a/src/FDM/JSBSim/FGFDMExec.cpp b/src/FDM/JSBSim/FGFDMExec.cpp index caf4b9d14..d98f24038 100644 --- a/src/FDM/JSBSim/FGFDMExec.cpp +++ b/src/FDM/JSBSim/FGFDMExec.cpp @@ -34,42 +34,84 @@ HISTORY -------------------------------------------------------------------------------- 11/17/98 JSB Created +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # include +# include # else # include # include +# include # endif #else # include # include +# include #endif #include "FGFDMExec.h" #include "FGState.h" #include "FGAtmosphere.h" #include "FGFCS.h" +#include "FGPropulsion.h" #include "FGAircraft.h" #include "FGTranslation.h" #include "FGRotation.h" #include "FGPosition.h" #include "FGAuxiliary.h" #include "FGOutput.h" +#include "FGConfigFile.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = "ID_FDMEXEC"; +char highint[5] = {27, '[', '1', 'm', '\0' }; +char halfint[5] = {27, '[', '2', 'm', '\0' }; +char normint[6] = {27, '[', '2', '2', 'm', '\0' }; +char reset[5] = {27, '[', '0', 'm', '\0' }; +char underon[5] = {27, '[', '4', 'm', '\0' }; +char underoff[6] = {27, '[', '2', '4', 'm', '\0' }; +char fgblue[6] = {27, '[', '3', '4', 'm', '\0' }; +char fgcyan[6] = {27, '[', '3', '6', 'm', '\0' }; +char fgred[6] = {27, '[', '3', '1', 'm', '\0' }; +char fggreen[6] = {27, '[', '3', '2', 'm', '\0' }; +char fgdef[6] = {27, '[', '3', '9', 'm', '\0' }; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -CLASS IMPLEMENTATION +GLOBAL DECLARATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +short debug_lvl; // This describes to any interested entity the debug level + // requested by setting the JSBSIM_DEBUG environment variable. + // The bitmasked value choices are as follows: + // a) unset: In this case (the default) JSBSim would only print + // out the normally expected messages, essentially echoing + // the config files as they are read. If the environment + // variable is not set, debug_lvl is set to 1 internally + // b) 0: This requests JSBSim not to output any messages + // whatsoever. + // c) 1: This value explicity requests the normal JSBSim + // startup messages + // d) 2: This value asks for a message to be printed out when + // a class is instantiated + // e) 4: When this value is set, a message is displayed when a + // FGModel object executes its Run() method + // f) 8: When this value is set, various runtime state variables + // are printed out periodically + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS IMPLEMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ // Constructor @@ -80,6 +122,7 @@ FGFDMExec::FGFDMExec(void) State = 0; Atmosphere = 0; FCS = 0; + Propulsion = 0; Aircraft = 0; Translation = 0; Rotation = 0; @@ -90,23 +133,42 @@ FGFDMExec::FGFDMExec(void) terminate = false; frozen = false; modelLoaded = false; - + Scripted = false; + + cout << "\n\n " << highint << underon << "JSBSim Flight Dynamics Model v" + << JSBSIM_VERSION << underoff << normint << endl; + cout << halfint << " [cfg file spec v" << NEEDED_CFG_VERSION << "]\n\n"; + cout << normint << "JSBSim startup beginning ...\n\n"; + + try { + char* num = getenv("JSBSIM_DEBUG"); + if (!num) debug_lvl = 1; + else debug_lvl = atoi(num); // set debug level + } catch (...) { // if error set to 1 + debug_lvl = 1; + } + + if (debug_lvl & 2) cout << "Instantiated: FGFDMExec" << endl; + Allocate(); - } -FGFDMExec::~FGFDMExec(void){ - - DeAllocate(); +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FGFDMExec::~FGFDMExec() { + DeAllocate(); + if (debug_lvl & 2) cout << "Destroyed: FGFDMExec" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + bool FGFDMExec::Allocate(void) { - + bool result=true; - + Atmosphere = new FGAtmosphere(this); FCS = new FGFCS(this); + Propulsion = new FGPropulsion(this); Aircraft = new FGAircraft(this); Translation = new FGTranslation(this); Rotation = new FGRotation(this); @@ -118,39 +180,62 @@ bool FGFDMExec::Allocate(void) { // Initialize models so they can communicate with each other - if (!Atmosphere->InitModel()) {cerr << "Atmosphere model init failed"; Error+=1;} - if (!FCS->InitModel()) {cerr << "FCS model init failed"; Error+=2;} - if (!Aircraft->InitModel()) {cerr << "Aircraft model init failed"; Error+=4;} - if (!Translation->InitModel()){cerr << "Translation model init failed"; Error+=8;} - if (!Rotation->InitModel()) {cerr << "Rotation model init failed"; Error+=16;} - if (!Position->InitModel()) {cerr << "Position model init failed"; Error+=32;} - if (!Auxiliary->InitModel()) {cerr << "Auxiliary model init failed"; Error+=64;} - if (!Output->InitModel()) {cerr << "Output model init failed"; Error+=128;} - - if(Error > 0) result=false; - + if (!Atmosphere->InitModel()) { + cerr << fgred << "Atmosphere model init failed" << fgdef << endl; + Error+=1;} + if (!FCS->InitModel()) { + cerr << fgred << "FCS model init failed" << fgdef << endl; + Error+=2;} + if (!Propulsion->InitModel()) { + cerr << fgred << "FGPropulsion model init failed" << fgdef << endl; + Error+=4;} + if (!Aircraft->InitModel()) { + cerr << fgred << "Aircraft model init failed" << fgdef << endl; + Error+=8;} + if (!Translation->InitModel()){ + cerr << fgred << "Translation model init failed" << fgdef << endl; + Error+=16;} + if (!Rotation->InitModel()) { + cerr << fgred << "Rotation model init failed" << fgdef << endl; + Error+=32;} + if (!Position->InitModel()) { + cerr << fgred << "Position model init failed" << fgdef << endl; + Error+=64;} + if (!Auxiliary->InitModel()) { + cerr << fgred << "Auxiliary model init failed" << fgdef << endl; + Error+=128;} + if (!Output->InitModel()) { + cerr << fgred << "Output model init failed" << fgdef << endl; + Error+=256;} + + if (Error > 0) result = false; + // Schedule a model. The second arg (the integer) is the pass number. For // instance, the atmosphere model gets executed every fifth pass it is called // by the executive. Everything else here gets executed each pass. Schedule(Atmosphere, 1); Schedule(FCS, 1); + Schedule(Propulsion, 1); Schedule(Aircraft, 1); Schedule(Rotation, 1); Schedule(Translation, 1); Schedule(Position, 1); Schedule(Auxiliary, 1); Schedule(Output, 1); - + modelLoaded = false; - return result; + return result; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + bool FGFDMExec::DeAllocate(void) { - + if ( Atmosphere != 0 ) delete Atmosphere; if ( FCS != 0 ) delete FCS; + if ( Propulsion != 0) delete Propulsion; if ( Aircraft != 0 ) delete Aircraft; if ( Translation != 0 ) delete Translation; if ( Rotation != 0 ) delete Rotation; @@ -165,6 +250,7 @@ bool FGFDMExec::DeAllocate(void) { State = 0; Atmosphere = 0; FCS = 0; + Propulsion = 0; Aircraft = 0; Translation = 0; Rotation = 0; @@ -173,9 +259,10 @@ bool FGFDMExec::DeAllocate(void) { Output = 0; modelLoaded = false; - + return modelLoaded; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% int FGFDMExec::Schedule(FGModel* model, int rate) { @@ -201,6 +288,7 @@ int FGFDMExec::Schedule(FGModel* model, int rate) return 0; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGFDMExec::Run(void) { @@ -211,8 +299,14 @@ bool FGFDMExec::Run(void) model_iterator = FirstModel; if (model_iterator == 0L) return false; - while (!model_iterator->Run()) - { + if (Scripted) { + RunScript(); + if (State->Getsim_time() >= EndTime) return false; + } + + if (debug_lvl & 4) cout << "=========================" << endl; + + while (!model_iterator->Run()) { model_iterator = model_iterator->NextModel; if (model_iterator == 0L) break; } @@ -222,6 +316,7 @@ bool FGFDMExec::Run(void) return true; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGFDMExec::RunIC(FGInitialCondition *fgic) { @@ -231,29 +326,305 @@ bool FGFDMExec::RunIC(FGInitialCondition *fgic) State->Resume(); return true; } - + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGFDMExec::LoadModel(string APath, string EPath, string model) { - bool result=false; - if(modelLoaded) { - DeAllocate(); - Allocate(); - } + bool result = false; + + if (modelLoaded) { + DeAllocate(); + Allocate(); + } + AircraftPath = APath; - EnginePath = EPath; + EnginePath = EPath; result = Aircraft->LoadAircraft(AircraftPath, EnginePath, model); if (result) { modelLoaded = true; } else { - cerr << "FGFDMExec: Failed to load aircraft and/or engine model" << endl; + cerr << fgred + << "FGFDMExec: Failed to load aircraft and/or engine model" + << fgdef << endl; } + cout << "\n\nJSBSim startup complete\n\n"; return result; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +bool FGFDMExec::LoadScript(string script) +{ + FGConfigFile Script(script); + string token=""; + string aircraft=""; + string initialize=""; + bool result=false; + float dt=0.0; + struct condition *newCondition; + + if (!Script.IsOpen()) return false; + + Script.GetNextConfigLine(); + ScriptName = Script.GetValue("name"); + Scripted = true; + cout << "Reading Script File " << ScriptName << endl; + + while (Script.GetNextConfigLine() != "EOF" && Script.GetValue() != "/runscript") { + token = Script.GetValue(); + if (token == "use") { + if ((token = Script.GetValue("aircraft")) != "") { + aircraft = token; + cout << " Use aircraft: " << token << endl; + } else if ((token = Script.GetValue("initialize")) != "") { + initialize = token; + cout << " Use reset file: " << token << endl; + } else { + cerr << "Unknown 'use' keyword: \"" << token << "\"" << endl; + } + } else if (token == "run") { + StartTime = strtod(Script.GetValue("start").c_str(), NULL); + State->Setsim_time(StartTime); + EndTime = strtod(Script.GetValue("end").c_str(), NULL); + dt = strtod(Script.GetValue("dt").c_str(), NULL); + State->Setdt(dt); + Script.GetNextConfigLine(); + token = Script.GetValue(); + while (token != "/run") { + + if (token == "when") { + Script.GetNextConfigLine(); + token = Script.GetValue(); + newCondition = new struct condition(); + while (token != "/when") { + if (token == "parameter") { + newCondition->TestParam.push_back(State->GetParameterIndex(Script.GetValue("name"))); + newCondition->TestValue.push_back(strtod(Script.GetValue("value").c_str(), NULL)); + newCondition->Comparison.push_back(Script.GetValue("comparison")); + } else if (token == "set") { + newCondition->SetParam.push_back(State->GetParameterIndex(Script.GetValue("name"))); + newCondition->SetValue.push_back(strtod(Script.GetValue("value").c_str(), NULL)); + newCondition->Triggered.push_back(false); + newCondition->OriginalValue.push_back(0.0); + newCondition->newValue.push_back(0.0); + newCondition->StartTime.push_back(0.0); + newCondition->EndTime.push_back(0.0); + string tempCompare = Script.GetValue("type"); + if (tempCompare == "FG_DELTA") newCondition->Type.push_back(FG_DELTA); + else if (tempCompare == "FG_BOOL") newCondition->Type.push_back(FG_BOOL); + else if (tempCompare == "FG_VALUE") newCondition->Type.push_back(FG_VALUE); + else newCondition->Type.push_back((eType)0); + tempCompare = Script.GetValue("action"); + if (tempCompare == "FG_RAMP") newCondition->Action.push_back(FG_RAMP); + else if (tempCompare == "FG_STEP") newCondition->Action.push_back(FG_STEP); + else if (tempCompare == "FG_EXP") newCondition->Action.push_back(FG_EXP); + else newCondition->Action.push_back((eAction)0); + + if (Script.GetValue("persistent") == "true") + newCondition->Persistent.push_back(true); + else + newCondition->Persistent.push_back(false); + + newCondition->TC.push_back(strtod(Script.GetValue("tc").c_str(), NULL)); + + } else { + cerr << "Unrecognized keyword in script file: \" [when] " << token << "\"" << endl; + } + Script.GetNextConfigLine(); + token = Script.GetValue(); + } + Conditions.push_back(*newCondition); + Script.GetNextConfigLine(); + token = Script.GetValue(); + + } else { + cerr << "Error reading script file: expected \"when\", got \"" << token << "\"" << endl; + } + + } + } else { + cerr << "Unrecognized keyword in script file: \"" << token << "\" [runscript] " << endl; + } + } + + if (aircraft == "") { + cerr << "Aircraft file not loaded in script" << endl; + exit(-1); + } + + // print out conditions for double-checking + + vector ::iterator iterConditions = Conditions.begin(); + + int count=0; + + cout << "\n Script goes from " << StartTime << " to " << EndTime + << " with dt = " << dt << endl << endl; + + while (iterConditions < Conditions.end()) { + cout << " Condition: " << count++ << endl; + cout << " if ("; + + for (int i=0; iTestValue.size(); i++) { + if (i>0) cout << " and" << endl << " "; + cout << "(" << State->paramdef[iterConditions->TestParam[i]] + << iterConditions->Comparison[i] << " " + << iterConditions->TestValue[i] << ")"; + } + cout << ") then {" << endl; + + for (int i=0; iSetValue.size(); i++) { + cout << " set" << State->paramdef[iterConditions->SetParam[i]] + << "to " << iterConditions->SetValue[i]; + + switch (iterConditions->Type[i]) { + case FG_VALUE: + cout << " (constant"; + break; + case FG_DELTA: + cout << " (delta"; + break; + case FG_BOOL: + cout << " (boolean"; + break; + default: + cout << " (unspecified type"; + } + + switch (iterConditions->Action[i]) { + case FG_RAMP: + cout << " via ramp"; + break; + case FG_STEP: + cout << " via step"; + break; + case FG_EXP: + cout << " via exponential approach"; + break; + default: + cout << " via unspecified action"; + } + + if (!iterConditions->Persistent[i]) cout << endl + << " once"; + else cout << endl + << " repeatedly"; + + if (iterConditions->Action[i] == FG_RAMP || + iterConditions->Action[i] == FG_EXP) cout << endl + << " with time constant " + << iterConditions->TC[i]; + } + cout << ")" << endl << " }" << endl << endl; + + iterConditions++; + } + + cout << endl; + + result = LoadModel("aircraft", "engine", aircraft); + if (!result) { + cerr << "Aircraft file " << aircraft << " was not found" << endl; + exit(-1); + } + if ( ! State->Reset("aircraft", aircraft, initialize)) + State->Initialize(2000,0,0,0,0,0,0.5,0.5,40000); + + return true; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -bool FGFDMExec::RunScript(string script) +void FGFDMExec::RunScript(void) { + vector ::iterator iC = Conditions.begin(); + bool truth; + bool WholeTruth; + + int count=0; + + float currentTime = State->Getsim_time(); + float newSetValue; + + while (iC < Conditions.end()) { + // determine whether the set of conditional tests for this condition equate + // to true + for (int i=0; iTestValue.size(); i++) { + if (iC->Comparison[i] == "lt") + truth = State->GetParameter(iC->TestParam[i]) < iC->TestValue[i]; + else if (iC->Comparison[i] == "le") + truth = State->GetParameter(iC->TestParam[i]) <= iC->TestValue[i]; + else if (iC->Comparison[i] == "eq") + truth = State->GetParameter(iC->TestParam[i]) == iC->TestValue[i]; + else if (iC->Comparison[i] == "ge") + truth = State->GetParameter(iC->TestParam[i]) >= iC->TestValue[i]; + else if (iC->Comparison[i] == "gt") + truth = State->GetParameter(iC->TestParam[i]) > iC->TestValue[i]; + else if (iC->Comparison[i] == "ne") + truth = State->GetParameter(iC->TestParam[i]) != iC->TestValue[i]; + else + cerr << "Bad comparison" << endl; + + if (i == 0) WholeTruth = truth; + else WholeTruth = WholeTruth && truth; + + if (!truth && iC->Persistent[i] && iC->Triggered[i]) iC->Triggered[i] = false; + } + + // if the conditions are true, do the setting of the desired parameters + + if (WholeTruth) { + for (int i=0; iSetValue.size(); i++) { + if ( ! iC->Triggered[i]) { + iC->OriginalValue[i] = State->GetParameter(iC->SetParam[i]); + switch (iC->Type[i]) { + case FG_VALUE: + iC->newValue[i] = iC->SetValue[i]; + break; + case FG_DELTA: + iC->newValue[i] = iC->OriginalValue[i] + iC->SetValue[i]; + break; + case FG_BOOL: + break; + default: + cerr << "Invalid Type specified" << endl; + break; + } + iC->Triggered[i] = true; + iC->StartTime[i] = currentTime; + } + + switch (iC->Action[i]) { + case FG_RAMP: + newSetValue = (currentTime - iC->StartTime[i])/(iC->TC[i]) + * (iC->newValue[i] - iC->OriginalValue[i]) + iC->OriginalValue[i]; + if (newSetValue > iC->newValue[i]) newSetValue = iC->newValue[i]; + break; + case FG_STEP: + newSetValue = iC->newValue[i]; + break; + case FG_EXP: + newSetValue = (1 - exp(-(currentTime - iC->StartTime[i])/(iC->TC[i]))) + * (iC->newValue[i] - iC->OriginalValue[i]) + iC->OriginalValue[i]; + break; + default: + cerr << "Invalid Action specified" << endl; + break; + } + State->SetParameter(iC->SetParam[i], newSetValue); + } + } + iC++; + } } + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGFDMExec::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGFDMExec.h b/src/FDM/JSBSim/FGFDMExec.h index 7d36c4027..046b2403f 100644 --- a/src/FDM/JSBSim/FGFDMExec.h +++ b/src/FDM/JSBSim/FGFDMExec.h @@ -1,125 +1,331 @@ -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - Header: FGFDMExec.h - Author: Jon Berndt - Date started: 11/17/98 - - ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) ------------- - - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA. - - Further information about the GNU General Public License can also be found on - the world wide web at http://www.gnu.org. - -HISTORY --------------------------------------------------------------------------------- -11/17/98 JSB Created -7/31/99 TP Added RunIC function that runs the sim so that every frame - 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; -class FGFCS; -class FGAircraft; -class FGTranslation; -class FGRotation; -class FGPosition; -class FGAuxiliary; -class FGOutput; -class FGInitialCondition; - -class FGFDMExec -{ -public: - FGFDMExec(void); - ~FGFDMExec(void); - - FGModel* FirstModel; - - bool Initialize(void); - int Schedule(FGModel* model, int rate); - bool Run(void); - bool RunIC(FGInitialCondition *fgic); - void Freeze(void) {frozen = true;} - void Resume(void) {frozen = false;} - - bool SetEnginePath(string path) {EnginePath = path;} - bool SetAircraftPath(string path) {AircraftPath = path;} - bool SetScriptPath(string path) {ScriptPath = path;} - - bool LoadModel(string AircraftPath, string EnginePath, string model); - bool RunScript(string script); - - inline FGState* GetState(void) {return State;} - inline FGAtmosphere* GetAtmosphere(void) {return Atmosphere;} - inline FGFCS* GetFCS(void) {return FCS;} - inline FGAircraft* GetAircraft(void) {return Aircraft;} - inline FGTranslation* GetTranslation(void) {return Translation;} - inline FGRotation* GetRotation(void) {return Rotation;} - 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; - bool terminate; - int Error; - bool modelLoaded; - - string AircraftPath; - string EnginePath; - string ScriptPath; - - FGState* State; - FGAtmosphere* Atmosphere; - FGFCS* FCS; - FGAircraft* Aircraft; - FGTranslation* Translation; - FGRotation* Rotation; - FGPosition* Position; - FGAuxiliary* Auxiliary; - FGOutput* Output; - - bool Allocate(void); - bool DeAllocate(void); - -protected: -}; - -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -#endif +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Header: FGFDMExec.h + Author: Jon Berndt + Date started: 11/17/98 + + ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) ------------- + + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA. + + Further information about the GNU General Public License can also be found on + the world wide web at http://www.gnu.org. + +HISTORY +-------------------------------------------------------------------------------- +11/17/98 JSB Created +7/31/99 TP Added RunIC function that runs the sim so that every frame + begins with the IC values from the given FGInitialCondition + object and dt=0. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +SENTRY +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +#ifndef FGFDMEXEC_HEADER_H +#define FGFDMEXEC_HEADER_H + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +INCLUDES +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +#ifdef FGFS +# include +# ifdef FG_HAVE_STD_INCLUDES +# include +# else +# include +# endif +#else +# include +#endif + +#include "FGModel.h" +#include "FGInitialCondition.h" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +#define ID_FDMEXEC "$Id$" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +class FGState; +class FGAtmosphere; +class FGFCS; +class FGPropulsion; +class FGAircraft; +class FGTranslation; +class FGRotation; +class FGPosition; +class FGAuxiliary; +class FGOutput; +class FGInitialCondition; + +struct condition { + vector TestParam; + vector SetParam; + vector TestValue; + vector SetValue; + vector Comparison; + vector TC; + vector Persistent; + vector Action; + vector Type; + vector Triggered; + vector newValue; + vector OriginalValue; + vector StartTime; + vector EndTime; + + condition() { + } +}; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Encapsulates the JSBSim simulation executive. + @author Jon S. Berndt + @version $Id$ + + @doc This class is the interface class through which all other simulation classes + are instantiated, initialized, and run. When integrated with FlightGear (or + other flight simulator) this class is typically instantiated by an interface + class on the simulator side. + +

Scripting support provided in the Executive

+ +

There is simple scripting support provided in the FGFDMExec + class. Commands are specified using the Simple Scripting + Directives for JSBSim (SSDJ). The script file is in XML + format. A test condition (or conditions) can be set up in the + script and when the condition evaluates to true, the specified + action[s] is/are taken. A test condition can be persistent, + meaning that if a test condition evaluates to true, then passes + and evaluates to false, the condition is reset and may again be + triggered. When the set of tests evaluates to true for a given + condition, an item may be set to another value. This value might + be a boolean, a value, or a delta value, and the change from the + current value to the new value can be either via a step function, + a ramp, or an exponential approach. The speed of a ramp or + approach is specified via the time constant. Here is the format + of the script file:

+ +
<?xml version="1.0"?>
+    <runscript name="C172-01A">
+
+    <!--
+    This run is for testing C172 runs
+    -->
+
+    <use aircraft="c172">
+    <use initialize="reset00">
+
+    <run start="0.0" end="4.5" dt="0.05">
+      <when>
+        <parameter name="FG_TIME" comparison="ge" value="0.25">
+        <parameter name="FG_TIME" comparison="le" value="0.50">
+        <set name="FG_AILERON_CMD" type="FG_VALUE" value="0.25"
+        action="FG_STEP" persistent="false" tc ="0.25">
+      </when>
+      <when>
+        <parameter name="FG_TIME" comparison="ge" value="0.5">
+        <parameter name="FG_TIME" comparison="le" value="1.5">
+        <set name="FG_AILERON_CMD" type="FG_DELTA" value="0.5"
+        action="FG_EXP" persistent="false" tc ="0.5">
+      </when>
+      <when>
+        <parameter name="FG_TIME" comparison="ge" value="1.5">
+        <parameter name="FG_TIME" comparison="le" value="2.5">
+        <set name="FG_RUDDER_CMD" type="FG_DELTA" value="0.5"
+        action="FG_RAMP" persistent="false" tc ="0.5">
+      </when>
+    </run>
+
+    </runscript>
+ +

The first line must always be present. The second line + identifies this file as a script file, and gives a descriptive + name to the script file. Comments are next, delineated by the + <!-- and --> symbols. The aircraft and initialization files + to be used are specified in the "use" lines. Next, + comes the "run" section, where the conditions are + described in "when" clauses.

+ +

JSBSim Debugging Directives

+ + This describes to any interested entity the debug level + requested by setting the JSBSIM_DEBUG environment variable. + The bitmasked value choices are as follows:
    +
  1. unset: In this case (the default) JSBSim would only print + out the normally expected messages, essentially echoing + the config files as they are read. If the environment + variable is not set, debug_lvl is set to 1 internally
  2. +
  3. 0: This requests JSBSim not to output any messages + whatsoever.
  4. +
  5. 1: This value explicity requests the normal JSBSim + startup messages
  6. +
  7. 2: This value asks for a message to be printed out when + a class is instantiated
  8. +
  9. 4: When this value is set, a message is displayed when a + FGModel object executes its Run() method
  10. +
  11. 8: When this value is set, various runtime state variables + are printed out periodically
  12. +
+ +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DECLARATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +class FGFDMExec +{ +public: + /// Default constructor + FGFDMExec(void); + + /// Default destructor + ~FGFDMExec(); + + /** This routine places a model into the runlist at the specified rate. The + "rate" is not really a clock rate. It represents how many calls to the + FGFDMExec::Run() method must be made before the model is executed. A + value of 1 means that the model will be executed for each call to the + exec's Run() method. A value of 5 means that the model will only be + executed every 5th call to the exec's Run() method. + @param model A pointer to the model being scheduled. + @param rate The rate at which to execute the model as described above. + @return Currently returns 0 always. */ + int Schedule(FGModel* model, int rate); + + /** This executes each scheduled model in succession, as well as running any + scripts which are loaded. + @return true if successful, false if sim should be ended */ + bool Run(void); + + /** Initializes the sim with a set of initial conditions. + @param fgic A pointer to a filled out initial conditions class which + describes the desired initial conditions. + @return true if successful + */ + bool RunIC(FGInitialCondition *fgic); + + /// Freezes the sim + void Freeze(void) {frozen = true;} + + /// Resumes the sim + void Resume(void) {frozen = false;} + + /** Loads an aircraft model. + @param AircraftPath path to the aircraft directory. For instance: + "aircraft". Under aircraft, then, would be directories for various + modeled aircraft such as C172/, x15/, etc. + @param EnginePath path to the directory under which engine config + files are kept, for instance "engine" + @param model the name of the aircraft model itself. This file will + be looked for in the directory specified in the AircraftPath variable, + and in turn under the directory with the same name as the model. For + instance: "aircraft/x15/x15.xml" + @return true if successful*/ + bool LoadModel(string AircraftPath, string EnginePath, string model); + + /** Loads a script to drive JSBSim (usually in standalone mode). + The language is the Simple Script Directives for JSBSim (SSDJ). + @param script the filename (including path name, if any) for the script. + @return true if successful */ + bool LoadScript(string script); + + /** This function is called each pass through the executive Run() method IF + scripting is enabled. */ + void RunScript(void); + + bool SetEnginePath(string path) {EnginePath = path; return true;} + bool SetAircraftPath(string path) {AircraftPath = path; return true;} + bool SetScriptPath(string path) {ScriptPath = path; return true;} + + /// @name Top-level executive State and Model retrieval mechanism + //@{ + /// Returns the FGState pointer. + inline FGState* GetState(void) {return State;} + /// Returns the FGAtmosphere pointer. + inline FGAtmosphere* GetAtmosphere(void) {return Atmosphere;} + /// Returns the FGFCS pointer. + inline FGFCS* GetFCS(void) {return FCS;} + /// Returns the FGPropulsion pointer. + inline FGPropulsion* GetPropulsion(void) {return Propulsion;} + /// Returns the FGAircraft pointer. + inline FGAircraft* GetAircraft(void) {return Aircraft;} + /// Returns the FGTranslation pointer. + inline FGTranslation* GetTranslation(void) {return Translation;} + /// Returns the FGRotation pointer. + inline FGRotation* GetRotation(void) {return Rotation;} + /// Returns the FGPosition pointer. + inline FGPosition* GetPosition(void) {return Position;} + /// Returns the FGAuxiliary pointer. + inline FGAuxiliary* GetAuxiliary(void) {return Auxiliary;} + /// Returns the FGOutput pointer. + inline FGOutput* GetOutput(void) {return Output;} + //@} + + /// Retrieves the engine path. + inline string GetEnginePath(void) {return EnginePath;} + /// Retrieves the aircraft path. + inline string GetAircraftPath(void) {return AircraftPath;} + +private: + FGModel* FirstModel; + + bool frozen; + bool terminate; + int Error; + bool modelLoaded; + bool Scripted; + + string AircraftPath; + string EnginePath; + string ScriptPath; + string ScriptName; + float StartTime; + float EndTime; + vector Conditions; + + FGState* State; + FGAtmosphere* Atmosphere; + FGFCS* FCS; + FGPropulsion* Propulsion; + FGAircraft* Aircraft; + FGTranslation* Translation; + FGRotation* Rotation; + FGPosition* Position; + FGAuxiliary* Auxiliary; + FGOutput* Output; + + bool Allocate(void); + bool DeAllocate(void); + void Debug(void); +}; + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#endif + diff --git a/src/FDM/JSBSim/FGForce.cpp b/src/FDM/JSBSim/FGForce.cpp index c73edd805..903bbeea6 100644 --- a/src/FDM/JSBSim/FGForce.cpp +++ b/src/FDM/JSBSim/FGForce.cpp @@ -1,43 +1,43 @@ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - + Source: FGForce.cpp Author: Tony Peden Date started: 6/10/00 - + ------------- Copyright (C) 1999 Anthony K. Peden (apeden@earthlink.net) ------------- - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. - - + + HISTORY -------------------------------------------------------------------------------- 6/10/00 TP Created - - + + FUNCTIONAL DESCRIPTION -------------------------------------------------------------------------------- - + The purpose of this class is to provide storage for computed forces and -encapsulate all the functionality associated with transforming those +encapsulate all the functionality associated with transforming those forces from their native coord system to the body system. This includes computing the moments due to the difference between the point of application and the cg. - + */ #include "FGFDMExec.h" @@ -47,32 +47,43 @@ and the cg. #include "FGDefs.h" #include "FGForce.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = "ID_FORCE"; +extern short debug_lvl; + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FGForce::FGForce(FGFDMExec *FDMExec) : vFn(3), vMn(3), + fdmex(FDMExec), vFb(3), vM(3), vXYZn(3), vDXYZ(3), mT(3,3), vSense(3), - fdmex(FDMExec), - ttype(tNone) + ttype(tNone) { mT(1,1)=1; //identity matrix mT(2,2)=1; mT(3,3)=1; vSense.InitMatrix(1); + if (debug_lvl & 2) cout << "Instantiated: FGForce" << endl; } -FGForce::~FGForce(void) {} +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGForce::~FGForce() +{ + if (debug_lvl & 2) cout << "Destroyed: FGForce" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGForce::GetBodyForces(void) { - - + vFb=Transform()*(vFn.multElementWise(vSense)); //find the distance from this vector's location to the cg @@ -82,11 +93,11 @@ FGColumnVector FGForce::GetBodyForces(void) { vDXYZ(3) = -(vXYZn(3) - fdmex->GetAircraft()->GetXYZcg()(3))*INCHTOFT; vM=vMn +vDXYZ*vFb; - + return vFb; } - +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGMatrix FGForce::Transform(void) { switch(ttype) { @@ -95,15 +106,17 @@ FGMatrix FGForce::Transform(void) { case tLocalBody: return fdmex->GetState()->GetTl2b(); case tCustom: - + case tNone: - return mT; + return mT; default: cout << "Unrecognized tranform requested from FGForce::Transform()" << endl; exit(1); } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + void FGForce::SetAnglesToBody(float broll, float bpitch, float byaw) { if(ttype == tCustom) { @@ -128,4 +141,10 @@ void FGForce::SetAnglesToBody(float broll, float bpitch, float byaw) { } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGForce::Debug(void) +{ + //TODO: Add your source code here +} diff --git a/src/FDM/JSBSim/FGForce.h b/src/FDM/JSBSim/FGForce.h index 6a765876f..5046496c7 100644 --- a/src/FDM/JSBSim/FGForce.h +++ b/src/FDM/JSBSim/FGForce.h @@ -57,7 +57,7 @@ SENTRY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_FORCE "$Header" +#define ID_FORCE "$Id$" #include "FGFDMExec.h" #include "FGMatrix.h" @@ -66,14 +66,15 @@ INCLUDES CLASS DECLARATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -typedef enum { tNone, tWindBody, tLocalBody, tCustom } TransformType; class FGForce { public: FGForce(FGFDMExec *FDMExec); - ~FGForce(void); + ~FGForce(); + + enum TransformType { tNone, tWindBody, tLocalBody, tCustom } ttype; inline void SetNativeForces(float Fnx, float Fny, float Fnz) { vFn(1)=Fnx; @@ -130,6 +131,8 @@ public: protected: FGColumnVector vFn; FGColumnVector vMn; + FGFDMExec *fdmex; + void Debug(void); private: FGColumnVector vFb; @@ -139,10 +142,6 @@ private: FGColumnVector vSense; FGMatrix mT; - - FGFDMExec *fdmex; - TransformType ttype; - }; #endif diff --git a/src/FDM/JSBSim/FGGroundReactions.cpp b/src/FDM/JSBSim/FGGroundReactions.cpp index 69520b6ea..f215f247e 100644 --- a/src/FDM/JSBSim/FGGroundReactions.cpp +++ b/src/FDM/JSBSim/FGGroundReactions.cpp @@ -37,9 +37,11 @@ INCLUDES #include "FGGroundReactions.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_GROUNDREACTIONS; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -47,9 +49,10 @@ CLASS IMPLEMENTATION FGGroundReactions::FGGroundReactions(FGFDMExec* fgex) : FGModel(fgex) { - + if (debug_lvl & 2) cout << "Instantiated: FGGroundReactions" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGGroundReactions:: Run(void) { @@ -61,8 +64,17 @@ bool FGGroundReactions:: Run(void) { } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + bool FGGroundReactions::LoadGroundReactions(FGConfigFile* AC_cfg) { // } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGGroundReactions::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGGroundReactions.h b/src/FDM/JSBSim/FGGroundReactions.h index 8d53309ad..29cafc574 100644 --- a/src/FDM/JSBSim/FGGroundReactions.h +++ b/src/FDM/JSBSim/FGGroundReactions.h @@ -44,7 +44,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -56,7 +56,7 @@ INCLUDES #include "FGModel.h" #include "FGConfigFile.h" -#define ID_GROUNDREACTIONS "$Header" +#define ID_GROUNDREACTIONS "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -66,10 +66,13 @@ class FGGroundReactions : public FGModel { public: FGGroundReactions(FGFDMExec*); - ~FGGroundReactions(void); + ~FGGroundReactions(); bool Run(void); bool LoadGroundReactions(FGConfigFile* AC_cfg); + +private: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGInertial.cpp b/src/FDM/JSBSim/FGInertial.cpp index e72aa64ed..026c9ca6b 100644 --- a/src/FDM/JSBSim/FGInertial.cpp +++ b/src/FDM/JSBSim/FGInertial.cpp @@ -37,9 +37,11 @@ INCLUDES #include "FGInertial.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_INERTIAL; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -47,9 +49,10 @@ CLASS IMPLEMENTATION FGInertial::FGInertial(FGFDMExec* fgex) : FGModel(fgex) { - + if (debug_lvl & 2) cout << "Instantiated: FGInertial" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGInertial:: Run(void) { @@ -61,8 +64,17 @@ bool FGInertial:: Run(void) { } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + bool FGInertial::LoadInertial(FGConfigFile* AC_cfg) { // } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGInertial::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGInertial.h b/src/FDM/JSBSim/FGInertial.h index d025b6e08..d24d17ca8 100644 --- a/src/FDM/JSBSim/FGInertial.h +++ b/src/FDM/JSBSim/FGInertial.h @@ -44,7 +44,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -56,19 +56,18 @@ INCLUDES #include "FGModel.h" #include "FGConfigFile.h" -#define ID_INERTIAL "$Header" +#define ID_INERTIAL "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -const char *Id_Inertial = "JSBSim $Header$"; class FGInertial : public FGModel { public: FGInertial(FGFDMExec*); - ~FGInertial(void); + ~FGInertial(); bool Run(void); bool LoadInertial(FGConfigFile* AC_cfg); diff --git a/src/FDM/JSBSim/FGInitialCondition.cpp b/src/FDM/JSBSim/FGInitialCondition.cpp index 14ea2ae0c..2982bc970 100644 --- a/src/FDM/JSBSim/FGInitialCondition.cpp +++ b/src/FDM/JSBSim/FGInitialCondition.cpp @@ -55,23 +55,32 @@ INCLUDES #include "FGOutput.h" #include "FGDefs.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_INITIALCONDITION; +extern short debug_lvl; -FGInitialCondition::FGInitialCondition(FGFDMExec *FDMExec) { - vt=vc=ve=0; +//****************************************************************************** + +FGInitialCondition::FGInitialCondition(FGFDMExec *FDMExec){ + + vt=vc=ve=vg=0; mach=0; alpha=beta=gamma=0; theta=phi=psi=0; altitude=hdot=0; latitude=longitude=0; - u=v=w=0; + u=v=w=0; + vw=vw=ww=0; vnorth=veast=vdown=0; lastSpeedSet=setvt; sea_level_radius = EARTHRAD; radius_to_vehicle = EARTHRAD; terrain_altitude = 0; + + salpha=sbeta=stheta=sphi=spsi=sgamma=0; + calpha=cbeta=ctheta=cphi=cpsi=cgamma=1; + if(FDMExec != NULL ) { fdmex=FDMExec; fdmex->GetPosition()->Seth(altitude); @@ -80,11 +89,17 @@ FGInitialCondition::FGInitialCondition(FGFDMExec *FDMExec) { cout << "FGInitialCondition: This class requires a pointer to a valid FGFDMExec object" << endl; } + if (debug_lvl & 2) cout << "Instantiated: FGInitialCondition" << endl; } +//****************************************************************************** -FGInitialCondition::~FGInitialCondition(void) {} +FGInitialCondition::~FGInitialCondition() +{ + if (debug_lvl & 2) cout << "Destroyed: FGInitialCondition" << endl; +} +//****************************************************************************** void FGInitialCondition::SetVcalibratedKtsIC(float tt) { @@ -102,6 +117,8 @@ void FGInitialCondition::SetVcalibratedKtsIC(float tt) { } } +//****************************************************************************** + void FGInitialCondition::SetVequivalentKtsIC(float tt) { ve=tt*jsbKTSTOFPS; lastSpeedSet=setve; @@ -110,6 +127,37 @@ void FGInitialCondition::SetVequivalentKtsIC(float tt) { vc=calcVcas(mach); } +//****************************************************************************** + +void FGInitialCondition::SetVgroundFpsIC(float tt) { + //float ua,va,wa; + float vxz; + + //cout << "FGInitialCondition::SetVgroundFpsIC" << endl; + vg=tt; + lastSpeedSet=setvg; + vnorth = vg*cos(psi); veast = vg*sin(psi); vdown = 0; + calcUVWfromNED(); + //cout << "\tu,v,w: " << u << ", " << v << ", " << w << endl; + calcWindUVW(); + //cout << "\tuw,vw,ww: " << uw << ", " << vw << ", " << ww << endl; + u = -uw; v = -vw; w = -ww; + //ua = u - uw; va = v - vw; wa = w - ww; + //cout << "\tua,va,wa: " << ua << ", " << va << ", " << wa << endl; + vt = sqrt( u*u + v*v + w*w ); + alpha = beta = 0; + vxz = sqrt( u*u + w*w ); + if( w != 0 ) alpha = atan2( w, u ); + if( vxz != 0 ) beta = atan2( v, vxz ); + //cout << "\tvt,alpha,beta: " << vt << ", " << alpha*RADTODEG << ", " + // << beta*RADTODEG << endl; + mach=vt/fdmex->GetAtmosphere()->GetSoundSpeed(); + vc=calcVcas(mach); + ve=vt*sqrt(fdmex->GetAtmosphere()->GetDensityRatio()); +} + +//****************************************************************************** + void FGInitialCondition::SetVtrueFpsIC(float tt) { vt=tt; lastSpeedSet=setvt; @@ -118,6 +166,8 @@ void FGInitialCondition::SetVtrueFpsIC(float tt) { ve=vt*sqrt(fdmex->GetAtmosphere()->GetDensityRatio()); } +//****************************************************************************** + void FGInitialCondition::SetMachIC(float tt) { mach=tt; lastSpeedSet=setmach; @@ -127,44 +177,162 @@ void FGInitialCondition::SetMachIC(float tt) { //cout << "Vt: " << vt*jsbFPSTOKTS << " Vc: " << vc*jsbFPSTOKTS << endl; } +//****************************************************************************** + void FGInitialCondition::SetClimbRateFpmIC(float tt) { SetClimbRateFpsIC(tt/60.0); } +//****************************************************************************** + void FGInitialCondition::SetClimbRateFpsIC(float tt) { if(vt > 0.1) { hdot=tt; gamma=asin(hdot/vt); + sgamma=sin(gamma); cgamma=cos(gamma); } } +//****************************************************************************** + void FGInitialCondition::SetFlightPathAngleRadIC(float tt) { gamma=tt; + sgamma=sin(gamma); cgamma=cos(gamma); + getTheta(); + hdot=vt*sgamma; +} + +//****************************************************************************** + +void FGInitialCondition::SetAlphaRadIC(float tt) { + alpha=tt; + salpha=sin(alpha); calpha=cos(alpha); + getTheta(); +} + +//****************************************************************************** + +void FGInitialCondition::SetPitchAngleRadIC(float tt) { + theta=tt; + stheta=sin(theta); ctheta=cos(theta); + calcWindUVW(); + getAlpha(); +} + +//****************************************************************************** + +void FGInitialCondition::SetBetaRadIC(float tt) { + beta=tt; + sbeta=sin(beta); cbeta=cos(beta); getTheta(); - hdot=vt*sin(tt); } +//****************************************************************************** + +void FGInitialCondition::SetRollAngleRadIC(float tt) { + phi=tt; + sphi=sin(phi); cphi=cos(phi); + getTheta(); +} + +//****************************************************************************** + +void FGInitialCondition::SetTrueHeadingRadIC(float tt) { + psi=tt; + spsi=sin(psi); cpsi=cos(psi); + calcWindUVW(); +} + +//****************************************************************************** void FGInitialCondition::SetUBodyFpsIC(float tt) { u=tt; - vt=sqrt(u*u+v*v+w*w); + vt=sqrt(u*u + v*v + w*w); lastSpeedSet=setuvw; } - +//****************************************************************************** + void FGInitialCondition::SetVBodyFpsIC(float tt) { v=tt; - vt=sqrt(u*u+v*v+w*w); + vt=sqrt(u*u + v*v + w*w); lastSpeedSet=setuvw; } +//****************************************************************************** + void FGInitialCondition::SetWBodyFpsIC(float tt) { w=tt; - vt=sqrt(u*u+v*v+w*w); + vt=sqrt( u*u + v*v + w*w ); lastSpeedSet=setuvw; } +//****************************************************************************** + +float FGInitialCondition::GetUBodyFpsIC(void) { + if(lastSpeedSet == setvg ) + return u; + else + return vt*calpha*cbeta; +} + +//****************************************************************************** + +float FGInitialCondition::GetVBodyFpsIC(void) { + if( lastSpeedSet == setvg ) + return v; + else + return vt*sbeta; +} + +//****************************************************************************** + +float FGInitialCondition::GetWBodyFpsIC(void) { + if( lastSpeedSet == setvg ) + return w; + else { + return vt*salpha*cbeta; + } +} + +//****************************************************************************** + +void FGInitialCondition::SetWindNEDFpsIC(float wN, float wE, float wD ) { + wnorth = wN; weast = wE; wdown = wD; + if(lastSpeedSet == setvg) + SetVgroundFpsIC(vg); + + +} + +//****************************************************************************** + +void FGInitialCondition::calcWindUVW(void) { + if(lastSpeedSet == setvg ) { + + uw=wnorth*ctheta*cpsi + + weast*ctheta*spsi - + wdown*stheta; + vw=wnorth*( sphi*stheta*cpsi - cphi*spsi ) + + weast*( sphi*stheta*spsi + cphi*cpsi ) + + wdown*sphi*ctheta; + ww=wnorth*(cphi*stheta*cpsi + sphi*spsi) + + weast*(cphi*stheta*spsi - sphi*cpsi) + + wdown*cphi*ctheta; + /* cout << "FGInitialCondition::calcWindUVW: wnorth, weast, wdown " + << wnorth << ", " << weast << ", " << wdown << endl; + cout << "FGInitialCondition::calcWindUVW: theta, phi, psi " + << theta << ", " << phi << ", " << psi << endl; + cout << "FGInitialCondition::calcWindUVW: uw, vw, ww " + << uw << ", " << vw << ", " << ww << endl; */ + + } else { + uw=vw=ww=0; + } +} + +//****************************************************************************** void FGInitialCondition::SetAltitudeFtIC(float tt) { altitude=tt; @@ -188,49 +356,67 @@ void FGInitialCondition::SetAltitudeFtIC(float tt) { case setmach: SetMachIC(mach); break; + case setvg: + SetVgroundFpsIC(vg); + break; } } +//****************************************************************************** + void FGInitialCondition::SetAltitudeAGLFtIC(float tt) { fdmex->GetPosition()->SetDistanceAGL(tt); altitude=fdmex->GetPosition()->Geth(); SetAltitudeFtIC(altitude); -} +} + +//****************************************************************************** + void FGInitialCondition::SetSeaLevelRadiusFtIC(double tt) { sea_level_radius = tt; } - + +//****************************************************************************** + void FGInitialCondition::SetTerrainAltitudeFtIC(double tt) { terrain_altitude=tt; fdmex->GetPosition()->SetDistanceAGL(altitude-terrain_altitude); fdmex->GetPosition()->SetRunwayRadius(sea_level_radius + terrain_altitude); -} +} + +//****************************************************************************** void FGInitialCondition::calcUVWfromNED(void) { - u=vnorth*cos(theta)*cos(psi) + - veast*cos(theta)*sin(psi) - - vdown*sin(theta); - v=vnorth*(sin(phi)*sin(theta)*cos(psi) - cos(phi)*sin(psi)) + - veast*(sin(phi)*sin(theta)*sin(psi) + cos(phi)*cos(psi)) + - vdown*sin(phi)*cos(theta); - w=vnorth*(cos(phi)*sin(theta)*cos(psi) + sin(phi)*sin(psi)) + - veast*(cos(phi)*sin(theta)*sin(psi) - sin(phi)*cos(psi)) + - vdown*cos(phi)*cos(theta); -} - + u=vnorth*ctheta*cpsi + + veast*ctheta*spsi - + vdown*stheta; + v=vnorth*( sphi*stheta*cpsi - cphi*spsi ) + + veast*( sphi*stheta*spsi + cphi*cpsi ) + + vdown*sphi*ctheta; + w=vnorth*( cphi*stheta*cpsi + sphi*spsi ) + + veast*( cphi*stheta*spsi - sphi*cpsi ) + + vdown*cphi*ctheta; +} + +//****************************************************************************** + void FGInitialCondition::SetVnorthFpsIC(float tt) { vnorth=tt; calcUVWfromNED(); vt=sqrt(u*u + v*v + w*w); lastSpeedSet=setned; -} - +} + +//****************************************************************************** + void FGInitialCondition::SetVeastFpsIC(float tt) { veast=tt; calcUVWfromNED(); vt=sqrt(u*u + v*v + w*w); lastSpeedSet=setned; -} +} + +//****************************************************************************** void FGInitialCondition::SetVdownFpsIC(float tt) { vdown=tt; @@ -238,10 +424,12 @@ void FGInitialCondition::SetVdownFpsIC(float tt) { vt=sqrt(u*u + v*v + w*w); SetClimbRateFpsIC(-1*vdown); lastSpeedSet=setned; -} +} + +//****************************************************************************** bool FGInitialCondition::getMachFromVcas(float *Mach,float vcas) { - + bool result=false; float guess=1.5; xlo=xhi=0; @@ -250,10 +438,12 @@ bool FGInitialCondition::getMachFromVcas(float *Mach,float vcas) { if(findInterval(vcas,guess)) { if(solve(&mach,vcas)) result=true; - } + } return result; } +//****************************************************************************** + bool FGInitialCondition::getAlpha(void) { bool result=false; float guess=theta-gamma; @@ -264,11 +454,15 @@ bool FGInitialCondition::getAlpha(void) { if(findInterval(0,guess)){ if(solve(&alpha,0)){ result=true; + salpha=sin(alpha); + calpha=cos(alpha); } } return result; -} - +} + +//****************************************************************************** + bool FGInitialCondition::getTheta(void) { bool result=false; float guess=alpha+gamma; @@ -278,32 +472,44 @@ bool FGInitialCondition::getTheta(void) { if(findInterval(0,guess)){ if(solve(&theta,0)){ result=true; + stheta=sin(theta); + ctheta=cos(theta); } } return result; -} - +} +//****************************************************************************** float FGInitialCondition::GammaEqOfTheta(float Theta) { - float a,b,c; - - a=cos(alpha)*cos(beta)*sin(Theta); - b=sin(beta)*sin(phi); - c=sin(alpha)*cos(beta)*cos(phi); - return sin(gamma)-a+(b+c)*cos(Theta); + float a,b,c,d; + float sTheta,cTheta; + + //theta=Theta; stheta=sin(theta); ctheta=cos(theta); + sTheta=sin(Theta); cTheta=cos(Theta); + calcWindUVW(); + a=wdown + vt*calpha*cbeta + uw; + b=vt*sphi*sbeta + vw*sphi; + c=vt*cphi*salpha*cbeta + ww*cphi; + return vt*sgamma - ( a*sTheta - (b+c)*cTheta); } +//****************************************************************************** + float FGInitialCondition::GammaEqOfAlpha(float Alpha) { - float a,b,c; - - a=cos(Alpha)*cos(beta)*sin(theta); - b=sin(beta)*sin(phi); - c=sin(Alpha)*cos(beta)*cos(phi); - return sin(gamma)-a+(b+c)*cos(theta); + float a,b,c,d; + float sAlpha,cAlpha; + + sAlpha=sin(Alpha); cAlpha=cos(Alpha); + a=wdown + vt*cAlpha*cbeta + uw; + b=vt*sphi*sbeta + vw*sphi; + c=vt*cphi*sAlpha*cbeta + ww*cphi; + + return vt*sgamma - ( a*stheta - (b+c)*ctheta ); } - +//****************************************************************************** + float FGInitialCondition::calcVcas(float Mach) { float p=fdmex->GetAtmosphere()->GetPressure(); @@ -343,6 +549,8 @@ float FGInitialCondition::calcVcas(float Mach) { return vcas; } +//****************************************************************************** + bool FGInitialCondition::findInterval(float x,float guess) { //void find_interval(inter_params &ip,eqfunc f,float y,float constant, int &flag){ @@ -380,30 +588,29 @@ bool FGInitialCondition::findInterval(float x,float guess) { return found; } +//****************************************************************************** - - -bool FGInitialCondition::solve(float *y,float x) { +bool FGInitialCondition::solve(float *y,float x) { float x1,x2,x3,f1,f2,f3,d,d0; float eps=1E-5; float const relax =0.9; int i; bool success=false; - + //initializations d=1; - + x1=xlo;x3=xhi; f1=(this->*sfunc)(x1)-x; f3=(this->*sfunc)(x3)-x; d0=fabs(x3-x1); - + //iterations i=0; while ((fabs(d) > eps) && (i < 100)) { d=(x3-x1)/d0; x2=x1-d*d0*f1/(f3-f1); - + f2=(this->*sfunc)(x2)-x; //cout << "solve x1,x2,x3: " << x1 << "," << x2 << "," << x3 << endl; //cout << " " << f1 << "," << f2 << "," << f3 << endl; @@ -430,3 +637,11 @@ bool FGInitialCondition::solve(float *y,float x) { //cout << "Success= " << success << " Vcas: " << vcas*jsbFPSTOKTS << " Mach: " << x2 << endl; return success; } + +//****************************************************************************** + +void FGInitialCondition::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGInitialCondition.h b/src/FDM/JSBSim/FGInitialCondition.h index a461bccb9..cee99ad8c 100644 --- a/src/FDM/JSBSim/FGInitialCondition.h +++ b/src/FDM/JSBSim/FGInitialCondition.h @@ -53,13 +53,13 @@ INCLUDES #include "FGAtmosphere.h" #include "FGMatrix.h" -#define ID_INITIALCONDITION "$Header" +#define ID_INITIALCONDITION "$Id$" /******************************************************************************* CLASS DECLARATION *******************************************************************************/ -typedef enum { setvt, setvc, setve, setmach, setuvw, setned } speedset; +typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset; #define jsbFPSTOKTS 0.5924838 #define jsbKTSTOFPS 1.6878099 @@ -81,8 +81,6 @@ typedef enum { setvt, setvc, setve, setmach, setuvw, setned } speedset; //or to loop the sim w/o integrating FDMExec->RunIC(fgic) - - Speed: Since vc, ve, vt, and mach all represent speed, the remaining three are recalculated each time one of them is set (using the @@ -112,141 +110,143 @@ class FGInitialCondition { public: FGInitialCondition(FGFDMExec *fdmex); - ~FGInitialCondition(void); - - inline speedset GetSpeedSet(void) { return lastSpeedSet; } + ~FGInitialCondition(); void SetVcalibratedKtsIC(float tt); void SetVequivalentKtsIC(float tt); - inline void SetVtrueKtsIC(float tt) { SetVtrueFpsIC(tt*jsbKTSTOFPS); } - void SetVtrueFpsIC(float tt); + inline void SetVtrueKtsIC(float tt) { SetVtrueFpsIC(tt*jsbKTSTOFPS); } + inline void SetVgroundKtsIC(float tt) { SetVgroundFpsIC(tt*jsbKTSTOFPS); } void SetMachIC(float tt); - - void SetUBodyFpsIC(float tt); - void SetVBodyFpsIC(float tt); - void SetWBodyFpsIC(float tt); - void SetVnorthFpsIC(float tt); - void SetVeastFpsIC(float tt); - void SetVdownFpsIC(float tt); + inline void SetAlphaDegIC(float tt) { SetAlphaRadIC(tt*DEGTORAD); } + inline void SetBetaDegIC(float tt) { SetBetaRadIC(tt*DEGTORAD);} + inline void SetPitchAngleDegIC(float tt) { SetPitchAngleRadIC(tt*DEGTORAD); } + inline void SetRollAngleDegIC(float tt) { SetRollAngleRadIC(tt*DEGTORAD);} + inline void SetTrueHeadingDegIC(float tt){ SetTrueHeadingRadIC(tt*DEGTORAD); } + + void SetClimbRateFpmIC(float tt); + inline void SetFlightPathAngleDegIC(float tt) { SetFlightPathAngleRadIC(tt*DEGTORAD); } + void SetAltitudeFtIC(float tt); void SetAltitudeAGLFtIC(float tt); void SetSeaLevelRadiusFtIC(double tt); void SetTerrainAltitudeFtIC(double tt); - - //"vertical" flight path, recalculate theta - inline void SetFlightPathAngleDegIC(float tt) { SetFlightPathAngleRadIC(tt*DEGTORAD); } - void SetFlightPathAngleRadIC(float tt); - //set speed first - void SetClimbRateFpmIC(float tt); - void SetClimbRateFpsIC(float tt); - //use currently stored gamma, recalcualte theta - inline void SetAlphaDegIC(float tt) { alpha=tt*DEGTORAD; getTheta(); } - inline void SetAlphaRadIC(float tt) { alpha=tt; getTheta(); } - //use currently stored gamma, recalcualte alpha - inline void SetPitchAngleDegIC(float tt) { theta=tt*DEGTORAD; getAlpha(); } - inline void SetPitchAngleRadIC(float tt) { theta=tt; getAlpha(); } - - inline void SetBetaDegIC(float tt) { beta=tt*DEGTORAD; getTheta();} - inline void SetBetaRadIC(float tt) { beta=tt; getTheta(); } - - inline void SetRollAngleDegIC(float tt) { phi=tt*DEGTORAD; getTheta(); } - inline void SetRollAngleRadIC(float tt) { phi=tt; getTheta(); } - - inline void SetTrueHeadingDegIC(float tt) { psi=tt*DEGTORAD; } - inline void SetTrueHeadingRadIC(float tt) { psi=tt; } inline void SetLatitudeDegIC(float tt) { latitude=tt*DEGTORAD; } - inline void SetLatitudeRadIC(float tt) { latitude=tt; } - inline void SetLongitudeDegIC(float tt) { longitude=tt*DEGTORAD; } - inline void SetLongitudeRadIC(float tt) { longitude=tt; } + inline float GetVcalibratedKtsIC(void) { return vc*jsbFPSTOKTS; } inline float GetVequivalentKtsIC(void) { return ve*jsbFPSTOKTS; } + inline float GetVgroundKtsIC(void) { return vg*jsbFPSTOKTS; } inline float GetVtrueKtsIC(void) { return vt*jsbFPSTOKTS; } - inline float GetVtrueFpsIC(void) { return vt; } inline float GetMachIC(void) { return mach; } + + inline float GetClimbRateFpmIC(void) { return hdot*60; } + inline float GetFlightPathAngleDegIC(void) { return gamma*RADTODEG; } + + inline float GetAlphaDegIC(void) { return alpha*RADTODEG; } + inline float GetBetaDegIC(void) { return beta*RADTODEG; } + + inline float GetPitchAngleDegIC(void) { return theta*RADTODEG; } + inline float GetRollAngleDegIC(void) { return phi*RADTODEG; } + inline float GetHeadingDegIC(void) { return psi*RADTODEG; } + inline float GetLatitudeDegIC(void) { return latitude*RADTODEG; } + inline float GetLongitudeDegIC(void) { return longitude*RADTODEG; } + 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; } + inline float GetSeaLevelRadiusFtIC(void) { return sea_level_radius; } + inline float GetTerrainAltitudeFtIC(void) { return terrain_altitude; } - inline float GetClimbRateFpmIC(void) { return hdot*60; } + void SetVgroundFpsIC(float tt); + void SetVtrueFpsIC(float tt); + void SetUBodyFpsIC(float tt); + void SetVBodyFpsIC(float tt); + void SetWBodyFpsIC(float tt); + void SetVnorthFpsIC(float tt); + void SetVeastFpsIC(float tt); + void SetVdownFpsIC(float tt); + void SetWindNEDFpsIC(float wN, float wE, float wD); + void SetClimbRateFpsIC(float tt); + inline float GetVgroundFpsIC(void) { return vg; } + inline float GetVtrueFpsIC(void) { return vt; } + inline float GetWindUFpsIC(void) { return uw; } + inline float GetWindVFpsIC(void) { return vw; } + inline float GetWindWFpsIC(void) { return ww; } + inline float GetWindNFpsIC(void) { return wnorth; } + inline float GetWindEFpsIC(void) { return weast; } + inline float GetWindDFpsIC(void) { return wdown; } inline float GetClimbRateFpsIC(void) { return hdot; } - - inline float GetAlphaDegIC(void) { return alpha*RADTODEG; } + float GetUBodyFpsIC(void); + float GetVBodyFpsIC(void); + float GetWBodyFpsIC(void); + void SetFlightPathAngleRadIC(float tt); + void SetAlphaRadIC(float tt); + void SetPitchAngleRadIC(float tt); + void SetBetaRadIC(float tt); + void SetRollAngleRadIC(float tt); + void SetTrueHeadingRadIC(float tt); + inline void SetLatitudeRadIC(float tt) { latitude=tt; } + inline void SetLongitudeRadIC(float tt) { longitude=tt; } + inline float GetFlightPathAngleRadIC(void) { return gamma; } inline float GetAlphaRadIC(void) { return alpha; } - - inline float GetPitchAngleDegIC(void) { return theta*RADTODEG; } inline float GetPitchAngleRadIC(void) { return theta; } - - - inline float GetBetaDegIC(void) { return beta*RADTODEG; } - inline float GetBetaRadIC(void) { return beta*RADTODEG; } - - inline float GetRollAngleDegIC(void) { return phi*RADTODEG; } + inline float GetBetaRadIC(void) { return beta; } inline float GetRollAngleRadIC(void) { return phi; } - - inline float GetHeadingDegIC(void) { return psi*RADTODEG; } inline float GetHeadingRadIC(void) { return psi; } - - inline float GetLatitudeDegIC(void) { return latitude*RADTODEG; } inline float GetLatitudeRadIC(void) { return latitude; } - - inline float GetLongitudeDegIC(void) { return longitude*RADTODEG; } inline float GetLongitudeRadIC(void) { return longitude; } - - inline float GetUBodyFpsIC(void) { return vt*cos(alpha)*cos(beta); } - inline float GetVBodyFpsIC(void) { return vt*sin(beta); } - inline float GetWBodyFpsIC(void) { return vt*sin(alpha)*cos(beta); } - inline float GetThetaRadIC(void) { return theta; } inline float GetPhiRadIC(void) { return phi; } inline float GetPsiRadIC(void) { return psi; } - - inline float GetSeaLevelRadiusFtIC(void) { return sea_level_radius; } - inline float GetTerrainAltitudeFtIC(void) { return terrain_altitude; } - + inline speedset GetSpeedSet(void) { return lastSpeedSet; } private: - float vt,vc,ve; - float alpha,beta,gamma,theta,phi,psi; + float vt,vc,ve,vg; float mach; float altitude,hdot; float latitude,longitude; float u,v,w; + float uw,vw,ww; float vnorth,veast,vdown; + float wnorth,weast,wdown; double sea_level_radius; double terrain_altitude; double radius_to_vehicle; - + + float alpha, beta, theta, phi, psi, gamma; + float salpha,sbeta,stheta,sphi,spsi,sgamma; + float calpha,cbeta,ctheta,cphi,cpsi,cgamma; + float xlo, xhi,xmin,xmax; - + typedef float (FGInitialCondition::*fp)(float x); fp sfunc; speedset lastSpeedSet; FGFDMExec *fdmex; - - + bool getAlpha(void); bool getTheta(void); bool getMachFromVcas(float *Mach,float vcas); - + float GammaEqOfTheta(float Theta); float GammaEqOfAlpha(float Alpha); float calcVcas(float Mach); void calcUVWfromNED(void); - + void calcWindUVW(void); + bool findInterval(float x,float guess); bool solve(float *y, float x); + void Debug(void); }; #endif + diff --git a/src/FDM/JSBSim/FGLGear.cpp b/src/FDM/JSBSim/FGLGear.cpp index 6dc659162..1f044a548 100644 --- a/src/FDM/JSBSim/FGLGear.cpp +++ b/src/FDM/JSBSim/FGLGear.cpp @@ -31,6 +31,7 @@ FUNCTIONAL DESCRIPTION HISTORY -------------------------------------------------------------------------------- 11/18/99 JSB Created +01/30/01 NHP Extended gear model to properly simulate steering and braking %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES @@ -47,9 +48,12 @@ DEFINITIONS GLOBAL DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -static const char *IdSrc = "$Header$"; + +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_LGEAR; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -62,7 +66,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 >> BrakeGroup >> maxSteerAngle; + >> rollingFCoeff >> sSteerType >> sBrakeGroup >> maxSteerAngle; cout << " Name: " << name << endl; cout << " Location: " << vXYZ << endl; @@ -70,31 +74,41 @@ 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 << " Grouping: " << BrakeGroup << endl; - cout << " Steering Type: " << SteerType << endl; + cout << " Rolling Friction: " << rollingFCoeff << endl; + cout << " Steering Type: " << sSteerType << endl; + cout << " Grouping: " << sBrakeGroup << 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; + if (sBrakeGroup == "LEFT" ) eBrakeGrp = bgLeft; + else if (sBrakeGroup == "RIGHT" ) eBrakeGrp = bgRight; + else if (sBrakeGroup == "CENTER") eBrakeGrp = bgCenter; + else if (sBrakeGroup == "NOSE" ) eBrakeGrp = bgNose; + else if (sBrakeGroup == "TAIL" ) eBrakeGrp = bgTail; + else if (sBrakeGroup == "NONE" ) eBrakeGrp = bgNone; else { cerr << "Improper braking group specification in config file: " - << BrakeGroup << " is undefined." << endl; + << sBrakeGroup << " is undefined." << endl; + } + + if (sSteerType == "STEERABLE") eSteerType = stSteer; + else if (sSteerType == "FIXED" ) eSteerType = stFixed; + else if (sSteerType == "CASTERED" ) eSteerType = stCaster; + else { + cerr << "Improper steering type specification in config file: " + << sSteerType << " is undefined." << endl; } -// add some AI here to determine if gear is located properly according to its -// brake group type +// 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(); Rotation = Exec->GetRotation(); + FCS = Exec->GetFCS(); WOW = false; - ReportEnable=true; + ReportEnable = true; FirstContact = false; Reported = false; DistanceTraveled = 0.0; @@ -105,6 +119,8 @@ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3), vWhlBodyVec(eZ) = -vWhlBodyVec(eZ); vLocalGear = State->GetTb2l() * vWhlBodyVec; + + if (debug_lvl & 2) cout << "Instantiated: FGLGear" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -116,6 +132,7 @@ FGLGear::FGLGear(const FGLGear& lgear) Position = lgear.Position; Rotation = lgear.Rotation; Exec = lgear.Exec; + FCS = lgear.FCS; vXYZ = lgear.vXYZ; vMoment = lgear.vMoment; @@ -135,26 +152,36 @@ FGLGear::FGLGear(const FGLGear& lgear) compressSpeed = lgear.compressSpeed; staticFCoeff = lgear.staticFCoeff; dynamicFCoeff = lgear.dynamicFCoeff; + rollingFCoeff = lgear.rollingFCoeff; brakePct = lgear.brakePct; maxCompLen = lgear.maxCompLen; SinkRate = lgear.SinkRate; GroundSpeed = lgear.GroundSpeed; Reported = lgear.Reported; name = lgear.name; - SteerType = lgear.SteerType; - BrakeGroup = lgear.BrakeGroup; + sSteerType = lgear.sSteerType; + eSteerType = lgear.eSteerType; + sBrakeGroup = lgear.sBrakeGroup; eBrakeGrp = lgear.eBrakeGrp; maxSteerAngle = lgear.maxSteerAngle; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGLGear::~FGLGear(void) {} +FGLGear::~FGLGear() +{ + if (debug_lvl & 2) cout << "Destroyed: FGLGear" << endl; +} //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGColumnVector FGLGear::Force(void) { + float SteerGain, SteerAngle, BrakeFCoeff; + float SinWheel, CosWheel, SideWhlVel, RollingWhlVel; + float RudderPedal, RollingForce, SideForce, FCoeff; + float WheelSlip; + FGColumnVector vForce(3); FGColumnVector vLocalForce(3); //FGColumnVector vLocalGear(3); // Vector: CG to this wheel (Local) @@ -166,11 +193,18 @@ FGColumnVector FGLGear::Force(void) vLocalGear = State->GetTb2l() * vWhlBodyVec; +// For now, gear compression is assumed to happen in the Local Z axis, +// not the strut axis as it should be. Will fix this later. + compressLength = vLocalGear(eZ) - Position->GetDistanceAGL(); if (compressLength > 0.00) { WOW = true; + +// The next equation should really use the vector to the contact patch of the tire +// including the strut compression and not vWhlBodyVec. Will fix this later. + vWhlVelVec = State->GetTb2l() * (Rotation->GetPQR() * vWhlBodyVec); vWhlVelVec += Position->GetVel(); @@ -182,45 +216,132 @@ FGColumnVector FGLGear::Force(void) GroundSpeed = Position->GetVel().Magnitude(); } - // The following code normalizes the wheel velocity vector, reverses it, and zeroes out - // the z component of the velocity. The question is, should the Z axis velocity be zeroed - // out first before the normalization takes place or not? Subsequent to that, the Wheel - // Velocity vector now points as a unit vector backwards and parallel to the wheel - // velocity vector. It acts AT the wheel. - - vWhlVelVec = -1.0 * vWhlVelVec.Normalize(); - vWhlVelVec(eZ) = 0.00; - -// the following needs work regarding friction coefficients and braking and steering +// The following needs work regarding friction coefficients and braking and +// steering The BrakeFCoeff formula assumes that an anti-skid system is used. +// It also assumes that we won't be turning and braking at the same time. +// Will fix this later. switch (eBrakeGrp) { case bgLeft: - + SteerGain = -maxSteerAngle; + BrakeFCoeff = rollingFCoeff*(1.0 - FCS->GetBrake(bgLeft)) + + staticFCoeff*FCS->GetBrake(bgLeft); break; case bgRight: + SteerGain = -maxSteerAngle; + BrakeFCoeff = rollingFCoeff*(1.0 - FCS->GetBrake(bgRight)) + + staticFCoeff*FCS->GetBrake(bgRight); break; case bgCenter: + SteerGain = -maxSteerAngle; + BrakeFCoeff = rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) + + staticFCoeff*FCS->GetBrake(bgCenter); break; case bgNose: + SteerGain = maxSteerAngle; + BrakeFCoeff = rollingFCoeff; break; case bgTail: + SteerGain = -maxSteerAngle; + BrakeFCoeff = rollingFCoeff; break; case bgNone: + SteerGain = -maxSteerAngle; + BrakeFCoeff = rollingFCoeff; break; default: cerr << "Improper brake group membership detected for this gear." << endl; break; } -// + +// Note to Jon: Need to substitute the correct variable for RudderPedal. +// It is assumed that rudder pedal has a range of -1.0 to 1.0. + + switch (eSteerType) { + case stSteer: + SteerAngle = SteerGain*RudderPedal; + break; + case stFixed: + SteerAngle = 0.0; + break; + case stCaster: + + // Note to Jon: This is not correct for castering gear. I'll fix it later. + SteerAngle = 0.0; + break; + default: + cerr << "Improper steering type membership detected for this gear." << endl; + break; + } + +// Transform the wheel velocities from the local axis system to the wheel axis system. +// For now, steering angle is assumed to happen in the Local Z axis, +// not the strut axis as it should be. Will fix this later. +// Note to Jon: Please substitute the correct variable for Deg2Rad conversion. + + SinWheel = sin(Rotation->Getpsi() + SteerAngle*DEGTORAD); + CosWheel = cos(Rotation->Getpsi() + SteerAngle*DEGTORAD); + RollingWhlVel = vWhlVelVec(eX)*CosWheel + vWhlVelVec(eY)*SinWheel; + SideWhlVel = vWhlVelVec(eY)*CosWheel - vWhlVelVec(eX)*SinWheel; + +// Calculate tire slip angle. + + if (RollingWhlVel == 0.0 && SideWhlVel == 0.0) { + WheelSlip = 0.0; + } else { + WheelSlip = RADTODEG*atan2(SideWhlVel, RollingWhlVel); + } + + // The following code normalizes the wheel velocity vector, reverses it, and zeroes out + // the z component of the velocity. The question is, should the Z axis velocity be zeroed + // out first before the normalization takes place or not? Subsequent to that, the Wheel + // Velocity vector now points as a unit vector backwards and parallel to the wheel + // velocity vector. It acts AT the wheel. + +// Note to Jon: I commented out this line because I wasn't sure we want to do this. +// vWhlVelVec = -1.0 * vWhlVelVec.Normalize(); +// vWhlVelVec(eZ) = 0.00; + +// Compute the sideforce coefficients using similar assumptions to LaRCSim for now. +// Allow a maximum of 10 degrees tire slip angle before wheel slides. At that point, +// transition from static to dynamic friction. There are more complicated formulations +// of this that avoid the discrete jump. Will fix this later. + + if (fabs(WheelSlip) <= 10.0) { + FCoeff = staticFCoeff*WheelSlip/10.0; + } else { + FCoeff = dynamicFCoeff*fabs(WheelSlip)/WheelSlip; + } + +// Compute the vertical force on the wheel. 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); MaximumStrutForce = max(MaximumStrutForce, fabs(vLocalForce(eZ))); MaximumStrutTravel = max(MaximumStrutTravel, fabs(compressLength)); - vForce = State->GetTl2b() * vLocalForce ; +// Compute the forces in the wheel ground plane. + + RollingForce = vLocalForce(eZ) * BrakeFCoeff * fabs(RollingWhlVel)/RollingWhlVel; + SideForce = vLocalForce(eZ) * FCoeff; + +// Transform these forces back to the local reference frame. + + vLocalForce(eX) = RollingForce*CosWheel - SideForce*SinWheel; + vLocalForce(eY) = SideForce*CosWheel + RollingForce*SinWheel; + +// Note to Jon: At this point the forces will be too big when the airplane is stopped or +// rolling to a stop. We need to make sure that the gear forces just balance out the non-gear forces +// when the airplane is stopped. That way the airplane won't start to accelerate until the non-gear +// forces are larger than the gear forces. I think that the proper fix should go into FGAircraft::FMGear. +// This routine would only compute the local strut forces and return them to FMGear. All of the gear +// forces would get adjusted in FMGear using the total non-gear forces. Then the gear moments would be +// calculated. If strange things start happening to the airplane during testing as it rolls to a stop, +// then we need to implement this change. I ran out of time to do it now but have the equations. + +// Transform the forces back to the body frame and compute the moment. + + vForce = State->GetTl2b() * vLocalForce; vMoment = vWhlBodyVec * vForce; } else { @@ -245,6 +366,7 @@ FGColumnVector FGLGear::Force(void) if (ReportEnable && Position->GetVel().Magnitude() <= 0.05 && !Reported) { Report(); } + return vForce; } @@ -266,3 +388,10 @@ void FGLGear::Report(void) Reported = true; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGLGear::Debug(void) +{ + // TODO: Add user code here +} + diff --git a/src/FDM/JSBSim/FGLGear.h b/src/FDM/JSBSim/FGLGear.h index 0b2536a18..8f1a18672 100644 --- a/src/FDM/JSBSim/FGLGear.h +++ b/src/FDM/JSBSim/FGLGear.h @@ -52,7 +52,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_LGEAR "$Header" +#define ID_LGEAR "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -61,6 +61,7 @@ FORWARD DECLARATIONS class FGAircraft; class FGPosition; class FGRotation; +class FGFCS; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] @@ -143,6 +144,7 @@ CLASS DOCUMENTATION length times the spring coefficient and the gear velocity times the damping coefficient.
  • 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. @@ -171,7 +173,9 @@ class FGLGear { public: /// Brake grouping enumerators - enum eBrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail }; + enum BrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail }; + /// Steering group membership enumerators + enum SteerType {stSteer, stFixed, stCaster}; /** Constructor @param Executive a pointer to the parent executive object @param File a pointer to the config file instance */ @@ -180,13 +184,14 @@ public: @param lgear a reference to an existing FGLGear object */ FGLGear(const FGLGear& lgear); /// Destructor - ~FGLGear(void); + ~FGLGear(); /// 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; } @@ -223,7 +228,7 @@ private: float bDamp; float compressLength; float compressSpeed; - float staticFCoeff, dynamicFCoeff; + float staticFCoeff, dynamicFCoeff, rollingFCoeff; float brakePct; float maxCompLen; double SinkRate; @@ -236,23 +241,27 @@ private: bool Reported; bool ReportEnable; string name; - string SteerType; - string BrakeGroup; - eBrakeGroup eBrakeGrp; + string sSteerType; + string sBrakeGroup; + BrakeGroup eBrakeGrp; + SteerType eSteerType; float maxSteerAngle; - FGFDMExec* Exec; - FGState* State; - FGAircraft* Aircraft; - FGPosition* Position; - FGRotation* Rotation; + FGFDMExec* Exec; + FGState* State; + FGAircraft* Aircraft; + FGPosition* Position; + FGRotation* Rotation; + FGFCS* FCS; void Report(void); + void Debug(void); }; #include "FGAircraft.h" #include "FGPosition.h" #include "FGRotation.h" +#include "FGFCS.h" //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif diff --git a/src/FDM/JSBSim/FGMassBalance.cpp b/src/FDM/JSBSim/FGMassBalance.cpp index 300496454..dc380b128 100644 --- a/src/FDM/JSBSim/FGMassBalance.cpp +++ b/src/FDM/JSBSim/FGMassBalance.cpp @@ -40,9 +40,11 @@ INCLUDES #include "FGMassBalance.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_MASSBALANCE; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -50,11 +52,12 @@ CLASS IMPLEMENTATION FGMassBalance::FGMassBalance(FGFDMExec* fdmex) : FGModel(fdmex) { - // + if (debug_lvl & 2) cout << "Instantiated: FGMassBalance" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -bool FGMassBalance:: Run(void) { +bool FGMassBalance::Run(void) { if (!FGModel::Run()) { @@ -64,3 +67,10 @@ bool FGMassBalance:: Run(void) { } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGMassBalance::Debug(void) +{ + // TODO: Add user code here +} + diff --git a/src/FDM/JSBSim/FGMassBalance.h b/src/FDM/JSBSim/FGMassBalance.h index 1e69fd502..b182fb2e5 100644 --- a/src/FDM/JSBSim/FGMassBalance.h +++ b/src/FDM/JSBSim/FGMassBalance.h @@ -44,7 +44,7 @@ INCLUDES #include "FGModel.h" -#define ID_MASSBALANCE "$Header" +#define ID_MASSBALANCE "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -58,6 +58,9 @@ public: ~FGMassBalance(); bool Run(void); + +private: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGMatrix.cpp b/src/FDM/JSBSim/FGMatrix.cpp index 5660020fd..a7e068783 100644 --- a/src/FDM/JSBSim/FGMatrix.cpp +++ b/src/FDM/JSBSim/FGMatrix.cpp @@ -20,9 +20,11 @@ INCLUDES #include "FGMatrix.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_MATRIX; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -45,7 +47,7 @@ double** FGalloc(int rows, int cols) void dealloc(double **A, int rows) { - for(int i=0;i<= rows;i++) delete[] A[i]; + for (int i=0; i <= rows; i++) delete[] A[i]; delete[] A; } @@ -56,6 +58,8 @@ FGMatrix::FGMatrix(const unsigned int r, const unsigned int c) : rows(r), cols(c data = FGalloc(rows,cols); InitMatrix(); rowCtr = colCtr = 1; + + if (debug_lvl & 2) cout << "Instantiated: FGMatrix" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -65,6 +69,8 @@ FGMatrix::FGMatrix(const FGMatrix& M) data = NULL; rowCtr = colCtr = 1; *this = M; + + if (debug_lvl & 2) cout << "Instantiated: FGMatrix" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -74,6 +80,8 @@ FGMatrix::~FGMatrix(void) dealloc(data,rows); rowCtr = colCtr = 1; rows = cols = 0; + + if (debug_lvl & 2) cout << "Destroyed: FGMatrix" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -190,14 +198,14 @@ void FGMatrix::InitMatrix(void) FGMatrix FGMatrix::operator-(const FGMatrix& M) { + FGMatrix Diff(Rows(), Cols()); + if ((Rows() != M.Rows()) || (Cols() != M.Cols())) { MatrixException mE; mE.Message = "Invalid row/column match in Matrix operator -"; throw mE; } - FGMatrix Diff(Rows(), Cols()); - for (unsigned int i=1; i<=Rows(); i++) { for (unsigned int j=1; j<=Cols(); j++) { Diff(i,j) = data[i][j] - M(i,j); @@ -227,14 +235,14 @@ void FGMatrix::operator-=(const FGMatrix &M) FGMatrix FGMatrix::operator+(const FGMatrix& M) { + FGMatrix Sum(Rows(), Cols()); + if ((Rows() != M.Rows()) || (Cols() != M.Cols())) { MatrixException mE; mE.Message = "Invalid row/column match in Matrix operator +"; throw mE; } - FGMatrix Sum(Rows(), Cols()); - for (unsigned int i=1; i<=Rows(); i++) { for (unsigned int j=1; j<=Cols(); j++) { Sum(i,j) = data[i][j] + M(i,j); @@ -289,14 +297,14 @@ void FGMatrix::operator*=(const double scalar) FGMatrix FGMatrix::operator*(const FGMatrix& M) { + FGMatrix Product(Rows(), M.Cols()); + if (Cols() != M.Rows()) { MatrixException mE; mE.Message = "Invalid row/column match in Matrix operator *"; throw mE; } - FGMatrix Product(Rows(), M.Cols()); - for (unsigned int i=1; i<=Rows(); i++) { for (unsigned int j=1; j<=M.Cols(); j++) { Product(i,j) = 0; @@ -340,15 +348,16 @@ FGMatrix FGMatrix::operator/(const double scalar) { FGMatrix Quot(Rows(), Cols()); - if(scalar != 0) { + if (scalar != 0) { for (unsigned int i=1; i<=Rows(); i++) { for (unsigned int j=1; j<=Cols(); j++) { Quot(i,j) = data[i][j]/scalar; } } - } else + } else { cerr << "Attempt to divide by zero in method FGMatrix::operator/(const double scalar), object at " << this << endl; + } return Quot; } @@ -435,10 +444,26 @@ void FGMatrix::TransposeNonSquare(void) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGColumnVector::FGColumnVector(void):FGMatrix(3,1) { } +void FGMatrix::Debug(void) +{ + //TODO: Add your source code here +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGColumnVector::FGColumnVector(void):FGMatrix(3,1) +{ + if (debug_lvl & 2) cout << "Instantiated: FGColumnVector" << endl; +} + FGColumnVector::FGColumnVector(int m):FGMatrix(m,1) { } FGColumnVector::FGColumnVector(const FGColumnVector& b):FGMatrix(b) { } -FGColumnVector::~FGColumnVector() { } + +FGColumnVector::~FGColumnVector(void) +{ +// dealloc(data,rows); + if (debug_lvl & 2) cout << "Destroyed: FGColumnVector" << endl; +} //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -473,17 +498,16 @@ FGColumnVector operator*(const FGMatrix& Mat, const FGColumnVector& Col) FGColumnVector FGColumnVector::operator+(const FGColumnVector& C) { + FGColumnVector Sum(C.Rows()); // This must be created dynamically + // because we don't know the size of "C", + // it could be 3 or 4 or ... if (Rows() != C.Rows()) { MatrixException mE; mE.Message = "Invalid row/column match in Column Vector operator *"; throw mE; } - FGColumnVector Sum(C.Rows()); - - for (unsigned int i=1; i<=C.Rows(); i++) { - Sum(i) = C(i) + data[i][1]; - } + for (unsigned int i=1; i<=C.Rows(); i++) Sum(i) = C(i) + data[i][1]; return Sum; } @@ -503,14 +527,14 @@ FGColumnVector FGColumnVector::operator*(const double scalar) FGColumnVector FGColumnVector::operator-(const FGColumnVector& V) { + FGColumnVector Diff(Rows()); + if ((Rows() != V.Rows()) || (Cols() != V.Cols())) { MatrixException mE; mE.Message = "Invalid row/column match in Column Vector operator -"; throw mE; } - FGColumnVector Diff(Rows()); - for (unsigned int i=1; i<=Rows(); i++) { Diff(i) = data[i][1] - V(i); } @@ -523,16 +547,13 @@ FGColumnVector FGColumnVector::operator-(const FGColumnVector& V) FGColumnVector FGColumnVector::operator/(const double scalar) { FGColumnVector Quotient(Rows()); - if(scalar != 0) { - + if (scalar != 0) { for (unsigned int i=1; i<=Rows(); i++) Quotient(i) = data[i][1] / scalar; - - } else + } else { cerr << "Attempt to divide by zero in method FGColumnVector::operator/(const double scalar), object " << this << endl; + } return Quotient; - - } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -582,16 +603,16 @@ FGColumnVector FGColumnVector::Normalize(void) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGColumnVector FGColumnVector::operator*(const FGColumnVector& V) +FGColumnVector& FGColumnVector::operator*(const FGColumnVector& V) { + static FGColumnVector Product(3); + if (Rows() != 3 || V.Rows() != 3) { MatrixException mE; mE.Message = "Invalid row count in vector cross product function"; throw mE; } - FGColumnVector Product(3); - Product(1) = data[2][1] * V(3) - data[3][1] * V(2); Product(2) = data[3][1] * V(1) - data[1][1] * V(3); Product(3) = data[1][1] * V(2) - data[2][1] * V(1); @@ -601,16 +622,16 @@ FGColumnVector FGColumnVector::operator*(const FGColumnVector& V) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGColumnVector FGColumnVector::multElementWise(const FGColumnVector& V) +FGColumnVector& FGColumnVector::multElementWise(const FGColumnVector& V) { + static FGColumnVector Product(3); + if (Rows() != 3 || V.Rows() != 3) { MatrixException mE; mE.Message = "Invalid row count in vector cross product function"; throw mE; } - FGColumnVector Product(3); - Product(1) = data[1][1] * V(1); Product(2) = data[2][1] * V(2); Product(3) = data[3][1] * V(3); @@ -619,3 +640,11 @@ FGColumnVector FGColumnVector::multElementWise(const FGColumnVector& V) } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGColumnVector::Debug(void) +{ + //TODO: Add your source code here +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + diff --git a/src/FDM/JSBSim/FGMatrix.h b/src/FDM/JSBSim/FGMatrix.h index 1acb572e4..068be0fff 100644 --- a/src/FDM/JSBSim/FGMatrix.h +++ b/src/FDM/JSBSim/FGMatrix.h @@ -23,7 +23,7 @@ INCLUDES #include #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # include # include @@ -44,7 +44,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_MATRIX "$Header" +#define ID_MATRIX "$Id$" using std::string; using std::ostream; @@ -74,20 +74,10 @@ DECLARATION: FGMatrix class FGMatrix { -protected: - double **data; - -private: - unsigned int rows,cols; - char delim; - int width,prec,origin; - void TransposeSquare(void); - void TransposeNonSquare(void); - unsigned int rowCtr, colCtr; - public: FGMatrix(unsigned int r, unsigned int c); FGMatrix(const FGMatrix& A); + FGMatrix(void) {}; ~FGMatrix(void); FGMatrix& operator=(const FGMatrix& A); @@ -120,6 +110,18 @@ public: friend FGMatrix operator*(double scalar,FGMatrix& A); void SetOParams(char delim,int width,int prec, int origin=0); + +protected: + double **data; + unsigned int rows,cols; + +private: + char delim; + int width,prec,origin; + void TransposeSquare(void); + void TransposeNonSquare(void); + unsigned int rowCtr, colCtr; + void Debug(void); }; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -132,12 +134,12 @@ public: FGColumnVector(void); FGColumnVector(int m); FGColumnVector(const FGColumnVector& b); - ~FGColumnVector(); + ~FGColumnVector(void); FGColumnVector operator*(const double scalar); - FGColumnVector operator*(const FGColumnVector& V); // Cross product operator + FGColumnVector& operator*(const FGColumnVector& V); // Cross product operator FGColumnVector operator/(const double scalar); - FGColumnVector operator+(const FGColumnVector& B); + FGColumnVector operator+(const FGColumnVector& B); // must not return reference FGColumnVector operator-(const FGColumnVector& B); float Magnitude(void); FGColumnVector Normalize(void); @@ -147,7 +149,43 @@ public: double& operator()(int m) const; - FGColumnVector multElementWise(const FGColumnVector& V); + FGColumnVector& multElementWise(const FGColumnVector& V); + +private: + void Debug(void); +}; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DECLARATION: FGMatrix3x3 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +class FGMatrix3x3 : public FGMatrix +{ +public: + FGMatrix3x3(void) {FGMatrix(3,3);} +// ~FGMatrix3x3(void) {~FGMatrix();} +}; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DECLARATION: FGColumnVector4 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +class FGColumnVector4 : public FGColumnVector +{ +public: + FGColumnVector4(void) {FGColumnVector(4);} +// ~FGColumnVector4(void) {~FGColumnVector();} +}; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DECLARATION: FGColumnVector3 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +class FGColumnVector3 : public FGColumnVector +{ +public: + FGColumnVector3(void) {FGColumnVector(3);} +// ~FGColumnVector3(void) {~FGColumnVector();} }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGModel.cpp b/src/FDM/JSBSim/FGModel.cpp index dc0a9d998..5a0fc8412 100644 --- a/src/FDM/JSBSim/FGModel.cpp +++ b/src/FDM/JSBSim/FGModel.cpp @@ -50,9 +50,15 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_MODEL; +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +GLOBAL DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -61,10 +67,11 @@ FGModel::FGModel(FGFDMExec* fdmex) { FDMExec = fdmex; NextModel = 0L; - + State = 0; Atmosphere = 0; FCS = 0; + Propulsion = 0; Aircraft = 0; Translation = 0; Rotation = 0; @@ -73,19 +80,25 @@ FGModel::FGModel(FGFDMExec* fdmex) Output = 0; exe_ctr = 1; + + if (debug_lvl & 2) cout << " FGModel Base Class" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGModel::~FGModel() { + if (debug_lvl & 2) cout << "Destroyed: FGModel" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGModel::InitModel(void) { State = FDMExec->GetState(); Atmosphere = FDMExec->GetAtmosphere(); FCS = FDMExec->GetFCS(); + Propulsion = FDMExec->GetPropulsion(); Aircraft = FDMExec->GetAircraft(); Translation = FDMExec->GetTranslation(); Rotation = FDMExec->GetRotation(); @@ -96,6 +109,7 @@ bool FGModel::InitModel(void) if (!State || !Atmosphere || !FCS || + !Propulsion || !Aircraft || !Translation || !Rotation || @@ -105,9 +119,12 @@ bool FGModel::InitModel(void) else return(true); } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGModel::Run() { + if (debug_lvl & 4) cout << "Entering Run() for model " << Name << endl; + if (exe_ctr == 1) { if (exe_ctr++ >= rate) exe_ctr = 1; return false; @@ -117,4 +134,10 @@ bool FGModel::Run() } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGModel::Debug(void) +{ + //TODO: Add your source code here +} diff --git a/src/FDM/JSBSim/FGModel.h b/src/FDM/JSBSim/FGModel.h index 9c8de946f..d8bc729c0 100644 --- a/src/FDM/JSBSim/FGModel.h +++ b/src/FDM/JSBSim/FGModel.h @@ -42,7 +42,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -53,7 +53,7 @@ INCLUDES #include -#define ID_MODEL "$Header$" +#define ID_MODEL "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS @@ -69,6 +69,7 @@ class FGFDMExec; class FGState; class FGAtmosphere; class FGFCS; +class FGPropulsion; class FGAircraft; class FGTranslation; class FGRotation; @@ -99,7 +100,7 @@ public: /// Constructor FGModel(FGFDMExec*); /// Destructor - virtual ~FGModel(void); + virtual ~FGModel(); FGModel* NextModel; string Name; @@ -122,20 +123,21 @@ protected: int exe_ctr; int rate; - + FGFDMExec* FDMExec; FGState* State; FGAtmosphere* Atmosphere; FGFCS* FCS; + FGPropulsion* Propulsion; FGAircraft* Aircraft; FGTranslation* Translation; FGRotation* Rotation; FGPosition* Position; FGAuxiliary* Auxiliary; FGOutput* Output; - -private: + virtual void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGNozzle.cpp b/src/FDM/JSBSim/FGNozzle.cpp index 69141ceea..c5faef38b 100644 --- a/src/FDM/JSBSim/FGNozzle.cpp +++ b/src/FDM/JSBSim/FGNozzle.cpp @@ -37,22 +37,75 @@ INCLUDES #include "FGNozzle.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_NOZZLE; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -FGNozzle::FGNozzle(FGFDMExec *FDMExec) : FGThruster(FDMExec) +FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg) : FGThruster(FDMExec) { + string token; + + Name = Nzl_cfg->GetValue("NAME"); + cout << " Nozzle Name: " << Name << endl; + Nzl_cfg->GetNextConfigLine(); + while (Nzl_cfg->GetValue() != "/FG_NOZZLE") { + *Nzl_cfg >> token; + if (token == "PE") { + *Nzl_cfg >> PE; + cout << " Nozzle Exit Pressure = " << PE << endl; + } else if (token == "EXPR") { + *Nzl_cfg >> ExpR; + cout << " Nozzle Expansion Ratio = " << ExpR << endl; + } else if (token == "NZL_EFF") { + *Nzl_cfg >> nzlEff; + cout << " Nozzle Efficiency = " << nzlEff << endl; + } else if (token == "DIAM") { + *Nzl_cfg >> Diameter; + cout << " Nozzle Diameter = " << Diameter << endl; + } else { + cout << "Unhandled token in Nozzle config file: " << token << endl; + } + } + + if (debug_lvl & 2) cout << "Instantiated: FGNozzle" << endl; +} +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGNozzle::~FGNozzle() +{ + if (debug_lvl & 2) cout << "Destroyed: FGNozzle" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void FGNozzle::Calculate(void) +float FGNozzle::Calculate(float CfPc) { - FGThruster::Calculate(); + float Thrust; + float pAtm = fdmex->GetAtmosphere()->GetPressure(); + + Thrust = (CfPc + (PE - pAtm)*ExpR) * (Diameter / ExpR) * nzlEff; + return Thrust; } + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGNozzle::GetPowerRequired(void) +{ + return PE; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGNozzle::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGNozzle.h b/src/FDM/JSBSim/FGNozzle.h index cf3d14c63..78dfb1e46 100644 --- a/src/FDM/JSBSim/FGNozzle.h +++ b/src/FDM/JSBSim/FGNozzle.h @@ -44,7 +44,7 @@ INCLUDES #include "FGThruster.h" -#define ID_NOZZLE "$Header$"; +#define ID_NOZZLE "$Id$"; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -53,11 +53,20 @@ CLASS DECLARATION class FGNozzle : public FGThruster { public: - FGNozzle(FGFDMExec *FDMExec); - ~FGNozzle(void); - - void Calculate(void); + FGNozzle(FGFDMExec* exec, FGConfigFile* AC_cfg); + ~FGNozzle(); + + float Calculate(float CfPc); + float GetPowerRequired(void); + +private: + float PE; + float ExpR; + float nzlEff; + float Diameter; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGOutput.cpp b/src/FDM/JSBSim/FGOutput.cpp index b85c0e574..21d95e9d5 100644 --- a/src/FDM/JSBSim/FGOutput.cpp +++ b/src/FDM/JSBSim/FGOutput.cpp @@ -49,9 +49,11 @@ INCLUDES #include "FGPosition.h" #include "FGAuxiliary.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_OUTPUT; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -69,13 +71,15 @@ FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex) #ifdef FG_WITH_JSBSIM_SOCKET socket = new FGfdmSocket("localhost",1138); #endif + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGOutput::~FGOutput(void) +FGOutput::~FGOutput() { if (socket) delete socket; + if (debug_lvl & 2) cout << "Destroyed: FGOutput" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -525,3 +529,8 @@ void FGOutput::SocketStatusOutput(string out_str) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +void FGOutput::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGOutput.h b/src/FDM/JSBSim/FGOutput.h index 603fd77b2..5d5c91c27 100644 --- a/src/FDM/JSBSim/FGOutput.h +++ b/src/FDM/JSBSim/FGOutput.h @@ -42,7 +42,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # include # else @@ -56,7 +56,7 @@ INCLUDES #include "FGfdmSocket.h" -#define ID_OUTPUT "$Header$" +#define ID_OUTPUT "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -66,7 +66,7 @@ class FGOutput : public FGModel { public: FGOutput(FGFDMExec*); - ~FGOutput(void); + ~FGOutput(); bool Run(void); @@ -89,6 +89,7 @@ private: enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type; ofstream datafile; FGfdmSocket* socket; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGPiston.cpp b/src/FDM/JSBSim/FGPiston.cpp index 9acbf502a..914d7fa1b 100644 --- a/src/FDM/JSBSim/FGPiston.cpp +++ b/src/FDM/JSBSim/FGPiston.cpp @@ -40,17 +40,86 @@ INCLUDES #include "FGPiston.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_PISTON; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec) +{ + string token; + + Name = Eng_cfg->GetValue("NAME"); + cout << "\n Engine Name: " << Name << endl; + Eng_cfg->GetNextConfigLine(); + while (Eng_cfg->GetValue() != "/FG_PISTON") { + *Eng_cfg >> token; + if (token == "BRAKEHORSEPOWER") { + *Eng_cfg >> BrakeHorsePower; + cout << " BrakeHorsePower = " << BrakeHorsePower << endl; + } else if (token == "MAXTHROTTLE") { + *Eng_cfg >> MaxThrottle; + cout << " MaxThrottle = " << MaxThrottle << endl; + } else if (token == "MINTHROTTLE") { + *Eng_cfg >> MinThrottle; + cout << " MinThrottle = " << MinThrottle << endl; + } else if (token == "SLFUELFLOWMAX") { + *Eng_cfg >> SLFuelFlowMax; + cout << " SLFuelFlowMax = " << SLFuelFlowMax << endl; + } else if (token == "SPEEDSLOPE") { + *Eng_cfg >> SpeedSlope; + cout << " SpeedSlope = " << SpeedSlope << endl; + } else if (token == "SPEEDINTERCEPT") { + *Eng_cfg >> SpeedIntercept; + cout << " SpeedIntercept = " << SpeedIntercept << endl; + } else if (token == "ALTITUDESLOPE") { + *Eng_cfg >> AltitudeSlope; + cout << " AltitudeSlope = " << AltitudeSlope << endl; + } else { + cout << "Unhandled token in Engine config file: " << token << endl; + } + } + + EngineNumber = 0; + + if (debug_lvl & 2) cout << "Instantiated: FGPiston" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGPiston::~FGPiston() +{ + if (debug_lvl & 2) cout << "Destroyed: FGPiston" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGPiston::Calculate(float PowerRequired) +{ + float h,EngineMaxPower; + + ConsumeFuel(); + + Throttle = FCS->GetThrottlePos(EngineNumber); + + h = Position->Geth(); + + if (h < 0) h = 0; + + EngineMaxPower = (1 + AltitudeSlope*h)*BrakeHorsePower; + PowerAvailable = Throttle*EngineMaxPower*HPTOFTLBSSEC - PowerRequired; + + return PowerAvailable; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGPiston::FGPiston(FGFDMExec* fdex, string enginePath, string engineName, int num) : - FGEngine(fdex, enginePath, engineName, num) +void FGPiston::Debug(void) { - // + //TODO: Add your source code here } diff --git a/src/FDM/JSBSim/FGPiston.h b/src/FDM/JSBSim/FGPiston.h index 579eb82de..a71197c3b 100644 --- a/src/FDM/JSBSim/FGPiston.h +++ b/src/FDM/JSBSim/FGPiston.h @@ -43,8 +43,9 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" +#include "FGConfigFile.h" -#define ID_PISTON "$Header$"; +#define ID_PISTON "$Id$"; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -52,12 +53,22 @@ CLASS DECLARATION class FGPiston : public FGEngine { - public: - FGPiston(FGFDMExec*, string, string, int); + FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg); ~FGPiston(); + float Calculate(float PowerRequired); + float GetPowerAvailable(void) {return PowerAvailable;} + +private: + float BrakeHorsePower; + float SpeedSlope; + float SpeedIntercept; + float AltitudeSlope; + float PowerAvailable; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGPosition.cpp b/src/FDM/JSBSim/FGPosition.cpp index 2a895b4c5..984e1bc7b 100644 --- a/src/FDM/JSBSim/FGPosition.cpp +++ b/src/FDM/JSBSim/FGPosition.cpp @@ -29,11 +29,11 @@ FUNCTIONAL DESCRIPTION -------------------------------------------------------------------------------- This class encapsulates the integration of rates and accelerations to get the current position of the aircraft. - + HISTORY -------------------------------------------------------------------------------- 01/05/99 JSB Created - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -48,14 +48,14 @@ COMMENTS, REFERENCES, and NOTES 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 -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # include # else @@ -78,9 +78,11 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_POSITION; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -106,13 +108,19 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex), RunwayRadius = SeaLevelRadius; DistanceAGL = Radius - RunwayRadius; // Geocentric vRunwayNormal(3) = -1.0; // Initialized for standalone mode + + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGPosition::~FGPosition(void) {} +FGPosition::~FGPosition() +{ + if (debug_lvl & 2) cout << "Destroyed: FGPosition" << endl; +} -/*************************************************************************** Run +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +/* Purpose: Called on a schedule to perform Positioning algorithms Notes: [TP] Make sure that -Vt <= hdot <= Vt, which, of course, should always be the case @@ -128,7 +136,10 @@ bool FGPosition:: Run(void) { GetState(); Vground = sqrt( vVel(eNorth)*vVel(eNorth) + vVel(eEast)*vVel(eEast) ); - + psigt = atan2(vVel(eEast), vVel(eNorth)); + if(psigt < 0.0) + psigt += 2*M_PI; + invMass = 1.0 / Aircraft->GetMass(); Radius = h + SeaLevelRadius; invRadius = 1.0 / Radius; @@ -174,21 +185,32 @@ void FGPosition::GetState(void) { vUVW = Translation->GetUVW(); Vt = Translation->GetVt(); - vVel = State->GetTb2l()*vUVW; + vVel = State->GetTb2l()*vUVW + Atmosphere->GetWindNED(); vVelDot = State->GetTb2l() * Translation->GetUVWdot(); b = Aircraft->GetWingSpan(); - } -void FGPosition::Seth(double tt) { - h=tt; +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGPosition::Seth(double tt) { + h = tt; Radius = h + SeaLevelRadius; - DistanceAGL = Radius - RunwayRadius; // Geocentric -} + DistanceAGL = Radius - RunwayRadius; // Geocentric +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGPosition::SetDistanceAGL(double tt) { DistanceAGL=tt; Radius = RunwayRadius + DistanceAGL; h = Radius - SeaLevelRadius; -} +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGPosition::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGPosition.h b/src/FDM/JSBSim/FGPosition.h index 0051817b2..8d2d45e85 100644 --- a/src/FDM/JSBSim/FGPosition.h +++ b/src/FDM/JSBSim/FGPosition.h @@ -45,7 +45,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_POSITION "$Header$" +#define ID_POSITION "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -74,7 +74,7 @@ public: @param Executive a pointer to the parent executive object */ FGPosition(FGFDMExec*); /// Destructor - ~FGPosition(void); + ~FGPosition(); /** Runs the Position model; called by the Executive @see JSBSim.cpp documentation @@ -88,6 +88,7 @@ public: inline double GetVe(void) { return vVel(eY); } inline double GetVd(void) { return vVel(eZ); } inline double GetVground(void) { return Vground; } + inline double GetGroundTrack(void) { return psigt; } inline double Geth(void) { return h; } inline double Gethdot(void) { return RadiusDot; } inline double GetLatitude(void) { return Latitude; } @@ -131,10 +132,12 @@ private: double Vt, Vground; double hoverb,b; - void GetState(void); + double psigt; - + void GetState(void); + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGPropeller.cpp b/src/FDM/JSBSim/FGPropeller.cpp index 5eefe09ff..96176e0f5 100644 --- a/src/FDM/JSBSim/FGPropeller.cpp +++ b/src/FDM/JSBSim/FGPropeller.cpp @@ -37,22 +37,148 @@ INCLUDES #include "FGPropeller.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_PROPELLER; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -FGPropeller::FGPropeller(FGFDMExec *FDMExec) : FGThruster(FDMExec) +FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(exec) +{ + string token; + int rows, cols; + + PropName = Prop_cfg->GetValue("NAME"); + cout << "\n Propeller Name: " << PropName << endl; + Prop_cfg->GetNextConfigLine(); + while (Prop_cfg->GetValue() != "/FG_PROPELLER") { + *Prop_cfg >> token; + if (token == "IXX") { + *Prop_cfg >> Ixx; + cout << " IXX = " << Ixx << endl; + } else if (token == "DIAMETER") { + *Prop_cfg >> Diameter; + Diameter /= 12.0; + cout << " Diameter = " << Diameter << " ft." << endl; + } else if (token == "NUMBLADES") { + *Prop_cfg >> numBlades; + cout << " Number of Blades = " << numBlades << endl; + } else if (token == "EFFICIENCY") { + *Prop_cfg >> rows >> cols; + if (cols == 1) Efficiency = new FGTable(rows); + else Efficiency = new FGTable(rows, cols); + *Efficiency << *Prop_cfg; + cout << " Efficiency: " << endl; + Efficiency->Print(); + } else if (token == "C_THRUST") { + *Prop_cfg >> rows >> cols; + if (cols == 1) cThrust = new FGTable(rows); + else cThrust = new FGTable(rows, cols); + *cThrust << *Prop_cfg; + cout << " Thrust Coefficient: " << endl; + cThrust->Print(); + } else if (token == "C_POWER") { + *Prop_cfg >> rows >> cols; + if (cols == 1) cPower = new FGTable(rows); + else cPower = new FGTable(rows, cols); + *cPower << *Prop_cfg; + cout << " Power Coefficient: " << endl; + cPower->Print(); + } else if (token == "EOF") { + cout << " End of file reached" << endl; + break; + } else { + cout << "Unhandled token in Propeller config file: " << token << endl; + } + } + + if (debug_lvl & 2) cout << "Instantiated: FGPropeller" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGPropeller::~FGPropeller() { + if (Efficiency) delete Efficiency; + if (cThrust) delete cThrust; + if (cPower) delete cPower; + if (debug_lvl & 2) cout << "Destroyed: FGPropeller" << endl; +} +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +// +// We must be getting the aerodynamic velocity here, NOT the inertial velocity. +// We need the velocity with respect to the wind. +// +// Note that PowerAvailable is the excess power available after the drag of the +// propeller has been subtracted. At equilibrium, PowerAvailable will be zero - +// indicating that the propeller will not accelerate or decelerate. +// Remembering that Torque * omega = Power, we can derive the torque on the +// propeller and its acceleration to give a new RPM. The current RPM will be +// used to calculate thrust. +// +// Because RPM could be zero, we need to be creative about what RPM is stated as. + +float FGPropeller::Calculate(float PowerAvailable) +{ + float J, C_Thrust, omega; + float Vel = (fdmex->GetTranslation()->GetUVW())(1); + float rho = fdmex->GetAtmosphere()->GetDensity(); + float RPS = RPM/60.0; + + if (RPM > 0.10) { + J = Vel / (Diameter * RPM / 60.0); + } else { + J = 0.0; + } + + if (MaxPitch == MinPitch) { // Fixed pitch prop + C_Thrust = cThrust->GetValue(J); + } else { // Variable pitch prop + C_Thrust = cThrust->GetValue(J, Pitch); + } + + Thrust = C_Thrust*RPS*RPS*Diameter*Diameter*Diameter*Diameter*rho; + vFn(1) = Thrust; + omega = RPS*2.0*M_PI; + + if (omega <= 500) omega = 1.0; + + Torque = PowerAvailable / omega; + RPM = (RPS + ((Torque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0; + return Thrust; // return thrust in pounds } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void FGPropeller::Calculate(void) +float FGPropeller::GetPowerRequired(void) { - FGThruster::Calculate(); + if (RPM <= 0.10) return 0.0; // If the prop ain't turnin', the fuel ain't burnin'. + + float cPReq, RPS = RPM / 60.0; + float J = (fdmex->GetTranslation()->GetUVW())(1) / (Diameter * RPS); + float rho = fdmex->GetAtmosphere()->GetDensity(); + + if (MaxPitch == MinPitch) { // Fixed pitch prop + cPReq = cPower->GetValue(J); + } else { // Variable pitch prop + cPReq = cPower->GetValue(J, Pitch); + } + + PowerRequired = cPReq*RPS*RPS*RPS*Diameter*Diameter*Diameter*Diameter + *Diameter*rho; + return PowerRequired; } + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGPropeller::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGPropeller.h b/src/FDM/JSBSim/FGPropeller.h index 5c2010eb0..aaabfea56 100644 --- a/src/FDM/JSBSim/FGPropeller.h +++ b/src/FDM/JSBSim/FGPropeller.h @@ -27,10 +27,6 @@ HISTORY -------------------------------------------------------------------------------- 08/24/00 JSB Created -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -COMMENTS, REFERENCES, and NOTES -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -43,8 +39,48 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGThruster.h" +#include "FGTable.h" +#include "FGTranslation.h" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +#define ID_PROPELLER "$Id$" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_PROPELLER "$Header$" +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Propeller modeling class. + FGPropeller models a propeller given the tabular data for Ct, Cp, and + efficiency indexed by advance ratio "J". The data for the propeller is + stored in a config file named "prop_name.xml". The propeller config file + is referenced from the main aircraft config file in the "Propulsion" section. + See the constructor for FGPropeller to see what is read in and what should + be stored in the config file.
    + Several references were helpful, here:
      +
    • Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", + Wiley & Sons, 1979 ISBN 0-471-03032-5
    • +
    • Edwin Hartman, David Biermann, "The Aerodynamic Characteristics of + Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6 + Airfoil Sections", NACA Report TN-640, 1938 (?)
    • +
    • Various NACA Technical Notes and Reports
    • +
        + @author Jon S. Berndt + @version $Id$ + @see FGEngine + @see FGThruster + @see FGTable +*/ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -53,11 +89,80 @@ CLASS DECLARATION class FGPropeller : public FGThruster { public: - FGPropeller(FGFDMExec *FDMExec); - ~FGPropeller(void); - - void Calculate(void); + /** Constructor for FGPropeller. + @param exec a pointer to the main executive object + @param AC_cfg a pointer to the main aircraft config file object */ + FGPropeller(FGFDMExec* exec, FGConfigFile* AC_cfg); + + /// Destructor for FGPropeller - deletes the FGTable objects + ~FGPropeller(); + + /** Sets the Revolutions Per Minute for the propeller. Normally the propeller + instance will calculate its own rotational velocity, given the Torque + produced by the engine and integrating over time using the standard + equation for rotational acceleration "a": a = Q/I , where Q is Torque and + I is moment of inertia for the propeller. + @param rpm the rotational velocity of the propeller */ + void SetRPM(float rpm) {RPM = rpm;} + + /** This commands the pitch of the blade to change to the value supplied. + This call is meant to be issued either from the cockpit or by the flight + control system (perhaps to maintain constant RPM for a constant-speed + propeller). This value will be limited to be within whatever is specified + in the config file for Max and Min pitch. It is also one of the lookup + indices to the power, thrust, and efficiency tables for variable-pitch + propellers. + @param pitch the pitch of the blade in degrees. */ + void SetPitch(float pitch) {Pitch = pitch;} + + /// Retrieves the pitch of the propeller in degrees. + float GetPitch(void) { return Pitch; } + + /// Retrieves the RPMs of the propeller + float GetRPM(void) { return RPM; } + + /// Retrieves the propeller moment of inertia + float GetIxx(void) { return Ixx; } + + /// Retrieves the Thrust in pounds + float GetThrust(void) { return Thrust; } + + /// Retrieves the Torque in foot-pounds (Don't you love the English system?) + float GetTorque(void) { return Torque; } + + /** Retrieves the power required (or "absorbed") by the propeller - + i.e. the power required to keep spinning the propeller at the current + velocity, air density, and rotational rate. */ + float GetPowerRequired(void); + + /** Calculates and returns the thrust produced by this propeller. + Given the excess power available from the engine (in foot-pounds), the thrust is + calculated, as well as the current RPM. The RPM is calculated by integrating + the torque provided by the engine over what the propeller "absorbs" + (essentially the "drag" of the propeller). + @param PowerAvailable this is the excess power provided by the engine to + accelerate the prop. It could be negative, dictating that the propeller + would be slowed. + @return the thrust in pounds */ + float Calculate(float PowerAvailable); + +private: + string PropName; + int numBlades; + float RPM; + float Ixx; + float Diameter; + float MaxPitch; + float MinPitch; + float Pitch; + float Thrust; + float Torque; + FGTable *Efficiency; + FGTable *cThrust; + FGTable *cPower; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGPropulsion.cpp b/src/FDM/JSBSim/FGPropulsion.cpp index 4536b5ed4..2530429a3 100644 --- a/src/FDM/JSBSim/FGPropulsion.cpp +++ b/src/FDM/JSBSim/FGPropulsion.cpp @@ -34,13 +34,9 @@ propeller). Once the Propulsion class gets the config file, it reads in information which is specific to a type of engine. Then: 1) The appropriate engine type instance is created -2) At least one thruster object is instantiated, and is linked to the engine +2) A thruster object is instantiated, and is linked to the engine 3) At least one tank object is created, and is linked to an engine. -Note: Thusters can be linked to more than one engine and engines can be linked -to more than one thruster. It is the same with tanks - a many to many -relationship can be established. - At Run time each engines Calculate() method is called to return the excess power generated during that iteration. The drag from the previous iteration is sub- tracted to give the excess power available for thrust this pass. That quantity @@ -58,23 +54,56 @@ INCLUDES #include "FGPropulsion.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_PROPULSION; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -FGPropulsion::FGPropulsion(FGFDMExec* fgex) : FGModel(fgex) +FGPropulsion::FGPropulsion(FGFDMExec* exec) : FGModel(exec) { + Name = "FGPropulsion"; + numSelectedFuelTanks = numSelectedOxiTanks = 0; + numTanks = numEngines = numThrusters = 0; + numOxiTanks = numFuelTanks = 0; + Forces = new FGColumnVector(3); + Moments = new FGColumnVector(3); + + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FGPropulsion::~FGPropulsion() +{ + for (unsigned int i=0; iGetdt(); + + Forces->InitMatrix(); + Moments->InitMatrix(); if (!FGModel::Run()) { + for (unsigned int i=0; iSetdeltaT(dt*rate); + PowerAvailable = Engines[i]->Calculate(Thrusters[i]->GetPowerRequired()); + Thrusters[i]->Calculate(PowerAvailable); + *Forces += Thrusters[i]->GetBodyForces(); // sum body frame forces + *Moments += Thrusters[i]->GetMoments(); // sum body frame moments + } return false; } else { @@ -82,38 +111,182 @@ bool FGPropulsion:: Run(void) { } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +bool FGPropulsion::GetSteadyState(void) { + float PowerAvailable; + float currentThrust = 0, lastThrust=-1; + dt = State->Getdt(); + + Forces->InitMatrix(); + Moments->InitMatrix(); + + if (!FGModel::Run()) { + for (unsigned int i=0; iSetTrimMode(true); + Thrusters[i]->SetdeltaT(dt*rate); + while (pow(currentThrust - lastThrust, 2.0) > currentThrust*0.00010) { + PowerAvailable = Engines[i]->Calculate(Thrusters[i]->GetPowerRequired()); + lastThrust = currentThrust; + currentThrust = Thrusters[i]->Calculate(PowerAvailable); + } + *Forces += Thrusters[i]->GetBodyForces(); // sum body frame forces + *Moments += Thrusters[i]->GetMoments(); // sum body frame moments + Engines[i]->SetTrimMode(false); + } + + return false; + } else { + return true; + } +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGPropulsion::LoadPropulsion(FGConfigFile* AC_cfg) { - string token; - string engine_name; + string token, fullpath; + string engineFileName, engType; + string thrusterFileName, thrType; string parameter; - int numEngines=0, numTanks=0; + string enginePath = FDMExec->GetEnginePath(); + float xLoc, yLoc, zLoc, Pitch, Yaw; + int Feed; + +# ifndef macintosh + fullpath = enginePath + "/"; +# else + fullpath = enginePath + ";"; +# endif AC_cfg->GetNextConfigLine(); while ((token = AC_cfg->GetValue()) != "/PROPULSION") { - *AC_cfg >> parameter; - if (parameter == "AC_ENGINE") { + if (token == "AC_ENGINE") { // ============ READING ENGINES + + engineFileName = AC_cfg->GetValue("FILE"); - *AC_cfg >> engine_name; - Engines[numEngines] = *(new FGEngine(FDMExec, FDMExec->GetEnginePath(), engine_name, numEngines)); - numEngines++; + cout << "\n Reading engine from file: " << fullpath + + engineFileName + ".xml"<< endl; + FGConfigFile Eng_cfg(fullpath + engineFileName + ".xml"); - } else if (parameter == "AC_TANK") { + if (Eng_cfg.IsOpen()) { + Eng_cfg.GetNextConfigLine(); + engType = Eng_cfg.GetValue(); - Tanks[numTanks] = *(new FGTank(AC_cfg)); - switch(Tanks[numTanks].GetType()) { + FCS->AddThrottle(); + + if (engType == "FG_ROCKET") { + Engines.push_back(new FGRocket(FDMExec, &Eng_cfg)); + } else if (engType == "FG_PISTON") { + Engines.push_back(new FGPiston(FDMExec, &Eng_cfg)); + } else if (engType == "FG_TURBOJET") { + Engines.push_back(new FGTurboJet(FDMExec, &Eng_cfg)); + } else if (engType == "FG_TURBOSHAFT") { + Engines.push_back(new FGTurboShaft(FDMExec, &Eng_cfg)); + } else if (engType == "FG_TURBOPROP") { + Engines.push_back(new FGTurboProp(FDMExec, &Eng_cfg)); + } else { + cerr << " Unrecognized engine type: " << engType << " found in config file.\n"; + } + + AC_cfg->GetNextConfigLine(); + while ((token = AC_cfg->GetValue()) != "/AC_ENGINE") { + *AC_cfg >> token; + if (token == "XLOC") { *AC_cfg >> xLoc; cout << " X = " << xLoc << endl;} + else if (token == "YLOC") { *AC_cfg >> yLoc; cout << " Y = " << yLoc << endl;} + else if (token == "ZLOC") { *AC_cfg >> zLoc; cout << " Z = " << zLoc << endl;} + else if (token == "PITCH") { *AC_cfg >> Pitch; cout << " Pitch = " << Pitch << endl;} + else if (token == "YAW") { *AC_cfg >> Yaw; cout << " Yaw = " << Yaw << endl;} + else if (token == "FEED") { + *AC_cfg >> Feed; + Engines[numEngines]->AddFeedTank(Feed); + cout << " Feed tank: " << Feed << endl; + } else cerr << "Unknown identifier: " << token << " in engine file: " + << engineFileName << endl; + } + + Engines[numEngines]->SetPlacement(xLoc, yLoc, zLoc, Pitch, Yaw); + numEngines++; + + } else { + + cerr << "Could not read engine config file: " << fullpath + + engineFileName + ".xml" << endl; + return false; + } + + } else if (token == "AC_TANK") { // ============== READING TANKS + + cout << "\n Reading tank definition" << endl; + Tanks.push_back(new FGTank(AC_cfg)); + switch(Tanks[numTanks]->GetType()) { case FGTank::ttFUEL: -// numSelectedFuelTanks++; + numSelectedFuelTanks++; + numFuelTanks++; break; case FGTank::ttOXIDIZER: -// numSelectedOxiTanks++; + numSelectedOxiTanks++; + numOxiTanks++; break; } + numTanks++; + + } else if (token == "AC_THRUSTER") { // ========== READING THRUSTERS + + thrusterFileName = AC_cfg->GetValue("FILE"); + + cout << "\n Reading thruster from file: " << + fullpath + thrusterFileName + ".xml" << endl; + FGConfigFile Thruster_cfg(fullpath + thrusterFileName + ".xml"); + + if (Thruster_cfg.IsOpen()) { + Thruster_cfg.GetNextConfigLine(); + thrType = Thruster_cfg.GetValue(); + + if (thrType == "FG_PROPELLER") { + Thrusters.push_back(new FGPropeller(FDMExec, &Thruster_cfg)); + } else if (thrType == "FG_NOZZLE") { + Thrusters.push_back(new FGNozzle(FDMExec, &Thruster_cfg)); + } + + AC_cfg->GetNextConfigLine(); + while ((token = AC_cfg->GetValue()) != "/AC_THRUSTER") { + *AC_cfg >> token; + if (token == "XLOC") *AC_cfg >> xLoc; + else if (token == "YLOC") *AC_cfg >> yLoc; + else if (token == "ZLOC") *AC_cfg >> zLoc; + else if (token == "PITCH") *AC_cfg >> Pitch; + else if (token == "YAW") *AC_cfg >> Yaw; + else cerr << "Unknown identifier: " << token << " in engine file: " + << engineFileName << endl; + } + + Thrusters[numThrusters]->SetLocation(xLoc, yLoc, zLoc); + Thrusters[numThrusters]->SetAnglesToBody(0, Pitch, Yaw); + Thrusters[numThrusters]->SetdeltaT(dt*rate); + + numThrusters++; + + } else { + cerr << "Could not read thruster config file: " << fullpath + + thrusterFileName + ".xml" << endl; + return false; + } + } + AC_cfg->GetNextConfigLine(); } + + return true; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGPropulsion::Debug(void) +{ + //TODO: Add your source code here } diff --git a/src/FDM/JSBSim/FGPropulsion.h b/src/FDM/JSBSim/FGPropulsion.h index c67c6a432..bd2e667d6 100644 --- a/src/FDM/JSBSim/FGPropulsion.h +++ b/src/FDM/JSBSim/FGPropulsion.h @@ -27,10 +27,6 @@ HISTORY -------------------------------------------------------------------------------- 08/20/00 JSB Created -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -COMMENTS, REFERENCES, and NOTES -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -38,15 +34,13 @@ SENTRY #ifndef FGPROPULSION_H #define FGPROPULSION_H -#define ID_PROPULSION "$Header$" - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -57,24 +51,131 @@ INCLUDES #include "FGModel.h" -#include "FGEngine.h" +#include "FGRocket.h" +#include "FGPiston.h" +#include "FGTurboShaft.h" +#include "FGTurboJet.h" +#include "FGTurboProp.h" #include "FGTank.h" -#include "FGThruster.h" -#include "FGConfigFile.h" +#include "FGPropeller.h" +#include "FGNozzle.h" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +#define ID_PROPULSION "$Id$" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Propulsion management class. + FGPropulsion manages all aspects of propulsive force generation, including + containment of engines, tanks, and thruster class instances in STL vectors, + and the interaction and communication between them. + @author Jon S. Berndt + @version $Id$ + @see FGEngine + @see FGTank + @see FGThruster +*/ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGPropulsion : public FGModel { - vector Engines; - vector Tanks; - vector Thrusters; public: FGPropulsion(FGFDMExec*); + ~FGPropulsion(); + + /** Executes the propulsion model. + The initial plan for the FGPropulsion class calls for Run() to be executed, + performing the following tasks: +
          +
        1. Determine the drag - or power required - for the attached thrust effector + for this engine so that any feedback to the engine can be performed. This + is done by calling FGThruster::CalculatePReq()
        2. +
        3. Given 1, above, calculate the power available from the engine. This is + done by calling FGEngine::CalculatePAvail()
        4. +
        5. Next, calculate the thrust output from the thruster model given the power + available and the power required. This may also result in new performance + numbers for the thruster in the case of the propeller, at least. This + result is returned from a call to Calculate().
        + [Note: Should we be checking the Starved flag here?] */ bool Run(void); + + /** Loads the propulsion system (engine[s], tank[s], thruster[s]). + Characteristics of the propulsion system are read in from the config file. + @param AC_cfg pointer to the config file instance that describes the + aircraft being modeled. + @return true if successfully loaded, otherwise false */ bool LoadPropulsion(FGConfigFile* AC_cfg); + + /// Retrieves the number of engines defined for the aircraft. + inline unsigned int GetNumEngines(void) {return Engines.size();} + + /** Retrieves an engine object pointer from the list of engines. + @param index the engine index within the vector container + @return the address of the specific engine, or zero if no such engine is + available */ + inline FGEngine* GetEngine(unsigned int index) { + if (index <= Engines.size()-1) return Engines[index]; + else return 0L; } + + /** Retrieves a tank object pointer from the list of tanks. + @param index the tank index within the vector container + @return the address of the specific tank, or zero if no such tank is + available */ + inline FGTank* GetTank(unsigned int index) { + if (index <= Tanks.size()-1) return Tanks[index]; + else return 0L; } + + /** Retrieves a thruster object pointer from the list of thrusters. + @param index the thruster index within the vector container + @return the address of the specific thruster, or zero if no such thruster is + available */ + inline FGThruster* GetThruster(unsigned int index) { + if (index <= Thrusters.size()-1) return Thrusters[index]; + else return 0L; } + + /** Returns the number of fuel tanks currently actively supplying fuel */ + inline int GetnumSelectedFuelTanks(void) {return numSelectedFuelTanks;} + + /** Returns the number of oxidizer tanks currently actively supplying oxidizer */ + inline int GetnumSelectedOxiTanks(void) {return numSelectedOxiTanks;} + + bool GetSteadyState(void); + + + inline FGColumnVector& GetForces(void) {return *Forces; } + inline FGColumnVector& GetMoments(void) {return *Moments;} + +private: + vector Engines; + vector Tanks; + vector Thrusters; + unsigned int numSelectedFuelTanks; + unsigned int numSelectedOxiTanks; + unsigned int numFuelTanks; + unsigned int numOxiTanks; + unsigned int numEngines; + unsigned int numTanks; + unsigned int numThrusters; + float dt; + FGColumnVector *Forces; + FGColumnVector *Moments; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGRocket.cpp b/src/FDM/JSBSim/FGRocket.cpp index 962b5bb38..3b38c0d49 100644 --- a/src/FDM/JSBSim/FGRocket.cpp +++ b/src/FDM/JSBSim/FGRocket.cpp @@ -40,17 +40,101 @@ INCLUDES #include "FGRocket.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_ROCKET; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +FGRocket::FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec) +{ + string token; + + Name = Eng_cfg->GetValue("NAME"); + cout << " Engine Name: " << Name << endl; + Eng_cfg->GetNextConfigLine(); + while (Eng_cfg->GetValue() != "/FG_ROCKET") { + *Eng_cfg >> token; + if (token == "SHR") { + *Eng_cfg >> SHR; + cout << " Specific Heat Ratio = " << SHR << endl; + } else if (token == "MAX_PC") { + *Eng_cfg >> maxPC; + cout << " Maximum Chamber Pressure = " << maxPC << endl; + } else if (token == "PROP_EFF") { + *Eng_cfg >> propEff; + cout << " Propulsive Efficiency = " << propEff << endl; + } else if (token == "MAXTHROTTLE") { + *Eng_cfg >> MaxThrottle; + cout << " MaxThrottle = " << MaxThrottle << endl; + } else if (token == "MINTHROTTLE") { + *Eng_cfg >> MinThrottle; + cout << " MinThrottle = " << MinThrottle << endl; + } else if (token == "SLFUELFLOWMAX") { + *Eng_cfg >> SLFuelFlowMax; + cout << " FuelFlowMax = " << SLFuelFlowMax << endl; + } else if (token == "SLOXIFLOWMAX") { + *Eng_cfg >> SLOxiFlowMax; + cout << " OxiFlowMax = " << SLOxiFlowMax << endl; + } else if (token == "VARIANCE") { + *Eng_cfg >> Variance; + cout << " Variance = " << Variance << endl; + } else { + cout << "Unhandled token in Engine config file: " << token << endl; + } + } + + EngineNumber = 0; + + kFactor = (2.0*SHR*SHR/(SHR-1.0))*pow(2.0/(SHR+1), (SHR+1)/(SHR-1)); + + if (debug_lvl & 2) cout << "Instantiated: FGRocket" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGRocket::~FGRocket() +{ + if (debug_lvl & 2) cout << "Destroyed: FGRocket" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGRocket::Calculate(float pe) +{ + float lastThrust; + float Cf; + float chamberPress; + + ConsumeFuel(); + + Throttle = FCS->GetThrottlePos(EngineNumber); + lastThrust = Thrust; // last actual thrust + + if (Throttle < MinThrottle || Starved) { + PctPower = Thrust = 0.0; // desired thrust + Flameout = true; + } else { + PctPower = Throttle / MaxThrottle; + chamberPress = maxPC*PctPower * (1.0 + Variance * ((float)rand()/(float)RAND_MAX - 0.5)); + Cf = sqrt(kFactor*(1 - pow(pe/(chamberPress), (SHR-1)/SHR))); + Flameout = false; + } + + if (State->Getdt() > 0.0) { // actual thrust - if not in freeze + Thrust -= 0.8*(Thrust - lastThrust); + } + + return Cf*maxPC*PctPower; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGRocket::FGRocket(FGFDMExec* fdex, string enginePath, string engineName, int num) : - FGEngine(fdex, enginePath, engineName, num) +void FGRocket::Debug(void) { - // + //TODO: Add your source code here } diff --git a/src/FDM/JSBSim/FGRocket.h b/src/FDM/JSBSim/FGRocket.h index 436971ea9..c99446c55 100644 --- a/src/FDM/JSBSim/FGRocket.h +++ b/src/FDM/JSBSim/FGRocket.h @@ -27,10 +27,6 @@ HISTORY -------------------------------------------------------------------------------- 09/12/2000 JSB Created -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -COMMENTS, REFERENCES, and NOTES -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -43,8 +39,62 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" +#include "FGConfigFile.h" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_ROCKET "$Header$" +#define ID_ROCKET "$Id$" + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** Models a generic rocket engine. + The rocket engine is modeled given the following parameters: +
          +
        • Chamber pressure (in psf)
        • +
        • Specific heat ratio (usually about 1.2 for hydrocarbon fuel and LOX)
        • +
        • Propulsive efficiency (in percent, from 0 to 1.0)
        • +
        • Variance (in percent, from 0 to 1.0, nominally 0.05)
        • +
        + Additionally, the following control inputs, operating characteristics, and + location are required, as with all other engine types: +
          +
        • Throttle setting (in percent, from 0 to 1.0)
        • +
        • Maximum allowable throttle setting
        • +
        • Minimum working throttle setting
        • +
        • Sea level fuel flow at maximum thrust
        • +
        • Sea level oxidizer flow at maximum thrust
        • +
        • X, Y, Z location in structural coordinate frame
        • +
        • Pitch and Yaw
        • +
        + The nozzle exit pressure (p2) is returned via a + call to FGNozzle::GetPowerRequired(). This exit pressure is used, + along with chamber pressure and specific heat ratio, to get the + thrust coefficient for the throttle setting. This thrust + coefficient is multiplied by the chamber pressure and then passed + to the nozzle Calculate() routine, where the thrust force is + determined. + + @author Jon S. Berndt + @version $Id$ + @see FGNozzle + @see FGThruster + @see FGForce + @see FGEngine + @see FGPropulsion + @see FGTank +*/ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -52,12 +102,31 @@ CLASS DECLARATION class FGRocket : public FGEngine { - public: - FGRocket(FGFDMExec*, string, string, int); + /** Constructor. + @param exec pointer to JSBSim parent object, the FDM Executive. + @param Eng_cfg pointer to the config file object. */ + FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg); + + /** Destructor */ ~FGRocket(); + /** Determines the thrust coefficient. + This routine takes the nozzle exit pressure and calculates the thrust + coefficient times the chamber pressure. + @param pe nozzle exit pressure + @return thrust coefficient times chamber pressure */ + float Calculate(float pe); + +private: + float SHR; + float maxPC; + float propEff; + float kFactor; + float Variance; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGRotation.cpp b/src/FDM/JSBSim/FGRotation.cpp index 5a4f4c13b..e96acb1a0 100644 --- a/src/FDM/JSBSim/FGRotation.cpp +++ b/src/FDM/JSBSim/FGRotation.cpp @@ -66,9 +66,11 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_ROTATION; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -81,15 +83,18 @@ FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex), vEuler(3), vEulerRates(3) { - Name = "FGRotation"; - cTht=cPhi=cPsi=1.0; - sTht=sPhi=sPsi=0.0; + Name = "FGRotation"; + cTht=cPhi=cPsi=1.0; + sTht=sPhi=sPsi=0.0; + + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGRotation::~FGRotation(void) +FGRotation::~FGRotation() { + if (debug_lvl & 2) cout << "Destroyed: FGRotation" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -116,12 +121,10 @@ bool FGRotation::Run(void) State->CalcMatrices(); vEuler = State->CalcEuler(); - cTht = cos(vEuler(eTht)); sTht = sin(vEuler(eTht)); cPhi = cos(vEuler(ePhi)); sPhi = sin(vEuler(ePhi)); cPsi = cos(vEuler(ePsi)); sPsi = sin(vEuler(ePsi)); - vEulerRates(eTht) = vPQR(2)*cPhi - vPQR(3)*sPhi; if (cTht != 0.0) { tTheta = sTht/cTht; // what's cheaper: / or tan() ? @@ -141,7 +144,6 @@ bool FGRotation::Run(void) void FGRotation::GetState(void) { dt = State->Getdt(); - vMoments = Aircraft->GetMoments(); Ixx = Aircraft->GetIxx(); @@ -152,3 +154,8 @@ void FGRotation::GetState(void) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +void FGRotation::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGRotation.h b/src/FDM/JSBSim/FGRotation.h index c6741290e..d072bda1e 100644 --- a/src/FDM/JSBSim/FGRotation.h +++ b/src/FDM/JSBSim/FGRotation.h @@ -58,7 +58,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -69,13 +69,13 @@ INCLUDES #ifndef M_PI # include -# define M_PI SGD_PI +# define M_PI FG_PI #endif #include "FGModel.h" #include "FGMatrix.h" -#define ID_ROTATION "$Header$" +#define ID_ROTATION "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -83,24 +83,9 @@ CLASS DECLARATION class FGRotation : public FGModel { - FGColumnVector vPQR; - FGColumnVector vPQRdot; - FGColumnVector vMoments; - FGColumnVector vEuler; - FGColumnVector vEulerRates; - - float cTht,sTht; - float cPhi,sPhi; - float cPsi,sPsi; - - float Ixx, Iyy, Izz, Ixz; - float dt; - - void GetState(void); - public: FGRotation(FGFDMExec*); - ~FGRotation(void); + ~FGRotation(); bool Run(void); @@ -123,9 +108,25 @@ public: inline float GetSintht(void) {return sTht;} inline float GetSinpsi(void) {return sPsi;} +private: + FGColumnVector vPQR; + FGColumnVector vPQRdot; + FGColumnVector vMoments; + FGColumnVector vEuler; + FGColumnVector vEulerRates; + + float cTht,sTht; + float cPhi,sPhi; + float cPsi,sPsi; + + float Ixx, Iyy, Izz, Ixz; + float dt; + void GetState(void); + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGRotor.cpp b/src/FDM/JSBSim/FGRotor.cpp index de5ee60ba..3bfd7e5d0 100644 --- a/src/FDM/JSBSim/FGRotor.cpp +++ b/src/FDM/JSBSim/FGRotor.cpp @@ -37,9 +37,11 @@ INCLUDES #include "FGRotor.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_ROTOR; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -47,12 +49,28 @@ CLASS IMPLEMENTATION FGRotor::FGRotor(FGFDMExec *FDMExec) : FGThruster(FDMExec) { + if (debug_lvl & 2) cout << "Instantiated: FGRotor" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FGRotor::~FGRotor() +{ + if (debug_lvl & 2) cout << "Destroyed: FGRotor" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void FGRotor::Calculate(void) +float FGRotor::Calculate(float PowerAvailable) { - FGThruster::Calculate(); + return 0.0; +} +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGRotor::Debug(void) +{ + //TODO: Add your source code here } + + diff --git a/src/FDM/JSBSim/FGRotor.h b/src/FDM/JSBSim/FGRotor.h index 9d22743f3..e86d11c17 100644 --- a/src/FDM/JSBSim/FGRotor.h +++ b/src/FDM/JSBSim/FGRotor.h @@ -44,7 +44,7 @@ INCLUDES #include "FGThruster.h" -#define ID_ROTOR "$Header$" +#define ID_ROTOR "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -54,9 +54,12 @@ class FGRotor : public FGThruster { public: FGRotor(FGFDMExec *FDMExec); - ~FGRotor(void); + ~FGRotor(); - void Calculate(void); + float Calculate(float); + +private: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGState.cpp b/src/FDM/JSBSim/FGState.cpp index d0ab74ab7..7422e86ac 100644 --- a/src/FDM/JSBSim/FGState.cpp +++ b/src/FDM/JSBSim/FGState.cpp @@ -38,7 +38,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -49,7 +49,7 @@ INCLUDES #ifndef M_PI # include -# define M_PI SGD_PI +# define M_PI FG_PI #endif #include "FGState.h" @@ -63,9 +63,11 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_STATE; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MACROS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -86,14 +88,17 @@ CLASS IMPLEMENTATION FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3), mTl2b(3,3), mTs2b(3,3), - vQtrn(4) + vQtrn(4), + vlastQdot(4) { FDMExec = fdex; a = 1000.0; sim_time = 0.0; dt = 1.0/120.0; - + ActiveEngine = -1; + + RegisterVariable(FG_TIME, " time " ); RegisterVariable(FG_QBAR, " qbar " ); RegisterVariable(FG_WINGAREA, " wing_area " ); RegisterVariable(FG_WINGSPAN, " wingspan " ); @@ -102,7 +107,7 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3), RegisterVariable(FG_ALPHADOT, " alphadot " ); RegisterVariable(FG_BETA, " beta " ); RegisterVariable(FG_BETADOT, " betadot " ); - RegisterVariable(SGD_PITCHRATE, " pitch_rate " ); + RegisterVariable(FG_PITCHRATE, " pitch_rate " ); RegisterVariable(FG_ROLLRATE, " roll_rate " ); RegisterVariable(FG_YAWRATE, " yaw_rate " ); RegisterVariable(FG_MACH, " mach " ); @@ -123,18 +128,26 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3), RegisterVariable(FG_FLAPS_CMD, " flaps_cmd " ); RegisterVariable(FG_THROTTLE_CMD, " throttle_cmd " ); RegisterVariable(FG_THROTTLE_POS, " throttle_pos " ); + RegisterVariable(FG_ACTIVE_ENGINE, " active_engine " ); RegisterVariable(FG_HOVERB, " height/span " ); - RegisterVariable(SGD_PITCH_TRIM_CMD, " pitch_trim_cmd " ); + RegisterVariable(FG_PITCH_TRIM_CMD, " pitch_trim_cmd " ); + + if (debug_lvl & 2) cout << "Instantiated: FGState" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGState::~FGState(void) {} +FGState::~FGState() +{ + if (debug_lvl & 2) cout << "Destroyed: FGState" << endl; +} //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGState::GetParameter(eParam val_idx) { switch(val_idx) { + case FG_TIME: + return sim_time; case FG_QBAR: return FDMExec->GetTranslation()->Getqbar(); case FG_WINGAREA: @@ -151,7 +164,7 @@ float FGState::GetParameter(eParam val_idx) { return FDMExec->GetTranslation()->Getbeta(); case FG_BETADOT: return FDMExec->GetTranslation()->Getbdot(); - case SGD_PITCHRATE: + case FG_PITCHRATE: return (FDMExec->GetRotation()->GetPQR())(2); case FG_ROLLRATE: return (FDMExec->GetRotation()->GetPQR())(1); @@ -201,7 +214,7 @@ float FGState::GetParameter(eParam val_idx) { return FDMExec->GetFCS()->GetThrottlePos(0); case FG_HOVERB: return FDMExec->GetPosition()->GetHOverB(); - case SGD_PITCH_TRIM_CMD: + case FG_PITCH_TRIM_CMD: return FDMExec->GetFCS()->GetPitchTrimCmd(); default: cerr << "FGState::GetParameter() - No handler for parameter " << val_idx << endl; @@ -245,7 +258,37 @@ void FGState::SetParameter(eParam val_idx, float val) { FDMExec->GetFCS()->SetDfPos(val); break; case FG_THROTTLE_POS: - FDMExec->GetFCS()->SetThrottlePos(-1,val); + FDMExec->GetFCS()->SetThrottlePos(ActiveEngine,val); + break; + + case FG_ELEVATOR_CMD: + FDMExec->GetFCS()->SetDeCmd(val); + break; + case FG_AILERON_CMD: + FDMExec->GetFCS()->SetDaCmd(val); + break; + case FG_RUDDER_CMD: + FDMExec->GetFCS()->SetDrCmd(val); + break; + case FG_SPDBRAKE_CMD: + FDMExec->GetFCS()->SetDsbCmd(val); + break; + case FG_SPOILERS_CMD: + FDMExec->GetFCS()->SetDspCmd(val); + break; + case FG_FLAPS_CMD: + FDMExec->GetFCS()->SetDfCmd(val); + break; + case FG_THROTTLE_CMD: + FDMExec->GetFCS()->SetThrottleCmd(ActiveEngine,val); + break; + + case FG_ACTIVE_ENGINE: + ActiveEngine = (int)val; + break; + + default: + cerr << "Parameter '" << val_idx << "' (" << paramdef[val_idx] << ") not handled" << endl; } } @@ -461,14 +504,13 @@ void FGState::CalcMatrices(void) { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void FGState::IntegrateQuat(FGColumnVector vPQR, int rate) { - static FGColumnVector vlastQdot(4); static FGColumnVector vQdot(4); + static FGColumnVector vTmp(4); vQdot(1) = -0.5*(vQtrn(2)*vPQR(eP) + vQtrn(3)*vPQR(eQ) + vQtrn(4)*vPQR(eR)); vQdot(2) = 0.5*(vQtrn(1)*vPQR(eP) + vQtrn(3)*vPQR(eR) - vQtrn(4)*vPQR(eQ)); vQdot(3) = 0.5*(vQtrn(1)*vPQR(eQ) + vQtrn(4)*vPQR(eP) - vQtrn(2)*vPQR(eR)); vQdot(4) = 0.5*(vQtrn(1)*vPQR(eR) + vQtrn(2)*vPQR(eQ) - vQtrn(3)*vPQR(eP)); - vQtrn += 0.5*dt*rate*(vlastQdot + vQdot); vQtrn.Normalize(); @@ -518,3 +560,8 @@ FGMatrix FGState::GetTs2b(float alpha, float beta) { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +void FGState::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGState.h b/src/FDM/JSBSim/FGState.h index 4e0fcf67f..196b4035b 100644 --- a/src/FDM/JSBSim/FGState.h +++ b/src/FDM/JSBSim/FGState.h @@ -46,7 +46,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -65,7 +65,7 @@ INCLUDES DEFINES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_STATE "$Header$" +#define ID_STATE "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -76,7 +76,7 @@ class FGFDMExec; class FGState { public: FGState(FGFDMExec*); - ~FGState(void); + ~FGState(); bool Reset(string, string, string); void Initialize(float, float, float, float, float, float, float, float, float); @@ -95,7 +95,6 @@ public: float GetParameter(string val_string); eParam GetParameterIndex(string val_string); - inline void Seta(float tt) { a = tt; } inline float Setsim_time(float tt) { @@ -131,9 +130,12 @@ private: FGMatrix mTl2b; FGMatrix mTs2b; FGColumnVector vQtrn; + FGColumnVector vlastQdot; typedef map CoeffMap; CoeffMap coeffdef; + void Debug(void); + int ActiveEngine; protected: enum {ePhi=1, eTht, ePsi}; @@ -142,3 +144,4 @@ protected: //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGTank.cpp b/src/FDM/JSBSim/FGTank.cpp index 52f592e46..2559b38b1 100644 --- a/src/FDM/JSBSim/FGTank.cpp +++ b/src/FDM/JSBSim/FGTank.cpp @@ -38,29 +38,39 @@ INCLUDES #include "FGTank.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_TANK; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +using std::cerr; +using std::endl; +using std::cout; FGTank::FGTank(FGConfigFile* AC_cfg) { - string type; - - *AC_cfg >> type; // Type = 0: fuel, 1: oxidizer - - if (type == "FUEL") Type = ttFUEL; + string type = AC_cfg->GetValue("TYPE"); + string token; + + if (type == "FUEL") Type = ttFUEL; else if (type == "OXIDIZER") Type = ttOXIDIZER; - else Type = ttUNKNOWN; - *AC_cfg >> X; // inches - *AC_cfg >> Y; // " - *AC_cfg >> Z; // " - *AC_cfg >> Radius; // " - *AC_cfg >> Capacity; // pounds (amount it can hold) - *AC_cfg >> Contents; // pounds (amount it is holding) + else Type = ttUNKNOWN; + + AC_cfg->GetNextConfigLine(); + while ((token = AC_cfg->GetValue()) != "/AC_TANK") { + if (token == "XLOC") *AC_cfg >> X; + else if (token == "YLOC") *AC_cfg >> Y; + else if (token == "ZLOC") *AC_cfg >> Z; + else if (token == "RADIUS") *AC_cfg >> Radius; + else if (token == "CAPACITY") *AC_cfg >> Capacity; + else if (token == "CONTENTS") *AC_cfg >> Contents; + else cerr << "Unknown identifier: " << token << " in tank definition." << endl; + } + Selected = true; if (Capacity != 0) { @@ -69,13 +79,23 @@ FGTank::FGTank(FGConfigFile* AC_cfg) Contents = 0; PctFull = 0; } + + cout << " " << type << " tank holds " << Capacity << " lbs. " << type << endl; + cout << " currently at " << PctFull << "% of maximum capacity" << endl; + cout << " Tank location (X, Y, Z): " << X << ", " << Y << ", " << Z << endl; + cout << " Effective radius: " << Radius << " inches" << endl; + + if (debug_lvl & 2) cout << "Instantiated: FGTank" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGTank::~FGTank(void) +FGTank::~FGTank() { + if (debug_lvl & 2) cout << "Destroyed: FGTank" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float FGTank::Reduce(float used) { @@ -84,7 +104,7 @@ float FGTank::Reduce(float used) if (used < Contents) { Contents -= used; PctFull = 100.0*Contents/Capacity; - return Contents; + return 0.0; } else { shortage = Contents - used; Contents = 0.0; @@ -94,3 +114,10 @@ float FGTank::Reduce(float used) } } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGTank::Debug(void) +{ + //TODO: Add your source code here +} + diff --git a/src/FDM/JSBSim/FGTank.h b/src/FDM/JSBSim/FGTank.h index 5919c473b..cd7a2ecac 100644 --- a/src/FDM/JSBSim/FGTank.h +++ b/src/FDM/JSBSim/FGTank.h @@ -55,7 +55,7 @@ INCLUDES DEFINES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_TANK "$Header" +#define ID_TANK "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -65,7 +65,7 @@ class FGTank { public: FGTank(FGConfigFile*); - ~FGTank(void); + ~FGTank(); float Reduce(float); int GetType(void) {return Type;} @@ -86,9 +86,9 @@ private: float PctFull; float Contents; bool Selected; - -protected: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGThruster.cpp b/src/FDM/JSBSim/FGThruster.cpp index 04c616625..758c14494 100644 --- a/src/FDM/JSBSim/FGThruster.cpp +++ b/src/FDM/JSBSim/FGThruster.cpp @@ -37,9 +37,11 @@ INCLUDES #include "FGThruster.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_THRUSTER; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -47,12 +49,22 @@ CLASS IMPLEMENTATION FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec) { + SetTransformType(FGForce::tCustom); + if (debug_lvl & 2) cout << "Instantiated: FGThruster" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void FGThruster::Calculate(void) +FGThruster::~FGThruster() { + if (debug_lvl & 2) cout << "Destroyed: FGThruster" << endl; +} +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGThruster::Debug(void) +{ + //TODO: Add your source code here } diff --git a/src/FDM/JSBSim/FGThruster.h b/src/FDM/JSBSim/FGThruster.h index e340d2f06..d03e92ede 100644 --- a/src/FDM/JSBSim/FGThruster.h +++ b/src/FDM/JSBSim/FGThruster.h @@ -43,8 +43,9 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGForce.h" +#include "FGConfigFile.h" -#define ID_THRUSTER "$Header" +#define ID_THRUSTER "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -54,12 +55,23 @@ class FGThruster : public FGForce { public: FGThruster(FGFDMExec *FDMExec); - ~FGThruster(void); + virtual ~FGThruster(); enum Type {ttNozzle, ttRotor, ttPropeller}; - virtual void Calculate(void); + virtual float Calculate(float) {return 0.0;} + void SetName(string name) {Name = name;} + virtual float GetPowerRequired(void) {return 0.0;} + virtual void SetdeltaT(float dt) {deltaT = dt;} + +protected: + string Name; + float Thrust; + float PowerRequired; + float deltaT; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGTranslation.cpp b/src/FDM/JSBSim/FGTranslation.cpp index aa706890e..82407997f 100644 --- a/src/FDM/JSBSim/FGTranslation.cpp +++ b/src/FDM/JSBSim/FGTranslation.cpp @@ -1,40 +1,40 @@ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - + Module: FGTranslation.cpp Author: Jon Berndt Date started: 12/02/98 Purpose: Integrates the translational EOM Called by: FDMExec - + ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) ------------- - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. - + FUNCTIONAL DESCRIPTION -------------------------------------------------------------------------------- This class integrates the translational EOM. - + HISTORY -------------------------------------------------------------------------------- 12/02/98 JSB Created - 7/23/99 TP Added data member and modified Run and PutState to calcuate - Mach number - + 7/23/99 TP Added data member and modified Run and PutState to calcuate + Mach number + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -49,10 +49,10 @@ COMMENTS, REFERENCES, and NOTES 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 - + 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -68,9 +68,11 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_TRANSLATION; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -78,7 +80,6 @@ CLASS IMPLEMENTATION FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex), vUVW(3), - vWindUVW(3), vUVWdot(3), vNcg(3), vPQR(3), @@ -92,11 +93,16 @@ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex), alpha = beta = 0.0; adot = bdot = 0.0; rho = 0.002378; + + if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -FGTranslation::~FGTranslation(void) {} +FGTranslation::~FGTranslation() +{ + if (debug_lvl & 2) cout << "Destroyed: FGTranslation" << endl; +} //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -119,11 +125,11 @@ bool FGTranslation::Run(void) { mVel(3,3) = 0.0; vUVWdot = mVel*vPQR + vForces/Mass; - - vNcg=vUVWdot*INVGRAVITY; - vUVW += 0.5*dt*rate*(vlastUVWdot + vUVWdot) + vWindUVW; - + vNcg = vUVWdot*INVGRAVITY; + + vUVW += 0.5*dt*rate*(vlastUVWdot + vUVWdot); + Vt = vUVW.Magnitude(); if (vUVW(eW) != 0.0) @@ -131,27 +137,23 @@ bool FGTranslation::Run(void) { if (vUVW(eV) != 0.0) beta = vUVW(eU)*vUVW(eU)+vUVW(eW)*vUVW(eW) > 0.0 ? atan2(vUVW(eV), sqrt(vUVW(eU)*vUVW(eU) + vUVW(eW)*vUVW(eW))) : 0.0; - - - - // stolen, quite shamelessly, from LaRCsim + + // stolen, quite shamelessly, from LaRCsim float mUW = (vUVW(eU)*vUVW(eU) + vUVW(eW)*vUVW(eW)); float signU=1; if (vUVW(eU) != 0.0) - signU = vUVW(eU)/fabs(vUVW(eU)); - - if( (mUW == 0.0) || (Vt == 0.0) ) { - adot = 0.0; - bdot = 0.0; - } else { - adot = (vUVW(eU)*vUVWdot(eW) - vUVW(eW)*vUVWdot(eU))/mUW; - bdot = (signU*mUW*vUVWdot(eV) - vUVW(eV)*(vUVW(eU)*vUVWdot(eU) + signU = vUVW(eU)/fabs(vUVW(eU)); + + if ( (mUW == 0.0) || (Vt == 0.0) ) { + adot = 0.0; + bdot = 0.0; + } else { + adot = (vUVW(eU)*vUVWdot(eW) - vUVW(eW)*vUVWdot(eU))/mUW; + bdot = (signU*mUW*vUVWdot(eV) - vUVW(eV)*(vUVW(eU)*vUVWdot(eU) + vUVW(eW)*vUVWdot(eW)))/(Vt*Vt*sqrt(mUW)); - } - // - - qbar = 0.5*rho*Vt*Vt; + } + qbar = 0.5*rho*Vt*Vt; Mach = Vt / State->Geta(); vlastUVWdot = vUVWdot; @@ -173,7 +175,12 @@ void FGTranslation::GetState(void) { rho = Atmosphere->GetDensity(); vEuler = Rotation->GetEuler(); +} - vWindUVW = Atmosphere->GetWindUVW(); +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGTranslation::Debug(void) +{ + //TODO: Add your source code here } diff --git a/src/FDM/JSBSim/FGTranslation.h b/src/FDM/JSBSim/FGTranslation.h index 7eb04d6f4..fff41ab0a 100644 --- a/src/FDM/JSBSim/FGTranslation.h +++ b/src/FDM/JSBSim/FGTranslation.h @@ -58,7 +58,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -70,7 +70,7 @@ INCLUDES #include "FGModel.h" #include "FGMatrix.h" -#define ID_TRANSLATION "$Header" +#define ID_TRANSLATION "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -79,7 +79,7 @@ CLASS DECLARATION class FGTranslation : public FGModel { public: FGTranslation(FGFDMExec*); - ~FGTranslation(void); + ~FGTranslation(); inline FGColumnVector GetUVW(void) { return vUVW; } inline FGColumnVector GetUVWdot(void) { return vUVWdot; } @@ -104,13 +104,13 @@ public: inline void Setbdot (float tt) { bdot = tt; } inline void SetAB(float t1, float t2) { alpha=t1; beta=t2; } - + bool Run(void); protected: private: - FGColumnVector vUVW,vWindUVW; + FGColumnVector vUVW; FGColumnVector vUVWdot; FGColumnVector vNcg; FGColumnVector vPQR; @@ -124,7 +124,9 @@ private: float rho; void GetState(void); + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGTrim.cpp b/src/FDM/JSBSim/FGTrim.cpp index 5bc3f407a..67fd7d53f 100644 --- a/src/FDM/JSBSim/FGTrim.cpp +++ b/src/FDM/JSBSim/FGTrim.cpp @@ -52,9 +52,15 @@ INCLUDES #include "FGTrim.h" #include "FGAircraft.h" -static const char *IdSrc = "$Header$"; +#if _MSC_VER +#pragma warning (disable : 4786 4788) +#endif + +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_TRIM; +extern short debug_lvl; + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGTrim::FGTrim(FGFDMExec *FDMExec,FGInitialCondition *FGIC, TrimMode tt ) { @@ -76,44 +82,47 @@ FGTrim::FGTrim(FGFDMExec *FDMExec,FGInitialCondition *FGIC, TrimMode tt ) { xlo=xhi=alo=ahi; switch(mode) { case tFull: - cout << " Full 6-DOF Trim" << endl; - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAlpha,Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tUdot,tThrottle,Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tPitchTrim,A_Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tVdot,tPhi,Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tAileron,A_Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tRdot,tRudder,A_Tolerance)); + cout << " Full Trim" << endl; + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAlpha )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tUdot,tThrottle )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tPitchTrim )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tHmgt,tBeta )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tVdot,tPhi )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tAileron )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tRdot,tRudder )); break; case tLongitudinal: cout << " Longitudinal Trim" << endl; - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAlpha,Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tUdot,tThrottle,Tolerance)); - TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tPitchTrim,A_Tolerance)); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAlpha )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tUdot,tThrottle )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tPitchTrim )); break; case tGround: 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,tWdot,tAltAGL )); + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tTheta )); + //TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tPhi )); break; } - //cout << "NumAxes: " << TrimAxes.size() << endl; - NumAxes=TrimAxes.size(); - sub_iterations=new float[NumAxes]; - successful=new float[NumAxes]; - solution=new bool[NumAxes]; + //cout << "TrimAxes.size(): " << TrimAxes.size() << endl; + sub_iterations=new float[TrimAxes.size()]; + successful=new float[TrimAxes.size()]; + solution=new bool[TrimAxes.size()]; current_axis=0; + + if (debug_lvl & 2) cout << "Instantiated: FGTrim" << endl; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGTrim::~FGTrim(void) { - for(current_axis=0; current_axis 0) { cout << " Sub-iterations:" << endl; - for(current_axis=0; current_axisGetRunCount(); sprintf(out," %5s: %3.0f average: %5.2f successful: %3.0f stability: %5.2f\n", - TrimAxes[current_axis]->GetAccelName().c_str(), + TrimAxes[current_axis]->GetStateName().c_str(), sub_iterations[current_axis], sub_iterations[current_axis]/float(total_its), successful[current_axis], @@ -143,7 +152,7 @@ void FGTrim::TrimStats() { void FGTrim::Report(void) { cout << " Trim Results: " << endl; - for(current_axis=0; current_axisAxisReport(); } @@ -189,7 +198,7 @@ void FGTrim::ReportState(void) { cout << out; sprintf(out, " Normal Load Factor: %4.2f g's Pitch Rate: %5.2f deg/s\n", fdmex->GetAircraft()->GetNlf(), - fdmex->GetState()->GetParameter(SGD_PITCHRATE)*RADTODEG ); + fdmex->GetState()->GetParameter(FG_PITCHRATE)*RADTODEG ); cout << out; sprintf(out, " Heading: %3.0f deg true Sideslip: %5.2f deg\n", fdmex->GetRotation()->Getpsi()*RADTODEG, @@ -205,27 +214,134 @@ void FGTrim::ReportState(void) { cout << out; sprintf(out, " Throttle: %5.2f%c\n", fdmex->GetFCS()->GetThrottlePos(0),'%' ); - cout << out; + cout << out; + + sprintf(out, " Wind Components: %5.2f kts head wind, %5.2f kts cross wind\n", + fdmex->GetAuxiliary()->GetHeadWind()*jsbFPSTOKTS, + fdmex->GetAuxiliary()->GetCrossWind()*jsbFPSTOKTS ); + cout << out; + + sprintf(out, " Ground Speed: %4.0f knots , Ground Track: %3.0f deg true\n", + fdmex->GetPosition()->GetVground()*jsbFPSTOKTS, + fdmex->GetPosition()->GetGroundTrack()*RADTODEG ); + cout << out; + +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGTrim::ClearStates(void) { + FGTrimAxis* ta; + + mode=tCustom; + vector::iterator iAxes; + iAxes = TrimAxes.begin(); + while (iAxes != TrimAxes.end()) { + ta=*iAxes; + delete ta; + iAxes++; + } + TrimAxes.clear(); + cout << "TrimAxes.size(): " << TrimAxes.size() << endl; } + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +bool FGTrim::AddState( State state, Control control ) { + FGTrimAxis* ta; + bool result=true; + + mode = tCustom; + vector ::iterator iAxes = TrimAxes.begin(); + while (iAxes != TrimAxes.end()) { + ta=*iAxes; + if( ta->GetStateType() == state ) + result=false; + iAxes++; + } + if(result) { + TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,state,control)); + delete[] sub_iterations; + delete[] successful; + delete[] solution; + sub_iterations=new float[TrimAxes.size()]; + successful=new float[TrimAxes.size()]; + solution=new bool[TrimAxes.size()]; + } + return result; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +bool FGTrim::RemoveState( State state ) { + FGTrimAxis* ta; + bool result=false; + + mode = tCustom; + vector ::iterator iAxes = TrimAxes.begin(); + while (iAxes != TrimAxes.end()) { + ta=*iAxes; + if( ta->GetStateType() == state ) { + delete ta; + TrimAxes.erase(iAxes); + result=true; + continue; + } + iAxes++; + } + if(result) { + delete[] sub_iterations; + delete[] successful; + delete[] solution; + sub_iterations=new float[TrimAxes.size()]; + successful=new float[TrimAxes.size()]; + solution=new bool[TrimAxes.size()]; + } + return result; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +bool FGTrim::EditState( State state, Control new_control ){ + FGTrimAxis* ta; + bool result=false; + + mode = tCustom; + vector ::iterator iAxes = TrimAxes.begin(); + while (iAxes != TrimAxes.end()) { + ta=*iAxes; + if( ta->GetStateType() == state ) { + TrimAxes.insert(iAxes,1,new FGTrimAxis(fdmex,fgic,state,new_control)); + delete ta; + TrimAxes.erase(iAxes+1); + result=true; + break; + } + iAxes++; + } + cout << "Exit FGTrim::EditState(...)" << endl; + return result; +} + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bool FGTrim::DoTrim(void) { trim_failed=false; + int i; - - for(int i=0;i < fdmex->GetAircraft()->GetNumGearUnits();i++){ + for(i=0;i < fdmex->GetAircraft()->GetNumGearUnits();i++){ fdmex->GetAircraft()->GetGearUnit(i)->SetReport(false); } fdmex->GetOutput()->Disable(); //clear the sub iterations counts & zero out the controls - for(current_axis=0;current_axisGetAccelName() + for(current_axis=0;current_axisGetStateName() //<< " " << TrimAxes[current_axis]->GetControlName()<< endl; - if(TrimAxes[current_axis]->GetAccelType() == tQdot) { + if(TrimAxes[current_axis]->GetStateType() == tQdot) { if(mode == tGround) TrimAxes[current_axis]->initTheta(); } @@ -240,7 +356,7 @@ bool FGTrim::DoTrim(void) { } do { axis_count=0; - for(current_axis=0;current_axis 0) TrimAxes[current_axis]->AxisReport(); if(TrimAxes[current_axis]->InTolerance()) { @@ -264,34 +380,34 @@ bool FGTrim::DoTrim(void) { } - if((axis_count == NumAxes-1) && (NumAxes > 1)) { - //cout << NumAxes-1 << " out of " << NumAxes << "!" << endl; + if((axis_count == TrimAxes.size()-1) && (TrimAxes.size() > 1)) { + //cout << TrimAxes.size()-1 << " out of " << TrimAxes.size() << "!" << endl; //At this point we can check the input limits of the failed axis //and declare the trim failed if there is no sign change. If there //is, keep going until success or max iteration count //Oh, well: two out of three ain't bad - for(current_axis=0;current_axisInTolerance()) { if(!checkLimits()) { // special case this for now -- if other cases arise proper // support can be added to FGTrimAxis if( (gamma_fallback) && - (TrimAxes[current_axis]->GetAccelType() == tUdot) && + (TrimAxes[current_axis]->GetStateType() == tUdot) && (TrimAxes[current_axis]->GetControlType() == tThrottle)) { cout << " Can't trim udot with throttle, trying flight" << " path angle. (" << N << ")" << endl; - if(TrimAxes[current_axis]->GetAccel() > 0) + if(TrimAxes[current_axis]->GetState() > 0) TrimAxes[current_axis]->SetControlToMin(); else TrimAxes[current_axis]->SetControlToMax(); TrimAxes[current_axis]->Run(); delete TrimAxes[current_axis]; TrimAxes[current_axis]=new FGTrimAxis(fdmex,fgic,tUdot, - tGamma,Tolerance); + tGamma ); } else { - cout << " Sorry, " << TrimAxes[current_axis]->GetAccelName() + cout << " Sorry, " << TrimAxes[current_axis]->GetStateName() << " doesn't appear to be trimmable" << endl; //total_its=k; trim_failed=true; //force the trim to fail @@ -303,15 +419,15 @@ bool FGTrim::DoTrim(void) { N++; if(N > max_iterations) trim_failed=true; - } while((axis_count < NumAxes) && (!trim_failed)); - if((!trim_failed) && (axis_count >= NumAxes)) { + } while((axis_count < TrimAxes.size()) && (!trim_failed)); + if((!trim_failed) && (axis_count >= TrimAxes.size())) { total_its=N; cout << endl << " Trim successful" << endl; } else { total_its=N; cout << endl << " Trim failed" << endl; } - for(int i=0;i < fdmex->GetAircraft()->GetNumGearUnits();i++){ + for(i=0;i < fdmex->GetAircraft()->GetNumGearUnits();i++){ fdmex->GetAircraft()->GetGearUnit(i)->SetReport(true); } fdmex->GetOutput()->Enable(); @@ -349,7 +465,7 @@ bool FGTrim::solve(void) { x2=x1-d*d0*f1/(f3-f1); TrimAxes[current_axis]->SetControl(x2); TrimAxes[current_axis]->Run(); - f2=TrimAxes[current_axis]->GetAccel(); + f2=TrimAxes[current_axis]->GetState(); if(Debug > 1) { cout << "FGTrim::solve Nsub,x1,x2,x3: " << Nsub << ", " << x1 << ", " << x2 << ", " << x3 << endl; @@ -406,7 +522,7 @@ bool FGTrim::findInterval(void) { bool found=false; float step; float current_control=TrimAxes[current_axis]->GetControl(); - float current_accel=TrimAxes[current_axis]->GetAccel();; + float current_accel=TrimAxes[current_axis]->GetState();; float xmin=TrimAxes[current_axis]->GetControlMin(); float xmax=TrimAxes[current_axis]->GetControlMax(); float lastxlo,lastxhi,lastalo,lastahi; @@ -426,10 +542,10 @@ bool FGTrim::findInterval(void) { if(xhi > xmax) xhi=xmax; TrimAxes[current_axis]->SetControl(xlo); TrimAxes[current_axis]->Run(); - alo=TrimAxes[current_axis]->GetAccel(); + alo=TrimAxes[current_axis]->GetState(); TrimAxes[current_axis]->SetControl(xhi); TrimAxes[current_axis]->Run(); - ahi=TrimAxes[current_axis]->GetAccel(); + ahi=TrimAxes[current_axis]->GetState(); if(fabs(ahi-alo) <= TrimAxes[current_axis]->GetTolerance()) continue; if(alo*ahi <=0) { //found interval with root found=true; @@ -475,16 +591,16 @@ bool FGTrim::findInterval(void) { bool FGTrim::checkLimits(void) { bool solutionExists; float current_control=TrimAxes[current_axis]->GetControl(); - float current_accel=TrimAxes[current_axis]->GetAccel(); + float current_accel=TrimAxes[current_axis]->GetState(); xlo=TrimAxes[current_axis]->GetControlMin(); xhi=TrimAxes[current_axis]->GetControlMax(); TrimAxes[current_axis]->SetControl(xlo); TrimAxes[current_axis]->Run(); - alo=TrimAxes[current_axis]->GetAccel(); + alo=TrimAxes[current_axis]->GetState(); TrimAxes[current_axis]->SetControl(xhi); TrimAxes[current_axis]->Run(); - ahi=TrimAxes[current_axis]->GetAccel(); + ahi=TrimAxes[current_axis]->GetState(); if(Debug > 1) cout << "checkLimits() xlo,xhi,alo,ahi: " << xlo << ", " << xhi << ", " << alo << ", " << ahi << endl; @@ -508,8 +624,5 @@ bool FGTrim::checkLimits(void) { return solutionExists; } - - - //YOU WERE WARNED, BUT YOU DID IT ANYWAY. diff --git a/src/FDM/JSBSim/FGTrim.h b/src/FDM/JSBSim/FGTrim.h index 6f17a81cb..f8469f97d 100644 --- a/src/FDM/JSBSim/FGTrim.h +++ b/src/FDM/JSBSim/FGTrim.h @@ -37,8 +37,6 @@ and throttle setting required to fly steady level. This is currently for in-air conditions only. It is implemented using an iterative, one-axis-at-a-time scheme. - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -63,15 +61,79 @@ INCLUDES #include "FGTrim.h" #include "FGTrimAxis.h" -#include +#include + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DEFINITIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_TRIM "$Header" +#define ID_TRIM "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -CLASS DECLARATION +FORWARD DECLARATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -typedef enum { tLongitudinal, tFull, tGround } TrimMode; +typedef enum { tLongitudinal, tFull, tGround, tCustom, tNone } TrimMode; + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** FGTrim -- the trimming routine for JSBSim. + FGTrim finds the aircraft attitude and control settings needed to maintain + the steady state described by the FGInitialCondition object . It does this + iteratively by assigning a control to each state and adjusting that control + until the state is within a specified tolerance of zero. States include the + recti-linear accelerations udot, vdot, and wdot, the angular accelerations + qdot, pdot, and rdot, and the difference between heading and ground track. + Controls include the usual flight deck controls available to the pilot plus + angle of attack (alpha), sideslip angle(beta), flight path angle (gamma), + pitch attitude(theta), roll attitude(phi), and altitude above ground. The + last three are used for on-ground trimming. The state-control pairs used in + a given trim are completely user configurable and several pre-defined modes + are provided as well. They are: +
          +
        • tLongitudinal: Trim wdot with alpha, udot with thrust, qdot with elevator
        • +
        • tFull: tLongitudinal + vdot with phi, pdot with aileron, rdot with rudder + and heading minus ground track (hmgt) with beta
        • +
        • tGround: wdot with altitude, qdot with theta, and pdot with phi
        • + The remaining modes include tCustom, which is completely user defined and + tNone. +
        + Currently, this class cannot trim a non-1g condition and is limited to + trimming for constant true airspeed in climbs and descents. + + Note that trims can (and do) fail for reasons that are completely outside + the control of the trimming routine itself. The most common problem is the + initial conditions: is the model capable of steady state flight + at those conditions? Check the speed, altitude, configuration (flaps, + gear, etc.), weight, cg, and anything else that may be relevant. + + Example usage: + FGFDMExec* FDMExec = new FGFDMExec(); + . + . + . + FGInitialCondition* fgic = new FGInitialCondition(FDMExec); + FGTrim *fgt(FDMExec,fgic,tFull); + fgic->SetVcaibratedKtsIC(100); + fgic->SetAltitudeFtIC(1000); + fgic->SetClimbRate(500); + if( !fgt->DoTrim() ) { + cout << "Trim Failed" << endl; + } + fgt->ReportState(); + @author Tony Peden + @version $Id$ +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DECLARATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGTrim { private: @@ -79,7 +141,6 @@ private: vector TrimAxes; int current_axis; int N, Nsub; - int NumAxes; TrimMode mode; int Debug; float Tolerance, A_Tolerance; @@ -98,42 +159,116 @@ private: int solutionDomain; float xlo,xhi,alo,ahi; - FGFDMExec* fdmex; FGInitialCondition* fgic; - - // returns false if there is no change in the current axis accel - // between accel(control_min) and accel(control_max). if there is a - // change, sets solutionDomain to: - // 0 for no sign change, - // -1 if sign change between accel(control_min) and accel(0) - // 1 if sign between accel(0) and accel(control_max) - bool solve(void); + + bool solve(void); + + /** @return false if there is no change in the current axis accel + between accel(control_min) and accel(control_max). If there is a + change, sets solutionDomain to: + 0 for no sign change, + -1 if sign change between accel(control_min) and accel(0) + 1 if sign between accel(0) and accel(control_max) + */ bool findInterval(void); + bool checkLimits(void); public: + /** Initializes the trimming class + @param FDMExec pointer to a JSBSim executive object. + @param FGIC pointer to a FGInitialCondition object + @param TrimMode the set of axes to trim. Can be: + tLongitudinal, tFull, tGround, tCustom, or tNone + */ FGTrim(FGFDMExec *FDMExec, FGInitialCondition *FGIC, TrimMode tt); - ~FGTrim(void); + ~FGTrim(void); + + /** Execute the trim + */ bool DoTrim(void); + /** Print the results of the trim. For each axis trimmed, this + includes the final state value, control value, and tolerance + used. + @return true if trim succeeds + */ void Report(void); + + /** Prints a summary of simulator state (speed, altitude, + configuration, etc.) + */ void ReportState(void); + + /** Iteration statistics + */ void TrimStats(); - inline void SetUdotTrim(bool bb) { trimudot=bb; } - inline bool GetUdotTrim(void) { return trimudot; } + /** Clear all state-control pairs from the current configuration. + The trimming routine must have at least one state-control pair + configured to be useful + */ + void ClearStates(void); + + /** Add a state-control pair to the current configuration. See the enums + State and Control in FGTrimAxis.h for the available options. + Will fail if the given state is already configured. + @param state the accel or other condition to zero + @param control the control used to zero the state + @return true if add is successful + */ + bool AddState( State state, Control control ); + + /** Remove a specific state-control pair from the current configuration + @param state the state to remove + @return true if removal is successful + */ + bool RemoveState( State state ); + + /** Change the control used to zero a state previously configured + @param state the accel or other condition to zero + @param control the control used to zero the state + */ + bool EditState( State state, Control new_control ); + /** automatically switch to trimming longitudinal acceleration with + flight path angle (gamma) once it becomes apparent that there + is not enough/too much thrust. + @param gamma_fallback true to enable fallback + */ inline void SetGammaFallback(bool bb) { gamma_fallback=true; } + + /** query the fallback state + @return true if fallback is enabled. + */ inline bool GetGammaFallback(void) { return gamma_fallback; } + /** Set the iteration limit. DoTrim() will return false if limit + iterations are reached before trim is achieved. The default + is 60. This does not ordinarily need to be changed. + @param ii integer iteration limit + */ inline void SetMaxCycles(int ii) { max_iterations = ii; } + + /** Set the per-axis iteration limit. Attempt to zero each state + by iterating limit times before moving on to the next. The + default limit is 100 and also does not ordinarily need to + be changed. + @param ii integer iteration limit + */ inline void SetMaxCyclesPerAxis(int ii) { max_sub_iterations = ii; } + + /** Set the tolerance for declaring a state trimmed. Angular accels are + held to a tolerance of 1/10th of the given. The default is + 0.001 for the recti-linear accelerations and 0.0001 for the angular. + */ inline void SetTolerance(float tt) { Tolerance = tt; A_Tolerance = tt / 10; } + //Debug level 1 shows results of each top-level iteration //Debug level 2 shows level 1 & results of each per-axis iteration inline void SetDebug(int level) { Debug = level; } diff --git a/src/FDM/JSBSim/FGTrimAxis.cpp b/src/FDM/JSBSim/FGTrimAxis.cpp index 292454f04..692b82c5a 100644 --- a/src/FDM/JSBSim/FGTrimAxis.cpp +++ b/src/FDM/JSBSim/FGTrimAxis.cpp @@ -40,29 +40,31 @@ INCLUDES #include "FGInitialCondition.h" #include "FGTrimAxis.h" #include "FGAircraft.h" +#include "FGPropulsion.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_TRIMAXIS; +extern short debug_lvl; + /*****************************************************************************/ -FGTrimAxis::FGTrimAxis(FGFDMExec* fdex, FGInitialCondition* ic, Accel acc, - Control ctrl, float ff) { +FGTrimAxis::FGTrimAxis(FGFDMExec* fdex, FGInitialCondition* ic, State st, + Control ctrl) { fdmex=fdex; fgic=ic; - accel=acc; + state=st; control=ctrl; - tolerance=ff; solver_eps=tolerance; max_iterations=10; control_value=0; its_to_stable_value=0; total_iterations=0; total_stability_iterations=0; - accel_convert=1.0; + state_convert=1.0; control_convert=1.0; - accel_value=0; + state_value=0; switch(control) { case tThrottle: control_min=0; @@ -93,7 +95,7 @@ FGTrimAxis::FGTrimAxis(FGFDMExec* fdex, FGInitialCondition* ic, Accel acc, case tRudder: control_min=-1; control_max=1; - accel_convert=RADTODEG; + state_convert=RADTODEG; solver_eps=tolerance/100; break; case tAltAGL: @@ -105,12 +107,13 @@ FGTrimAxis::FGTrimAxis(FGFDMExec* fdex, FGInitialCondition* ic, Accel acc, case tTheta: control_min=fdmex->GetRotation()->Gettht() - 5*DEGTORAD; control_max=fdmex->GetRotation()->Gettht() + 5*DEGTORAD; - accel_convert=RADTODEG; + state_convert=RADTODEG; break; case tPhi: - control_min=fdmex->GetRotation()->Getphi() - 5*DEGTORAD; - control_max=fdmex->GetRotation()->Getphi() + 5*DEGTORAD; - accel_convert=RADTODEG; + control_min=fdmex->GetRotation()->Getphi() - 30*DEGTORAD; + control_max=fdmex->GetRotation()->Getphi() + 30*DEGTORAD; + state_convert=RADTODEG; + control_convert=RADTODEG; break; case tGamma: solver_eps=tolerance/100; @@ -118,30 +121,50 @@ FGTrimAxis::FGTrimAxis(FGFDMExec* fdex, FGInitialCondition* ic, Accel acc, control_max=80*DEGTORAD; control_convert=RADTODEG; break; + case tHeading: + control_min=fdmex->GetRotation()->Getpsi() - 30*DEGTORAD; + control_max=fdmex->GetRotation()->Getpsi() + 30*DEGTORAD; + state_convert=RADTODEG; + break; } + switch(state) { + case tUdot: tolerance = DEFAULT_TOLERANCE; break; + case tVdot: tolerance = DEFAULT_TOLERANCE; break; + case tWdot: tolerance = DEFAULT_TOLERANCE; break; + case tQdot: tolerance = DEFAULT_TOLERANCE / 10; break; + case tPdot: tolerance = DEFAULT_TOLERANCE / 10; break; + case tRdot: tolerance = DEFAULT_TOLERANCE / 10; break; + case tHmgt: tolerance = 0.01; break; + } + + if (debug_lvl & 2) cout << "Instantiated: FGTrimAxis" << endl; } /*****************************************************************************/ -FGTrimAxis::~FGTrimAxis() {} +FGTrimAxis::~FGTrimAxis() +{ + if (debug_lvl & 2) cout << "Destroyed: FGTrimAxis" << endl; +} /*****************************************************************************/ -void FGTrimAxis::getAccel(void) { - switch(accel) { - case tUdot: accel_value=fdmex -> GetTranslation()->GetUVWdot()(1); break; - case tVdot: accel_value=fdmex -> GetTranslation()->GetUVWdot()(2); break; - case tWdot: accel_value=fdmex -> GetTranslation()->GetUVWdot()(3); break; - case tQdot: accel_value=fdmex -> GetRotation()->GetPQRdot()(2);break; - case tPdot: accel_value=fdmex -> GetRotation()->GetPQRdot()(1); break; - case tRdot: accel_value=fdmex -> GetRotation()->GetPQRdot()(3); break; +void FGTrimAxis::getState(void) { + switch(state) { + case tUdot: state_value=fdmex->GetTranslation()->GetUVWdot()(1); break; + case tVdot: state_value=fdmex->GetTranslation()->GetUVWdot()(2); break; + case tWdot: state_value=fdmex->GetTranslation()->GetUVWdot()(3); break; + case tQdot: state_value=fdmex->GetRotation()->GetPQRdot()(2);break; + case tPdot: state_value=fdmex->GetRotation()->GetPQRdot()(1); break; + case tRdot: state_value=fdmex->GetRotation()->GetPQRdot()(3); break; + case tHmgt: state_value=computeHmgt(); break; } } /*****************************************************************************/ -//Accels are not settable +//States are not settable void FGTrimAxis::getControl(void) { switch(control) { @@ -158,27 +181,47 @@ void FGTrimAxis::getControl(void) { case tTheta: control_value=fdmex->GetRotation()->Gettht(); break; case tPhi: control_value=fdmex->GetRotation()->Getphi(); break; case tGamma: control_value=fdmex->GetPosition()->GetGamma();break; + case tHeading: control_value=fdmex->GetRotation()->Getpsi(); break; } } /*****************************************************************************/ +float FGTrimAxis::computeHmgt(void) { + float diff; + + diff = fdmex->GetRotation()->Getpsi() - + fdmex->GetPosition()->GetGroundTrack(); + + if( diff < -M_PI ) { + return (diff + 2*M_PI); + } else if( diff > M_PI ) { + return (diff - 2*M_PI); + } else { + return diff; + } + +} + +/*****************************************************************************/ + void FGTrimAxis::setControl(void) { switch(control) { case tThrottle: setThrottlesPct(); break; case tBeta: fgic->SetBetaRadIC(control_value); break; case tAlpha: fgic->SetAlphaRadIC(control_value); break; - case tPitchTrim: fdmex->GetFCS() -> SetPitchTrimCmd(control_value); break; - case tElevator: fdmex-> GetFCS() -> SetDeCmd(control_value); break; + case tPitchTrim: fdmex->GetFCS()->SetPitchTrimCmd(control_value); break; + case tElevator: fdmex->GetFCS()->SetDeCmd(control_value); break; case tRollTrim: - case tAileron: fdmex-> GetFCS() -> SetDaCmd(control_value); break; + case tAileron: fdmex->GetFCS()->SetDaCmd(control_value); break; case tYawTrim: - case tRudder: fdmex-> GetFCS() -> SetDrCmd(control_value); break; + case tRudder: fdmex->GetFCS()->SetDrCmd(control_value); break; case tAltAGL: fgic->SetAltitudeAGLFtIC(control_value); break; case tTheta: fgic->SetPitchAngleRadIC(control_value); break; case tPhi: fgic->SetRollAngleRadIC(control_value); break; case tGamma: fgic->SetFlightPathAngleRadIC(control_value); break; + case tHeading: fgic->SetTrueHeadingRadIC(control_value); break; } } @@ -326,7 +369,7 @@ void FGTrimAxis::SetPhiOnGround(float ff) { void FGTrimAxis::Run(void) { - float last_accel_value; + float last_state_value; int i; setControl(); //cout << "FGTrimAxis::Run: " << control_value << endl; @@ -334,11 +377,11 @@ void FGTrimAxis::Run(void) { bool stable=false; while(!stable) { i++; - last_accel_value=accel_value; + last_state_value=state_value; fdmex->RunIC(fgic); - getAccel(); + getState(); if(i > 1) { - if((fabs(last_accel_value - accel_value) < tolerance) || (i >= 100) ) + if((fabs(last_state_value - state_value) < tolerance) || (i >= 100) ) stable=true; } } @@ -352,29 +395,26 @@ void FGTrimAxis::Run(void) { void FGTrimAxis::setThrottlesPct(void) { float tMin,tMax; - for(unsigned i=0;iGetAircraft()->GetNumEngines();i++) { - tMin=fdmex->GetAircraft()->GetEngine(i)->GetThrottleMin(); - tMax=fdmex->GetAircraft()->GetEngine(i)->GetThrottleMax(); + for(unsigned i=0;iGetPropulsion()->GetNumEngines();i++) { + tMin=fdmex->GetPropulsion()->GetEngine(i)->GetThrottleMin(); + tMax=fdmex->GetPropulsion()->GetEngine(i)->GetThrottleMax(); //cout << "setThrottlespct: " << i << ", " << control_min << ", " << control_max << ", " << control_value; fdmex -> GetFCS() -> SetThrottleCmd(i,tMin+control_value*(tMax-tMin)); } } - /*****************************************************************************/ - void FGTrimAxis::AxisReport(void) { char out[80]; sprintf(out," %20s: %6.2f %5s: %9.2e Tolerance: %3.0e\n", GetControlName().c_str(), GetControl()*control_convert, - GetAccelName().c_str(), GetAccel(), GetTolerance()); + GetStateName().c_str(), GetState(), GetTolerance()); cout << out; } - /*****************************************************************************/ float FGTrimAxis::GetAvgStability( void ) { @@ -384,3 +424,9 @@ float FGTrimAxis::GetAvgStability( void ) { return 0; } +/*****************************************************************************/ + +void FGTrimAxis::Debug(void) +{ +} + diff --git a/src/FDM/JSBSim/FGTrimAxis.h b/src/FDM/JSBSim/FGTrimAxis.h index d03ac462b..969e89cda 100644 --- a/src/FDM/JSBSim/FGTrimAxis.h +++ b/src/FDM/JSBSim/FGTrimAxis.h @@ -23,13 +23,10 @@ Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. - HISTORY -------------------------------------------------------------------------------- 7/3/00 TP Created - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -54,40 +51,44 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" -#define ID_TRIMAXIS "$Header" +#define ID_TRIMAXIS "$Id$" + +#define DEFAULT_TOLERANCE 0.001 -const string AccelNames[6]= { "udot","vdot","wdot","qdot","pdot","rdot" }; -const string ControlNames[13]= { "Throttle","Sideslip","Angle of Attack", +const string StateNames[7]= { "udot","vdot","wdot","qdot","pdot","rdot","hmgt" }; +const string ControlNames[14]= { "Throttle","Sideslip","Angle of Attack", "Elevator","Ailerons","Rudder", "Altitude AGL", "Pitch Angle", "Roll Angle", "Flight Path Angle", - "Pitch Trim", "Roll Trim", "Yaw Trim" + "Pitch Trim", "Roll Trim", "Yaw Trim", + "Heading" }; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -enum Accel { tUdot,tVdot,tWdot,tQdot,tPdot,tRdot }; +enum State { tUdot,tVdot,tWdot,tQdot,tPdot,tRdot,tHmgt }; enum Control { tThrottle, tBeta, tAlpha, tElevator, tAileron, tRudder, tAltAGL, - tTheta, tPhi, tGamma, tPitchTrim, tRollTrim, tYawTrim }; + tTheta, tPhi, tGamma, tPitchTrim, tRollTrim, tYawTrim, tHeading }; class FGTrimAxis { public: - FGTrimAxis(FGFDMExec* fdmex, FGInitialCondition *ic, Accel acc, - Control ctrl, float tolerance); + FGTrimAxis(FGFDMExec* fdmex, FGInitialCondition *ic, State st, + Control ctrl ); ~FGTrimAxis(); void Run(void); - float GetAccel(void) { getAccel(); return accel_value; } + float GetState(void) { getState(); return state_value; } //Accels are not settable inline void SetControl(float value ) { control_value=value; } inline float GetControl(void) { return control_value; } - inline Accel GetAccelType(void) { return accel; } + inline State GetStateType(void) { return state; } inline Control GetControlType(void) { return control; } - inline string GetAccelName(void) { return AccelNames[accel]; } + inline string GetStateName(void) { return StateNames[state]; } inline string GetControlName(void) { return ControlNames[control]; } inline float GetControlMin(void) { return control_min; } @@ -121,17 +122,16 @@ public: void AxisReport(void); - bool InTolerance(void) { getAccel(); return (fabs(accel_value) <= tolerance); } + bool InTolerance(void) { getState(); return (fabs(state_value) <= tolerance); } private: FGFDMExec *fdmex; FGInitialCondition *fgic; - - Accel accel; + State state; Control control; - float accel_value; + float state_value; float control_value; float control_min; @@ -141,7 +141,7 @@ private: float solver_eps; - float accel_convert; + float state_convert; float control_convert; int max_iterations; @@ -150,15 +150,15 @@ private: int total_stability_iterations; int total_iterations; - void setThrottlesPct(void); - void getAccel(void); + void getState(void); void getControl(void); void setControl(void); + float computeHmgt(void); - + void Debug(void); }; #endif diff --git a/src/FDM/JSBSim/FGTurboJet.cpp b/src/FDM/JSBSim/FGTurboJet.cpp index 6d04e394a..93c383dda 100644 --- a/src/FDM/JSBSim/FGTurboJet.cpp +++ b/src/FDM/JSBSim/FGTurboJet.cpp @@ -40,17 +40,40 @@ INCLUDES #include "FGTurboJet.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_TURBOJET; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -FGTurboJet::FGTurboJet(FGFDMExec* fdex, string enginePath, string engineName, int num) : - FGEngine(fdex, enginePath, engineName, num) +FGTurboJet::FGTurboJet(FGFDMExec* exec, FGConfigFile* cfg) : FGEngine(exec) +{ + if (debug_lvl & 2) cout << "Instantiated: FGTurboJet" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGTurboJet::~FGTurboJet() +{ + if (debug_lvl & 2) cout << "Destroyed: FGTurboJet" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGTurboJet::Calculate(float dummy) +{ + ConsumeFuel(); + return 0.0; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGTurboJet::Debug(void) { - // + //TODO: Add your source code here } diff --git a/src/FDM/JSBSim/FGTurboJet.h b/src/FDM/JSBSim/FGTurboJet.h index d109f33bb..8c3456eb1 100644 --- a/src/FDM/JSBSim/FGTurboJet.h +++ b/src/FDM/JSBSim/FGTurboJet.h @@ -43,8 +43,9 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" +#include "FGConfigFile.h" -#define ID_TURBOJET "$Header" +#define ID_TURBOJET "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -52,12 +53,16 @@ CLASS DECLARATION class FGTurboJet : public FGEngine { - public: - FGTurboJet(FGFDMExec*, string, string, int); + FGTurboJet(FGFDMExec* exec, FGConfigFile* Eng_cfg); ~FGTurboJet(); + float Calculate(float); + +private: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGTurboShaft.cpp b/src/FDM/JSBSim/FGTurboShaft.cpp index f85d0a637..86030771e 100644 --- a/src/FDM/JSBSim/FGTurboShaft.cpp +++ b/src/FDM/JSBSim/FGTurboShaft.cpp @@ -40,17 +40,37 @@ INCLUDES #include "FGTurboShaft.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_TURBOSHAFT; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +FGTurboShaft::FGTurboShaft(FGFDMExec* exec, FGConfigFile* cfg) : FGEngine(exec) +{ + if (debug_lvl & 2) cout << "Instantiated: FGTurboShaft" << endl; +} -FGTurboShaft::FGTurboShaft(FGFDMExec* fdex, string enginePath, string engineName, int num) : - FGEngine(fdex, enginePath, engineName, num) +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FGTurboShaft::~FGTurboShaft() { - // + if (debug_lvl & 2) cout << "Destroyed: FGTurboShaft" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +float FGTurboShaft::Calculate(float dummy) { + ConsumeFuel(); + return 0.0; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGTurboShaft::Debug(void) +{ + //TODO: Add your source code here +} diff --git a/src/FDM/JSBSim/FGTurboShaft.h b/src/FDM/JSBSim/FGTurboShaft.h index 75f9b1d6e..278ed557e 100644 --- a/src/FDM/JSBSim/FGTurboShaft.h +++ b/src/FDM/JSBSim/FGTurboShaft.h @@ -43,8 +43,9 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include "FGEngine.h" +#include "FGConfigFile.h" -#define ID_TURBOSHAFT "$Header" +#define ID_TURBOSHAFT "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -52,12 +53,15 @@ CLASS DECLARATION class FGTurboShaft : public FGEngine { - public: - FGTurboShaft(FGFDMExec*, string, string, int); + FGTurboShaft(FGFDMExec* exec, FGConfigFile* Eng_cfg); ~FGTurboShaft(); + float Calculate(float); +private: + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif + diff --git a/src/FDM/JSBSim/FGUtility.cpp b/src/FDM/JSBSim/FGUtility.cpp index b837060d8..892db1ceb 100644 --- a/src/FDM/JSBSim/FGUtility.cpp +++ b/src/FDM/JSBSim/FGUtility.cpp @@ -44,7 +44,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -57,19 +57,31 @@ INCLUDES #include "FGState.h" #include "FGFDMExec.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_UTILITY; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ FGUtility::FGUtility() { + if (debug_lvl & 2) cout << "Instantiated: FGUtility" << endl; } +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FGUtility::~FGUtility() +{ + if (debug_lvl & 2) cout << "Destroyed: FGUtility" << endl; +} + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGUtility::Debug(void) { } + diff --git a/src/FDM/JSBSim/FGUtility.h b/src/FDM/JSBSim/FGUtility.h index 5457ee1d7..824f87dde 100644 --- a/src/FDM/JSBSim/FGUtility.h +++ b/src/FDM/JSBSim/FGUtility.h @@ -42,7 +42,7 @@ INCLUDES DEFINES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_UTILITY "$Header" +#define ID_UTILITY "$Id$" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION @@ -55,13 +55,12 @@ class FGUtility { public: FGUtility(void); - ~FGUtility(void); - -protected: + ~FGUtility(); private: FGState* State; FGFDMExec* FDMExec; + void Debug(void); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/FGfdmSocket.cpp b/src/FDM/JSBSim/FGfdmSocket.cpp index 19be402a7..105187102 100644 --- a/src/FDM/JSBSim/FGfdmSocket.cpp +++ b/src/FDM/JSBSim/FGfdmSocket.cpp @@ -39,9 +39,11 @@ INCLUDES #include "FGfdmSocket.h" -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_FDMSOCKET; +extern short debug_lvl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -87,9 +89,11 @@ FGfdmSocket::FGfdmSocket(string address, int port) cout << "Could not create socket for FDM, error = " << errno << endl; } } + + if (debug_lvl & 2) cout << "Instantiated: FGfdmSocket" << endl; } -FGfdmSocket::~FGfdmSocket(void) +FGfdmSocket::~FGfdmSocket() { #ifndef macintosh if (sckt) shutdown(sckt,2); diff --git a/src/FDM/JSBSim/FGfdmSocket.h b/src/FDM/JSBSim/FGfdmSocket.h index f40429e83..e5064a519 100644 --- a/src/FDM/JSBSim/FGfdmSocket.h +++ b/src/FDM/JSBSim/FGfdmSocket.h @@ -45,9 +45,8 @@ INCLUDES #include #ifdef FGFS -# pragma message("FGFS defined") # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # include # else @@ -55,7 +54,6 @@ INCLUDES # include # endif #else -# pragma message("FGFS not defined") # include # include #endif @@ -76,7 +74,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_FDMSOCKET "$Header" +#define ID_FDMSOCKET "$Id$" using std::cout; using std::endl; @@ -90,7 +88,7 @@ using std::string; class FGfdmSocket { public: FGfdmSocket(string, int); - ~FGfdmSocket(void); + ~FGfdmSocket(); void Send(void); void Append(const char*); void Append(float); diff --git a/src/FDM/JSBSim/JSBSim.cpp b/src/FDM/JSBSim/JSBSim.cpp index 3d2c84d6a..499be6817 100644 --- a/src/FDM/JSBSim/JSBSim.cpp +++ b/src/FDM/JSBSim/JSBSim.cpp @@ -39,58 +39,6 @@ HISTORY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#if __BCPLUSPLUS__ == 0x0540 // If compiling under Borland C++Builder -#pragma hdrstop -#include -USEUNIT("FGUtility.cpp"); -USEUNIT("FGAtmosphere.cpp"); -USEUNIT("FGAuxiliary.cpp"); -USEUNIT("FGCoefficient.cpp"); -USEUNIT("FGConfigFile.cpp"); -USEUNIT("FGControls.cpp"); -USEUNIT("FGEngine.cpp"); -USEUNIT("FGFCS.cpp"); -USEUNIT("FGFDMExec.cpp"); -USEUNIT("FGfdmSocket.cpp"); -USEUNIT("FGInitialCondition.cpp"); -USEUNIT("FGLGear.cpp"); -USEUNIT("FGMatrix.cpp"); -USEUNIT("FGModel.cpp"); -USEUNIT("FGOutput.cpp"); -USEUNIT("FGPosition.cpp"); -USEUNIT("FGRotation.cpp"); -USEUNIT("FGState.cpp"); -USEUNIT("FGTank.cpp"); -USEUNIT("FGTranslation.cpp"); -USEUNIT("FGAircraft.cpp"); -USERES("JSBSim.res"); -USEUNIT("filtersjb\FGfcsComponent.cpp"); -USEUNIT("filtersjb\FGSwitch.cpp"); -USEUNIT("filtersjb\FGFilter.cpp"); -USEUNIT("filtersjb\FGGain.cpp"); -USEUNIT("filtersjb\FGGradient.cpp"); -USEUNIT("filtersjb\FGSummer.cpp"); -USEUNIT("filtersjb\FGDeadBand.cpp"); -USEUNIT("filtersjb\FGFlaps.cpp"); -USEFILE("JSBSim.cxx"); -USEUNIT("FGForce.cpp"); -USEUNIT("FGInertial.cpp"); -USEUNIT("FGNozzle.cpp"); -USEUNIT("FGPropeller.cpp"); -USEUNIT("FGRotor.cpp"); -USEUNIT("FGThruster.cpp"); -USEUNIT("FGMassBalance.cpp"); -USEUNIT("FGRocket.cpp"); -USEUNIT("FGTurboJet.cpp"); -USEUNIT("FGPiston.cpp"); -USEUNIT("FGTurboShaft.cpp"); -USEUNIT("FGPropulsion.cpp"); -USEUNIT("FGGroundReactions.cpp"); -USEUNIT("FGAerodynamics.cpp"); - -#pragma argsused -#endif - #include "FGFDMExec.h" #include "FGRotation.h" #include "FGAtmosphere.h" @@ -101,11 +49,12 @@ USEUNIT("FGAerodynamics.cpp"); #include "FGPosition.h" #include "FGAuxiliary.h" #include "FGOutput.h" +#include "FGConfigFile.h" #ifdef FGFS #include #include STL_IOSTREAM -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -123,7 +72,7 @@ DEFINITIONS GLOBAL DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -static const char *IdSrc = "$Header$"; +static const char *IdSrc = "$Id$"; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] @@ -136,8 +85,8 @@ 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. + command line. To get any use out of this, you will have to create a script + to run a test case and specify what kind of output you would like. @author Jon S. Berndt @version $Id$ @see - @@ -150,56 +99,54 @@ IMPLEMENTATION int main(int argc, char** argv) { FGFDMExec* FDMExec; + float cmd = 0.0; bool result = false; + bool scripted = false; + + if (argc == 2) { + FGConfigFile testFile(argv[1]); - if (argc != 3) { + if (!testFile.IsOpen()) { + cout << "Script file not opened" << endl; + exit(-1); + } + + testFile.GetNextConfigLine(); + if (testFile.GetValue("runscript").length() <= 0) { + cout << "File: " << argv[1] << " is not a script file" << endl; + exit(-1); + } + scripted = true; + } else if (argc != 3) { cout << endl << " You must enter the name of a registered aircraft and reset point:" << endl << endl << " FDM " << endl; + cout << endl << " Alternatively, you may specify only the name of a script file:" + << endl << endl << " FDM