]> git.mxchange.org Git - flightgear.git/commitdiff
Merge branch 'ehofman/sound'
authorTim Moore <timoore@redhat.com>
Wed, 13 Jan 2010 06:30:52 +0000 (07:30 +0100)
committerTim Moore <timoore@redhat.com>
Wed, 13 Jan 2010 06:30:52 +0000 (07:30 +0100)
247 files changed:
FlightGear.dsp [deleted file]
FlightGear.dsw [deleted file]
acinclude.m4
configure.ac
docs-mini/README.effects
projects/VC7.1/FlightGear.vcproj
projects/VC90/FlightGear/FlightGear.vcproj
src/AIModel/AIAircraft.cxx
src/AIModel/AIFlightPlanCreateCruise.cxx [changed mode: 0755->0644]
src/AIModel/AIGroundVehicle.cxx
src/AIModel/AIGroundVehicle.hxx
src/AIModel/AIManager.cxx
src/AIModel/AIMultiplayer.cxx [changed mode: 0755->0644]
src/AIModel/AIMultiplayer.hxx [changed mode: 0755->0644]
src/AIModel/AIShip.cxx
src/AIModel/AIShip.hxx
src/AIModel/performancedb.cxx
src/ATCDCL/AILocalTraffic.cxx
src/ATCDCL/ATCDialog.cxx
src/ATCDCL/commlist.cxx
src/ATCDCL/tower.cxx
src/Airports/runways.cxx
src/Airports/simple.cxx
src/Airports/simple.hxx
src/Airports/xmlloader.cxx
src/Autopilot/Makefile.am
src/Autopilot/autobrake.cxx [new file with mode: 0644]
src/Autopilot/autobrake.hxx [new file with mode: 0644]
src/Autopilot/route_mgr.cxx
src/Autopilot/route_mgr.hxx
src/Autopilot/xmlauto.cxx
src/Autopilot/xmlauto.hxx
src/Cockpit/hud.cxx
src/Cockpit/panel_io.cxx
src/Environment/atmosphere.cxx
src/Environment/atmosphere.hxx
src/Environment/environment_ctrl.cxx
src/Environment/fgclouds.cxx
src/Environment/fgclouds.hxx
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGJSBBase.cpp
src/FDM/JSBSim/FGJSBBase.h
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGState.h
src/FDM/JSBSim/JSBSim.cxx
src/FDM/JSBSim/JSBSim.hxx
src/FDM/JSBSim/initialization/FGInitialCondition.cpp
src/FDM/JSBSim/initialization/FGInitialCondition.h
src/FDM/JSBSim/initialization/FGTrim.cpp
src/FDM/JSBSim/initialization/FGTrimAxis.cpp
src/FDM/JSBSim/input_output/FGGroundCallback.cpp
src/FDM/JSBSim/input_output/FGGroundCallback.h
src/FDM/JSBSim/input_output/FGPropertyManager.h
src/FDM/JSBSim/input_output/FGScript.cpp
src/FDM/JSBSim/input_output/FGScript.h
src/FDM/JSBSim/input_output/FGXMLElement.cpp
src/FDM/JSBSim/input_output/FGXMLElement.h
src/FDM/JSBSim/input_output/FGXMLFileRead.h
src/FDM/JSBSim/input_output/FGXMLParse.cpp
src/FDM/JSBSim/input_output/FGXMLParse.h
src/FDM/JSBSim/input_output/FGfdmSocket.cpp
src/FDM/JSBSim/input_output/FGfdmSocket.h
src/FDM/JSBSim/input_output/net_fdm.hxx
src/FDM/JSBSim/input_output/string_utilities.h
src/FDM/JSBSim/math/FGColumnVector3.cpp
src/FDM/JSBSim/math/FGColumnVector3.h
src/FDM/JSBSim/math/FGCondition.cpp
src/FDM/JSBSim/math/FGCondition.h
src/FDM/JSBSim/math/FGFunction.cpp
src/FDM/JSBSim/math/FGFunction.h
src/FDM/JSBSim/math/FGLocation.cpp
src/FDM/JSBSim/math/FGLocation.h
src/FDM/JSBSim/math/FGMatrix33.cpp
src/FDM/JSBSim/math/FGMatrix33.h
src/FDM/JSBSim/math/FGPropertyValue.h
src/FDM/JSBSim/math/FGQuaternion.h
src/FDM/JSBSim/math/FGTable.cpp
src/FDM/JSBSim/math/FGTable.h
src/FDM/JSBSim/models/FGAerodynamics.cpp
src/FDM/JSBSim/models/FGAerodynamics.h
src/FDM/JSBSim/models/FGAircraft.cpp
src/FDM/JSBSim/models/FGAircraft.h
src/FDM/JSBSim/models/FGAtmosphere.cpp
src/FDM/JSBSim/models/FGAtmosphere.h
src/FDM/JSBSim/models/FGAuxiliary.cpp
src/FDM/JSBSim/models/FGAuxiliary.h
src/FDM/JSBSim/models/FGBuoyantForces.cpp
src/FDM/JSBSim/models/FGBuoyantForces.h
src/FDM/JSBSim/models/FGExternalForce.cpp
src/FDM/JSBSim/models/FGExternalForce.h
src/FDM/JSBSim/models/FGExternalReactions.cpp
src/FDM/JSBSim/models/FGExternalReactions.h
src/FDM/JSBSim/models/FGFCS.cpp
src/FDM/JSBSim/models/FGFCS.h
src/FDM/JSBSim/models/FGGasCell.cpp
src/FDM/JSBSim/models/FGGasCell.h
src/FDM/JSBSim/models/FGGroundReactions.cpp
src/FDM/JSBSim/models/FGGroundReactions.h
src/FDM/JSBSim/models/FGInertial.cpp
src/FDM/JSBSim/models/FGInertial.h
src/FDM/JSBSim/models/FGInput.cpp
src/FDM/JSBSim/models/FGInput.h
src/FDM/JSBSim/models/FGLGear.cpp
src/FDM/JSBSim/models/FGLGear.h
src/FDM/JSBSim/models/FGMassBalance.cpp
src/FDM/JSBSim/models/FGMassBalance.h
src/FDM/JSBSim/models/FGModel.cpp
src/FDM/JSBSim/models/FGModel.h
src/FDM/JSBSim/models/FGOutput.cpp
src/FDM/JSBSim/models/FGOutput.h
src/FDM/JSBSim/models/FGPropagate.cpp
src/FDM/JSBSim/models/FGPropagate.h
src/FDM/JSBSim/models/FGPropulsion.cpp
src/FDM/JSBSim/models/FGPropulsion.h
src/FDM/JSBSim/models/atmosphere/FGMSIS.cpp
src/FDM/JSBSim/models/atmosphere/FGMSIS.h
src/FDM/JSBSim/models/atmosphere/FGMars.cpp
src/FDM/JSBSim/models/atmosphere/FGMars.h
src/FDM/JSBSim/models/flight_control/FGAccelerometer.cpp
src/FDM/JSBSim/models/flight_control/FGAccelerometer.h
src/FDM/JSBSim/models/flight_control/FGActuator.cpp
src/FDM/JSBSim/models/flight_control/FGActuator.h
src/FDM/JSBSim/models/flight_control/FGDeadBand.cpp
src/FDM/JSBSim/models/flight_control/FGDeadBand.h
src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp
src/FDM/JSBSim/models/flight_control/FGFCSComponent.h
src/FDM/JSBSim/models/flight_control/FGFCSFunction.cpp
src/FDM/JSBSim/models/flight_control/FGFCSFunction.h
src/FDM/JSBSim/models/flight_control/FGFilter.cpp
src/FDM/JSBSim/models/flight_control/FGFilter.h
src/FDM/JSBSim/models/flight_control/FGGain.cpp
src/FDM/JSBSim/models/flight_control/FGGain.h
src/FDM/JSBSim/models/flight_control/FGGradient.cpp
src/FDM/JSBSim/models/flight_control/FGGradient.h
src/FDM/JSBSim/models/flight_control/FGGyro.cpp
src/FDM/JSBSim/models/flight_control/FGGyro.h
src/FDM/JSBSim/models/flight_control/FGKinemat.cpp
src/FDM/JSBSim/models/flight_control/FGKinemat.h
src/FDM/JSBSim/models/flight_control/FGMagnetometer.cpp
src/FDM/JSBSim/models/flight_control/FGMagnetometer.h
src/FDM/JSBSim/models/flight_control/FGPID.cpp
src/FDM/JSBSim/models/flight_control/FGPID.h
src/FDM/JSBSim/models/flight_control/FGSensor.cpp
src/FDM/JSBSim/models/flight_control/FGSensor.h
src/FDM/JSBSim/models/flight_control/FGSensorOrientation.h [new file with mode: 0755]
src/FDM/JSBSim/models/flight_control/FGSummer.cpp
src/FDM/JSBSim/models/flight_control/FGSummer.h
src/FDM/JSBSim/models/flight_control/FGSwitch.cpp
src/FDM/JSBSim/models/flight_control/FGSwitch.h
src/FDM/JSBSim/models/flight_control/Makefile.am
src/FDM/JSBSim/models/propulsion/FGElectric.cpp
src/FDM/JSBSim/models/propulsion/FGElectric.h
src/FDM/JSBSim/models/propulsion/FGEngine.cpp
src/FDM/JSBSim/models/propulsion/FGEngine.h
src/FDM/JSBSim/models/propulsion/FGForce.cpp
src/FDM/JSBSim/models/propulsion/FGForce.h
src/FDM/JSBSim/models/propulsion/FGNozzle.cpp
src/FDM/JSBSim/models/propulsion/FGNozzle.h
src/FDM/JSBSim/models/propulsion/FGPiston.cpp
src/FDM/JSBSim/models/propulsion/FGPiston.h
src/FDM/JSBSim/models/propulsion/FGPropeller.cpp
src/FDM/JSBSim/models/propulsion/FGPropeller.h
src/FDM/JSBSim/models/propulsion/FGRocket.cpp
src/FDM/JSBSim/models/propulsion/FGRocket.h
src/FDM/JSBSim/models/propulsion/FGRotor.cpp
src/FDM/JSBSim/models/propulsion/FGTank.cpp
src/FDM/JSBSim/models/propulsion/FGTank.h
src/FDM/JSBSim/models/propulsion/FGThruster.cpp
src/FDM/JSBSim/models/propulsion/FGThruster.h
src/FDM/JSBSim/models/propulsion/FGTurbine.cpp
src/FDM/JSBSim/models/propulsion/FGTurbine.h
src/FDM/JSBSim/models/propulsion/FGTurboProp.cpp
src/FDM/JSBSim/models/propulsion/FGTurboProp.h
src/FDM/UIUCModel/uiuc_getwind.cpp
src/FDM/YASim/Airplane.cpp
src/GUI/dialog.cxx
src/GUI/dialog.hxx
src/GUI/gui_funcs.cxx
src/Include/config.h-msvc6
src/Include/config.h-msvc71
src/Include/config.h-msvc8
src/Input/FGDeviceConfigurationMap.cxx
src/Input/FGEventInput.cxx
src/Input/FGEventInput.hxx
src/Input/FGLinuxEventInput.cxx
src/Input/FGLinuxEventInput.hxx
src/Instrumentation/KLN89/kln89.cxx
src/Instrumentation/KLN89/kln89.hxx
src/Instrumentation/KLN89/kln89_page.cxx
src/Instrumentation/KLN89/kln89_page.hxx
src/Instrumentation/KLN89/kln89_page_act.hxx
src/Instrumentation/KLN89/kln89_page_apt.cxx
src/Instrumentation/KLN89/kln89_page_apt.hxx
src/Instrumentation/KLN89/kln89_page_dir.cxx
src/Instrumentation/KLN89/kln89_page_dir.hxx
src/Instrumentation/KLN89/kln89_page_fpl.cxx
src/Instrumentation/KLN89/kln89_page_int.cxx
src/Instrumentation/KLN89/kln89_page_nav.cxx
src/Instrumentation/KLN89/kln89_page_ndb.cxx
src/Instrumentation/KLN89/kln89_page_vor.cxx
src/Instrumentation/dclgps.cxx
src/Instrumentation/dclgps.hxx
src/Instrumentation/gps.cxx
src/Instrumentation/gps.hxx
src/Instrumentation/groundradar.cxx
src/Instrumentation/heading_indicator_fg.cxx
src/Instrumentation/instrument_mgr.cxx
src/Instrumentation/instrument_mgr.hxx
src/Instrumentation/kt_70.cxx
src/Instrumentation/mk_viii.hxx
src/Instrumentation/navradio.cxx
src/Instrumentation/navradio.hxx
src/Instrumentation/tacan.cxx
src/Instrumentation/testgps.cxx [new file with mode: 0644]
src/Main/CameraGroup.cxx
src/Main/bootstrap.cxx
src/Main/fg_init.cxx
src/Main/fg_props.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Main/renderer.cxx
src/Main/splash.cxx
src/Model/panelnode.cxx
src/Navaids/awynet.cxx
src/Navaids/awynet.hxx
src/Navaids/navdb.cxx
src/Navaids/navrecord.cxx
src/Navaids/positioned.cxx
src/Navaids/positioned.hxx
src/Scenery/scenery.cxx
src/Scenery/test.cxx
src/Scenery/tilemgr.cxx
src/Scripting/NasalSys.cxx
src/Scripting/nasal-props.cxx
src/Time/light.cxx
src/Time/light.hxx
src/Time/tmp.cxx
src/Traffic/Schedule.cxx
src/Traffic/TrafficMgr.cxx
tests/Makefile.am
tests/est-epsilon.c [deleted file]
tests/est-epsilon.cxx [new file with mode: 0644]
tests/gl-info.c [deleted file]
tests/gl-info.cxx [new file with mode: 0644]
utils/Modeller/yasim_import.py [new file with mode: 0644]
utils/TerraSync/terrasync.cxx

diff --git a/FlightGear.dsp b/FlightGear.dsp
deleted file mode 100644 (file)
index c17eb56..0000000
+++ /dev/null
@@ -1,12019 +0,0 @@
-# Microsoft Developer Studio Project File - Name="FlightGear" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=FlightGear - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "FlightGear.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "FlightGear.mak" CFG="FlightGear - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "FlightGear - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "FlightGear - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Target_Dir ""\r
-# ADD CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c  /MT /I ".." /I "src" /I "src\include" /I "src\FDM\JSBsim" /I "..\SimGear" /I "..\zlib-1.2.3" /I "..\freeglut-2.4.0\include" /I "..\OpenAL 1.0 Software Development Kit\include" /I "..\Pre-built.2\include" /D "_USE_MATH_DEFINES" /D "_CRT_SECURE_NO_DEPRECATE" /D "HAVE_CONFIG_H" /D "FGFS" /D "FG_NEW_ENVIRONMENT" /D "ENABLE_AUDIO_SUPPORT" /D "ENABLE_PLIB_JOYSTICK"\r
-# SUBTRACT CPP /YX\r
-# ADD RSC /l 0xc09 /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 \r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c  /MTd /I ".." /I "src" /I "src\include" /I "src\FDM\JSBsim" /I "..\SimGear" /I "..\zlib-1.2.3" /I "..\freeglut-2.4.0\include" /I "..\OpenAL 1.0 Software Development Kit\include" /I "..\Pre-built.2\include" /D "_USE_MATH_DEFINES" /D "_CRT_SECURE_NO_DEPRECATE" /D "HAVE_CONFIG_H" /D "FGFS" /D "FG_NEW_ENVIRONMENT" /D "ENABLE_AUDIO_SUPPORT" /D "ENABLE_PLIB_JOYSTICK"\r
-# ADD RSC /l 0xc09 /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib gdi32.lib shell32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept \r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "FlightGear - Win32 Release"\r
-# Name "FlightGear - Win32 Debug"\r
-# Begin Group "Lib_Aircraft"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Aircraft\aircraft.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Aircraft"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Aircraft"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Aircraft\aircraft.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Aircraft"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Aircraft"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Aircraft\controls.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Aircraft"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Aircraft"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Aircraft\controls.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Aircraft"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Aircraft"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Aircraft\replay.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Aircraft"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Aircraft"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Aircraft\replay.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Aircraft"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Aircraft"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Airports"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\apt_loader.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\apt_loader.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\runways.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\runways.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\simple.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\simple.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\runwayprefs.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\runwayprefs.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\parking.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\parking.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\gnnode.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\gnnode.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\groundnetwork.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\groundnetwork.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\dynamics.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\dynamics.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\dynamicloader.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\dynamicloader.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\runwayprefloader.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\runwayprefloader.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\xmlloader.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Airports\xmlloader.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Airports"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Airports"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_ATC"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATC\trafficcontrol.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATC"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATC"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATC\trafficcontrol.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATC"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATC"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_ATCDCL"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATC.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATC.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\atis.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\atis.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\tower.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\tower.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\approach.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\approach.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ground.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ground.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\commlist.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\commlist.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCDialog.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCDialog.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCVoice.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCVoice.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCmgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCmgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCutils.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCutils.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCProjection.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\ATCProjection.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIMgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIMgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIEntity.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIEntity.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIPlane.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIPlane.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AILocalTraffic.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AILocalTraffic.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIGAVFRTraffic.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\AIGAVFRTraffic.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\transmission.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\transmission.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\transmissionlist.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\ATCDCL\transmissionlist.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ATCDCL"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ATCDCL"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Autopilot"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Autopilot\route_mgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Autopilot"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Autopilot"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Autopilot\route_mgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Autopilot"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Autopilot"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Autopilot\xmlauto.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Autopilot"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Autopilot"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Autopilot\xmlauto.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Autopilot"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Autopilot"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Cockpit"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\cockpit.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\cockpit.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_card.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_dnst.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_gaug.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_inst.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_labl.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_ladr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_rwy.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_scal.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\hud_tbi.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\panel.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\panel.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\panel_io.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\panel_io.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Cockpit"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Cockpit"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Built_in"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\built_in\FGMagRibbon.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Built_in"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Built_in"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Cockpit\built_in\FGMagRibbon.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Built_in"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Built_in"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Environment"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\environment.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\environment.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\environment_mgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\environment_mgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\environment_ctrl.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\environment_ctrl.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\fgmetar.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\fgmetar.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\fgclouds.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\fgclouds.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\atmosphere.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\atmosphere.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\precipitation_mgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Environment\precipitation_mgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Environment"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Environment"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_ExternalNet"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\ExternalNet\ExternalNet.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ExternalNet"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ExternalNet"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\ExternalNet\ExternalNet.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ExternalNet"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ExternalNet"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_ExternalPipe"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\ExternalPipe\ExternalPipe.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ExternalPipe"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ExternalPipe"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\ExternalPipe\ExternalPipe.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_ExternalPipe"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_ExternalPipe"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_JSBSim"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\FGFDMExec.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_JSBSim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_JSBSim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\FGJSBBase.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_JSBSim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_JSBSim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\FGState.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_JSBSim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_JSBSim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\JSBSim.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_JSBSim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_JSBSim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Init"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\initialization\FGInitialCondition.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Init"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Init"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\initialization\FGTrim.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Init"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Init"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\initialization\FGTrimAxis.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Init"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Init"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_InputOutput"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\input_output\FGGroundCallback.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_InputOutput"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_InputOutput"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\input_output\FGPropertyManager.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_InputOutput"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_InputOutput"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\input_output\FGScript.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_InputOutput"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_InputOutput"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\input_output\FGXMLElement.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_InputOutput"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_InputOutput"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\input_output\FGXMLParse.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_InputOutput"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_InputOutput"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\input_output\FGfdmSocket.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_InputOutput"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_InputOutput"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Math"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGColumnVector3.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGFunction.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGLocation.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGMatrix33.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGPropertyValue.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGQuaternion.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGRealValue.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGTable.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\math\FGCondition.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Math"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Math"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Models"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGAerodynamics.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGAircraft.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGAtmosphere.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGAuxiliary.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGFCS.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGGroundReactions.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGInertial.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGBuoyantForces.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGExternalForce.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGLGear.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGMassBalance.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGModel.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGOutput.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGPropagate.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGPropulsion.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGInput.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGExternalReactions.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\FGGasCell.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Models"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Models"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_FlightControl"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGPID.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGDeadBand.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGFCSComponent.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGFilter.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGGain.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGGradient.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGKinemat.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGSummer.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGSwitch.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGFCSFunction.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGSensor.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\flight_control\FGActuator.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_FlightControl"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_FlightControl"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Atmosphere"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\atmosphere\FGMSIS.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Atmosphere"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Atmosphere"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\atmosphere\FGMSISData.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Atmosphere"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Atmosphere"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\atmosphere\FGMars.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Atmosphere"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Atmosphere"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Propulsion"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGElectric.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGEngine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGForce.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGNozzle.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGPiston.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGPropeller.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGRocket.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGTank.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGThruster.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGTurbine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\JSBSim\models\propulsion\FGTurboProp.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Propulsion"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Propulsion"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_LaRCsim"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\LaRCsim.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\LaRCsim.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\LaRCsimIC.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\LaRCsimIC.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\IO360.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\IO360.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\atmos_62.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\atmos_62.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\default_model_routines.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\default_model_routines.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_accel.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_accel.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_aux.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_aux.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_cockpit.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_constants.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_generic.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_geodesy.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_geodesy.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_gravity.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_gravity.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_init.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_init.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_matrix.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_matrix.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_model.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_model.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_sim_control.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_step.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_step.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_sym.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_types.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\c172_aero.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\c172_engine.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\c172_gear.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\c172_init.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\basic_init.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\basic_init.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\basic_aero.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\basic_aero.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\basic_engine.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\basic_gear.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\navion_init.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\navion_aero.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\navion_engine.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\navion_gear.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\navion_init.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\uiuc_aero.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\cherokee_aero.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\cherokee_engine.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\cherokee_gear.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\cherokee_init.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_interface.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\LaRCsim\ls_interface.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_SPFDM"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\ADA.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\ADA.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\ACMS.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\ACMS.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\Balloon.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\Balloon.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\BalloonSim.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\BalloonSim.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\MagicCarpet.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\SP\MagicCarpet.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_SPFDM"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_SPFDM"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_UIUCModel"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_1DdataFileReader.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_1DdataFileReader.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_1Dinterpolation.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_1Dinterpolation.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_2DdataFileReader.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_2DdataFileReader.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_2Dinterpolation.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_2Dinterpolation.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_3Dinterpolation.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_3Dinterpolation.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_aerodeflections.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_aerodeflections.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_aircraft.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_alh_ap.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_alh_ap.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_auto_pilot.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_auto_pilot.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_betaprobe.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_betaprobe.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_drag.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_drag.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_lift.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_lift.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_pitch.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_pitch.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_roll.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_roll.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_sideforce.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_sideforce.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_yaw.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coef_yaw.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coefficients.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_coefficients.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_controlInput.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_controlInput.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_convert.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_convert.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_engine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_engine.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_flapdata.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_flapdata.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_find_position.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_find_position.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_fog.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_fog.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_gear.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_gear.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_get_flapper.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_get_flapper.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_getwind.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_getwind.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_hh_ap.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_hh_ap.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_ice.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_ice.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_iceboot.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_iceboot.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_iced_nonlin.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_iced_nonlin.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_icing_demo.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_icing_demo.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_initializemaps.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_initializemaps.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_CD.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_CD.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_CL.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_CL.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_CY.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_CY.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cm.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cm.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cn.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_Cn.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_Croll.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_Croll.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_controlSurface.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_controlSurface.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_engine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_engine.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_fog.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_fog.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_geometry.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_geometry.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_ice.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_ice.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_gear.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_gear.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_init.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_init.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_keyword.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_keyword.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_mass.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_mass.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_misc.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_misc.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record1.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record1.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record2.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record2.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record3.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record3.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record4.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record4.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record5.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record5.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record6.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_map_record6.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_init.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_init.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_geometry.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_geometry.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_controlSurface.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_controlSurface.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_mass.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_mass.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_engine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_engine.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_CD.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_CD.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_CL.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_CL.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_Cm.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_Cm.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_CY.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_CY.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_Croll.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_Croll.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_Cn.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_Cn.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_gear.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_gear.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_ice.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_ice.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_fog.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_fog.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_record.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_record.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_misc.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_misc.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_functions.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_menu_functions.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_pah_ap.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_pah_ap.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_parsefile.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_parsefile.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_rah_ap.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_rah_ap.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_recorder.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_recorder.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_warnings_errors.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_warnings_errors.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_wrapper.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UIUCModel\uiuc_wrapper.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_UIUCModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_UIUCModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_YASim"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\YASim.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\YASim.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\FGGround.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\FGGround.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Airplane.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Airplane.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Atmosphere.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Atmosphere.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\BodyEnvironment.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\ControlMap.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\ControlMap.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\FGFDM.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\FGFDM.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Gear.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Gear.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Glue.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Glue.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Ground.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Ground.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Hitch.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Hitch.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Hook.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Hook.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Launchbar.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Launchbar.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Integrator.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Integrator.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Jet.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Jet.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Math.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Math.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Model.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Model.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\PropEngine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\PropEngine.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Propeller.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Propeller.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Engine.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\PistonEngine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\PistonEngine.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\TurbineEngine.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\TurbineEngine.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\RigidBody.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\RigidBody.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Rotor.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Rotor.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Rotorpart.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Rotorpart.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\SimpleJet.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\SimpleJet.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Surface.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Surface.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Thruster.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Thruster.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Vector.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Wing.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Wing.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Turbulence.cpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\YASim\Turbulence.hpp\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_YASim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_YASim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Flight"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\flight.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\flight.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\groundcache.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\groundcache.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UFO.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\UFO.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\NullFDM.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\FDM\NullFDM.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Flight"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Flight"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_GUI"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\new_gui.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\new_gui.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\dialog.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\dialog.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\menubar.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\menubar.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\gui.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\gui.h\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\gui_funcs.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\fonts.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\AirportList.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\AirportList.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\property_list.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\property_list.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\layout.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\layout-props.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\layout.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\SafeTexFont.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\GUI\SafeTexFont.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_GUI"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_GUI"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Input"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Input\input.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Input"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Input"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Input\input.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Input"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Input"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Instrumentation"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\instrument_mgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\instrument_mgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\adf.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\adf.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\airspeed_indicator.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\airspeed_indicator.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\altimeter.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\altimeter.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\attitude_indicator.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\attitude_indicator.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\clock.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\clock.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\dme.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\dme.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\gps.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\gps.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\gsdi.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\gsdi.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\gyro.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\gyro.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\heading_indicator.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\heading_indicator.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\heading_indicator_fg.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\heading_indicator_fg.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\heading_indicator_dg.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\heading_indicator_dg.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\kr_87.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\kr_87.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\kt_70.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\kt_70.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\mag_compass.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\mag_compass.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\marker_beacon.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\marker_beacon.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\mrg.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\mrg.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\navradio.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\navradio.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\slip_skid_ball.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\slip_skid_ball.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\transponder.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\transponder.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\turn_indicator.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\turn_indicator.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\vertical_speed_indicator.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\vertical_speed_indicator.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\inst_vertical_speed_indicator.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\inst_vertical_speed_indicator.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\od_gauge.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\od_gauge.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\wxradar.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\wxradar.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\tacan.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\tacan.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\mk_viii.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\mk_viii.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\dclgps.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\dclgps.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\render_area_2d.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\render_area_2d.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\groundradar.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\groundradar.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\agradar.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\agradar.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\rad_alt.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\rad_alt.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Instrumentation"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Instrumentation"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_KLN89"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_act.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_act.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_apt.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_apt.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_cal.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_cal.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_dir.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_dir.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_fpl.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_fpl.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_int.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_int.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_nav.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_nav.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_ndb.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_ndb.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_nrst.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_nrst.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_oth.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_oth.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_set.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_set.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_usr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_usr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_vor.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_page_vor.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\KLN89\kln89_symbols.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_KLN89"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_KLN89"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_HUD"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_tape.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_dial.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_gauge.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_instrument.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_label.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_ladder.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_misc.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_runway.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_scale.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Instrumentation\HUD\HUD_tbi.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_HUD"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_HUD"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "main"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\bootstrap.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Main"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\main.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\main.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\renderer.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\renderer.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_commands.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_commands.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_init.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_init.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_io.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_io.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_props.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_props.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\globals.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\globals.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\logger.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\logger.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\options.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\options.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\splash.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\splash.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\util.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\util.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\viewer.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\viewer.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\viewmgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\viewmgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\CameraGroup.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\CameraGroup.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\FGManipulator.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\FGManipulator.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\WindowSystemAdapter.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\WindowSystemAdapter.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\WindowBuilder.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\WindowBuilder.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\fg_os_osgviewer.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Main\$(GFX_COMMON)\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Main"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Main"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Model"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\acmodel.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\acmodel.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\model_panel.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\model_panel.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\modelmgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\modelmgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\panelnode.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Model\panelnode.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Model"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Model"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_AIModel"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\submodel.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\submodel.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIManager.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIManager.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIBase.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIBase.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIModelData.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIModelData.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIAircraft.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIAircraft.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIMultiplayer.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIMultiplayer.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIShip.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIShip.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIBallistic.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIBallistic.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIStorm.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIStorm.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIThermal.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIThermal.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIFlightPlan.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIFlightPlan.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIFlightPlanCreate.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIFlightPlanCreatePushBack.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIFlightPlanCreateCruise.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AICarrier.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AICarrier.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIStatic.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIStatic.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AITanker.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AITanker.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIWingman.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\AIWingman.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\performancedata.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\performancedata.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\performancedb.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\AIModel\performancedb.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_AIModel"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_AIModel"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_MultiPlayer"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\MultiPlayer\multiplaymgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_MultiPlayer"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_MultiPlayer"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\MultiPlayer\multiplaymgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_MultiPlayer"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_MultiPlayer"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\MultiPlayer\mpmessages.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_MultiPlayer"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_MultiPlayer"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\MultiPlayer\tiny_xdr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_MultiPlayer"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_MultiPlayer"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\MultiPlayer\tiny_xdr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_MultiPlayer"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_MultiPlayer"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Navaids"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\navdb.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\navdb.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\fix.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\fixlist.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\fixlist.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\awynet.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\awynet.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\navrecord.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\navrecord.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\navlist.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\navlist.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\positioned.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Navaids\positioned.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Navaids"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Navaids"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Network"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\protocol.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\protocol.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ATC-Main.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ATC-Main.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ATC-Inputs.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ATC-Inputs.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ATC-Outputs.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ATC-Outputs.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\atlas.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\atlas.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\AV400.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\AV400.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\garmin.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\garmin.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\lfsglass.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\lfsglass.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\lfsglass_data.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\httpd.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\httpd.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\joyclient.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\joyclient.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\jsclient.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\jsclient.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native_ctrls.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native_ctrls.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native_fdm.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native_fdm.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native_gui.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\native_gui.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\net_ctrls.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\net_fdm.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\net_fdm_mini.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\net_gui.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\nmea.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\nmea.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\opengc.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\opengc.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\opengc_data.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\multiplay.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\multiplay.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\props.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\props.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\pve.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\pve.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ray.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\ray.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\rul.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\rul.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\generic.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Network\generic.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Network"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Network"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Scenery"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\redout.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\redout.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\scenery.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\scenery.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\SceneryPager.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\SceneryPager.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\tilemgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scenery\tilemgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scenery"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scenery"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Scripting"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scripting\NasalSys.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scripting"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scripting"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scripting\NasalSys.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scripting"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scripting"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Scripting\nasal-props.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Scripting"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Scripting"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Sound"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\beacon.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\beacon.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\fg_fx.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\fg_fx.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\morse.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\morse.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\voice.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Sound\voice.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Sound"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Sound"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Systems"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\system_mgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\system_mgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\electrical.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\electrical.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\pitot.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\pitot.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\static.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\static.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\vacuum.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Systems\vacuum.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Systems"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Systems"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Time"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\fg_timer.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\fg_timer.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\light.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\light.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\sunsolver.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\sunsolver.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\tmp.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Time\tmp.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Time"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Time"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Group "Lib_Traffic"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Traffic\SchedFlight.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Traffic"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Traffic"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Traffic\SchedFlight.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Traffic"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Traffic"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Traffic\Schedule.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Traffic"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Traffic"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Traffic\Schedule.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Traffic"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Traffic"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Traffic\TrafficMgr.cxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Traffic"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Traffic"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\src\Traffic\TrafficMgr.hxx\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_Traffic"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_Traffic"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# End Group\r
-# Begin Source File\r
-\r
-SOURCE = .\src\Include\config.h-msvc6\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# Begin Custom Build - Creating config.h\r
-InputPath=.\src\Include\config.h-msvc6\r
-\r
-".\src\Include\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       copy .\src\Include\config.h-msvc6 .\src\Include\config.h\r
-\r
-# End Custom Build\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# Begin Custom Build - Creating config.h\r
-InputPath=.\src\Include\config.h-msvc6\r
-\r
-".\src\Include\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       copy .\src\Include\config.h-msvc6 .\src\Include\config.h\r
-\r
-# End Custom Build\r
-\r
-!ENDIF\r
-\r
-# End Source File\r
-# End Target\r
-# End Project\r
diff --git a/FlightGear.dsw b/FlightGear.dsw
deleted file mode 100644 (file)
index 6b82534..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00\r
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
-\r
-###############################################################################\r
-\r
-Project: "FlightGear"=".\FlightGear.dsp" - Package Owner=<4>\r
-\r
-Package=<5>\r
-{{{\r
-}}}\r
-\r
-Package=<4>\r
-{{{\r
-}}}\r
-\r
-###############################################################################\r
-\r
-Global:\r
-\r
-Package=<5>\r
-{{{\r
-}}}\r
-\r
-Package=<3>\r
-{{{\r
-}}}\r
-\r
-###############################################################################\r
-\r
index d79f3f0b228886de38c58b7d36da6d9a5ebfd3d0..7822c2a4db3a9e4c8a6d715cea208b00d81d354b 100644 (file)
@@ -650,7 +650,7 @@ if test "x$want_boost" = "xyes"; then
                if test "$_version" = "0" ; then
                        AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
                else
-                       AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
+                       AC_MSG_ERROR([Your boost libraries seems to old (version $_version).])
                fi
        else
                AC_SUBST(BOOST_CPPFLAGS)
index 40106421306ef14640602f3b97c9c55aa8f93a0b..6ae6d7438f964ea35c212bd69d1ddbf6fa50dfac 100644 (file)
@@ -20,7 +20,7 @@ AC_PROG_CXX
 AC_PROG_RANLIB
 AC_PROG_INSTALL
 AC_PROG_LN_S
-AX_BOOST_BASE([1.34.0])
+AX_BOOST_BASE([1.37.0])
 
 if test "x$BOOST_CPPFLAGS" != "x-I/usr/include" ; then
    CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
@@ -686,6 +686,13 @@ case "${host}" in
 esac
 AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
 
+AC_MSG_CHECKING([checking for osg::CullSettings::CLEAR_MASK])
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[#include <osg/CullSettings>]],
+    [[osg::CullSettings::VariablesMask mask = osg::CullSettings::CLEAR_MASK;]])],
+  [AC_DEFINE([HAVE_CULLSETTINGS_CLEAR_MASK],1,[define if OSG has CullSettings::CLEAR_MASK])
+   AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([no])])
 AC_LANG_POP
 
 dnl Check for system installed zlib
index 60b30386aa30f157e5e16273639d32597a4208f9..f6d2b3159eb69d7f4d8e765b44c78089c09cd88c 100644 (file)
@@ -1,3 +1,6 @@
+Effects
+-------
+
 Effects describe the graphical appearance of 3d objects and scenery in
 FlightGear. The main motivation for effects is to support OpenGL
 shaders and to provide different implementations for graphics hardware
@@ -10,13 +13,16 @@ values. Effects are read from files with a ".eff" extension or can be
 created on-the-fly by FlightGear at runtime.  An effect consists of a
 "parameters" section followed by "technique" descriptions.  The
 "parameters" section is a tree of values that describe, abstractly,
-the graphical appearence of objects that use the effect. Techniques
+the graphical characteristics of objects that use the effect. Techniques
 refer to these parameters and use them to set OpenGL state or to set
-parameters for shader programs.
+parameters for shader programs. The names of properties in the
+parameter section can be whatever the effects author chooses, although
+some standard parameters  are set by FlightGear itself. On the other
+hand, the properties in the techniques section are all defined by the
+FlightGear. 
 
-Parameters can be declared to have a dynamic variance, which means
-that if their value is changed the corresponding value in the
-technique will be changed too. [TO BE IMPLEMENTED]
+Techniques
+----------
 
 A technique can contain a predicate that describes the OpenGL
 functionality required to support the technique. The first
@@ -29,22 +35,131 @@ and, or, equal, less, less-equal
 glversion - returns the version number of OpenGL
 extension-supported - returns true if an OpenGL extension is supported
 property - returns the boolean value of a property
+shader-language - returns the version of GLSL supported, or 0 if there is none.
+
+The proper way to test whether to enable a shader-based technique is:
+    <predicate>
+      <and>
+        <property>/sim/rendering/shader-effects</property>
+        <less-equal>
+          <value type="float">1.0</value>
+          <shader-language/>
+        </less-equal>
+      </and>
+    </predicate>
+
 
 A technique can consist of several passes. A pass is basically an Open
 Scene Graph StateSet. Ultimately all OpenGL and OSG modes and state
-attributes  will be setable in a technique. The following are
-are currently implemented:
-lighting - true, false
-shade-model - flat, smooth
+attributes  will be accessable in techniques. State attributes -- that
+is, technique properties that have children and are not just boolean
+modes -- have an <active> parameter which enables or disables the
+attribute. In this way a technique can declare parameters it needs,
+but not enable the attribute at all if it is not needed; the decision
+can be based on a parameter in the parameters section of the
+effect. For example, effects that support transparent and opaque
+geometry could have as part of a technique:
+
+      <blend>
+        <active><use>blend/active</use></active>
+        <source>src-alpha</source>
+        <destination>one-minus-src-alpha</destination>
+      </blend>
+
+So if the blend/active parameter is true blending will be activated
+using the usual blending equation; otherwise blending is disabled.
+
+Values of Technique Attributes
+------------------------------
+
+Values are assigned to technique properties in several ways:
+
+       * They can appear directly in the techniques section as a
+        constant. For example:
+      <uniform>
+        <name>ColorsTex</name>
+        <type>sampler-1d</type>
+        <value type="int">2</value>
+      </uniform>
+        * The name of a property in the parameters section can be
+        referenced using a "use" clause. For example, in the technique
+        section: 
+      <material>
+        <ambient><use>material/ambient</use></ambient>
+      </material>
+        Then, in the parameters section of the effect:
+  <parameters>
+    <material>
+      <ambient type="vec4d">
+        0.2 .2 0.2 1.0
+      </ambient>
+    </material>
+  </parameters>
+
+        It's worth pointing out that the "material" property in a
+        technique specifies part of OpenGL's state, whereas "material"
+        in the parameters section is just a name, part of a
+        hierarchical namespace.
+
+        * A property in the parameters section doesn't need to contain
+        a constant value; it can also contain a "use" property. Here
+        the value of the use clause is the name of a node in an
+        external property tree which will be used as the source of a
+        value. If the name begins with '/', the node is in
+        FlightGear's global property tree; otherwise, it is in a local
+        property tree, usually belonging to a model [NOT IMPLEMENTED
+        YET]. For example:
+  <parameters>
+    <chrome-light><use>/rendering/scene/chrome-light</use></chrome-light>
+  </parameters>
+        The type is determined by what is expected by the technique
+        attribute that will ultimately receive the value. [There is
+        no way to get vector values out of the main property system
+        yet; this will be fixed shortly.] Values that are declared
+        this way are dynamically updated if the property node
+        changes.
+
+OpenGL Attributes
+-----------------
+
+The following attributes are currently implemented in techiques:
+alpha-test - children: active, comparison, reference
+         Valid values for comparision:
+             never, less, equal, lequal, greater, notequal, gequal,
+             always 
+
+blend - children: active, source, destination, source-rgb,
+         source-alpha, destination-rgb, destination-alpha
+         Each operand can have the following values:
+             dst-alpha, dst-color, one, one-minus-dst-alpha,
+             one-minus-dst-color, one-minus-src-alpha,
+             one-minus-src-color, src-alpha, src-alpha-saturate,
+             src-color, constant-color, one-minus-constant-color,
+             constant-alpha, one-minus-constant-alpha, zero
+
 cull-face - front, back, front-back
+
+lighting - true, false
+
+material - children: active, ambient, ambient-front, ambient-back, diffuse,
+         diffuse-front, diffuse-back, specular, specular-front,
+         specular-back, emissive, emissive-front, emissive-back, shininess,
+         shininess-front, shininess-back, color-mode
+
+polygon-mode - children: front, back
+        Valid values:
+              fill, line, point
+
+program
+        vertex-shader
+        fragment-shader
+
+render-bin - (OSG) children: bin-number, bin-name
+
 rendering-hint - (OSG) opaque, transparent
-render-bin - children: bin-number, bin-name
-material - children: ambient, ambient-front, ambient-back, diffuse,
-diffuse-front, diffuse-back, specular, specular-front,
-specular-back, emissive, emissive-front, emissive-back, shininess,
-shininess-front, shininess-back, color-mode
-blend - true, false
-alpha-test - true, false
+
+shade-model - flat, smooth
+
 texture-unit - has several child properties:
        unit - The number of an OpenGL texture unit
         type - This is either an OpenGL texture type or the name of a
@@ -62,16 +177,17 @@ texture-unit - has several child properties:
         environment
                 mode
                 color
-program
-        vertex-shader
-        fragment-shader
 uniform
         name
         type - float, float-vec3, float-vec4, sampler-1d, sampler-2d,
         sampler-3d
-polygon-mode
-front - fill, line, point
-back - fill, line, point
+
+vertex-program-two-side - true, false
+
+vertex-program-point-size - true, false
+
+Inheritance
+-----------
 
 One feature not fully illustrated in the sample below is that
 effects can inherit from each other. The parent effect is listed in
@@ -83,164 +199,64 @@ precedence.  This means that effects that inherit from the example
 effect below could be very short, listing just new
 parameters and adding nothing to the techniques section;
 alternatively, a technique could be altered or customized in a
-child, listing (for example) a different shader program. Terrain
-materials work in this way: for each material type in materials.xml
-an effect is created that inherits from a single default terrain
-effect. The parameters section of the effect is filled in using the
-ambient, diffuse, specular, emissive, shininess, and transparent
-fields of the material. Seperate effects are created for each texture
+child, listing (for example) a different shader program. An example
+showing inheritance Effects/crop.eff, which inherits some if its
+values from Effects/terrain-default.eff.
+
+FlightGear directly uses effects inheritance to assign effects to 3D
+models and terrain. As described below, at runtime small effects are
+created that contain material and texture values in a "parameters"
+section. These effects inherit from another effect which references
+those parameters in its "techniques" section. The derived effect
+overrides any default values that might be in the base effect's
+parameters section.
+
+Default Effects in Terrain Materials and Models
+---------------------------------------
+
+Effects for terrain work in this way: for each material type in
+materials.xml an effect is created that inherits from a single default
+terrain effect, Effects/terrain-default.eff. The parameters section of
+the effect is filled in using the ambient, diffuse, specular,
+emissive, shininess, and transparent fields of the material. The
+parameters image, filter, wrap-s, and wrap-t are also initialized from
+the material xml. Seperate effects are created for each texture
 variant of a material.
 
+Model effects are created by walking the OpenSceneGraph scene graph
+for a model and replacing nodes (osg::Geode) that have state sets with
+node that uses an effect instead. Again, a small effect is created
+with parameters extracted from OSG objects; this effect inherits, by
+default, from Effects/model-default.eff. A larger set of parameters is
+created for model effects than for terrain because there is more
+variation possible from the OSG model loaders than from the terrain
+system. The parameters created are: 
+
+       * material active, ambient, diffuse, specular, emissive,
+        shininess, color mode
+        * blend active, source, destination
+        * shade-model
+        * cull-face
+        * rendering-hint
+        * texture type, image, filter, wrap-s, wrap-t
+
+Specifying Custom Effects
+-------------------------
+
+You can specify the effects that will be used by FlightGear as the
+base effect when it creates terrain and model effects.
+
+In the terrain materials.xml, an "effect" property specifies the name
+of the model to use.
+
+In model .xml files, A richer syntax is supported. [TO BE DETERMINED]
+
 Material animations will be implemented by creating a new effect
 that inherits from one in a model, overriding the parameters that
 will be animated.
 
+Examples
+--------
 
-<PropertyList>
-  <effect>
-    <name>city</name>
-    <!-- <inherits-from>another-effect</inherits-from> -->
-    <parameters>
-      <material>
-        <ambient type="vec4d">
-          0.0 0.0 0.0 1.0
-        </ambient>
-        <diffuse type="vec4d">
-          .5 .5 .5 1.0
-        </diffuse>
-        <specular type="vec4d">
-          0.3 0.3 0.3 1.0
-        </specular>
-        <emissive type="vec4d" variance="dynamic">
-          0.0 0.0 0.0 1.0
-        </emissive>
-        <shininess>1.2</shininess>
-      </material>
-      <texture n="0">
-        <image>city.png</image>
-        <filter>linear-mipmap-linear</filter>
-        <!-- also repeat -->
-        <wrap-s>clamp</wrap-s>
-        <wrap-t>clamp-to-edge</wrap-t>
-        <!--
-           <wrap-r>clamp-to-border</wrap-r>
-           -->
-        <!-- float, signed-integer, integer -->
-        <internal-format>normalized</internal-format>
-      </texture>
-      <texture n="1">
-        <image>detail.png</image>
-        <filter>linear-mipmap-linear</filter>
-        <!-- also repeat -->
-        <wrap-s>clamp</wrap-s>
-        <wrap-t>clamp-to-edge</wrap-t>
-        <!--
-          <wrap-r>clamp-to-border</wrap-r>
-           -->
-        <!-- float, signed-integer, integer -->
-        <internal-format>normalized</internal-format>
-      </texture>
-      <bump-height type="double">.05</bump-height>
-      <pattern-rotation type="vec4d">0 0 1 1.5708</pattern-rotation>
-    </parameters>
-    <technique>
-      <predicate>
-        <!-- This is the general way to test for shader support -->
-        <or>
-          <less-equal>
-            <value type="float">2.0</value>
-            <glversion/>
-          </less-equal>
-          <and>
-            <extension-supported>GL_ARB_shader_objects</extension-supported>
-            <extension-supported>GL_ARB_shading_language_100</extension-supported>
-            <extension-supported>GL_ARB_vertex_shader</extension-supported>
-            <extension-supported>GL_ARB_fragment_shader</extension-supported>
-          </and>
-        </or>
-      </predicate>
-      <pass>
-        <lighting>true</lighting>
-        <material>
-          <ambient><use>material/ambient</use></ambient>
-          <diffuse><use>material/diffuse</use></diffuse>
-          <specular><use>material/specular</use></specular>
-          <shininess><use>material/shininess</use></shininess>
-        </material>
-        <texture-unit>
-          <unit>0</unit>
-          <image><use>texture[0]/image</use></image>
-          <filter><use>texture[0]/filter</use></filter>
-          <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
-          <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
-          <internal-format>
-            <use>texture[0]/internal-format</use>
-          </internal-format>
-        </texture-unit>
-        <texture-unit>
-          <unit>1</unit>
-          <image><use>texture[1]/image</use></image>
-          <filter><use>texture[1]/filter</use></filter>
-          <wrap-s><use>texture[1]/wrap-s</use></wrap-s>
-          <wrap-t><use>texture[1]/wrap-t</use></wrap-t>
-          <internal-format>
-            <use>texture[1]/internal-format</use>
-          </internal-format>
-        </texture-unit>
-          <uniform>
-            <name>bumpHeight</name>
-            <type>float</type>
-            <use>bump-height</use>
-          </uniform>
-          <uniform>
-            <name>patternRotation</name>
-            <type>float-vec4</type>
-            <use>pattern-rotation</use>
-          </uniform>
-          <uniform>
-            <name>baseTexture</name>
-            <type>sampler-2d</type>
-            <value>0</value>
-          </uniform>
-          <uniform>
-            <name>detailTexture</name>
-            <type>sampler-2d</type>
-            <value>1</value>
-          </uniform>
-        <shader-program>
-          <!-- These two vertex shaders are linked together -->
-          <vertex-shader>
-            "Shaders/util.vert"
-          </vertex-shader>
-          <vertex-shader>
-            "Shaders/foo.vert"
-          </vertex-shader>
-          <fragment-shader>
-            "Shaders/foo.frag"
-          </fragment-shader>
-        </shader-program>
-      </pass>
-    </technique>
-    <!-- This  technique is always valid -->
-    <technique>
-      <pass>
-        <lighting>true</lighting>
-        <material>
-          <ambient><use>material/ambient</use></ambient>
-          <diffuse><use>material/diffuse</use></diffuse>
-          <specular><use>material/specular</use></specular>
-        </material>
-        <texture-unit>
-          <unit>0</unit>
-          <image><use>texture[0]/image</use></image>
-          <filter><use>texture[0]/filter</use></filter>
-          <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
-          <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
-          <internal-format>
-            <use>texture[0]/internal-format</use>
-          </internal-format>
-        </texture-unit>
-      </pass>
-    </technique>
-  </effect>
-</PropertyList>
+The Effects directory contains the effects definitions; look there for
+examples. Effects/crop.eff is a good example of a complex effect.
index 92b70f5c49e64807c354ebb4fc834ceef940bcc0..6414b2966344cdfc69882868232e383d14681e5a 100755 (executable)
                <Filter
                        Name="Lib_Autopilot"
                        Filter="">
+                       <File
+                               RelativePath="..\..\src\Autopilot\autobrake.cxx">
+                       </File>
+                       <File
+                               RelativePath="..\..\src\Autopilot\autobrake.hxx">
+                       </File>
                        <File
                                RelativePath="..\..\src\Autopilot\route_mgr.cxx">
                        </File>
index 1be40009cfceacdd83accfc260eb1668ab324884..2bc8734090aa73bc76df41708c0b3a797659e006 100644 (file)
                <Filter
                        Name="Lib_Autopilot"
                        >
+                       <File
+                               RelativePath="..\..\..\src\Autopilot\autobrake.cxx"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\..\src\Autopilot\autobrake.hxx"
+                               >
+                       </File>
                        <File
                                RelativePath="..\..\..\src\Autopilot\route_mgr.cxx"
                                >
index 3f7b476d4e52b844f1409fa253a4950a57f2ae93..68d7f46c44d4d0d605a63a2751d4ba59fe4ec859 100644 (file)
@@ -33,6 +33,7 @@
 #include <string>
 #include <math.h>
 #include <time.h>
+
 #ifdef _MSC_VER
 #  include <float.h>
 #  define finite _finite
old mode 100755 (executable)
new mode 100644 (file)
index 4f44ab1..d20a213
@@ -76,18 +76,14 @@ void FGAIFlightPlan::evaluateRoutePart(double deplat,
       }
       
       //cerr << "1"<< endl;
-      SGGeoc geoc = SGGeoc::fromCart(SGVec3d(newPos[0], newPos[1], newPos[2]));
-
-      double midlat = geoc.getLatitudeDeg();
-      double midlon = geoc.getLongitudeDeg();
+      SGGeod geod = SGGeod::fromCart(SGVec3d(newPos[0], newPos[1], newPos[2]));
 
       prevNode = tmpNode;
-      tmpNode = globals->get_airwaynet()->findNearestNode(midlat, midlon);
+      tmpNode = globals->get_airwaynet()->findNearestNode(geod);
 
       FGNode* node = globals->get_airwaynet()->findNode(tmpNode);
-      SGGeoc nodePos(SGGeoc::fromGeod(node->getPosition()));
     
-      if ((tmpNode != prevNode) && (SGGeodesy::distanceM(geoc, nodePos) < 25000)) {
+      if ((tmpNode != prevNode) && (SGGeodesy::distanceM(geod, node->getPosition()) < 25000)) {
         nodes.push_back(tmpNode);
       }
     }
index 75f18b9c7844929ac08ccf02e34dcb7f20f439ac..21bc80d5ed70a5f46ae069c026ce35aca6f69667 100644 (file)
@@ -37,11 +37,16 @@ FGAIShip(otGroundVehicle),
 _pitch(0),
 _pitch_deg(0),
 _speed_kt(0),
+_selected_ac(0),
 _range_ft(0),
 _relbrg (0),
 _parent_speed(0),
+_dt_count(0),
+_next_run(0),
 _parent_x_offset(0),
-_selected_ac(0)
+_parent_y_offset(0),
+_parent("")
+
 {
     invisible = false;
 }
@@ -57,14 +62,15 @@ void FGAIGroundVehicle::readFromScenario(SGPropertyNode* scFileNode) {
     setNoRoll(scFileNode->getBoolValue("no-roll", true));
     setName(scFileNode->getStringValue("name", "groundvehicle"));
     setSMPath(scFileNode->getStringValue("submodel-path", ""));
-    setContactX1offset(scFileNode->getDoubleValue("contact_x1_offset", 0.0));
-    setContactX2offset(scFileNode->getDoubleValue("contact_x2_offset", 0.0));
+    setContactX1offset(scFileNode->getDoubleValue("contact-x1-offset", 0.0));
+    setContactX2offset(scFileNode->getDoubleValue("contact-x2-offset", 0.0));
     setXOffset(scFileNode->getDoubleValue("hitch-x-offset", 38.55));
+    setYOffset(scFileNode->getDoubleValue("hitch-y-offset", 0.0));
     setPitchoffset(scFileNode->getDoubleValue("pitch-offset", 0.0));
     setRolloffset(scFileNode->getDoubleValue("roll-offset", 0.0));
     setYawoffset(scFileNode->getDoubleValue("yaw-offset", 0.0));
-    setPitchCoeff(scFileNode->getDoubleValue("pitch-coefficient", 0.5));
-    setElevCoeff(scFileNode->getDoubleValue("elevation-coefficient", 0.5));
+    setPitchCoeff(scFileNode->getDoubleValue("pitch-coefficient", 0.1));
+    setElevCoeff(scFileNode->getDoubleValue("elevation-coefficient", 0.25));
     setParentName(scFileNode->getStringValue("parent", ""));
     setTowAngleGain(scFileNode->getDoubleValue("tow-angle-gain", 2.0));
     setTowAngleLimit(scFileNode->getDoubleValue("tow-angle-limit-deg", 2.0));
@@ -91,29 +97,20 @@ void FGAIGroundVehicle::bind() {
         SGRawValuePointer<double>(&_range_ft));
     props->tie("hitch/x-offset-ft",
         SGRawValuePointer<double>(&_x_offset));
+    props->tie("hitch/y-offset-ft",
+        SGRawValuePointer<double>(&_y_offset));
     props->tie("hitch/parent-x-offset-ft",
         SGRawValuePointer<double>(&_parent_x_offset));
+    props->tie("hitch/parent-y-offset-ft",
+        SGRawValuePointer<double>(&_parent_y_offset));
     props->tie("controls/constants/tow-angle/gain",
         SGRawValuePointer<double>(&_tow_angle_gain));
     props->tie("controls/constants/tow-angle/limit-deg",
         SGRawValuePointer<double>(&_tow_angle_limit));
-
-
-    //we may need these later for towed vehicles
-
-    //    (*this, &FGAIBallistic::getElevHitchToUser));
-    //props->tie("position/x-offset",
-    //    SGRawValueMethods<FGAIBase,double>(*this, &FGAIBase::_getXOffset, &FGAIBase::setXoffset));
-    //props->tie("position/y-offset",
-    //    SGRawValueMethods<FGAIBase,double>(*this, &FGAIBase::_getYOffset, &FGAIBase::setYoffset));
-    //props->tie("position/z-offset",
-    //    SGRawValueMethods<FGAIBase,double>(*this, &FGAIBase::_getZOffset, &FGAIBase::setZoffset));
-    //props->tie("position/tgt-x-offset",
-    //    SGRawValueMethods<FGAIWingman,double>(*this, &FGAIWingman::getTgtXOffset, &FGAIWingman::setTgtXOffset));
-    //props->tie("position/tgt-y-offset",
-    //    SGRawValueMethods<FGAIWingman,double>(*this, &FGAIWingman::getTgtYOffset, &FGAIWingman::setTgtYOffset));
-    //props->tie("position/tgt-z-offset",
-    //    SGRawValueMethods<FGAIWingman,double>(*this, &FGAIWingman::getTgtZOffset, &FGAIWingman::setTgtZOffset));
+    props->tie("controls/contact-x1-offset-ft",
+        SGRawValuePointer<double>(&_contact_x1_offset));
+    props->tie("controls/contact-x2-offset-ft",
+        SGRawValuePointer<double>(&_contact_x2_offset));
 }
 
 void FGAIGroundVehicle::unbind() {
@@ -126,20 +123,13 @@ void FGAIGroundVehicle::unbind() {
     props->untie("hitch/tow-angle-deg");
     props->untie("hitch/range-ft");
     props->untie("hitch/x-offset-ft");
+    props->untie("hitch/y-offset-ft");
     props->untie("hitch/parent-x-offset-ft");
+    props->untie("hitch/parent-y-offset-ft");
     props->untie("controls/constants/tow-angle/gain");
     props->untie("controls/constants/tow-angle/limit-deg");
-
-    //we may need these later for towed vehicles
-    //props->untie("load/rel-brg-to-user-deg");
-    //props->untie("load/elev-to-user-deg");
-    //props->untie("velocities/vertical-speed-fps");
-    //props->untie("position/x-offset");
-    //props->untie("position/y-offset");
-    //props->untie("position/z-offset");
-    //props->untie("position/tgt-x-offset");
-    //props->untie("position/tgt-y-offset");
-    //props->untie("position/tgt-z-offset");
+    props->untie("controls/contact-x1-offset-ft");
+    props->untie("controls/contact-x2-offset-ft");
 }
 
 bool FGAIGroundVehicle::init(bool search_in_AI_path) {
@@ -147,7 +137,6 @@ bool FGAIGroundVehicle::init(bool search_in_AI_path) {
         return false;
 
     invisible = false;
-
     _limit = 200;
     no_roll = true;
 
@@ -157,77 +146,8 @@ bool FGAIGroundVehicle::init(bool search_in_AI_path) {
 void FGAIGroundVehicle::update(double dt) {
     //    SG_LOG(SG_GENERAL, SG_ALERT, "updating GroundVehicle: " << _name );
 
-    if (getPitch()){
-        setElevation(_elevation, dt, _elevation_coeff);
-        ClimbTo(_elevation_ft);
-        setPitch(_pitch, dt, _pitch_coeff);
-        PitchTo(_pitch_deg);
-    }
-
-    if(_parent !=""){
-        setParent();
-
-        string parent_next_name = _selected_ac->getStringValue("waypoint/name-next");
-        bool parent_waiting = _selected_ac->getBoolValue("waypoint/waiting");
-        _parent_speed = _selected_ac->getDoubleValue("velocities/true-airspeed-kt");
-
-        if (parent_next_name == "END" && fp->getNextWaypoint()->name != "END" ){
-            SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
-                << " setting END: getting new waypoints ");
-            AdvanceFP();
-            setWPNames();
-        /*} else if (parent_next_name == "WAIT" && fp->getNextWaypoint()->name != "WAIT" ){*/
-        } else if (parent_waiting && !_waiting){
-            SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
-                << " setting WAIT/WAITUNTIL: getting new waypoints ");
-            AdvanceFP();
-            setWPNames();
-            _waiting = true;
-        } else if (parent_next_name != "WAIT" && fp->getNextWaypoint()->name == "WAIT"){
-            SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
-                << " wait done: getting new waypoints ");
-            _waiting = false;
-            _wait_count = 0;
-            fp->IncrementWaypoint(false);
-            next = fp->getNextWaypoint();
-
-            if (next->name == "WAITUNTIL" || next->name == "WAIT"
-                || next->name == "END"){
-            } else {
-                prev = curr;
-                fp->IncrementWaypoint(false);
-                curr = fp->getCurrentWaypoint();
-                next = fp->getNextWaypoint();
-            }
-
-            setWPNames();
-        } else if (_range_ft > 1000){
-
-             SG_LOG(SG_GENERAL, SG_INFO, "AIGroundVeh1cle: " << _name
-                << " rescue: reforming train " << _range_ft << " " << _x_offset * 15);
-
-            setTowAngle(0, dt, 1);
-            setSpeed(_parent_speed * 2);
-
-        } else if (_parent_speed > 1){
-
-            setTowSpeed();
-            setTowAngle(_relbrg, dt, 1);
-
-        } else if (_parent_speed < -1){
-
-            setTowSpeed();
-
-            if (_relbrg < 0)
-                setTowAngle(-(180 - (360 + _relbrg)), dt, 1);
-            else
-                setTowAngle(-(180 - _relbrg), dt, 1);
-
-        } else
-            setSpeed(_parent_speed);
-    }
-
-    FGAIShip::update(dt);
+    RunGroundVehicle(dt);
+//    FGAIShip::update(dt);
 }
 
 void FGAIGroundVehicle::setNoRoll(bool nr) {
@@ -246,6 +166,10 @@ void FGAIGroundVehicle::setXOffset(double x) {
     _x_offset = x;
 }
 
+void FGAIGroundVehicle::setYOffset(double y) {
+    _y_offset = y;
+}
+
 void FGAIGroundVehicle::setPitchCoeff(double pc) {
     _pitch_coeff = pc;
 }
@@ -277,26 +201,22 @@ void FGAIGroundVehicle::setParentName(const string& p) {
 }
 
 void FGAIGroundVehicle::setTowAngle(double ta, double dt, double coeff){
-    ta *= _tow_angle_gain;
-    //_tow_angle = pow(ta,2) * sign(ta);
-    //if (_tow_angle > _tow_angle_limit) _tow_angle = _tow_angle_limit;
-    //if (_tow_angle < -_tow_angle_limit) _tow_angle = -_tow_angle_limit;
+    //_tow_angle = ta * _tow_angle_gain;
+    _tow_angle = pow(ta,2) * sign(ta);
     SG_CLAMP_RANGE(_tow_angle, -_tow_angle_limit, _tow_angle_limit);
 }
 
 bool FGAIGroundVehicle::getGroundElev(SGGeod inpos) {
 
-    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 10000),
-        _elevation_m, &_material)){
-            _ht_agl_ft = pos.getElevationFt() - _elevation_m * SG_METER_TO_FEET;
+    double height_m ;
+
+    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &_material,0)){
+            _ht_agl_ft = inpos.getElevationFt() - height_m * SG_METER_TO_FEET;
 
             if (_material) {
                 const vector<string>& names = _material->get_names();
 
                 _solid = _material->get_solid();
-                _load_resistance = _material->get_load_resistance();
-                _frictionFactor =_material->get_friction_factor();
-                _elevation = _elevation_m * SG_METER_TO_FEET;
 
                 if (!names.empty())
                     props->setStringValue("material/name", names[0].c_str());
@@ -321,58 +241,92 @@ bool FGAIGroundVehicle::getGroundElev(SGGeod inpos) {
 
 bool FGAIGroundVehicle::getPitch() {
 
-    double vel = props->getDoubleValue("velocities/true-airspeed-kt", 0);
-    double contact_offset_x1_m = _contact_x1_offset * SG_FEET_TO_METER;
-    double contact_offset_x2_m = _contact_x2_offset * SG_FEET_TO_METER;
+    if (!_tunnel){
+
+        double vel = props->getDoubleValue("velocities/true-airspeed-kt", 0);
+        double contact_offset_x1_m = _contact_x1_offset * SG_FEET_TO_METER;
+        double contact_offset_x2_m = _contact_x2_offset * SG_FEET_TO_METER;
+
+        SGVec3d front(-contact_offset_x1_m, 0, 0);
+        SGVec3d rear(-contact_offset_x2_m, 0, 0);
+        SGVec3d Front = getCartPosAt(front);
+        SGVec3d Rear = getCartPosAt(rear);
 
-    SGVec3d front(-contact_offset_x1_m, 0, 0);
-    SGVec3d rear(-contact_offset_x2_m, 0, 0);
-    SGVec3d Front = getCartPosAt(front);
-    SGVec3d Rear = getCartPosAt(rear);
+        SGGeod geodFront = SGGeod::fromCart(Front);
+        SGGeod geodRear = SGGeod::fromCart(Rear);
 
-    SGGeod geodFront = SGGeod::fromCart(Front);
-    SGGeod geodRear = SGGeod::fromCart(Rear);
+        double front_elev_m = 0;
+        double rear_elev_m = 0;
+        double elev_front = 0;
+        double elev_rear = 0;
+        double max_alt = 10000;
 
-    double front_elev_m = 0;
-    double rear_elev_m = 0;
-    double elev_front = 0;
-    double elev_rear = 0;
+        if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodFront, 3000), elev_front,
+             &_material, 0)){
+                front_elev_m = elev_front;
+        } else
+            return false;
 
-    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodFront, 10000),
-        elev_front, &_material)){
+        if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodRear, 3000),
+            elev_rear, &_material, 0)){
+                rear_elev_m = elev_rear;
+        } else
+            return false;
 
-            front_elev_m = elev_front;
+        if (vel >= 0){
+            double diff = front_elev_m - rear_elev_m;
+            _pitch = atan2 (diff,
+                fabs(contact_offset_x1_m) + fabs(contact_offset_x2_m)) * SG_RADIANS_TO_DEGREES;
+            _elevation = (rear_elev_m + diff/2) * SG_METER_TO_FEET;
+        } else {
+            double diff = rear_elev_m - front_elev_m;
+            _pitch = atan2 (diff,
+                fabs(contact_offset_x1_m) + fabs(contact_offset_x2_m)) * SG_RADIANS_TO_DEGREES;
+            _elevation = (front_elev_m + diff/2) * SG_METER_TO_FEET;
+            _pitch = -_pitch;
+        }
 
-            //if (_material) {
-            //
-            //}
+    } else {
 
-    } else
-        return false;
+        if (prev->altitude == 0 || curr->altitude == 0) return false;
 
-    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodRear, 10000),
-        elev_rear, &_material)){
-            rear_elev_m = elev_rear;
-            //if (_material) {
-            //    rear_elev_m = elev_rear;
-            //}
+        static double distance;
+        static double d_alt;
+        static double curr_alt;
+        static double prev_alt;
 
-    } else
-        return false;
+        if (_new_waypoint){
+            cout << "new waypoint, calculating pitch " << endl;
+            curr_alt = curr->altitude * SG_METER_TO_FEET;
+            prev_alt = prev->altitude * SG_METER_TO_FEET;
+            d_alt = curr_alt - prev_alt;
+
+            distance = SGGeodesy::distanceM(SGGeod::fromDeg(prev->longitude, prev->latitude),
+            SGGeod::fromDeg(curr->longitude, curr->latitude));
+
+            _pitch = atan2(d_alt, distance * SG_METER_TO_FEET) * SG_RADIANS_TO_DEGREES;
+//            cout << "new waypoint, calculating pitch " <<  _pitch << endl;
+        }
+
+
+        double distance_to_go = SGGeodesy::distanceM(SGGeod::fromDeg(pos.getLongitudeDeg(), pos.getLatitudeDeg()),
+            SGGeod::fromDeg(curr->longitude, curr->latitude));
+
+        //cout << "tunnel " << _tunnel
+        //     << " distance curr & prev " << prev->name << " " << curr->name << " " << distance * SG_METER_TO_FEET
+        //     << " distance to go " << distance_to_go * SG_METER_TO_FEET
+        //     << " d_alt ft " << d_alt
+        //     << endl;
+
+        if (distance_to_go > distance)
+            _elevation = prev_alt;
+        else
+            _elevation = curr_alt - (tan(_pitch * SG_DEGREES_TO_RADIANS) * distance_to_go * SG_METER_TO_FEET);
 
-    if (vel >= 0){
-        double diff = front_elev_m - rear_elev_m;
-        _pitch = atan2 (diff,
-            fabs(contact_offset_x1_m) + fabs(contact_offset_x2_m)) * SG_RADIANS_TO_DEGREES;
-        _elevation = (rear_elev_m + diff/2) * SG_METER_TO_FEET;
-    } else {
-        double diff = rear_elev_m - front_elev_m;
-        _pitch = atan2 (diff,
-            fabs(contact_offset_x1_m) + fabs(contact_offset_x2_m)) * SG_RADIANS_TO_DEGREES;
-        _elevation = (front_elev_m + diff/2) * SG_METER_TO_FEET;
-        _pitch = -_pitch;
     }
 
+    getGroundElev(pos);
+
     return true;
 }
 
@@ -387,6 +341,7 @@ void FGAIGroundVehicle::setParent() {
             model = _selected_ac;
         } else {
             model = ai->getChild(i);
+            string path = ai->getPath();
             const string name = model->getStringValue("name");
 
             if (!model->nChildren()){
@@ -408,12 +363,20 @@ void FGAIGroundVehicle::setParent() {
         double lat = _selected_ac->getDoubleValue("position/latitude-deg");
         double lon = _selected_ac->getDoubleValue("position/longitude-deg");
         double elevation = _selected_ac->getDoubleValue("position/altitude-ft");
-        double hitch_offset_m = _x_offset * SG_FEET_TO_METER;
+        double hitch_x_offset_m = _selected_ac->getDoubleValue("hitch/x-offset-ft")
+            * SG_FEET_TO_METER;
+        double hitch_y_offset_m = _selected_ac->getDoubleValue("hitch/y-offset-ft")
+            * SG_FEET_TO_METER;
+
         _selectedpos.setLatitudeDeg(lat);
         _selectedpos.setLongitudeDeg(lon);
         _selectedpos.setElevationFt(elevation);
 
-        SGVec3d rear_hitch(-hitch_offset_m, 0, 0);
+        _parent_x_offset = _selected_ac->getDoubleValue("hitch/x-offset-ft");
+        _parent_y_offset = _selected_ac->getDoubleValue("hitch/y-offset-ft");
+        _parent_speed    = _selected_ac->getDoubleValue("velocities/true-airspeed-kt");
+
+        SGVec3d rear_hitch(-hitch_x_offset_m, hitch_y_offset_m, 0);
         SGVec3d RearHitch = getCartHitchPosAt(rear_hitch);
 
         SGGeod rearpos = SGGeod::fromCart(RearHitch);
@@ -441,15 +404,13 @@ void FGAIGroundVehicle::calcRangeBearing(double lat, double lon, double lat2, do
     // calculate the bearing and range of the second pos from the first
     double az2, distance;
     geo_inverse_wgs_84(lat, lon, lat2, lon2, &bearing, &az2, &distance);
-    range = distance *= SG_METER_TO_NM;
+    range = distance * SG_METER_TO_NM;
 }
 
 double FGAIGroundVehicle::calcRelBearingDeg(double bearing, double heading)
 {
     double angle = bearing - heading;
-
     SG_NORMALIZE_RANGE(angle, -180.0, 180.0);
-
     return angle;
 }
 
@@ -535,9 +496,7 @@ void FGAIGroundVehicle::AdvanceFP(){
 
 void FGAIGroundVehicle::setTowSpeed(){
 
-    _parent_x_offset = _selected_ac->getDoubleValue("hitch/x-offset-ft");
-
-    // double diff = _range_ft - _parent_x_offset;
+    double diff = _range_ft - _x_offset;
     double  x = 0;
 
     if (_range_ft > _x_offset * 3) x = 50;
@@ -545,11 +504,11 @@ void FGAIGroundVehicle::setTowSpeed(){
     if (_relbrg < -90 || _relbrg > 90){
         setSpeed(_parent_speed - 5 - x);
         //cout << _name << " case 1r _relbrg spd - 5 " << _relbrg << " " << diff << endl;
-    }else if (_range_ft > _parent_x_offset + 0.25 && _relbrg >= -90 && _relbrg <= 90){
+    }else if (_range_ft > _x_offset + 0.25 && _relbrg >= -90 && _relbrg <= 90){
         setSpeed(_parent_speed + 1 + x);
         //cout << _name << " case 2r _relbrg spd + 1 " << _relbrg << " "
         //    << diff << " range " << _range_ft << endl;
-    } else if (_range_ft < _parent_x_offset - 0.25 && _relbrg >= -90 && _relbrg <= 90){
+    } else if (_range_ft < _x_offset - 0.25 && _relbrg >= -90 && _relbrg <= 90){
         setSpeed(_parent_speed - 1 - x);
         //cout << _name << " case 3r _relbrg spd - 2 " << _relbrg << " "
         //    << diff << " " << _range_ft << endl;
@@ -559,4 +518,100 @@ void FGAIGroundVehicle::setTowSpeed(){
     }
 
 }
+
+void FGAIGroundVehicle::RunGroundVehicle(double dt){
+
+    _dt_count += dt;
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Check execution time (currently once every 0.05 sec or 20 fps)
+    // Add a bit of randomization to prevent the execution of all flight plans
+    // in synchrony, which can add significant periodic framerate flutter.
+    // Randomization removed to get better appearance
+    ///////////////////////////////////////////////////////////////////////////
+
+    //cout << "_start_sec " << _start_sec << " time_sec " << time_sec << endl;
+    if (_dt_count < _next_run)
+        return;
+
+    _next_run = 0.055 /*+ (0.015 * sg_random())*/;
+
+    if (getPitch()){
+        setElevation(_elevation, _dt_count, _elevation_coeff);
+        ClimbTo(_elevation_ft);
+        setPitch(_pitch, _dt_count, _pitch_coeff);
+        PitchTo(_pitch_deg);
+    }
+
+    if(_parent == ""){
+        AccelTo(prev->speed);
+        FGAIShip::update(_dt_count);
+        _dt_count = 0;
+        return;
+    }
+
+    setParent();
+
+    string parent_next_name = _selected_ac->getStringValue("waypoint/name-next");
+    bool parent_waiting = _selected_ac->getBoolValue("waypoint/waiting");
+
+    if (parent_next_name == "END" && fp->getNextWaypoint()->name != "END" ){
+        SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
+            << " setting END: getting new waypoints ");
+        AdvanceFP();
+        setWPNames();
+        /*} else if (parent_next_name == "WAIT" && fp->getNextWaypoint()->name != "WAIT" ){*/
+    } else if (parent_waiting && !_waiting){
+        SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
+            << " setting WAIT/WAITUNTIL: getting new waypoints ");
+        AdvanceFP();
+        setWPNames();
+        _waiting = true;
+    } else if (parent_next_name != "WAIT" && fp->getNextWaypoint()->name == "WAIT"){
+        SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
+            << " wait done: getting new waypoints ");
+        _waiting = false;
+        _wait_count = 0;
+        fp->IncrementWaypoint(false);
+        next = fp->getNextWaypoint();
+
+        if (next->name == "WAITUNTIL" || next->name == "WAIT"
+            || next->name == "END"){
+        } else {
+            prev = curr;
+            fp->IncrementWaypoint(false);
+            curr = fp->getCurrentWaypoint();
+            next = fp->getNextWaypoint();
+        }
+
+        setWPNames();
+    } else if (_range_ft > _parent_x_offset * 4){
+        SG_LOG(SG_GENERAL, SG_INFO, "AIGroundVeh1cle: " << _name
+            << " rescue: reforming train " << _range_ft << " " << _x_offset * 15);
+
+        setTowAngle(0, dt, 1);
+        setSpeed(_parent_speed * 2);
+
+    } else if (_parent_speed > 1){
+
+        setTowSpeed();
+        setTowAngle(_relbrg, dt, 1);
+
+    } else if (_parent_speed < -1){
+
+        setTowSpeed();
+
+        if (_relbrg < 0)
+            setTowAngle(-(180 - (360 + _relbrg)), dt, 1);
+        else
+            setTowAngle(-(180 - _relbrg), dt, 1);
+
+    } else
+        setSpeed(_parent_speed);
+
+    FGAIShip::update(_dt_count);
+    _dt_count = 0;
+
+}
+
 // end AIGroundvehicle
index c38a9b8279cfc729ab4403ea70a1c7426324ae54..9be902c8a33c514540f78c4afe5ca0b42836145e 100644 (file)
@@ -52,6 +52,7 @@ private:
     void setContactX1offset(double x1);
     void setContactX2offset(double x2);
     void setXOffset(double x);
+    void setYOffset(double y);
 
     void setPitchCoeff(double pc);
     void setElevCoeff(double ec);
@@ -65,6 +66,7 @@ private:
     void setParent();
     void AdvanceFP();
     void setTowSpeed();
+    void RunGroundVehicle(double dt);
 
     bool getGroundElev(SGGeod inpos);
     bool getPitch();
@@ -86,10 +88,11 @@ private:
     double _contact_x1_offset, _contact_x2_offset, _contact_z_offset;
     double _pitch, _pitch_coeff, _pitch_deg;
     double _speed_coeff, _speed_kt;
-    double _x_offset;
+    double _x_offset, _y_offset;
     double _range_ft;
     double _relbrg;
-    double _parent_speed, _parent_x_offset;
+    double _parent_speed, _parent_x_offset, _parent_y_offset;
+    double _dt_count, _next_run;
 
     const SGMaterial* _material;
     const SGPropertyNode *_selected_ac;
index c0a4517f9499065852d387638c27f2b3ff479545..9813b9dc25f768542f0378e344e5e2850d34c564 100644 (file)
@@ -281,8 +281,8 @@ FGAIManager::processScenario( const string &filename ) {
             continue;
         std::string type = scEntry->getStringValue("type", "aircraft");
 
-         if (type == "tanker") { // refueling scenarios
-           FGAITanker* tanker = new FGAITanker;
+        if (type == "tanker") { // refueling scenarios
+            FGAITanker* tanker = new FGAITanker;
             tanker->readFromScenario(scEntry);
             attach(tanker);
 
@@ -291,7 +291,7 @@ FGAIManager::processScenario( const string &filename ) {
             wingman->readFromScenario(scEntry);
             attach(wingman);
 
-    } else if (type == "aircraft") {
+        } else if (type == "aircraft") {
             FGAIAircraft* aircraft = new FGAIAircraft;
             aircraft->readFromScenario(scEntry);
             attach(aircraft);
@@ -406,14 +406,14 @@ FGAIManager::calcCollision(double alt, double lat, double lon, double fuse_range
         tgt_ht[type] += fuse_range;
 
         if (fabs(tgt_alt - alt) > tgt_ht[type] || type == FGAIBase::otBallistic
-                || type == FGAIBase::otStorm || type == FGAIBase::otThermal ) {
-            SG_LOG(SG_GENERAL, SG_DEBUG, "AIManager: skipping "
-                << fabs(tgt_alt - alt)
-                << " "
-                << type
-                );
-            ++ai_list_itr;
-            continue;
+            || type == FGAIBase::otStorm || type == FGAIBase::otThermal ) {
+                SG_LOG(SG_GENERAL, SG_DEBUG, "AIManager: skipping "
+                    << fabs(tgt_alt - alt)
+                    << " "
+                    << type
+                    );
+                ++ai_list_itr;
+                continue;
         }
 
         double tgt_lat = (*ai_list_itr)->_getLatitude();
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index f484b6ac7f7f9a1c43094b7fdf8d3cba13502ab5..76b470d6d00b8e1a19c68837b3fad34fe7dbe7d7 100644 (file)
 
 
 FGAIShip::FGAIShip(object_type ot) :
-    FGAIBase(ot),
-    _limit(40),
-    _elevation_m(0),
-    _elevation_ft(0),
-    _tow_angle(0),
-    _dt_count(0),
-    _next_run(0),
-    _lead_angle(0),
-    _xtrack_error(0)
+FGAIBase(ot),
+_limit(40),
+_elevation_m(0),
+_elevation_ft(0),
+_tow_angle(0),
+_dt_count(0),
+_next_run(0),
+_lead_angle(0),
+_xtrack_error(0),
+_tunnel(false),
+_curr_alt(0),
+_prev_alt(0),
+_until_time(""),
+_fp_init(false),
+_missed(false),
+_waiting(false),
+_new_waypoint(true),
+_missed_count(0),
+_wait_count(0),
+_missed_time_sec(30),
+_day(86400),
+_wp_range(0),
+_old_range(0),
+_range_rate(0),
+_roll_constant(0.001),
+_hdg_constant(0.01),
+_roll_factor(-0.0083335)
 
 {
+        invisible = false;
 }
 
 FGAIShip::~FGAIShip() {
@@ -79,7 +98,7 @@ void FGAIShip::readFromScenario(SGPropertyNode* scFileNode) {
     setSpeedConstant(scFileNode->getDoubleValue("speed-constant", 0.5));
 
     if (!flightplan.empty()) {
-            SG_LOG(SG_GENERAL, SG_ALERT, "getting flightplan: " << _name );
+        SG_LOG(SG_GENERAL, SG_ALERT, "getting flightplan: " << _name );
 
         FGAIFlightPlan* fp = new FGAIFlightPlan(flightplan);
         setFlightPlan(fp);
@@ -92,8 +111,6 @@ bool FGAIShip::init(bool search_in_AI_path) {
     curr = 0; // the one ahead
     next = 0; // the next plus 1
 
-    _until_time = "";
-
     props->setStringValue("name", _name.c_str());
     props->setStringValue("waypoint/name-prev", _prev_name.c_str());
     props->setStringValue("waypoint/name-curr", _curr_name.c_str());
@@ -106,27 +123,8 @@ bool FGAIShip::init(bool search_in_AI_path) {
     _rudder = 0.0;
     no_roll = false;
 
-    _roll_constant = 0.001;
-    _hdg_constant = 0.01;
-    _roll_factor = -0.0083335;
-
     _rd_turn_radius_ft = _sp_turn_radius_ft = turn_radius_ft;
 
-    _fp_init = false;
-    _missed = false;
-    _waiting = false;
-    _new_waypoint = true;
-
-    _missed_count = 0;
-    _wait_count = 0;
-    _missed_time_sec = 30;
-
-    _day = 86400;
-
-
-    _wp_range = _old_range = 0;
-    _range_rate = 0;
-
     if (fp)
         _fp_init = initFlightPlan();
 
@@ -178,6 +176,12 @@ void FGAIShip::bind() {
         SGRawValuePointer<bool>(&_waiting));
     props->tie("waypoint/lead-angle-deg",
         SGRawValuePointer<double>(&_lead_angle));
+    props->tie("waypoint/tunnel",
+        SGRawValuePointer<bool>(&_tunnel));
+    props->tie("waypoint/alt-curr-m",
+        SGRawValuePointer<double>(&_curr_alt));
+    props->tie("waypoint/alt-prev-m",
+        SGRawValuePointer<double>(&_prev_alt));
     props->tie("submodels/serviceable",
         SGRawValuePointer<bool>(&_serviceable));
     props->tie("controls/turn-radius-ft",
@@ -216,6 +220,9 @@ void FGAIShip::unbind() {
     props->untie("waypoint/lead-angle-deg");
     props->untie("waypoint/xtrack-error-ft");
     props->untie("waypoint/waiting");
+    props->untie("waypoint/tunnel");
+    props->untie("waypoint/alt-curr-m");
+    props->untie("waypoint/alt-prev-m");
     props->untie("submodels/serviceable");
     props->untie("controls/turn-radius-ft");
     props->untie("controls/turn-radius-corrected-ft");
@@ -257,7 +264,7 @@ void FGAIShip::update(double dt) {
     // Only change these values if we are able to compute them safely
     if (SGLimits<double>::min() < dt) {
         // Now here is the finite difference ...
-        
+
         // Transform that one to the horizontal local coordinate system.
         SGQuatd ec2hlNew = SGQuatd::fromLonLat(pos);
         // compute the new orientation
@@ -268,7 +275,7 @@ void FGAIShip::update(double dt) {
         dOr.getAngleAxis(dOrAngleAxis);
         // divided by the time difference provides a rotation speed vector
         dOrAngleAxis /= dt;
-        
+
         aip.setBodyAngularVelocity(dOrAngleAxis);
     }
 }
@@ -331,7 +338,7 @@ void FGAIShip::Run(double dt) {
         // adjust turn radius for speed. The equation is very approximate.
         // we need to allow for negative speeds
         if (type == "ship")
-        _sp_turn_radius_ft = 10 * pow ((fabs(speed) - 15), 2) + turn_radius_ft;
+            _sp_turn_radius_ft = 10 * pow ((fabs(speed) - 15), 2) + turn_radius_ft;
         else
             _sp_turn_radius_ft = turn_radius_ft;
 
@@ -399,10 +406,10 @@ void FGAIShip::Run(double dt) {
     // set the _rudder limit by speed
     if (type == "ship"){
 
-    if (speed <= 40)
-        rudder_limit = (-0.825 * speed) + 35;
-    else
-        rudder_limit = 2;
+        if (speed <= 40)
+            rudder_limit = (-0.825 * speed) + 35;
+        else
+            rudder_limit = 2;
 
     } else
         rudder_limit = 20;
@@ -549,7 +556,7 @@ void FGAIShip::setWPNames() {
         setPrevName("");
 
     if (curr != 0)
-    setCurrName(curr->name);
+        setCurrName(curr->name);
     else{
         setCurrName("");
         SG_LOG(SG_GENERAL, SG_ALERT, "AIShip: current wp name error" );
@@ -594,9 +601,7 @@ double FGAIShip::getCourse(double lat, double lon, double lat2, double lon2) con
 void FGAIShip::ProcessFlightPlan(double dt) {
 
     double time_sec = getDaySeconds();
-    double until_time_sec = 0;
 
-    _missed = false;
     _dt_count += dt;
 
     ///////////////////////////////////////////////////////////////////////////
@@ -611,6 +616,9 @@ void FGAIShip::ProcessFlightPlan(double dt) {
 
     _next_run = 1.0 + (0.5 * sg_random());
 
+    double until_time_sec = 0;
+    _missed = false;
+
     // check to see if we've reached the point for our next turn
     // if the range to the waypoint is less than the calculated turn
     // radius we can start the turn to the next leg
@@ -646,7 +654,24 @@ void FGAIShip::ProcessFlightPlan(double dt) {
 
     if ((_wp_range < (sp_turn_radius_nm * 1.25)) || _missed || (_waiting && !_new_waypoint)) {
 
-        if (_next_name == "END" || fp->getNextWaypoint() == 0) {
+        if (_next_name == "TUNNEL"){
+            _tunnel = !_tunnel;
+
+            //SG_LOG(SG_GENERAL, SG_ALERT, "AIShip: " << _name << " TUNNEL ");
+
+            fp->IncrementWaypoint(false);
+            next = fp->getNextWaypoint();
+
+            if (next->name == "WAITUNTIL" || next->name == "WAIT"
+                || next->name == "END" || next->name == "TUNNEL")
+                return;
+
+            prev = curr;
+            fp->IncrementWaypoint(false);
+            curr = fp->getCurrentWaypoint();
+            next = fp->getNextWaypoint();
+
+        }else if(_next_name == "END" || fp->getNextWaypoint() == 0) {
 
             if (_repeat) {
                 SG_LOG(SG_GENERAL, SG_ALERT, "AIShip: "<< _name << "Flightplan restarting ");
@@ -688,7 +713,7 @@ void FGAIShip::ProcessFlightPlan(double dt) {
                 next = fp->getNextWaypoint();
 
                 if (next->name == "WAITUNTIL" || next->name == "WAIT"
-                        || next->name == "END")
+                    || next->name == "END" || next->name == "TUNNEL")
                     return;
 
                 prev = curr;
@@ -703,7 +728,7 @@ void FGAIShip::ProcessFlightPlan(double dt) {
             _until_time = next->time;
             setUntilTime(next->time);
             if (until_time_sec > time_sec) {
-                SG_LOG(SG_GENERAL, SG_DEBUG, "AIShip: " << _name << " "
+                SG_LOG(SG_GENERAL, SG_ALERT, "AIShip: " << _name << " "
                     << curr->name << " waiting until: "
                     << _until_time << " " << until_time_sec << " now " << time_sec );
                 setSpeed(0);
@@ -748,7 +773,13 @@ void FGAIShip::ProcessFlightPlan(double dt) {
         _wp_range = getRange(pos.getLatitudeDeg(), pos.getLongitudeDeg(), curr->latitude, curr->longitude);
         _old_range = _wp_range;
         setWPPos();
-        AccelTo(prev->speed);
+        object_type type = getType();
+
+        if (type != 10)
+            AccelTo(prev->speed);
+
+        _curr_alt = curr->altitude;
+        _prev_alt = prev->altitude;
 
     } else {
         _new_waypoint = false;
@@ -762,7 +793,7 @@ void FGAIShip::ProcessFlightPlan(double dt) {
     else
         SG_LOG(SG_GENERAL, SG_ALERT, "AIShip: Bearing or Range is not a finite number");
 
-     _dt_count = 0;
+    _dt_count = 0;
 } // end Processing FlightPlan
 
 bool FGAIShip::initFlightPlan() {
@@ -770,7 +801,6 @@ bool FGAIShip::initFlightPlan() {
     SG_LOG(SG_GENERAL, SG_ALERT, "AIShip: " << _name << " initializing waypoints ");
 
     bool init = false;
-
     _start_sec = 0;
 
     fp->restart();
@@ -785,7 +815,7 @@ bool FGAIShip::initFlightPlan() {
         fp->IncrementWaypoint(false);
         curr = fp->getCurrentWaypoint();
         next = fp->getNextWaypoint();
-    }
+    } // end while loop
 
     if (!_start_time.empty()){
         _start_sec = processTimeString(_start_time);
@@ -814,9 +844,9 @@ bool FGAIShip::initFlightPlan() {
         }
 
     } else {
-    setLatitude(prev->latitude);
-    setLongitude(prev->longitude);
-    setSpeed(prev->speed);
+        setLatitude(prev->latitude);
+        setLongitude(prev->longitude);
+        setSpeed(prev->speed);
     }
 
     setWPNames();
@@ -907,11 +937,11 @@ bool FGAIShip::advanceFlightPlan (double start_sec, double day_sec) {
             next = fp->getNextWaypoint();
 
             if (next->name != "WAITUNTIL" && next->name != "WAIT"
-                    && next->name != "END") {
-                prev = curr;
-                fp->IncrementWaypoint(false);
-                curr = fp->getCurrentWaypoint();
-                next = fp->getNextWaypoint();
+                && next->name != "END") {
+                    prev = curr;
+                    fp->IncrementWaypoint(false);
+                    curr = fp->getCurrentWaypoint();
+                    next = fp->getNextWaypoint();
             }
 
         } else if (next->name == "WAITUNTIL") {
@@ -958,8 +988,8 @@ bool FGAIShip::advanceFlightPlan (double start_sec, double day_sec) {
     // so we will calculate the distance back up the track from the current waypoint
     // then calculate the lat and lon.
 
-    /*cout << "advancing flight plan done elapsed_sec: " << elapsed_sec
-        << " " << day_sec << endl;*/
+    //cout << "advancing flight plan done elapsed_sec: " << elapsed_sec
+    //    << " " << day_sec << endl;
 
     double time_diff = elapsed_sec - day_sec;
     double lat, lon, recip;
@@ -1002,27 +1032,33 @@ bool FGAIShip::advanceFlightPlan (double start_sec, double day_sec) {
 
 void FGAIShip::setWPPos() {
 
-    if (curr->name == "END" || curr->name == "WAIT" || curr->name == "WAITUNTIL"){
-        cout<< curr->name << endl;
-        return;
+    if (curr->name == "END" || curr->name == "WAIT"
+        || curr->name == "WAITUNTIL" || curr->name == "TUNNEL"){
+            //cout << curr->name << " returning" << endl;
+            return;
     }
 
     double elevation_m = 0;
     wppos.setLatitudeDeg(curr->latitude);
     wppos.setLongitudeDeg(curr->longitude);
-    wppos.setElevationFt(0);
+    wppos.setElevationM(0);
 
     if (curr->on_ground){
 
-        if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(wppos, 10000),
-            elevation_m, &_material)){
+        if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(wppos, 3000),
+            elevation_m, &_material, 0)){
                 wppos.setElevationM(elevation_m);
         }
 
+        //cout << curr->name << " setting measured  elev " << elevation_m << endl;
+
     } else {
-        wppos.setElevationFt(curr->altitude);
+        wppos.setElevationM(curr->altitude);
+        //cout << curr->name << " setting FP elev " << elevation_m << endl;
     }
 
+    curr->altitude = wppos.getElevationM();
+
 }
 
 void FGAIShip::setXTrackError() {
@@ -1033,7 +1069,6 @@ void FGAIShip::setXTrackError() {
         curr->latitude, curr->longitude);
     double xtrack_error_nm = sin((course - brg)* SG_DEGREES_TO_RADIANS) * _wp_range;
 
-    //if (_wp_range > _sp_turn_radius_ft / (2 * 6076.1155)){
     if (_wp_range > 0){
         _lead_angle = atan2(xtrack_error_nm,(_wp_range * _proportion)) * SG_RADIANS_TO_DEGREES;
     } else
@@ -1042,9 +1077,6 @@ void FGAIShip::setXTrackError() {
     _lead_angle *= _lead_angle_gain;
     _xtrack_error = xtrack_error_nm * 6076.1155;
 
-    if (_lead_angle<= -_lead_angle_limit)
-        _lead_angle = -_lead_angle_limit;
-    else if (_lead_angle >= _lead_angle_limit)
-        _lead_angle = _lead_angle_limit;
+    SG_CLAMP_RANGE(_lead_angle, -_lead_angle_limit, _lead_angle_limit);
 
 }
index cf7f6c404e5045d7d54acd5c36fbb3f38c4cea13..0526df32ae7a3f7b4347aa9bc3439f998b1f335e 100644 (file)
@@ -62,17 +62,20 @@ public:
     void setSpeedConstant(double sc);
     void setFixedTurnRadius(double ft);
     void setWPNames();
+    void setWPPos();
     double sign(double x);
 
     bool _hdg_lock;
     bool _serviceable;
     bool _waiting;
     bool _new_waypoint;
+    bool _tunnel;
+
 
     virtual const char* getTypeString(void) const { return "ship"; }
     double _rudder_constant, _speed_constant, _hdg_constant, _limit ;
     double _elevation_m, _elevation_ft;
-    double _missed_range, _tow_angle, _wait_count;
+    double _missed_range, _tow_angle, _wait_count, _wp_range;
 
     FGAIFlightPlan::waypoint* prev; // the one behind you
     FGAIFlightPlan::waypoint* curr; // the one ahead
@@ -95,7 +98,7 @@ private:
     void Run(double dt);
     void setStartTime(const string&);
     void setUntilTime(const string&);
-    void setWPPos();
+    //void setWPPos();
     void setWPAlt();
     void setXTrackError();
 
@@ -115,7 +118,7 @@ private:
 
     double _roll_constant, _roll_factor;
     double _sp_turn_radius_ft, _rd_turn_radius_ft, _fixed_turn_radius;
-    double _wp_range, _old_range, _range_rate;
+    double _old_range, _range_rate;
     double _dt_count, _missed_count;
     double _next_run;
     double _missed_time_sec;
@@ -125,6 +128,7 @@ private:
     double _lead_angle_gain, _lead_angle_limit, _proportion;
     double _course;
     double _xtrack_error;
+    double _curr_alt, _prev_alt;
 
     string _prev_name, _curr_name, _next_name;
     string _path;
index 3f9aafa6893f704d496f68d89a9308ef263be529..f7c286a9a345b8aea1d73ff6d5b9160f151a89b6 100644 (file)
@@ -1,3 +1,4 @@
+#include <simgear/math/SGMath.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/props/props_io.hxx>
index 6c1b77d8f5da776381435328fe7c13074fdfcacc..c4e467a6fc5c2db56375577de908931161808675 100644 (file)
@@ -841,7 +841,7 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                // TODO - At hot 'n high airports this may be 500ft AGL though - need to make this a variable.
                if((_pos.getElevationM() - rwy.threshold_pos.getElevationM()) * SG_METER_TO_FEET > 700) {
                        double cc = 0.0;
-                       if(tower && tower->GetCrosswindConstraint(cc)) {
+                       if(_controlled && tower->GetCrosswindConstraint(cc)) {
                                if(orthopos.y() > cc) {
                                        //cout << "Turning to crosswind, distance from threshold = " << orthopos.y() << '\n'; 
                                        leg = TURN1;
@@ -884,7 +884,7 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                // turn 1000m out for now, taking other traffic into accout
                if(fabs(orthopos.x()) > 900) {
                        double dd = 0.0;
-                       if(tower && tower->GetDownwindConstraint(dd)) {
+                       if(_controlled && tower->GetDownwindConstraint(dd)) {
                                if(fabs(orthopos.x()) > fabs(dd)) {
                                        //cout << "Turning to downwind, distance from centerline = " << fabs(orthopos.x()) << '\n'; 
                                        leg = TURN2;
@@ -930,7 +930,7 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                        // For now we're assuming that we aim to follow the same glidepath regardless of wind.
                        double d1;
                        double d2;
-                       CalculateSoD(((tower && tower->GetBaseConstraint(d1)) ? d1 : -1000.0), ((tower && tower->GetDownwindConstraint(d2)) ? d2 : 1000.0 * patternDirection), (patternDirection ? true : false));
+                       CalculateSoD(((_controlled && tower->GetBaseConstraint(d1)) ? d1 : -1000.0), ((_controlled && tower->GetDownwindConstraint(d2)) ? d2 : 1000.0 * patternDirection), (patternDirection ? true : false));
                        if(SoD.leg == DOWNWIND) {
                                descending = (orthopos.y() < SoD.y ? true : false);
                        }
@@ -950,7 +950,7 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                if(orthopos.y() < -1000.0 + turn_radius) {
                //if(orthopos.y() < -980) {
                        double bb = 0.0;
-                       if(tower && tower->GetBaseConstraint(bb)) {
+                       if(_controlled && tower->GetBaseConstraint(bb)) {
                                if(fabs(orthopos.y()) > fabs(bb)) {
                                        //cout << "Turning to base, distance from threshold = " << fabs(orthopos.y()) << '\n'; 
                                        leg = TURN3;
@@ -982,7 +982,7 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                        double d1;
                        // Make downwind leg position artifically large to avoid any chance of SoD being returned as
                        // on downwind when we are already on base.
-                       CalculateSoD(((tower && tower->GetBaseConstraint(d1)) ? d1 : -1000.0), (10000.0 * patternDirection), (patternDirection ? true : false));
+                       CalculateSoD(((_controlled && tower->GetBaseConstraint(d1)) ? d1 : -1000.0), (10000.0 * patternDirection), (patternDirection ? true : false));
                        if(SoD.leg == BASE) {
                                descending = (fabs(orthopos.y()) < fabs(SoD.y) ? true : false);
                        }
@@ -1146,24 +1146,8 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                double axx = gxx - wxx; // Plane in-air velocity x component
                double ayy = gyy - wyy; // Plane in-air velocity y component
                // Now we want the angle between gxx and axx (which is the crab)
-               double maga = sqrt(axx*axx + ayy*ayy);
-               double magg = sqrt(gxx*gxx + gyy*gyy);
-               crab = acos((axx*gxx + ayy*gyy) / (maga * magg));
-               // At this point this works except we're getting the modulus of the angle
+               crab = atan2(ayy - gyy, axx - gxx) * DCL_RADIANS_TO_DEGREES;
                //cout << "crab = " << crab << '\n';
-               
-               // Make sure both headings are in the 0->360 circle in order to get sane differences
-               dclBoundHeading(wind_from);
-               dclBoundHeading(track);
-               if(track > wind_from) {
-                       if((track - wind_from) <= 180) {
-                               crab *= -1.0;
-                       }
-               } else {
-                       if((wind_from - track) >= 180) {
-                               crab *= -1.0;
-                       }
-               }
        } else {        // on the ground - crab dosen't apply
                crab = 0.0;
        }
@@ -1171,6 +1155,7 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
        //cout << "X " << orthopos.x() << "  Y " << orthopos.y() << "  SLOPE " << slope << "  elev " << _pos.elev() * SG_METER_TO_FEET << '\n';
        
        _hdg = track + crab;
+       dclBoundHeading(_hdg);
        dist = vel * 0.514444 * dt;
        _pos = dclUpdatePosition(_pos, track, slope, dist);
 }
@@ -1209,7 +1194,7 @@ void FGAILocalTraffic::TransmitPatternPositionReport(void) {
        // airport name + "traffic" + airplane callsign + pattern direction + pattern leg + rwy + ?
        string trns;
        int code = 0;
-       const string& apt_name = tower ? tower->get_name() : airportID;
+       const string& apt_name = _controlled ? tower->get_name() : airportID;
 
        trns += apt_name;
        trns += " Traffic ";
index f094b1170cc82893a419028af4a11e132cd890ce..f5f5ec935d3f337e7b1efe4ad1cb7b2e613d503b 100644 (file)
@@ -382,7 +382,6 @@ void FGATCDialog::FreqDisplay(string& ident) {
        comm_list_type stations;
        int found = current_commlist->FindByPos(a->geod(), 20.0, &stations);
        if(found) {
-               ostringstream ostr;
                comm_list_iterator itr = stations.begin();
                for (n = 0; itr != stations.end(); ++itr) {
                        if(itr->ident != ident)
@@ -396,8 +395,9 @@ void FGATCDialog::FreqDisplay(string& ident) {
                        copyProperties(freq_group->getNode("group-template", true), entry);
                        entry->removeChildren("enabled", true);
 
+                       ostringstream ostr;
                        ostr << itr->type;
-                       entry->setStringValue("text[0]/label", ostr.str().c_str());
+                       entry->setStringValue("text[0]/label", ostr.str());
 
                        char buf[8];
                        snprintf(buf, 8, "%.2f", (itr->freq / 100.0));  // Convert from KHz to MHz
@@ -406,8 +406,6 @@ void FGATCDialog::FreqDisplay(string& ident) {
                        buf[7] = '\0';
 
                        entry->setStringValue("text[1]/label", buf);
-
-                       ostr.seekp(0);
                        n++;
                }
        }
index baed76f373bea946e0e8d81858a2699dcf3dcd1a..ef5c8d7b8097dc87475ee1db282c9e46c3d1627c 100644 (file)
@@ -167,17 +167,18 @@ int FGCommList::FindByPos(const SGGeod& aPos, double range, comm_list_type* stat
      SGBucket buck(aPos);
  
      // get neigboring buckets
-     int bx = (int)( range*SG_NM_TO_METER / buck.get_width_m() / 2);
-     int by = (int)( range*SG_NM_TO_METER / buck.get_height_m() / 2 );
+     int bx = (int)( range*SG_NM_TO_METER / buck.get_width_m() / 2) + 1;
+     int by = (int)( range*SG_NM_TO_METER / buck.get_height_m() / 2 ) + 1;
      
      // loop over bucket range 
      for ( int i=-bx; i<=bx; i++) {
          for ( int j=-by; j<=by; j++) {
              buck = sgBucketOffset(aPos.getLongitudeDeg(), aPos.getLatitudeDeg(), i, j);
              long int bucket = buck.gen_index();
-             comm_list_type Fstations = commlist_bck[bucket];
-             comm_list_iterator current = Fstations.begin();
-             comm_list_iterator last = Fstations.end();
+             comm_map_const_iterator Fstations = commlist_bck.find(bucket);
+             if (Fstations == commlist_bck.end()) continue;
+             comm_list_const_iterator current = Fstations->second.begin();
+             comm_list_const_iterator last = Fstations->second.end();
              
              
              // double az1, az2, s;
index d1886c3389691a8ca6226f9df68ab6db253d115b..fa54b15cf8804d352001b347424c34057df33eb3 100644 (file)
@@ -55,6 +55,8 @@ using std::cout;
 
 TowerPlaneRec::TowerPlaneRec() :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -85,6 +87,8 @@ TowerPlaneRec::TowerPlaneRec() :
 
 TowerPlaneRec::TowerPlaneRec(const PlaneRec& p) :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -115,6 +119,8 @@ TowerPlaneRec::TowerPlaneRec(const PlaneRec& p) :
 
 TowerPlaneRec::TowerPlaneRec(const SGGeod& pt) :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -146,6 +152,8 @@ TowerPlaneRec::TowerPlaneRec(const SGGeod& pt) :
 
 TowerPlaneRec::TowerPlaneRec(const PlaneRec& p, const SGGeod& pt) :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -2125,6 +2133,7 @@ void FGTower::VFRArrivalContact(const string& ID, const LandingType& opt) {
        
        t->plane.type = GA_SINGLE;      // FIXME - Another assumption!
        t->plane.callsign = usercall;
+       CalcETA(t);
        
        t->vfrArrivalReported = true;
        responseReqd = true;
index c076d8cfc1ff0f44d5f3233742256abab563ca01..3eb853823e4d39f0927fcba599c71f3d08750217 100644 (file)
@@ -151,9 +151,8 @@ void FGRunway::processThreshold(SGPropertyNode* aThreshold)
   _displ_thresh = aThreshold->getDoubleValue("displ-m") * SG_METER_TO_FEET;
   _stopway = aThreshold->getDoubleValue("stopw-m") * SG_METER_TO_FEET;
   
-  // compute the new runway center, based on the threshold lat/lon, length,
-  // and any displaced threshold.
-  double offsetFt = (0.5 * _length) - _displ_thresh;
+  // compute the new runway center, based on the threshold lat/lon and length,
+  double offsetFt = (0.5 * _length);
   SGGeod newCenter;
   double dummy;
   SGGeodesy::direct(newThreshold, _heading, offsetFt * SG_FEET_TO_METER, newCenter, dummy);
index aa5af682576e3d352421ca9a7877a5251b85bfdb..af16923b3469507a8b5e0487aaab7e595e8f136e 100644 (file)
@@ -294,7 +294,7 @@ bool FGAirport::HardSurfaceFilter::passAirport(FGAirport* aApt) const
 FGAirport* FGAirport::findByIdent(const std::string& aIdent)
 {
   FGPositionedRef r;
-  AirportFilter filter;
+  PortsFilter filter;
   r = FGPositioned::findNextWithPartialId(r, aIdent, &filter);
   if (!r) {
     return NULL; // we don't warn here, let the caller do that
@@ -305,7 +305,7 @@ FGAirport* FGAirport::findByIdent(const std::string& aIdent)
 FGAirport* FGAirport::getByIdent(const std::string& aIdent)
 {
   FGPositionedRef r;
-  AirportFilter filter;
+  PortsFilter filter;
   r = FGPositioned::findNextWithPartialId(r, aIdent, &filter);
   if (!r) {
     throw sg_range_exception("No such airport with ident: " + aIdent);
@@ -351,7 +351,7 @@ void FGAirport::loadSceneryDefintions() const
 {  
   // allow users to disable the scenery data in the short-term
   // longer term, this option can probably disappear
-  if (!fgGetBool("/sim/use-scenery-airport-data")) {
+  if (!fgGetBool("/sim/paths/use-custom-scenery-data")) {
     return; 
   }
   
index 93c76fbe1d63a6377083abeb7103fad404cb42b2..521c48c9abedb77afbe9435b675b6b04a17a966d 100644 (file)
@@ -113,7 +113,7 @@ public:
        }
        
        virtual Type maxType() const {
-         return SEAPORT;
+         return AIRPORT;
        }
        
        virtual bool passAirport(FGAirport* aApt) const {
@@ -121,6 +121,17 @@ public:
        }
      };
      
+     /**
+      * Filter which passes heliports and seaports in addition to airports
+      */
+     class PortsFilter : public AirportFilter
+     {
+     public:
+       virtual Type maxType() const {
+         return SEAPORT;
+       }
+     };
+     
      class HardSurfaceFilter : public AirportFilter
      {
      public:
@@ -128,9 +139,6 @@ public:
        
        virtual bool passAirport(FGAirport* aApt) const;
        
-       virtual Type maxType() const {
-         return AIRPORT;
-       }
      private:
        double mMinLengthFt;
      };
@@ -138,7 +146,7 @@ public:
      /**
       * Syntactic wrapper around FGPositioned::findClosest - find the closest
       * match for filter, and return it cast to FGAirport. The default filter
-      * passes all airports, including seaports and heliports.
+      * passes airports, but not seaports or heliports
       */
      static FGAirport* findClosest(const SGGeod& aPos, double aCuttofNm, Filter* filter = NULL);
      
index 7579e8cc4c4d404d9a0fb10e7b387e38935e10e5..9487144c99817ed42361776b9d4c495d19c368c7 100644 (file)
@@ -34,7 +34,7 @@ XMLLoader::~XMLLoader() {}
 
 void XMLLoader::load(FGAirportDynamics* d) {
   FGAirportDynamicsXMLLoader visitor(d);
-  if (fgGetBool("/sim/traffic-manager/use-custom-scenery-data") == false) {
+  if (fgGetBool("/sim/paths/use-custom-scenery-data") == false) {
    SGPath parkpath( globals->get_fg_root() );
    parkpath.append( "/AI/Airports/" );
    parkpath.append( d->getId() );
@@ -57,7 +57,7 @@ void XMLLoader::load(FGAirportDynamics* d) {
 
 void XMLLoader::load(FGRunwayPreference* p) {
   FGRunwayPreferenceXMLLoader visitor(p);
-  if (fgGetBool("/sim/traffic-manager/use-custom-scenery-data") == false) {
+  if (fgGetBool("/sim/paths/use-custom-scenery-data") == false) {
     SGPath rwyPrefPath( globals->get_fg_root() );
     rwyPrefPath.append( "AI/Airports/" );
     rwyPrefPath.append( p->getId() );
index cda785cdec1fa72895a74cb689e71f222c574e49..7ba3b5bb6b4687ccacd5e58c2ddee6610ede6c3c 100644 (file)
@@ -2,6 +2,7 @@ noinst_LIBRARIES = libAutopilot.a
 
 libAutopilot_a_SOURCES = \
        route_mgr.cxx route_mgr.hxx \
-       xmlauto.cxx xmlauto.hxx
+       xmlauto.cxx xmlauto.hxx \
+       autobrake.cxx autobrake.hxx
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
diff --git a/src/Autopilot/autobrake.cxx b/src/Autopilot/autobrake.cxx
new file mode 100644 (file)
index 0000000..ec1fcfc
--- /dev/null
@@ -0,0 +1,349 @@
+// autobrake.cxx - generic, configurable autobrake system
+//
+// Written by James Turner, started September 2009.
+//
+// Copyright (C) 2009  Curtis L. Olson
+//
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// $Id$
+
+#include "autobrake.hxx"
+
+#include <Main/fg_props.hxx>
+
+FGAutoBrake::FGAutoBrake() :
+  _lastGroundspeedKts(0.0),
+  _step(0),
+  _rto(false),
+  _armed(false),
+  _rtoArmed(false),
+  _engaged(false),
+  _targetDecel(0.0),
+  _fcsBrakeControl(0.0),
+  _leftBrakeOutput(0.0),
+  _rightBrakeOutput(0.0)
+{
+  // default config, close to Boeing 747-400 / 777 values
+  _configNumSteps = 4;
+  _configRTOStep = -1;
+  _configDisengageStep = 0;
+  _configMaxDecel = 11; // ft-sec-sec
+  _configRTODecel = 11; // ft-sec-sec
+  _configRTOSpeed = 85; // kts
+}
+
+FGAutoBrake::~FGAutoBrake()
+{
+}
+
+void FGAutoBrake::init()
+{
+  _root = fgGetNode("/autopilot/autobrake", true);
+  
+  _root->tie("armed", SGRawValueMethods<FGAutoBrake, bool>
+    (*this, &FGAutoBrake::getArmed, &FGAutoBrake::setArmed));
+  
+  _root->tie("step", SGRawValueMethods<FGAutoBrake, int>
+    (*this, &FGAutoBrake::getStep, &FGAutoBrake::setStep));
+    
+  _root->tie("rto", SGRawValueMethods<FGAutoBrake, bool>
+    (*this, &FGAutoBrake::getRTO, &FGAutoBrake::setRTO));
+      
+  _engineControlsNode = fgGetNode("/controls/engines");
+  
+  // brake position nodes
+  _brakeInputs[0] = fgGetNode("/controls/gear/brake-left");
+  _brakeInputs[1] = fgGetNode("/controls/gear/brake-right");
+  _brakeInputs[2] = fgGetNode("/controls/gear/copilot-brake-left");
+  _brakeInputs[3] = fgGetNode("/controls/gear/copilot-brake-right");
+  
+    // config
+  SGPropertyNode_ptr config = _root->getChild("config", 0, true);
+  config->tie("num-steps", SGRawValuePointer<int>(&_configNumSteps));
+  config->tie("rto-step", SGRawValuePointer<int>(&_configRTOStep));
+  config->tie("disengage-step", SGRawValuePointer<int>(&_configDisengageStep));
+  config->tie("rto-decel-fts-sec", SGRawValuePointer<double>(&_configRTODecel));
+  config->tie("max-decel-fts-sec", SGRawValuePointer<double>(&_configMaxDecel));
+  config->tie("rto-engage-kts", SGRawValuePointer<double>(&_configRTOSpeed));
+  
+  
+  // outputs
+  _root->tie("target-decel-fts-sec", 
+    SGRawValueMethods<FGAutoBrake,double>(*this, &FGAutoBrake::getTargetDecel));
+  _root->tie("actual-decel-fts-sec", 
+    SGRawValueMethods<FGAutoBrake,double>(*this, &FGAutoBrake::getActualDecel));
+  _root->tie("fcs-brake", SGRawValuePointer<double>(&_fcsBrakeControl));
+  _root->tie("brake-left-output", SGRawValuePointer<double>(&_leftBrakeOutput));
+  _root->tie("brake-right-output", SGRawValuePointer<double>(&_rightBrakeOutput));
+  
+  _root->tie("engaged", SGRawValueMethods<FGAutoBrake, bool>(*this, &FGAutoBrake::getEngaged)); 
+}
+
+void FGAutoBrake::postinit()
+{  
+  _weightOnWheelsNode = fgGetNode("/gear/gear/wow");
+  _groundspeedNode = fgGetNode("/velocities/groundspeed-kt");
+  if (!_weightOnWheelsNode) {
+    return; // don't crash if we're using an acft (UFO, ATC, with no WoW flag)
+  }
+  
+  _lastWoW = _weightOnWheelsNode->getBoolValue();
+}
+
+
+void FGAutoBrake::bind()
+{
+}
+
+void FGAutoBrake::unbind()
+{
+}
+
+void FGAutoBrake::update(double dt)
+{
+  _leftBrakeInput = SGMiscd::max(_brakeInputs[0]->getDoubleValue(), 
+      _brakeInputs[2]->getDoubleValue());
+  _rightBrakeInput = SGMiscd::max(_brakeInputs[1]->getDoubleValue(), 
+      _brakeInputs[3]->getDoubleValue());
+
+  // various FDMs don't supply sufficent information for us to work,
+  // so just be passive in those cases.
+  if (!_weightOnWheelsNode || !_groundspeedNode || !_engineControlsNode) {
+    // pass the values straight through
+    _leftBrakeOutput = _leftBrakeInput; 
+    _rightBrakeOutput = _rightBrakeInput; 
+    return;
+  }
+
+  if (dt <= 0.0) {
+    return; // paused
+  }
+  
+  double gs = _groundspeedNode->getDoubleValue();
+  _actualDecel = (_lastGroundspeedKts - gs) / dt;
+  _lastGroundspeedKts = gs;
+  
+  if (!_armed || (_step == 0)) {
+    // even if we're off or disarmed, the physical valve system must pass
+    // pilot control values through.
+    _leftBrakeOutput = _leftBrakeInput; 
+    _rightBrakeOutput = _rightBrakeInput; 
+    return;
+  }
+  
+  if (_engaged) {
+    updateEngaged(dt);
+  } else {
+    bool e = shouldEngage();
+    if (e) {
+      engage();
+      updateEngaged(dt);
+    }
+  }
+  
+  // sum pilot inpiuts with auto-brake FCS input
+  _leftBrakeOutput = SGMiscd::max(_leftBrakeInput, _fcsBrakeControl);
+  _rightBrakeOutput = SGMiscd::max(_rightBrakeInput, _fcsBrakeControl);
+
+  _lastWoW = _weightOnWheelsNode->getBoolValue();
+}
+
+void FGAutoBrake::engage()
+{
+  SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: engaging");
+  _engaged = true;
+}
+
+void FGAutoBrake::updateEngaged(double dt)
+{
+  // check for pilot braking input cancelling engage
+  const double BRAKE_INPUT_THRESHOLD = 0.02; // 2% application triggers
+  if ((_leftBrakeInput > BRAKE_INPUT_THRESHOLD) || (_rightBrakeInput > BRAKE_INPUT_THRESHOLD)) {
+    SG_LOG(SG_AUTOPILOT, SG_INFO, "auto-brake, detected pilot brake input, disengaing");
+    disengage();
+    return;
+  }
+
+  if (!throttlesAtIdle()) {
+    SG_LOG(SG_AUTOPILOT, SG_INFO, "auto-brake, throttles not at idle, disengaing");
+    disengage();
+    return;
+  }
+
+  // update the target deceleration; note step can be changed while engaged
+  if (_rto) {
+    _targetDecel = _configRTODecel;
+  } else {
+    double f = (double) _step / _configNumSteps;
+    _targetDecel = _configMaxDecel * f;
+  }
+}
+
+bool FGAutoBrake::shouldEngage()
+{
+  if (_rto) {
+    return shouldEngageRTO();
+  }
+
+  if (_lastWoW || !_weightOnWheelsNode->getBoolValue()) {
+    return false;
+  }
+
+
+  if (!throttlesAtIdle()) {
+    return false;
+  }
+  
+  SG_LOG(SG_AUTOPILOT, SG_INFO, "Autobrake, should enage");
+  return true;
+}
+
+bool FGAutoBrake::shouldEngageRTO()
+{
+  double speed = _groundspeedNode->getDoubleValue();
+
+  if (_rtoArmed) {
+    if (speed < _configRTOSpeed) {
+      SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: RTO armed, but speed is now below arming speed");
+      _rtoArmed = false;
+      return false;
+    }
+    
+    if (!_weightOnWheelsNode->getBoolValue()) {
+      if (airborne()) {
+        SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: RTO, airbone, disengaging");
+        _rtoArmed = false;
+        _armed = false;
+        _step = _configDisengageStep;
+      }
+            
+      return false;
+    }
+    
+    if (throttlesAtIdle()) {
+      SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: RTO, throttles at idle, will engage");
+      return true;
+    } else {
+      return false;
+    }
+  } else {
+    // RTO arming case
+    if (speed > _configRTOSpeed) {
+      SG_LOG(SG_AUTOPILOT, SG_INFO, "Autobrake RTO: passed " << _configRTOSpeed << " knots, arming RTO mode");
+      _rtoArmed = true;
+    }
+  }
+  
+  return false;
+}
+
+void FGAutoBrake::disengage()
+{
+  if (!_engaged) {
+    return;
+  }
+  
+  SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: disengage");
+  _engaged = false;
+  _fcsBrakeControl = 0.0;
+  _armed = false;
+  _rtoArmed = false;
+  _targetDecel = 0.0;
+  _step = _configDisengageStep;
+}
+
+bool FGAutoBrake::airborne() const
+{
+  return !_weightOnWheelsNode->getBoolValue();
+}
+
+bool FGAutoBrake::throttlesAtIdle() const
+{
+  SGPropertyNode_ptr e;
+  const double IDLE_THROTTLE = 0.05; // 5% margin for idle setting
+  
+  for (int index=0; (e = _engineControlsNode->getChild("engine", index)) != NULL; ++index) {
+    if ((e->getDoubleValue("throttle") > IDLE_THROTTLE) && !e->getBoolValue("reverser")) {
+      return false;
+    }
+  } // of engines iteration
+  
+  return true;
+}
+
+void FGAutoBrake::setArmed(bool aArmed)
+{
+  if (aArmed == _armed) {
+    return;
+  }
+    
+  disengage();
+  _armed = aArmed;
+}
+
+void FGAutoBrake::setRTO(bool aRTO)
+{
+  if (aRTO) {
+    // ensure we meet RTO selection criteria: 
+    if (!_weightOnWheelsNode->getBoolValue()) {
+      // some systems combine RTO with a standard step, selecting RTO if on
+      // the ground. Handle that case by setting _rto = false, and letting
+      // setStep() do the rest of the work as normal.
+      if ((_configRTOStep > 0) && (_configRTOStep <= _configNumSteps)) {
+        // RTO is combined with a normal step, select that
+      } else {
+        SG_LOG(SG_AUTOPILOT, SG_WARN, "auto-brake: cannot select RTO mode, no weight on wheels");
+      }
+      
+      _rto = false;
+      return;
+    }
+    
+    _rtoArmed = false;
+    _rto = true;
+    _step = _configRTOStep;
+    setArmed(true);
+    SG_LOG(SG_AUTOPILOT, SG_INFO, "RTO mode set");
+  } else {
+    _rto = false;
+    _rtoArmed = false;
+    // and if we're enaged?
+    disengage(); 
+  }
+}
+
+void FGAutoBrake::setStep(int aStep)
+{
+  if (aStep == _step) {
+    return;
+  }
+  
+  SG_LOG(SG_AUTOPILOT, SG_INFO, "Autobrake step now=" << aStep);
+  _step = aStep;
+  bool validStep = false;
+  
+  if (aStep == _configRTOStep) {
+    setRTO(true);
+    validStep = true;
+  } else {
+    _rto = false;
+    validStep = (_step > 0) && (_step <= _configNumSteps);
+  }
+  
+  setArmed(validStep); // selecting a valid step arms the system
+}
+
+
diff --git a/src/Autopilot/autobrake.hxx b/src/Autopilot/autobrake.hxx
new file mode 100644 (file)
index 0000000..4dbf755
--- /dev/null
@@ -0,0 +1,108 @@
+// autobrake.hxx - generic, configurable autobrake system
+//
+// Written by James Turner, started September 2009.
+//
+// Copyright (C) 2009  Curtis L. Olson
+//
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// $Id$
+
+#ifndef FG_INSTR_AUTOBRAKE_HXX
+#define FG_INSTR_AUTOBRAKE_HXX
+
+#include <simgear/props/props.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
+
+// forward decls
+
+class FGAutoBrake : public SGSubsystem
+{
+public:
+  FGAutoBrake();
+  virtual ~FGAutoBrake();
+
+  virtual void init ();
+  virtual void postinit ();
+  virtual void bind ();
+  virtual void unbind ();
+  virtual void update (double dt);
+    
+private:
+  
+  void engage();
+  void disengage();
+  
+  void updateEngaged(double dt);
+  
+  bool shouldEngage();
+  bool shouldEngageRTO();
+  
+  /**
+   * Helper to determine if all throttles are at idle
+   * (or have reverse thrust engaged)
+   */
+  bool throttlesAtIdle() const;
+  
+  /**
+   * Helper to determine if we're airbone, i.e weight off all wheels
+   */
+  bool airborne() const;
+  
+// accessors, mostly for SGRawValueMethods use
+  void setArmed(bool aArmed);
+  bool getArmed() const { return _armed; }
+  
+  void setRTO(bool aRTO);
+  bool getRTO() const { return _rto; }
+  
+  void setStep(int aStep);
+  int getStep() const { return _step; }
+  
+  bool getEngaged() const { return _engaged;}
+  double getTargetDecel() const { return _targetDecel; }
+  double getActualDecel() const { return _actualDecel; }
+
+// members
+  double _lastGroundspeedKts;
+  int _step;
+  bool _rto; // true if in Rejected TakeOff mode
+  bool _armed;
+  bool _rtoArmed; ///< true if we have met arming criteria for RTO mode
+  bool _engaged; ///< true if auto-braking is currently active
+  double _targetDecel; // target deceleration ft-sec^2
+  double _actualDecel; // measured current deceleration in ft-sec^2
+  double _fcsBrakeControl;
+  bool _lastWoW;
+  double _leftBrakeInput; // summed pilot and co-pilot left brake input
+  double _rightBrakeInput; // summed pilot and co-pilot right brake input
+  double _leftBrakeOutput;
+  double _rightBrakeOutput;
+    
+  SGPropertyNode_ptr _root;
+  SGPropertyNode* _brakeInputs[4];
+  SGPropertyNode_ptr _weightOnWheelsNode;
+  SGPropertyNode_ptr _engineControlsNode;
+  SGPropertyNode_ptr _groundspeedNode;
+  
+  int _configNumSteps;
+  int _configRTOStep;
+  int _configDisengageStep;
+  double _configMaxDecel; ///< deceleration (in ft-sec^2) corresponding to step=numSteps
+  double _configRTODecel; ///< deceleration (in ft-sec^2) to use in RTO mode
+  double _configRTOSpeed; ///< speed (in kts) for RTO mode to arm
+};
+
+#endif // of FG_INSTR_AUTOBRAKE_HXX
index e8c5674c3213605a19f57ed730878c63812b16c4..bbd2db96b58531c063ecbee448a26ee897395420 100644 (file)
 #  include <config.h>
 #endif
 
-#include <simgear/compiler.h>
+#ifdef HAVE_WINDOWS_H
+#include <time.h>
+#endif
 
-#include <FDM/flight.hxx>
-#include <Main/fg_props.hxx>
-#include <Navaids/positioned.hxx>
+#include <simgear/compiler.h>
 
 #include "route_mgr.hxx"
 
+#include <boost/algorithm/string/case_conv.hpp>
+
+#include <simgear/misc/strutils.hxx>
+#include <simgear/structure/exception.hxx>
+
+#include <simgear/props/props_io.hxx>
+#include <simgear/misc/sg_path.hxx>
+#include <simgear/route/route.hxx>
+#include <simgear/sg_inlines.h>
+
+#include "Main/fg_props.hxx"
+#include "Navaids/positioned.hxx"
+#include "Airports/simple.hxx"
+#include "Airports/runways.hxx"
+
+#include "FDM/flight.hxx" // for getting ground speed
+
 #define RM "/autopilot/route-manager/"
 
+static double get_ground_speed() {
+  // starts in ft/s so we convert to kts
+  static const SGPropertyNode * speedup_node = fgGetNode("/sim/speed-up");
+
+  double ft_s = cur_fdm_state->get_V_ground_speed()
+      * speedup_node->getIntValue();
+  double kts = ft_s * SG_FEET_TO_METER * 3600 * SG_METER_TO_NM;
+  return kts;
+}
 
 FGRouteMgr::FGRouteMgr() :
-    route( new SGRoute ),
-    lon( NULL ),
-    lat( NULL ),
-    alt( NULL ),
-    true_hdg_deg( NULL ),
-    target_altitude_ft( NULL ),
-    altitude_lock( NULL ),
-    wp0_id( NULL ),
-    wp0_dist( NULL ),
-    wp0_eta( NULL ),
-    wp1_id( NULL ),
-    wp1_dist( NULL ),
-    wp1_eta( NULL ),
-    wpn_id( NULL ),
-    wpn_dist( NULL ),
-    wpn_eta( NULL ),
+    _route( new SGRoute ),
     input(fgGetNode( RM "input", true )),
-    listener(new Listener(this)),
-    mirror(fgGetNode( RM "route", true )),
-    altitude_set( false )
+    mirror(fgGetNode( RM "route", true ))
 {
+    listener = new InputListener(this);
     input->setStringValue("");
     input->addChangeListener(listener);
 }
@@ -67,141 +77,198 @@ FGRouteMgr::FGRouteMgr() :
 
 FGRouteMgr::~FGRouteMgr() {
     input->removeChangeListener(listener);
+    
     delete listener;
-    delete route;
+    delete _route;
 }
 
 
 void FGRouteMgr::init() {
-    lon = fgGetNode( "/position/longitude-deg", true );
-    lat = fgGetNode( "/position/latitude-deg", true );
-    alt = fgGetNode( "/position/altitude-ft", true );
-
-    true_hdg_deg = fgGetNode( "/autopilot/settings/true-heading-deg", true );
-    target_altitude_ft = fgGetNode( "/autopilot/settings/target-altitude-ft", true );
-    altitude_lock = fgGetNode( "/autopilot/locks/altitude", true );
-
-    wp0_id = fgGetNode( RM "wp[0]/id", true );
-    wp0_dist = fgGetNode( RM "wp[0]/dist", true );
-    wp0_eta = fgGetNode( RM "wp[0]/eta", true );
-
-    wp1_id = fgGetNode( RM "wp[1]/id", true );
-    wp1_dist = fgGetNode( RM "wp[1]/dist", true );
-    wp1_eta = fgGetNode( RM "wp[1]/eta", true );
-
-    wpn_id = fgGetNode( RM "wp-last/id", true );
-    wpn_dist = fgGetNode( RM "wp-last/dist", true );
-    wpn_eta = fgGetNode( RM "wp-last/eta", true );
-
-    route->clear();
-    update_mirror();
+  SGPropertyNode_ptr rm(fgGetNode(RM));
+  
+  lon = fgGetNode( "/position/longitude-deg", true );
+  lat = fgGetNode( "/position/latitude-deg", true );
+  alt = fgGetNode( "/position/altitude-ft", true );
+  magvar = fgGetNode("/environment/magnetic-variation-deg", true);
+     
+  departure = fgGetNode(RM "departure", true);
+  departure->tie("airport", SGRawValueMethods<FGRouteMgr, const char*>(*this, 
+    &FGRouteMgr::getDepartureICAO, &FGRouteMgr::setDepartureICAO));
+  departure->tie("name", SGRawValueMethods<FGRouteMgr, const char*>(*this, 
+    &FGRouteMgr::getDepartureName, NULL));
+    
+// init departure information from current location
+  SGGeod pos = SGGeod::fromDegFt(lon->getDoubleValue(), lat->getDoubleValue(), alt->getDoubleValue());
+  _departure = FGAirport::findClosest(pos, 20.0);
+  if (_departure) {
+    FGRunway* active = _departure->getActiveRunwayForUsage();
+    departure->setStringValue("runway", active->ident().c_str());
+  } else {
+    departure->setStringValue("runway", "");
+  }
+  
+  departure->getChild("etd", 0, true);
+  departure->getChild("takeoff-time", 0, true);
+
+  destination = fgGetNode(RM "destination", true);
+  destination->getChild("airport", 0, true);
+  
+  destination->tie("airport", SGRawValueMethods<FGRouteMgr, const char*>(*this, 
+    &FGRouteMgr::getDestinationICAO, &FGRouteMgr::setDestinationICAO));
+  destination->tie("name", SGRawValueMethods<FGRouteMgr, const char*>(*this, 
+    &FGRouteMgr::getDestinationName, NULL));
+    
+  destination->getChild("runway", 0, true);
+  destination->getChild("eta", 0, true);
+  destination->getChild("touchdown-time", 0, true);
+  
+  alternate = fgGetNode(RM "alternate", true);
+  alternate->getChild("airport", 0, true);
+  alternate->getChild("runway", 0, true);
+  
+  cruise = fgGetNode(RM "cruise", true);
+  cruise->getChild("altitude-ft", 0, true);
+  cruise->setDoubleValue("altitude-ft", 10000.0);
+  cruise->getChild("flight-level", 0, true);
+  cruise->getChild("speed-kts", 0, true);
+  cruise->setDoubleValue("speed-kts", 160.0);
+  
+  totalDistance = fgGetNode(RM "total-distance", true);
+  totalDistance->setDoubleValue(0.0);
+  
+  ete = fgGetNode(RM "ete", true);
+  ete->setDoubleValue(0.0);
+  
+  elapsedFlightTime = fgGetNode(RM "flight-time", true);
+  elapsedFlightTime->setDoubleValue(0.0);
+  
+  active = fgGetNode(RM "active", true);
+  active->setBoolValue(false);
+  
+  airborne = fgGetNode(RM "airborne", true);
+  airborne->setBoolValue(false);
+    
+  _edited = fgGetNode(RM "signals/edited", true);
+  _finished = fgGetNode(RM "signals/finished", true);
+  
+  _currentWpt = fgGetNode(RM "current-wp", true);
+  _currentWpt->tie(SGRawValueMethods<FGRouteMgr, int>
+    (*this, &FGRouteMgr::currentWaypoint, &FGRouteMgr::jumpToIndex));
+      
+  // temporary distance / eta calculations, for backward-compatability
+  wp0 = fgGetNode(RM "wp", 0, true);
+  wp0->getChild("id", 0, true);
+  wp0->getChild("dist", 0, true);
+  wp0->getChild("eta", 0, true);
+  wp0->getChild("bearing-deg", 0, true);
+  
+  wp1 = fgGetNode(RM "wp", 1, true);
+  wp1->getChild("id", 0, true);
+  wp1->getChild("dist", 0, true);
+  wp1->getChild("eta", 0, true);
+  
+  wpn = fgGetNode(RM "wp-last", 0, true);
+  wpn->getChild("dist", 0, true);
+  wpn->getChild("eta", 0, true);
+  
+  _route->clear();
+  update_mirror();
+  
+  _pathNode = fgGetNode(RM "file-path", 0, true);
 }
 
 
 void FGRouteMgr::postinit() {
     string_list *waypoints = globals->get_initial_waypoints();
-    if (!waypoints)
-        return;
-
-    vector<string>::iterator it;
-    for (it = waypoints->begin(); it != waypoints->end(); ++it)
+    if (waypoints) {
+      vector<string>::iterator it;
+      for (it = waypoints->begin(); it != waypoints->end(); ++it)
         new_waypoint(*it);
+    }
+
+    weightOnWheels = fgGetNode("/gear/gear[0]/wow", false);
+    // check airbone flag agrees with presets
+    
 }
 
 
 void FGRouteMgr::bind() { }
 void FGRouteMgr::unbind() { }
 
-
-static double get_ground_speed() {
-    // starts in ft/s so we convert to kts
-    static const SGPropertyNode * speedup_node = fgGetNode("/sim/speed-up");
-
-    double ft_s = cur_fdm_state->get_V_ground_speed()
-        * speedup_node->getIntValue();
-    double kts = ft_s * SG_FEET_TO_METER * 3600 * SG_METER_TO_NM;
-
-    return kts;
+bool FGRouteMgr::isRouteActive() const
+{
+  return active->getBoolValue();
 }
 
-void FGRouteMgr::updateTargetAltitude() {
-    if (route->size() == 0) {
-        altitude_set = false;
-        return;
+void FGRouteMgr::update( double dt ) {
+    if (dt <= 0.0) {
+      // paused, nothing to do here
+      return;
     }
-    
-    SGWayPoint wp = route->get_waypoint( 0 );
-    if (wp.get_target_alt() < -9990.0) {
-        altitude_set = false;
-        return;
+  
+    if (!active->getBoolValue()) {
+      return;
     }
     
-    altitude_set = true;
-    target_altitude_ft->setDoubleValue( wp.get_target_alt() * SG_METER_TO_FEET );
-            
-    if ( !near_ground() ) {
-        // James Turner [zakalawe]: there's no explanation for this logic,
-        // it feels like the autopilot should pull the target altitude out of
-        // wp0 instead of us pushing it through here. Hmmm.
-        altitude_lock->setStringValue( "altitude-hold" );
-    }
-}
-
-void FGRouteMgr::update( double dt ) {
-    if (route->size() == 0) {
-      return; // no route set, early return
+    double groundSpeed = get_ground_speed();
+    if (airborne->getBoolValue()) {
+      time_t now = time(NULL);
+      elapsedFlightTime->setDoubleValue(difftime(now, _takeoffTime));
+    } else { // not airborne
+      if (weightOnWheels->getBoolValue() || (groundSpeed < 40)) {
+        return;
+      }
+      
+      airborne->setBoolValue(true);
+      _takeoffTime = time(NULL); // start the clock
+      departure->setIntValue("takeoff-time", _takeoffTime);
     }
     
+  // basic course/distance information
     double wp_course, wp_distance;
-
-    // first way point
-    SGWayPoint wp = route->get_waypoint( 0 );
+    SGWayPoint wp = _route->get_current();
     wp.CourseAndDistance( lon->getDoubleValue(), lat->getDoubleValue(),
                           alt->getDoubleValue(), &wp_course, &wp_distance );
-    true_hdg_deg->setDoubleValue( wp_course );
 
-    if ( wp_distance < 200.0 ) {
-        pop_waypoint();
-        if (route->size() == 0) {
-            return; // end of route, we're done for the time being
-        }
-        
-        wp = route->get_waypoint( 0 );
-    }
-
-  // update the property tree info for WP0
-    wp0_id->setStringValue( wp.get_id().c_str() );
-    double accum = wp_distance;
-    wp0_dist->setDoubleValue( accum * SG_METER_TO_NM );
-    setETAPropertyFromDistance(wp0_eta, accum);
-
-    // next way point
-    if ( route->size() > 1 ) {
-        SGWayPoint wp = route->get_waypoint( 1 );
-
-        // update the property tree info
-        wp1_id->setStringValue( wp.get_id().c_str() );
-        accum += wp.get_distance();
-        wp1_dist->setDoubleValue( accum * SG_METER_TO_NM );
-        setETAPropertyFromDistance(wp1_eta, accum);
+  // update wp0 / wp1 / wp-last for legacy users
+    wp0->setDoubleValue("dist", wp_distance * SG_METER_TO_NM);
+    wp_course -= magvar->getDoubleValue(); // expose magnetic bearing
+    wp0->setDoubleValue("bearing-deg", wp_course);
+    setETAPropertyFromDistance(wp0->getChild("eta"), wp_distance);
+    
+    if ((_route->current_index() + 1) < _route->size()) {
+      wp = _route->get_waypoint(_route->current_index() + 1);
+      double wp1_course, wp1_distance;
+      wp.CourseAndDistance(lon->getDoubleValue(), lat->getDoubleValue(),
+                          alt->getDoubleValue(), &wp1_course, &wp1_distance);
+    
+      wp1->setDoubleValue("dist", wp1_distance * SG_METER_TO_NM);
+      setETAPropertyFromDistance(wp1->getChild("eta"), wp1_distance);
     }
-
-    // summarize remaining way points
-    if ( route->size() > 2 ) {
-        SGWayPoint wp;
-        for ( int i = 2; i < route->size(); ++i ) {
-            wp = route->get_waypoint( i );
-            accum += wp.get_distance();
-        }
-
-        // update the property tree info
-        wpn_id->setStringValue( wp.get_id().c_str() );
-        wpn_dist->setDoubleValue( accum * SG_METER_TO_NM );
-        setETAPropertyFromDistance(wpn_eta, accum);
+    
+    double totalDistanceRemaining = wp_distance; // distance to current waypoint
+    for (int i=_route->current_index() + 1; i<_route->size(); ++i) {
+      totalDistanceRemaining += _route->get_waypoint(i).get_distance();
     }
+    
+    wpn->setDoubleValue("dist", totalDistanceRemaining * SG_METER_TO_NM);
+    ete->setDoubleValue(totalDistanceRemaining * SG_METER_TO_NM / groundSpeed * 3600.0);
+    setETAPropertyFromDistance(wpn->getChild("eta"), totalDistanceRemaining);
+    
+    // get time now at destination tz as tm struct
+    // add ete seconds
+    // convert to string ... and stash in property
+    //destination->setDoubleValue("eta", eta);
 }
 
+
 void FGRouteMgr::setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDistance) {
+    double speed = get_ground_speed();
+    if (speed < 1.0) {
+      aProp->setStringValue("--:--");
+      return;
+    }
+  
     char eta_str[64];
     double eta = aDistance * SG_METER_TO_NM / get_ground_speed();
     if ( eta >= 100.0 ) { 
@@ -209,8 +276,7 @@ void FGRouteMgr::setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDi
     }
     
     if ( eta < (1.0/6.0) ) {
-        // within 10 minutes, bump up to min/secs
-        eta *= 60.0;
+      eta *= 60.0; // within 10 minutes, bump up to min/secs
     }
     
     int major = (int)eta, 
@@ -220,45 +286,38 @@ void FGRouteMgr::setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDi
 }
 
 void FGRouteMgr::add_waypoint( const SGWayPoint& wp, int n ) {
-    route->add_waypoint( wp, n );
-    update_mirror();
-    if ((n==0) || (route->size() == 1)) {
-        updateTargetAltitude();
-    }
+  _route->add_waypoint( wp, n );
+    
+  if (_route->current_index() > n) {
+    _route->set_current(_route->current_index() + 1);
+  }
+  
+  update_mirror();
+  _edited->fireValueChanged();
 }
 
 
 SGWayPoint FGRouteMgr::pop_waypoint( int n ) {
-    SGWayPoint wp;
-
-    if ( route->size() > 0 ) {
-        if ( n < 0 )
-            n = route->size() - 1;
-        wp = route->get_waypoint(n);
-        route->delete_waypoint(n);
-    }
-
-    if ( route->size() <= 2 ) {
-        wpn_id->setStringValue( "" );
-        wpn_dist->setDoubleValue( 0.0 );
-        wpn_eta->setStringValue( "" );
-    }
-
-    if ( route->size() <= 1 ) {
-        wp1_id->setStringValue( "" );
-        wp1_dist->setDoubleValue( 0.0 );
-        wp1_eta->setStringValue( "" );
-    }
-
-    if ( route->size() <= 0 ) {
-        wp0_id->setStringValue( "" );
-        wp0_dist->setDoubleValue( 0.0 );
-        wp0_eta->setStringValue( "" );
-    }
-
-    updateTargetAltitude();
-    update_mirror();
-    return wp;
+  if ( _route->size() <= 0 ) {
+    return SGWayPoint();
+  }
+  
+  if ( n < 0 ) {
+    n = _route->size() - 1;
+  }
+  
+  if (_route->current_index() > n) {
+    _route->set_current(_route->current_index() - 1);
+  }
+
+  SGWayPoint wp = _route->get_waypoint(n);
+  _route->delete_waypoint(n);
+    
+  update_mirror();
+  _edited->fireValueChanged();
+  checkFinished();
+  
+  return wp;
 }
 
 
@@ -275,23 +334,15 @@ void FGRouteMgr::new_waypoint( const string& target, int n ) {
     
     add_waypoint( *wp, n );
     delete wp;
-
-    if ( !near_ground() ) {
-        fgSetString( "/autopilot/locks/heading", "true-heading-hold" );
-    }
 }
 
 
 SGWayPoint* FGRouteMgr::make_waypoint(const string& tgt ) {
-    string target = tgt;
+    string target(boost::to_upper_copy(tgt));
     
-    // make upper case
-    for (unsigned int i = 0; i < target.size(); i++)
-        if (target[i] >= 'a' && target[i] <= 'z')
-            target[i] -= 'a' - 'A';
-
     // extract altitude
-    double alt = -9999.0;
+    double alt = cruise->getDoubleValue("altitude-ft") * SG_FEET_TO_METER;
+    
     size_t pos = target.find( '@' );
     if ( pos != string::npos ) {
         alt = atof( target.c_str() + pos + 1 );
@@ -305,65 +356,94 @@ SGWayPoint* FGRouteMgr::make_waypoint(const string& tgt ) {
     if ( pos != string::npos ) {
         double lon = atof( target.substr(0, pos).c_str());
         double lat = atof( target.c_str() + pos + 1);
-
-        SG_LOG( SG_GENERAL, SG_INFO, "Adding waypoint lon = " << lon << ", lat = " << lat );
-        return new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, target );
+        char buf[32];
+        char ew = (lon < 0.0) ? 'W' : 'E';
+        char ns = (lat < 0.0) ? 'S' : 'N';
+        snprintf(buf, 32, "%c%03d%c%03d", ew, (int) fabs(lon), ns, (int)fabs(lat));
+        return new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, buf);
     }    
 
     SGGeod basePosition;
-    if (route->size() > 0) {
-        SGWayPoint wp = get_waypoint(route->size()-1);
-        basePosition = SGGeod::fromDeg(wp.get_target_lon(), wp.get_target_lat());
+    if (_route->size() > 0) {
+        SGWayPoint wp = get_waypoint(_route->size()-1);
+        basePosition = wp.get_target();
     } else {
         // route is empty, use current position
         basePosition = SGGeod::fromDeg(
             fgGetNode("/position/longitude-deg")->getDoubleValue(), 
             fgGetNode("/position/latitude-deg")->getDoubleValue());
     }
+    
+    vector<string> pieces(simgear::strutils::split(target, "/"));
 
 
-    FGPositionedRef p = FGPositioned::findClosestWithIdent(target, basePosition);
+    FGPositionedRef p = FGPositioned::findClosestWithIdent(pieces.front(), basePosition);
     if (!p) {
-        SG_LOG( SG_GENERAL, SG_INFO, "Unable to find FGPositioned with ident:" << target);
+      SG_LOG( SG_AUTOPILOT, SG_INFO, "Unable to find FGPositioned with ident:" << pieces.front());
+      return NULL;
+    }
+    
+    SGGeod geod = SGGeod::fromGeodM(p->geod(), alt);
+    if (pieces.size() == 1) {
+      // simple case
+      return new SGWayPoint(geod, target, p->name());
+    }
+        
+    if (pieces.size() == 3) {
+      // navaid/radial/distance-nm notation
+      double radial = atof(pieces[1].c_str()),
+        distanceNm = atof(pieces[2].c_str()),
+        az2;
+      radial += magvar->getDoubleValue(); // convert to true bearing
+      SGGeod offsetPos;
+      SGGeodesy::direct(geod, radial, distanceNm * SG_NM_TO_METER, offsetPos, az2);
+      offsetPos.setElevationM(alt);
+      
+      SG_LOG(SG_AUTOPILOT, SG_INFO, "final offset radial is " << radial);
+      return new SGWayPoint(offsetPos, p->ident() + pieces[2], target);
+    }
+    
+    if (pieces.size() == 2) {
+      FGAirport* apt = dynamic_cast<FGAirport*>(p.ptr());
+      if (!apt) {
+        SG_LOG(SG_AUTOPILOT, SG_INFO, "Waypoint is not an airport:" << pieces.front());
+        return NULL;
+      }
+      
+      if (!apt->hasRunwayWithIdent(pieces[1])) {
+        SG_LOG(SG_AUTOPILOT, SG_INFO, "No runway: " << pieces[1] << " at " << pieces[0]);
         return NULL;
+      }
+      
+      FGRunway* runway = apt->getRunwayByIdent(pieces[1]);
+      SGGeod t = runway->threshold();
+      return new SGWayPoint(t.getLongitudeDeg(), t.getLatitudeDeg(), alt, SGWayPoint::WGS84, pieces[1]);
     }
     
-    return new SGWayPoint(p->longitude(), p->latitude(), alt, SGWayPoint::WGS84, target);
+    SG_LOG(SG_AUTOPILOT, SG_INFO, "Unable to parse waypoint:" << target);
+    return NULL;
 }
 
 
 // mirror internal route to the property system for inspection by other subsystems
 void FGRouteMgr::update_mirror() {
     mirror->removeChildren("wp");
-    for (int i = 0; i < route->size(); i++) {
-        SGWayPoint wp = route->get_waypoint(i);
+    for (int i = 0; i < _route->size(); i++) {
+        SGWayPoint wp = _route->get_waypoint(i);
         SGPropertyNode *prop = mirror->getChild("wp", i, 1);
 
+        const SGGeod& pos(wp.get_target());
         prop->setStringValue("id", wp.get_id().c_str());
         prop->setStringValue("name", wp.get_name().c_str());
-        prop->setDoubleValue("longitude-deg", wp.get_target_lon());
-        prop->setDoubleValue("latitude-deg", wp.get_target_lat());
-        prop->setDoubleValue("altitude-m", wp.get_target_alt());
-        prop->setDoubleValue("altitude-ft", wp.get_target_alt() * SG_METER_TO_FEET);
+        prop->setDoubleValue("longitude-deg", pos.getLongitudeDeg());
+        prop->setDoubleValue("latitude-deg",pos.getLatitudeDeg());
+        prop->setDoubleValue("altitude-m", pos.getElevationM());
+        prop->setDoubleValue("altitude-ft", pos.getElevationFt());
     }
     // set number as listener attachment point
-    mirror->setIntValue("num", route->size());
-}
-
-
-bool FGRouteMgr::near_ground() {
-    SGPropertyNode *gear = fgGetNode( "/gear/gear/wow", false );
-    if ( !gear || gear->getType() == simgear::props::NONE )
-        return fgGetBool( "/sim/presets/onground", true );
-
-    if ( fgGetDouble("/position/altitude-agl-ft", 300.0)
-            < fgGetDouble("/autopilot/route-manager/min-lock-altitude-agl-ft") )
-        return true;
-
-    return gear->getBoolValue();
+    mirror->setIntValue("num", _route->size());
 }
 
-
 // command interface /autopilot/route-manager/input:
 //
 //   @CLEAR             ... clear route
@@ -372,12 +452,18 @@ bool FGRouteMgr::near_ground() {
 //   @INSERT2:KSFO@900  ... insert "KSFO@900" as 3rd entry
 //   KSFO@900           ... append "KSFO@900"
 //
-void FGRouteMgr::Listener::valueChanged(SGPropertyNode *prop)
+void FGRouteMgr::InputListener::valueChanged(SGPropertyNode *prop)
 {
     const char *s = prop->getStringValue();
     if (!strcmp(s, "@CLEAR"))
         mgr->init();
-    else if (!strcmp(s, "@POP"))
+    else if (!strcmp(s, "@ACTIVATE"))
+        mgr->activate();
+    else if (!strcmp(s, "@LOAD")) {
+      mgr->loadRoute();
+    } else if (!strcmp(s, "@SAVE")) {
+      mgr->saveRoute();
+    } else if (!strcmp(s, "@POP"))
         mgr->pop_waypoint(0);
     else if (!strncmp(s, "@DELETE", 7))
         mgr->pop_waypoint(atoi(s + 7));
@@ -394,4 +480,332 @@ void FGRouteMgr::Listener::valueChanged(SGPropertyNode *prop)
         mgr->new_waypoint(s);
 }
 
+//    SGWayPoint( const double lon = 0.0, const double lat = 0.0,
+//             const double alt = 0.0, const modetype m = WGS84,
+//             const string& s = "", const string& n = "" );
+
+bool FGRouteMgr::activate()
+{
+  if (_departure) {
+    string runwayId(departure->getStringValue("runway"));
+    FGRunway* runway = NULL;
+    if (_departure->hasRunwayWithIdent(runwayId)) {
+      runway = _departure->getRunwayByIdent(runwayId);
+    } else {
+      SG_LOG(SG_AUTOPILOT, SG_INFO, 
+        "route-manager, departure runway not found:" << runwayId);
+      runway = _departure->getActiveRunwayForUsage();
+    }
+    
+    SGWayPoint swp(runway->threshold(), 
+      _departure->ident() + "-" + runway->ident(), runway->name());
+    add_waypoint(swp, 0);
+  }
+  
+  if (_destination) {
+    string runwayId = (destination->getStringValue("runway"));
+    if (_destination->hasRunwayWithIdent(runwayId)) {
+      FGRunway* runway = _destination->getRunwayByIdent(runwayId);
+      SGWayPoint swp(runway->end(), 
+        _destination->ident() + "-" + runway->ident(), runway->name());
+      add_waypoint(swp);
+    } else {
+      // quite likely, since destination runway may not be known until enroute
+      // probably want a listener on the 'destination' node to allow an enroute
+      // update
+      add_waypoint(SGWayPoint(_destination->geod(), _destination->ident(), _destination->name()));
+    }
+  }
+
+  _route->set_current(0);
+  
+  double routeDistanceNm = _route->total_distance() * SG_METER_TO_NM;
+  totalDistance->setDoubleValue(routeDistanceNm);
+  double cruiseSpeedKts = cruise->getDoubleValue("speed", 0.0);
+  if (cruiseSpeedKts > 1.0) {
+    // very very crude approximation, doesn't allow for climb / descent
+    // performance or anything else at all
+    ete->setDoubleValue(routeDistanceNm / cruiseSpeedKts * (60.0 * 60.0));
+  }
+  
+  active->setBoolValue(true);
+  SG_LOG(SG_AUTOPILOT, SG_INFO, "route-manager, activate route ok");
+  return true;
+}
+
+
+void FGRouteMgr::sequence()
+{
+  if (!active->getBoolValue()) {
+    SG_LOG(SG_AUTOPILOT, SG_ALERT, "trying to sequence waypoints with no active route");
+    return;
+  }
+  
+  if (checkFinished()) {
+    return;
+  }
+  
+  _route->increment_current();
+  currentWaypointChanged();
+  _currentWpt->fireValueChanged();
+}
+
+bool FGRouteMgr::checkFinished()
+{
+  int lastWayptIndex = _route->size() - 1;
+  if (_route->current_index() < lastWayptIndex) {
+    return false;
+  }
+  
+  SG_LOG(SG_AUTOPILOT, SG_INFO, "reached end of active route");
+  _finished->fireValueChanged();
+  active->setBoolValue(false);
+  return true;
+}
+
+void FGRouteMgr::jumpToIndex(int index)
+{
+  if (!active->getBoolValue()) {
+    SG_LOG(SG_AUTOPILOT, SG_ALERT, "trying to sequence waypoints with no active route");
+    return;
+  }
+
+  if ((index < 0) || (index >= _route->size())) {
+    SG_LOG(SG_AUTOPILOT, SG_ALERT, "passed invalid index (" << 
+      index << ") to FGRouteMgr::jumpToIndex");
+    return;
+  }
+
+  if (_route->current_index() == index) {
+    return; // no-op
+  }
+  
+  _route->set_current(index);
+  currentWaypointChanged();
+}
+
+void FGRouteMgr::currentWaypointChanged()
+{
+  SGWayPoint previous = _route->get_previous();
+  SGWayPoint cur = _route->get_current();
+  
+  wp0->getChild("id")->setStringValue(cur.get_id());
+  if ((_route->current_index() + 1) < _route->size()) {
+    wp1->getChild("id")->setStringValue(_route->get_next().get_id());
+  } else {
+    wp1->getChild("id")->setStringValue("");
+  }
+  
+  SG_LOG(SG_AUTOPILOT, SG_INFO, "route manager, current-wp is now " << _route->current_index());
+}
+
+int FGRouteMgr::findWaypoint(const SGGeod& aPos) const
+{  
+  for (int i=0; i<_route->size(); ++i) {
+    double d = SGGeodesy::distanceM(aPos, _route->get_waypoint(i).get_target());
+    if (d < 200.0) { // 200 metres seems close enough
+      return i;
+    }
+  }
+  
+  return -1;
+}
+
+SGWayPoint FGRouteMgr::get_waypoint( int i ) const
+{
+  return _route->get_waypoint(i);
+}
+
+int FGRouteMgr::size() const
+{
+  return _route->size();
+}
+
+int FGRouteMgr::currentWaypoint() const
+{
+  return _route->current_index();
+}
+
+void FGRouteMgr::saveRoute()
+{
+  SGPath path(_pathNode->getStringValue());
+  SG_LOG(SG_IO, SG_INFO, "Saving route to " << path.str());
+  try {
+    writeProperties(path.str(), mirror, false, SGPropertyNode::ARCHIVE);
+  } catch (const sg_exception &e) {
+    SG_LOG(SG_IO, SG_WARN, "Error saving route:" << e.getMessage());
+    //guiErrorMessage("Error writing autosave.xml: ", e);
+  }
+}
+
+void FGRouteMgr::loadRoute()
+{
+  try {
+    // deactivate route first
+    active->setBoolValue(false);
+    
+    SGPropertyNode_ptr routeData(new SGPropertyNode);
+    SGPath path(_pathNode->getStringValue());
+    
+    SG_LOG(SG_IO, SG_INFO, "going to read flight-plan from:" << path.str());
+    readProperties(path.str(), routeData);
+    
+  // departure nodes
+    SGPropertyNode* dep = routeData->getChild("departure");
+    if (!dep) {
+      throw sg_io_exception("malformed route file, no departure node");
+    }
+    
+    string depIdent = dep->getStringValue("airport");
+    _departure = (FGAirport*) fgFindAirportID(depIdent);
+
+        
+  // destination
+    SGPropertyNode* dst = routeData->getChild("destination");
+    if (!dst) {
+      throw sg_io_exception("malformed route file, no destination node");
+    }
+    
+    _destination = (FGAirport*) fgFindAirportID(dst->getStringValue("airport"));
+    destination->setStringValue("runway", dst->getStringValue("runway"));
+
+  // alternate
+    SGPropertyNode* alt = routeData->getChild("alternate");
+    if (alt) {
+      alternate->setStringValue(alt->getStringValue("airport"));
+    } // of cruise data loading
+    
+  // cruise
+    SGPropertyNode* crs = routeData->getChild("cruise");
+    if (crs) {
+      cruise->setDoubleValue(crs->getDoubleValue("speed"));
+    } // of cruise data loading
+
+  // route nodes
+    _route->clear();
+    SGPropertyNode_ptr _route = routeData->getChild("route", 0);
+    SGGeod lastPos = (_departure ? _departure->geod() : SGGeod());
+    
+    for (int i=0; i<_route->nChildren(); ++i) {
+      SGPropertyNode_ptr wp = _route->getChild("wp", i);
+      parseRouteWaypoint(wp);
+    } // of route iteration
+  } catch (sg_exception& e) {
+    SG_LOG(SG_IO, SG_WARN, "failed to load flight-plan (from '" << e.getOrigin()
+      << "'):" << e.getMessage());
+  }
+}
+
+void FGRouteMgr::parseRouteWaypoint(SGPropertyNode* aWP)
+{
+  SGGeod lastPos;
+  if (_route->size() > 0) {
+    lastPos = get_waypoint(_route->size()-1).get_target();
+  } else {
+    // route is empty, use departure airport position
+    const FGAirport* apt = fgFindAirportID(departure->getStringValue("airport"));
+    assert(apt); // shouldn't have got this far with an invalid airport
+    lastPos = apt->geod();
+  }
+
+  SGPropertyNode_ptr altProp = aWP->getChild("altitude-ft");
+  double alt = cruise->getDoubleValue("altitude-ft") * SG_FEET_TO_METER;
+  if (altProp) {
+    alt = altProp->getDoubleValue();
+  }
+      
+  string ident(aWP->getStringValue("ident"));
+  if (aWP->hasChild("longitude-deg")) {
+    // explicit longitude/latitude
+    SGWayPoint swp(aWP->getDoubleValue("longitude-deg"),
+      aWP->getDoubleValue("latitude-deg"), alt, 
+      SGWayPoint::WGS84, ident, aWP->getStringValue("name"));
+    add_waypoint(swp);
+  } else if (aWP->hasChild("navid")) {
+    // lookup by navid (possibly with offset)
+    string nid(aWP->getStringValue("navid"));
+    FGPositionedRef p = FGPositioned::findClosestWithIdent(nid, lastPos);
+    if (!p) {
+      throw sg_io_exception("bad route file, unknown navid:" + nid);
+    }
+    
+    SGGeod pos(p->geod());
+    if (aWP->hasChild("offset-nm") && aWP->hasChild("offset-radial")) {
+      double radialDeg = aWP->getDoubleValue("offset-radial");
+      // convert magnetic radial to a true radial!
+      radialDeg += magvar->getDoubleValue();
+      double offsetNm = aWP->getDoubleValue("offset-nm");
+      double az2;
+      SGGeodesy::direct(p->geod(), radialDeg, offsetNm * SG_NM_TO_METER, pos, az2);
+    }
+    
+    SGWayPoint swp(pos.getLongitudeDeg(), pos.getLatitudeDeg(), alt, 
+      SGWayPoint::WGS84, ident, "");
+    add_waypoint(swp);
+  } else {
+    // lookup by ident (symbolic waypoint)
+    FGPositionedRef p = FGPositioned::findClosestWithIdent(ident, lastPos);
+    if (!p) {
+      throw sg_io_exception("bad route file, unknown waypoint:" + ident);
+    }
+    
+    SGWayPoint swp(p->longitude(), p->latitude(), alt, 
+      SGWayPoint::WGS84, p->ident(), p->name());
+    add_waypoint(swp);
+  }
+}
+
+const char* FGRouteMgr::getDepartureICAO() const
+{
+  if (!_departure) {
+    return "";
+  }
+  
+  return _departure->ident().c_str();
+}
+
+const char* FGRouteMgr::getDepartureName() const
+{
+  if (!_departure) {
+    return "";
+  }
+  
+  return _departure->name().c_str();
+}
+
+void FGRouteMgr::setDepartureICAO(const char* aIdent)
+{
+  if ((aIdent == NULL) || (strlen(aIdent) < 4)) {
+    _departure = NULL;
+  } else {
+    _departure = FGAirport::findByIdent(aIdent);
+  }
+}
+
+const char* FGRouteMgr::getDestinationICAO() const
+{
+  if (!_destination) {
+    return "";
+  }
+  
+  return _destination->ident().c_str();
+}
+
+const char* FGRouteMgr::getDestinationName() const
+{
+  if (!_destination) {
+    return "";
+  }
+  
+  return _destination->name().c_str();
+}
 
+void FGRouteMgr::setDestinationICAO(const char* aIdent)
+{
+  if ((aIdent == NULL) || (strlen(aIdent) < 4)) {
+    _destination = NULL;
+  } else {
+    _destination = FGAirport::findByIdent(aIdent);
+  }
+}
+    
index 8806cae2746a918d18d53bfacf3c95a2479c7e4e..b096572591533419f4a429cedde07d820c64240a 100644 (file)
 #define _ROUTE_MGR_HXX 1
 
 #include <simgear/props/props.hxx>
-#include <simgear/route/route.hxx>
+#include <simgear/route/waypoint.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 
+// forward decls
+class SGRoute;
+class SGPath;
+
+class FGAirport;
+typedef SGSharedPtr<FGAirport> FGAirportRef;
 
 /**
  * Top level route manager class
@@ -38,61 +44,100 @@ class FGRouteMgr : public SGSubsystem
 {
 
 private:
-
-    SGRoute *route;
-
+    SGRoute* _route;
+    time_t _takeoffTime;
+    time_t _touchdownTime;
+    FGAirportRef _departure;
+    FGAirportRef _destination;
+    
     // automatic inputs
     SGPropertyNode_ptr lon;
     SGPropertyNode_ptr lat;
     SGPropertyNode_ptr alt;
-
-    // automatic outputs
-    SGPropertyNode_ptr true_hdg_deg;
-    SGPropertyNode_ptr target_altitude_ft;
-    SGPropertyNode_ptr altitude_lock;
-
-    SGPropertyNode_ptr wp0_id;
-    SGPropertyNode_ptr wp0_dist;
-    SGPropertyNode_ptr wp0_eta;
-
-    SGPropertyNode_ptr wp1_id;
-    SGPropertyNode_ptr wp1_dist;
-    SGPropertyNode_ptr wp1_eta;
-
-    SGPropertyNode_ptr wpn_id;
-    SGPropertyNode_ptr wpn_dist;
-    SGPropertyNode_ptr wpn_eta;
-
-
-    class Listener : public SGPropertyChangeListener {
+    SGPropertyNode_ptr magvar;
+    
+    // automatic outputs    
+    SGPropertyNode_ptr departure; ///< departure airport information
+    SGPropertyNode_ptr destination; ///< destination airport information
+    SGPropertyNode_ptr alternate; ///< alternate airport information
+    SGPropertyNode_ptr cruise; ///< cruise information
+    
+    SGPropertyNode_ptr totalDistance;
+    SGPropertyNode_ptr ete;
+    SGPropertyNode_ptr elapsedFlightTime;
+    
+    SGPropertyNode_ptr active;
+    SGPropertyNode_ptr airborne;
+    
+    SGPropertyNode_ptr wp0;
+    SGPropertyNode_ptr wp1;
+    SGPropertyNode_ptr wpn;
+    
+    
+    SGPropertyNode_ptr _pathNode;
+    SGPropertyNode_ptr _currentWpt;
+    
+    
+    /** 
+     * Signal property to notify people that the route was edited
+     */
+    SGPropertyNode_ptr _edited;
+    
+    /**
+     * Signal property to notify when the last waypoint is reached
+     */
+    SGPropertyNode_ptr _finished;
+    
+    void setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDistance);
+    
+    class InputListener : public SGPropertyChangeListener {
     public:
-        Listener(FGRouteMgr *m) : mgr(m) {}
+        InputListener(FGRouteMgr *m) : mgr(m) {}
         virtual void valueChanged (SGPropertyNode * prop);
     private:
         FGRouteMgr *mgr;
     };
 
     SGPropertyNode_ptr input;
-    Listener *listener;
+    SGPropertyNode_ptr weightOnWheels;
+    
+    InputListener *listener;
     SGPropertyNode_ptr mirror;
-    bool altitude_set;
 
+    /**
+     * Create a SGWayPoint from a string in the following format:
+     *  - simple identifier
+     *  - decimal-lon,decimal-lat
+     *  - airport-id/runway-id
+     *  - navaid/radial-deg/offset-nm
+     */
     SGWayPoint* make_waypoint(const string& target);
+    
+    
     void update_mirror();
-    bool near_ground();
-
+    
+    void currentWaypointChanged();
+    
     /**
-     * Helper to set a string property to the estimated arrival time (ETA),
-     * formatted as either hours:minutes or minutes:seconds, based on a distance
-     * and the current groundspeed.
+     * Parse a route/wp node (from a saved, property-lsit formatted route)
      */
-    void setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDistance);
+    void parseRouteWaypoint(SGPropertyNode* aWP);
     
     /**
-     * Helper to update the target_altitude_ft and altitude_set flag when wp0
-     * changes
+     * Check if we've reached the final waypoint. 
+     * Returns true if we have.
      */
-    void updateTargetAltitude();
+    bool checkFinished();
+    
+// tied getters and setters
+    const char* getDepartureICAO() const;
+    const char* getDepartureName() const;
+    void setDepartureICAO(const char* aIdent);
+    
+    const char* getDestinationICAO() const;
+    const char* getDestinationName() const;
+    void setDestinationICAO(const char* aIdent);
+    
 public:
 
     FGRouteMgr();
@@ -110,14 +155,41 @@ public:
     void add_waypoint( const SGWayPoint& wp, int n = -1 );
     SGWayPoint pop_waypoint( int i = 0 );
 
-    SGWayPoint get_waypoint( int i ) const {
-        return route->get_waypoint(i);
-    }
-
-    int size() const {
-        return route->size();
-    }
+    SGWayPoint get_waypoint( int i ) const;
+    int size() const;
+        
+    bool isRouteActive() const;
+        
+    int currentWaypoint() const;
+       
+    /**
+     * Find a waypoint in the route, by position, and return its index, or
+     * -1 if no matching waypoint was found in the route.
+     */
+    int findWaypoint(const SGGeod& aPos) const;
+          
+    /**
+     * Activate a built route. This checks for various mandatory pieces of
+     * data, such as departure and destination airports, and creates waypoints
+     * for them on the route structure.
+     *
+     * returns true if the route was activated successfully, or false if the
+     * route could not be activated for some reason
+     */
+    bool activate();
 
+    /**
+     * Step to the next waypoint on the active route
+     */
+    void sequence();
+    
+    /**
+     *
+     */
+    void jumpToIndex(int index);
+    
+    void saveRoute();
+    void loadRoute();
 };
 
 
index 6761cddf7d30a88330064d7e088b9447b089a75d..6d542855787ee720bc80f7a92336bdac8d13e37a 100644 (file)
 using std::cout;
 using std::endl;
 
+FGXMLAutoInput::FGXMLAutoInput( SGPropertyNode_ptr node, double value, double offset, double scale) :
+  value(0.0),
+  abs(false),
+  property(NULL),
+  offset(NULL),
+  scale(NULL),
+  min(NULL),
+  max(NULL),
+  _condition(NULL) 
+{
+  parse( node, value, offset, scale );
+}
+
+
 void FGXMLAutoInput::parse( SGPropertyNode_ptr node, double aValue, double aOffset, double aScale )
 {
     value = aValue;
@@ -151,7 +165,7 @@ double FGXMLAutoInput::get_value()
     return abs ? fabs(value) : value;
 }
 
-FGXMLAutoComponent::FGXMLAutoComponent( SGPropertyNode * node ) :
+FGXMLAutoComponent::FGXMLAutoComponent() :
       _condition( NULL ),
       enable_prop( NULL ),
       enable_value( NULL ),
@@ -162,94 +176,116 @@ FGXMLAutoComponent::FGXMLAutoComponent( SGPropertyNode * node ) :
       debug(false),
       enabled( false )
 {
-    int i;
-    SGPropertyNode *prop; 
-
-    for ( i = 0; i < node->nChildren(); ++i ) {
-        SGPropertyNode *child = node->getChild(i);
-        string cname = child->getName();
-        string cval = child->getStringValue();
-        if ( cname == "name" ) {
-            name = cval;
-
-        } else if ( cname == "feedback-if-disabled" ) {
-            feedback_if_disabled = child->getBoolValue();
-
-        } else if ( cname == "debug" ) {
-            debug = child->getBoolValue();
-
-        } else if ( cname == "enable" ) {
-            if( (prop = child->getChild("condition")) != NULL ) {
-              _condition = sgReadCondition(child, prop);
-            } else {
-               if ( (prop = child->getChild( "prop" )) != NULL ) {
-                   enable_prop = fgGetNode( prop->getStringValue(), true );
-               }
-
-               if ( (prop = child->getChild( "value" )) != NULL ) {
-                   delete enable_value;
-                   enable_value = new string(prop->getStringValue());
-               }
-            }
-            if ( (prop = child->getChild( "honor-passive" )) != NULL ) {
-                honor_passive = prop->getBoolValue();
-            }
-
-        } else if ( cname == "input" ) {
-
-              valueInput.push_back( new FGXMLAutoInput( child ) );
-
-        } else if ( cname == "reference" ) {
+}
 
-              referenceInput.push_back( new FGXMLAutoInput( child ) );
+FGXMLAutoComponent::~FGXMLAutoComponent() 
+{
+    delete enable_value;
+}
 
-        } else if ( cname == "output" ) {
-            // grab all <prop> and <property> childs
-            int found = 0;
-            // backwards compatibility: allow <prop> elements
-            for( int i = 0; (prop = child->getChild("prop", i)) != NULL; i++ ) { 
-                SGPropertyNode *tmp = fgGetNode( prop->getStringValue(), true );
-                output_list.push_back( tmp );
-                found++;
-            }
-            for( int i = 0; (prop = child->getChild("property", i)) != NULL; i++ ) { 
-                SGPropertyNode *tmp = fgGetNode( prop->getStringValue(), true );
-                output_list.push_back( tmp );
-                found++;
-            }
+void FGXMLAutoComponent::parseNode(SGPropertyNode* aNode)
+{
+  SGPropertyNode *prop; 
+  for (int i = 0; i < aNode->nChildren(); ++i ) {
+    SGPropertyNode *child = aNode->getChild(i);
+    string cname(child->getName());
+    
+    if (parseNodeHook(cname, child)) {
+      // derived class handled it, fine
+    } else if ( cname == "name" ) {
+      name = child->getStringValue();
+    } else if ( cname == "feedback-if-disabled" ) {
+      feedback_if_disabled = child->getBoolValue();
+    } else if ( cname == "debug" ) {
+      debug = child->getBoolValue();
+    } else if ( cname == "enable" ) {
+      if( (prop = child->getChild("condition")) != NULL ) {
+        _condition = sgReadCondition(child, prop);
+      } else {
+         if ( (prop = child->getChild( "prop" )) != NULL ) {
+             enable_prop = fgGetNode( prop->getStringValue(), true );
+         }
+
+         if ( (prop = child->getChild( "value" )) != NULL ) {
+             delete enable_value;
+             enable_value = new string(prop->getStringValue());
+         }
+      }
+      if ( (prop = child->getChild( "honor-passive" )) != NULL ) {
+          honor_passive = prop->getBoolValue();
+      }
+    } else if ( cname == "input" ) {
+      valueInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "reference" ) {
+      referenceInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "output" ) {
+      // grab all <prop> and <property> childs
+      int found = 0;
+      // backwards compatibility: allow <prop> elements
+      for( int i = 0; (prop = child->getChild("prop", i)) != NULL; i++ ) { 
+          SGPropertyNode *tmp = fgGetNode( prop->getStringValue(), true );
+          output_list.push_back( tmp );
+          found++;
+      }
+      for( int i = 0; (prop = child->getChild("property", i)) != NULL; i++ ) { 
+          SGPropertyNode *tmp = fgGetNode( prop->getStringValue(), true );
+          output_list.push_back( tmp );
+          found++;
+      }
+
+      // no <prop> elements, text node of <output> is property name
+      if( found == 0 )
+          output_list.push_back( fgGetNode(child->getStringValue(), true ) );
+    } else if ( cname == "config" ) {
+      parseConfig(child);
+    } else if ( cname == "min" ) {
+        uminInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "u_min" ) {
+        uminInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "max" ) {
+        umaxInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "u_max" ) {
+        umaxInput.push_back( new FGXMLAutoInput( child ) );
+    } else {
+      SG_LOG(SG_AUTOPILOT, SG_ALERT, "malformed autopilot definition - unrecognized node:" 
+        << cname << " in section " << name);
+      throw sg_io_exception("XMLAuto: unrecognized component node:" + cname, "Section=" + name);
+    }
+  } // of top-level iteration
+}
 
-            // no <prop> elements, text node of <output> is property name
-            if( found == 0 )
-                output_list.push_back( fgGetNode(child->getStringValue(), true ) );
+void FGXMLAutoComponent::parseConfig(SGPropertyNode* aConfig)
+{
+  for (int i = 0; i < aConfig->nChildren(); ++i ) {
+    SGPropertyNode *child = aConfig->getChild(i);
+    string cname(child->getName());
+    
+    if (parseConfigHook(cname, child)) {
+      // derived class handled it, fine
+    } else if ( cname == "min" ) {
+        uminInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "u_min" ) {
+        uminInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "max" ) {
+        umaxInput.push_back( new FGXMLAutoInput( child ) );
+    } else if ( cname == "u_max" ) {
+        umaxInput.push_back( new FGXMLAutoInput( child ) );
+    } else {
+      SG_LOG(SG_AUTOPILOT, SG_ALERT, "malformed autopilot definition - unrecognized config node:" 
+        << cname << " in section " << name);
+      throw sg_io_exception("XMLAuto: unrecognized config node:" + cname, "Section=" + name);
+    }
+  } // of config iteration
+}
 
-        } else if ( cname == "config" ) {
-            if( (prop = child->getChild("min")) != NULL ) {
-              uminInput.push_back( new FGXMLAutoInput( prop ) );
-            }
-            if( (prop = child->getChild("u_min")) != NULL ) {
-              uminInput.push_back( new FGXMLAutoInput( prop ) );
-            }
-            if( (prop = child->getChild("max")) != NULL ) {
-              umaxInput.push_back( new FGXMLAutoInput( prop ) );
-            }
-            if( (prop = child->getChild("u_max")) != NULL ) {
-              umaxInput.push_back( new FGXMLAutoInput( prop ) );
-            }
-        } else if ( cname == "min" ) {
-            uminInput.push_back( new FGXMLAutoInput( child ) );
-        } else if ( cname == "u_min" ) {
-            uminInput.push_back( new FGXMLAutoInput( child ) );
-        } else if ( cname == "max" ) {
-            umaxInput.push_back( new FGXMLAutoInput( child ) );
-        } else if ( cname == "u_max" ) {
-            umaxInput.push_back( new FGXMLAutoInput( child ) );
-        } 
-    }   
+bool FGXMLAutoComponent::parseNodeHook(const string& aName, SGPropertyNode* aNode)
+{
+  return false;
 }
 
-FGXMLAutoComponent::~FGXMLAutoComponent() 
+bool FGXMLAutoComponent::parseConfigHook(const string& aName, SGPropertyNode* aNode)
 {
-    delete enable_value;
+  return false;
 }
 
 bool FGXMLAutoComponent::isPropertyEnabled()
@@ -289,7 +325,7 @@ double FGXMLAutoComponent::clamp( double value )
 }
 
 FGPIDController::FGPIDController( SGPropertyNode *node ):
-    FGXMLAutoComponent( node ),
+    FGXMLAutoComponent(),
     alpha( 0.1 ),
     beta( 1.0 ),
     gamma( 0.0 ),
@@ -300,46 +336,32 @@ FGPIDController::FGPIDController( SGPropertyNode *node ):
     desiredTs( 0.0 ),
     elapsedTime( 0.0 )
 {
-    int i;
-    for ( i = 0; i < node->nChildren(); ++i ) {
-        SGPropertyNode *child = node->getChild(i);
-        string cname = child->getName();
-        string cval = child->getStringValue();
-        if ( cname == "config" ) {
-            SGPropertyNode *config;
-
-            if ( (config = child->getChild( "Ts" )) != NULL ) {
-                desiredTs = config->getDoubleValue();
-            }
-           
-            Kp.push_back( new FGXMLAutoInput( child->getChild( "Kp" ) ) );
-            Ti.push_back( new FGXMLAutoInput( child->getChild( "Ti" ) ) );
-            Td.push_back( new FGXMLAutoInput( child->getChild( "Td" ) ) );
-
-            config = child->getChild( "beta" );
-            if ( config != NULL ) {
-                beta = config->getDoubleValue();
-            }
-
-            config = child->getChild( "alpha" );
-            if ( config != NULL ) {
-                alpha = config->getDoubleValue();
-            }
-
-            config = child->getChild( "gamma" );
-            if ( config != NULL ) {
-                gamma = config->getDoubleValue();
-            }
-
-        } else {
-            SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in autopilot config logic" );
-            if ( get_name().length() ) {
-                SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << get_name() );
-            }
-        }
-    }   
+  parseNode(node);
 }
 
+bool FGPIDController::parseConfigHook(const string& aName, SGPropertyNode* aNode)
+{
+  if (aName == "Ts") {
+    desiredTs = aNode->getDoubleValue();
+  } else if (aName == "Kp") {
+    Kp.push_back( new FGXMLAutoInput(aNode) );
+  } else if (aName == "Ti") {
+    Ti.push_back( new FGXMLAutoInput(aNode) );
+  } else if (aName == "Td") {
+    Td.push_back( new FGXMLAutoInput(aNode) );
+  } else if (aName == "beta") {
+    beta = aNode->getDoubleValue();
+  } else if (aName == "alpha") {
+    alpha = aNode->getDoubleValue();
+  } else if (aName == "gamma") {
+    gamma = aNode->getDoubleValue();
+  } else {
+    // unhandled by us, let the base class try it
+    return false;
+  }
+
+  return true;
+}
 
 /*
  * Roy Vegard Ovesen:
@@ -512,26 +534,25 @@ void FGPIDController::update( double dt ) {
 
 
 FGPISimpleController::FGPISimpleController( SGPropertyNode *node ):
-    FGXMLAutoComponent( node ),
+    FGXMLAutoComponent(),
     int_sum( 0.0 )
 {
-    int i;
-    for ( i = 0; i < node->nChildren(); ++i ) {
-        SGPropertyNode *child = node->getChild(i);
-        string cname = child->getName();
-        string cval = child->getStringValue();
-        if ( cname == "config" ) {
-            Kp.push_back( new FGXMLAutoInput( child->getChild( "Kp" ) ) );
-            Ki.push_back( new FGXMLAutoInput( child->getChild( "Ki" ) ) );
-        } else {
-            SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in autopilot config logic" );
-            if ( get_name().length() ) {
-                SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << get_name() );
-            }
-        }
-    }   
+  parseNode(node);
 }
 
+bool FGPISimpleController::parseConfigHook(const string& aName, SGPropertyNode* aNode)
+{
+  if (aName == "Kp") {
+    Kp.push_back( new FGXMLAutoInput(aNode) );
+  } else if (aName == "Ki") {
+    Ki.push_back( new FGXMLAutoInput(aNode) );
+  } else {
+    // unhandled by us, let the base class try it
+    return false;
+  }
+
+  return true;
+}
 
 void FGPISimpleController::update( double dt ) {
 
@@ -573,19 +594,23 @@ void FGPISimpleController::update( double dt ) {
 
 
 FGPredictor::FGPredictor ( SGPropertyNode *node ):
-    FGXMLAutoComponent( node ),
+    FGXMLAutoComponent(),
     average(0.0)
 {
-    int i;
-    for ( i = 0; i < node->nChildren(); ++i ) {
-        SGPropertyNode *child = node->getChild(i);
-        string cname = child->getName();
-        if ( cname == "seconds" ) {
-            seconds.push_back( new FGXMLAutoInput( child, 0 ) );
-        } else if ( cname == "filter-gain" ) {
-            filter_gain.push_back( new FGXMLAutoInput( child, 0 ) );
-        }
-    }   
+  parseNode(node);
+}
+
+bool FGPredictor::parseNodeHook(const string& aName, SGPropertyNode* aNode)
+{
+  if (aName == "seconds") {
+    seconds.push_back( new FGXMLAutoInput( aNode, 0 ) );
+  } else if (aName == "filter-gain") {
+    filter_gain.push_back( new FGXMLAutoInput( aNode, 0 ) );
+  } else {
+    return false;
+  }
+  
+  return true;
 }
 
 void FGPredictor::update( double dt ) {
@@ -634,47 +659,52 @@ void FGPredictor::update( double dt ) {
 
 
 FGDigitalFilter::FGDigitalFilter(SGPropertyNode *node):
-    FGXMLAutoComponent( node ),
+    FGXMLAutoComponent(),
     filterType(none)
 {
-    int i;
-    for ( i = 0; i < node->nChildren(); ++i ) {
-        SGPropertyNode *child = node->getChild(i);
-        string cname = child->getName();
-        string cval = child->getStringValue();
-        if ( cname == "type" ) {
-            if ( cval == "exponential" ) {
-                filterType = exponential;
-            } else if (cval == "double-exponential") {
-                filterType = doubleExponential;
-            } else if (cval == "moving-average") {
-                filterType = movingAverage;
-            } else if (cval == "noise-spike") {
-                filterType = noiseSpike;
-            } else if (cval == "gain") {
-                filterType = gain;
-            } else if (cval == "reciprocal") {
-                filterType = reciprocal;
-            }
-        } else if ( cname == "filter-time" ) {
-            TfInput.push_back( new FGXMLAutoInput( child, 1.0 ) );
-            if( filterType == none ) filterType = exponential;
-        } else if ( cname == "samples" ) {
-            samplesInput.push_back( new FGXMLAutoInput( child, 1 ) );
-            if( filterType == none ) filterType = movingAverage;
-        } else if ( cname == "max-rate-of-change" ) {
-            rateOfChangeInput.push_back( new FGXMLAutoInput( child, 1 ) );
-            if( filterType == none ) filterType = noiseSpike;
-        } else if ( cname == "gain" ) {
-            gainInput.push_back( new FGXMLAutoInput( child, 1 ) );
-            if( filterType == none ) filterType = gain;
-        }
-    }
+    parseNode(node);
 
     output.resize(2, 0.0);
     input.resize(samplesInput.get_value() + 1, 0.0);
 }
 
+
+bool FGDigitalFilter::parseNodeHook(const string& aName, SGPropertyNode* aNode)
+{
+  if (aName == "type" ) {
+    string val(aNode->getStringValue());
+    if ( val == "exponential" ) {
+      filterType = exponential;
+    } else if (val == "double-exponential") {
+      filterType = doubleExponential;
+    } else if (val == "moving-average") {
+      filterType = movingAverage;
+    } else if (val == "noise-spike") {
+      filterType = noiseSpike;
+    } else if (val == "gain") {
+      filterType = gain;
+    } else if (val == "reciprocal") {
+      filterType = reciprocal;
+    }
+  } else if (aName == "filter-time" ) {
+    TfInput.push_back( new FGXMLAutoInput( aNode, 1.0 ) );
+    if( filterType == none ) filterType = exponential;
+  } else if (aName == "samples" ) {
+    samplesInput.push_back( new FGXMLAutoInput( aNode, 1 ) );
+    if( filterType == none ) filterType = movingAverage;
+  } else if (aName == "max-rate-of-change" ) {
+    rateOfChangeInput.push_back( new FGXMLAutoInput( aNode, 1 ) );
+    if( filterType == none ) filterType = noiseSpike;
+  } else if (aName == "gain" ) {
+    gainInput.push_back( new FGXMLAutoInput( aNode, 1 ) );
+    if( filterType == none ) filterType = gain;
+  } else {
+    return false; // not handled by us, let the base class try
+  }
+  
+  return true;
+}
+
 void FGDigitalFilter::update(double dt)
 {
     if ( isPropertyEnabled() ) {
@@ -795,9 +825,9 @@ void FGXMLAutopilot::init() {
                         " details.");
                 exit(-1);
             }        
-        } catch (const sg_exception&) {
+        } catch (const sg_exception& e) {
             SG_LOG( SG_ALL, SG_ALERT, "Failed to load autopilot configuration: "
-                    << config.str() );
+                    << config.str() << ":" << e.getMessage() );
         }
 
     } else {
index bbe122631d4f1532fe48e624288064fe1db47ba3..3f68fb20c31f8283f4e36a5464f8fd91eb12a698 100644 (file)
 #ifndef _XMLAUTO_HXX
 #define _XMLAUTO_HXX 1
 
-#ifndef __cplusplus
-# error This library requires C++
-#endif
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 #include <simgear/compiler.h>
 
 #include <string>
 #include <vector>
 #include <deque>
 
-using std::string;
-using std::vector;
-using std::deque;
-
 #include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/props/condition.hxx>
 
-#include <Main/fg_props.hxx>
-
 
 class FGXMLAutoInput : public SGReferenced {
 private:
@@ -61,18 +47,8 @@ private:
      SGSharedPtr<const SGCondition> _condition;
 
 public:
-    FGXMLAutoInput( SGPropertyNode_ptr node = NULL, double value = 0.0, double offset = 0.0, double scale = 1.0 ) :
-      value(0.0),
-      abs(false),
-      property(NULL),
-      offset(NULL),
-      scale(NULL),
-      min(NULL),
-      max(NULL),
-      _condition(NULL) {
-       parse( node, value, offset, scale );
-     }
-
+    FGXMLAutoInput( SGPropertyNode_ptr node = NULL, double value = 0.0, double offset = 0.0, double scale = 1.0 );
+    
     void parse( SGPropertyNode_ptr, double value = 0.0, double offset = 0.0, double scale = 1.0 );
 
     /* get the value of this input, apply scale and offset and clipping */
@@ -95,7 +71,7 @@ public:
 
 };
 
-class FGXMLAutoInputList : public vector<SGSharedPtr<FGXMLAutoInput> > {
+class FGXMLAutoInputList : public std::vector<SGSharedPtr<FGXMLAutoInput> > {
   public:
     FGXMLAutoInput * get_active() {
       for (iterator it = begin(); it != end(); ++it) {
@@ -119,16 +95,16 @@ class FGXMLAutoInputList : public vector<SGSharedPtr<FGXMLAutoInput> > {
 class FGXMLAutoComponent : public SGReferenced {
 
 private:
-    vector <SGPropertyNode_ptr> output_list;
+    std::vector <SGPropertyNode_ptr> output_list;
 
     SGSharedPtr<const SGCondition> _condition;
     SGPropertyNode_ptr enable_prop;
-    string * enable_value;
+    std::string * enable_value;
 
     SGPropertyNode_ptr passive_mode;
     bool honor_passive;
 
-    string name;
+    std::string name;
 
     /* Feed back output property to input property if
        this filter is disabled. This is for multi-stage
@@ -141,6 +117,31 @@ private:
     void do_feedback_if_disabled();
 
 protected:
+    FGXMLAutoComponent();
+    
+    /*
+     * Parse a component specification read from a property-list.
+     * Calls the hook methods below to allow derived classes to
+     * specialise parsing bevaiour.
+     */
+    void parseNode(SGPropertyNode* aNode);
+
+    /**
+     * Helper to parse the config section
+     */
+    void parseConfig(SGPropertyNode* aConfig);
+
+    /*
+     * Over-rideable hook method to allow derived classes to refine top-level
+     * node parsing. Return true if the node was handled, false otherwise.
+     */
+    virtual bool parseNodeHook(const std::string& aName, SGPropertyNode* aNode);
+    
+    /**
+     * Over-rideable hook method to allow derived classes to refine config
+     * node parsing. Return true if the node was handled, false otherwise.
+     */
+    virtual bool parseConfigHook(const std::string& aName, SGPropertyNode* aNode);
 
     FGXMLAutoInputList valueInput;
     FGXMLAutoInputList referenceInput;
@@ -156,13 +157,12 @@ protected:
     }
 
 public:
-
-    FGXMLAutoComponent( SGPropertyNode *node);
+    
     virtual ~FGXMLAutoComponent();
 
     virtual void update (double dt)=0;
     
-    inline const string& get_name() { return name; }
+    inline const std::string& get_name() { return name; }
 
     double clamp( double value );
 
@@ -173,7 +173,7 @@ public:
         // helpful for things like flight directors which position
         // their vbars from the autopilot computations.
         if ( honor_passive && passive_mode->getBoolValue() ) return;
-        for( vector <SGPropertyNode_ptr>::iterator it = output_list.begin(); it != output_list.end(); ++it)
+        for( std::vector <SGPropertyNode_ptr>::iterator it = output_list.begin(); it != output_list.end(); ++it)
           (*it)->setDoubleValue( clamp( value ) );
     }
 
@@ -252,7 +252,9 @@ private:
     double desiredTs;            // desired sampling interval (sec)
     double elapsedTime;          // elapsed time (sec)
     
-    
+
+protected:
+  bool parseConfigHook(const std::string& aName, SGPropertyNode* aNode);
     
 public:
 
@@ -279,6 +281,8 @@ private:
     FGXMLAutoInputList Ki;
     double int_sum;
 
+protected:
+  bool parseConfigHook(const std::string& aName, SGPropertyNode* aNode);
 
 public:
 
@@ -301,6 +305,9 @@ private:
     FGXMLAutoInputList seconds;
     FGXMLAutoInputList filter_gain;
 
+protected:
+  bool parseNodeHook(const std::string& aName, SGPropertyNode* aNode);
+
 public:
     FGPredictor( SGPropertyNode *node );
     ~FGPredictor() {}
@@ -329,12 +336,15 @@ private:
     FGXMLAutoInputList gainInput;     // 
     FGXMLAutoInputList TfInput;            // Filter time [s]
 
-    deque <double> output;
-    deque <double> input;
+    std::deque <double> output;
+    std::deque <double> input;
     enum filterTypes { exponential, doubleExponential, movingAverage,
                        noiseSpike, gain, reciprocal, none };
     filterTypes filterType;
 
+protected:
+  bool parseNodeHook(const std::string& aName, SGPropertyNode* aNode);
+  
 public:
     FGDigitalFilter(SGPropertyNode *node);
     ~FGDigitalFilter() {}
@@ -365,7 +375,7 @@ public:
 
 protected:
 
-    typedef vector<SGSharedPtr<FGXMLAutoComponent> > comp_list;
+    typedef std::vector<SGSharedPtr<FGXMLAutoComponent> > comp_list;
 
 private:
 
index 6673184e4bdae16d5760989e7141d4220117b3db..aae7bf22e2cf4dbe655099e600604ff587b80af6 100644 (file)
@@ -429,9 +429,9 @@ void drawHUD(osg::State* state)
         = fgGetNode("/autopilot/locks/altitude", true);
 
     static char hud_hdg_text[256];
-    static char hud_wp0_text[256];
-    static char hud_wp1_text[256];
-    static char hud_wp2_text[256];
+    static char hud_gps_text0[256];
+    static char hud_gps_text1[256];
+    static char hud_gps_text2[256];
     static char hud_alt_text[256];
 
     glEnable(GL_BLEND);
@@ -468,32 +468,42 @@ void drawHUD(osg::State* state)
                   fgGetDouble("/autopilot/settings/true-heading-deg") );
         HUD_TextList.add( fgText( 40, apY, hud_hdg_text ) );
         apY -= 15;
-
-        string wp0_id = fgGetString( "/autopilot/route-manager/wp[0]/id" );
-        if ( wp0_id.length() > 0 ) {
-            snprintf( hud_wp0_text, 256, "%5s %6.1fnm %s", wp0_id.c_str(),
-                      fgGetDouble( "/autopilot/route-manager/wp[0]/dist" ),
-                      fgGetString( "/autopilot/route-manager/wp[0]/eta" ) );
-            HUD_TextList.add( fgText( 40, apY, hud_wp0_text ) );
-            apY -= 15;
-        }
-        string wp1_id = fgGetString( "/autopilot/route-manager/wp[1]/id" );
-        if ( wp1_id.length() > 0 ) {
-            snprintf( hud_wp1_text, 256, "%5s %6.1fnm %s", wp1_id.c_str(),
-                      fgGetDouble( "/autopilot/route-manager/wp[1]/dist" ),
-                      fgGetString( "/autopilot/route-manager/wp[1]/eta" ) );
-            HUD_TextList.add( fgText( 40, apY, hud_wp1_text ) );
-            apY -= 15;
-        }
-        string wp2_id = fgGetString( "/autopilot/route-manager/wp-last/id" );
-        if ( wp2_id.length() > 0 ) {
-            snprintf( hud_wp2_text, 256, "%5s %6.1fnm %s", wp2_id.c_str(),
-                      fgGetDouble( "/autopilot/route-manager/wp-last/dist" ),
-                      fgGetString( "/autopilot/route-manager/wp-last/eta" ) );
-            HUD_TextList.add( fgText( 40, apY, hud_wp2_text ) );
-            apY -= 15;
-        }
     }
+  
+  // GPS current waypoint information
+    SGPropertyNode_ptr gps = fgGetNode("/instrumentation/gps", true);
+    SGPropertyNode_ptr curWp = gps->getChild("wp")->getChild("wp",1);
+    
+    if ((gps->getDoubleValue("raim") > 0.5) && curWp) {
+      // GPS is receiving a valid signal
+      snprintf(hud_gps_text0, 256, "WPT:%5s BRG:%03.0f %5.1fnm",
+        curWp->getStringValue("ID"),
+        curWp->getDoubleValue("bearing-mag-deg"),
+        curWp->getDoubleValue("distance-nm"));
+      HUD_TextList.add( fgText( 40, apY, hud_gps_text0 ) );
+      apY -= 15;
+       
+       // curWp->getStringValue("TTW")
+      snprintf(hud_gps_text2, 256, "ETA %s", curWp->getStringValue("TTW"));
+      HUD_TextList.add( fgText( 40, apY, hud_gps_text2 ) );
+      apY -= 15;
+      
+      double courseError = curWp->getDoubleValue("course-error-nm");
+      if (fabs(courseError) >= 0.01) {
+        // generate an arrow indicatinng if the pilot should turn left or right
+        char dir = (courseError < 0.0) ? '<' : '>';
+        snprintf(hud_gps_text1, 256, "GPS TRK:%03.0f XTRK:%c%4.2fnm",
+          gps->getDoubleValue("indicated-track-magnetic-deg"), dir, fabs(courseError));
+      } else { // on course, don't bother showing the XTRK error
+        snprintf(hud_gps_text1, 256, "GPS TRK:%03.0f",
+          gps->getDoubleValue("indicated-track-magnetic-deg"));
+      }
+      
+      HUD_TextList.add( fgText( 40, apY, hud_gps_text1) );
+      apY -= 15;
+    } // of valid GPS output
+    
+  ////////////////////
 
     if ( strcmp( altitude_enabled->getStringValue(), "altitude-hold" ) == 0 ) {
         snprintf( hud_alt_text, 256, "alt = %.0f\n",
index f59f93c8ffdae34d2c95a99886920b67a4715534..fdb6b26868321f96c723a3e48354e27d33c90bc0 100644 (file)
@@ -260,7 +260,7 @@ readTransformation (const SGPropertyNode * node, float w_scale, float h_scale)
   SGPropertyNode * target = 0;
 
   if (type.empty()) {
-    SG_LOG( SG_COCKPIT, SG_INFO,
+    SG_LOG( SG_COCKPIT, SG_BULK,
             "No type supplied for transformation " << name
             << " assuming \"rotation\"" );
     type = "rotation";
@@ -282,7 +282,7 @@ readTransformation (const SGPropertyNode * node, float w_scale, float h_scale)
                                // Check for an interpolation table
   const SGPropertyNode * trans_table = node->getNode("interpolation");
   if (trans_table != 0) {
-    SG_LOG( SG_COCKPIT, SG_INFO, "Found interpolation table with "
+    SG_LOG( SG_COCKPIT, SG_DEBUG, "Found interpolation table with "
             << trans_table->nChildren() << " children" );
     t->table = new SGInterpTable(trans_table);
   } else {
@@ -430,7 +430,7 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
 
 
   if (type.empty()) {
-    SG_LOG( SG_COCKPIT, SG_INFO,
+    SG_LOG( SG_COCKPIT, SG_BULK,
             "No type supplied for layer " << name
             << " assuming \"texture\"" );
     type = "texture";
@@ -641,7 +641,6 @@ readInstrument (const SGPropertyNode * node)
   }
 
   readConditions(instrument, node);
-  SG_LOG( SG_COCKPIT, SG_DEBUG, "Done reading instrument " << name );
   return instrument;
 }
 
@@ -784,7 +783,7 @@ readPanel (const SGPropertyNode * root)
             h = real_h;
           }
           
-          SG_LOG( SG_COCKPIT, SG_DEBUG, "Reading instrument " << name );
+          SG_LOG( SG_COCKPIT, SG_BULK, "Reading instrument " << name );
           
           // Warning - hardwired size!!!
           RenderArea2D* instrument = new RenderArea2D(158, 40, 158, 40, x, y);
index a15c943ed47aba514bddb6212459f38f9a85c3fc..099669586a82b41f046ef5a7ecedb91d58be26ca 100644 (file)
@@ -260,6 +260,21 @@ double FGAtmo::QNH(const double field_elev, const double field_press) {
     return rslt;
 }
 
+// Invert the QNH calculation to get the field pressure from a metar
+// report.
+// field pressure _in pascals_ 
+//  ... caller gets to convert to inHg or millibars
+// Field elevation in m
+// Altimeter setting (QNH) in pascals
+// Valid for fields within the troposphere only.
+double FGAtmo::fieldPressure(const double field_elev, const double qnh)
+{
+    using namespace atmodel;
+    static const double nn = ISA::lam0 * Rgas / g / mm;
+    const double pratio = pow(qnh / ISA::P0, nn);
+    return ISA::P0 * pow(pratio - field_elev * ISA::lam0 / ISA::T0, 1.0 / nn);
+}
+
 void FGAltimeter::dump_stack1(const double Tref) {
     using namespace atmodel;
     const int bs(200);
index 55ccfb3f9e580a76d6d08c4ee1006fcb714bef02..1ee4e1b6beeaa58da610de8d854737f0b31f4bc5 100644 (file)
@@ -110,6 +110,15 @@ public:
 // Field pressure in pascals
 // Valid for fields within the troposphere only.
     double QNH(const double field_elev, const double field_press);
+/**
+ * Invert the QNH calculation to get the field pressure from a metar
+ * report. Valid for fields within the troposphere only.
+ * @param field_elev field elevation in m
+ * @param qnh altimeter setting in pascals
+ * @return field pressure _in pascals_. Caller gets to convert to inHg
+ * or millibars 
+ */
+    static double fieldPressure(const double field_elev, const double qnh);
 };
 
 
index 5b9cfcfb99744b5e0a72843dbb252f57ab1518d8..0aa3572f6dca179ae109da33ddbe0ce45fc45490 100644 (file)
@@ -34,6 +34,7 @@
 #include <Main/fg_props.hxx>
 #include <Main/util.hxx>
 
+#include "atmosphere.hxx"
 #include "fgmetar.hxx"
 #include "environment_ctrl.hxx"
 
@@ -44,6 +45,10 @@ public:
        virtual bool passAirport(FGAirport* aApt) const {
                return aApt->getMetar();
        }
+  
+  // permit heliports and seaports too
+  virtual FGPositioned::Type maxType() const
+  { return FGPositioned::SEAPORT; }
 };
 
 static AirportWithMetar airportWithMetarFilter;
@@ -433,6 +438,25 @@ static inline double convert_to_180( double d )
        return d > 180.0 ? d - 360.0 : d;
 }
 
+// Return the sea level pressure for a metar observation, in inHg.
+// This is different from QNH because it accounts for the current
+// temperature at the observation point.
+// metarPressure in inHg
+// fieldHt in ft
+// fieldTemp in C
+
+static double reducePressureSl(double metarPressure, double fieldHt,
+                               double fieldTemp)
+{
+    double elev = fieldHt * SG_FEET_TO_METER;
+    double fieldPressure
+        = FGAtmo::fieldPressure(elev, metarPressure * atmodel::inHg);
+    double slPressure = P_layer(0, elev, fieldPressure,
+                                fieldTemp + atmodel::freezing,
+                                atmodel::ISA::lam0);
+    return slPressure / atmodel::inHg;
+}
+
 void
 FGMetarCtrl::update(double dt)
 {
@@ -444,6 +468,7 @@ FGMetarCtrl::update(double dt)
 
        bool reinit_required = false;
        bool layer_rebuild_required = false;
+        double station_elevation_ft = station_elevation_n->getDoubleValue();
 
        if (first_update) {
                double dir = base_wind_dir_n->getDoubleValue()+magnetic_variation_n->getDoubleValue();
@@ -455,7 +480,10 @@ FGMetarCtrl::update(double dt)
                fgDefaultWeatherValue("visibility-m", metarvis);
 
                double metarpressure = pressure_n->getDoubleValue();
-               fgDefaultWeatherValue("pressure-sea-level-inhg", metarpressure);
+               fgDefaultWeatherValue("pressure-sea-level-inhg",
+                                      reducePressureSl(metarpressure,
+                                                       station_elevation_ft,
+                                                       temperature_n->getDoubleValue()));
 
                // We haven't already loaded a METAR, so apply it immediately.
                vector<SGPropertyNode_ptr> layers = clouds_n->getChildren("layer");
@@ -597,8 +625,11 @@ FGMetarCtrl::update(double dt)
 
                double pressure = boundary_sea_level_pressure_n->getDoubleValue();
                double metarpressure = pressure_n->getDoubleValue();
-               if( pressure != metarpressure ) {
-                       pressure = interpolate_val( pressure, metarpressure, MaxPressureChangeInHgSec );
+                double newpressure = reducePressureSl(metarpressure,
+                                                      station_elevation_ft,
+                                                      temperature_n->getDoubleValue());
+               if( pressure != newpressure ) {
+                       pressure = interpolate_val( pressure, newpressure, MaxPressureChangeInHgSec );
                        fgDefaultWeatherValue("pressure-sea-level-inhg", pressure);
                        reinit_required = true;
                }
@@ -666,11 +697,8 @@ FGMetarCtrl::update(double dt)
                        }
                }
        }
-       {
-               double station_elevation_ft = station_elevation_n->getDoubleValue();
-               set_temp_at_altitude(temperature_n->getDoubleValue(), station_elevation_ft);
-               set_dewpoint_at_altitude(dewpoint_n->getDoubleValue(), station_elevation_ft);
-       }
+        set_temp_at_altitude(temperature_n->getDoubleValue(), station_elevation_ft);
+        set_dewpoint_at_altitude(dewpoint_n->getDoubleValue(), station_elevation_ft);
        //TODO: check if temperature/dewpoint have changed. This requires reinit.
 
        // Force an update of the 3D clouds
index 1498a00f47096502c7386c14c327a6657b20427b..606a4973e8a5e2ae964b619a46dfefcf07e6a514 100644 (file)
@@ -75,9 +75,11 @@ void FGClouds::init(void) {
        }
 }
 
-void FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_def_root, const string& name, sgVec3 pos, SGCloudField *layer) {
+// Build an invidual cloud. Returns the extents of the cloud for coverage calculations
+double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_def_root, const string& name, double grid_z_rand, SGCloudField *layer) {
        SGPropertyNode *box_def=NULL;
        SGPropertyNode *cld_def=NULL;
+       double extent = 0.0;
 
        SGPath texture_root = globals->get_fg_root();
        texture_root.append("Textures");
@@ -91,55 +93,97 @@ void FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_de
                        box_def = box_def_root->getChild(base_name.c_str());
                }
                if( !box_def )
-                       return;
+                       return 0.0;
        }
+
+       double x = sg_random() * SGCloudField::fieldSize - (SGCloudField::fieldSize / 2.0);
+       double y = sg_random() * SGCloudField::fieldSize - (SGCloudField::fieldSize / 2.0);
+       double z = grid_z_rand * (sg_random() - 0.5);
+               
+       sgVec3 pos={x,y,z};
+       
         
        for(int i = 0; i < box_def->nChildren() ; i++) {
                SGPropertyNode *abox = box_def->getChild(i);
                if( strcmp(abox->getName(), "box") == 0) {
-                       double x = abox->getDoubleValue("x") + pos[0];
-                       double y = abox->getDoubleValue("y") + pos[1];
-                       double z = abox->getDoubleValue("z") + pos[2];
-                       SGVec3f newpos = SGVec3f(x, z, y);
-                        
+
                        string type = abox->getStringValue("type", "cu-small");
-                               
                        cld_def = cloud_def_root->getChild(type.c_str());
-                       if ( !cld_def ) return;
-                        
-                       double min_width = cld_def->getDoubleValue("min-cloud-width-m", 500.0);
-                       double max_width = cld_def->getDoubleValue("max-cloud-width-m", 1000.0);
-                       double min_height = cld_def->getDoubleValue("min-cloud-height-m", min_width);
-                       double max_height = cld_def->getDoubleValue("max-cloud-height-m", max_width);
-                       double min_sprite_width = cld_def->getDoubleValue("min-sprite-width-m", 200.0);
-                       double max_sprite_width = cld_def->getDoubleValue("max-sprite-width-m", min_sprite_width);
-                       double min_sprite_height = cld_def->getDoubleValue("min-sprite-height-m", min_sprite_width);
-                       double max_sprite_height = cld_def->getDoubleValue("max-sprite-height-m", max_sprite_width);
-                       int num_sprites = cld_def->getIntValue("num-sprites", 20);
-                       int num_textures_x = cld_def->getIntValue("num-textures-x", 1);
-                       int num_textures_y = cld_def->getIntValue("num-textures-y", 1);
-                       double bottom_shade = cld_def->getDoubleValue("bottom-shade", 1.0);
-                       string texture = cld_def->getStringValue("texture", "cl_cumulus.rgb");
-
-                       SGNewCloud *cld = 
-                               new SGNewCloud(type,
-                                       texture_root, 
-                                       texture, 
-                                       min_width, 
-                                       max_width, 
-                                       min_height,
-                                       max_height,
-                                       min_sprite_width,
-                                       max_sprite_width,
-                                       min_sprite_height,
-                                       max_sprite_height,
-                                       bottom_shade,
-                                       num_sprites,
-                                       num_textures_x,
-                                       num_textures_y);
-                       layer->addCloud(newpos, cld);
+                       if ( !cld_def ) return 0.0;
+                       
+                       double w = abox->getDoubleValue("width", 1000.0);
+                       double h = abox->getDoubleValue("height", 1000.0);
+                       int hdist = abox->getIntValue("hdist", 1);
+                       int vdist = abox->getIntValue("vdist", 1);
+
+                       double c = abox->getDoubleValue("count", 5);
+                       int count = (int) (c + (sg_random() - 0.5) * c);
+
+                       extent = max(w*w, extent);
+
+                       for (int j = 0; j < count; j++) {
+
+                               // Locate the clouds randomly in the defined space. The hdist and
+                               // vdist values control the horizontal and vertical distribution
+                               // by simply summing random components.
+                               double x = 0.0;
+                               double y = 0.0;
+                               double z = 0.0;
+
+                               for (int k = 0; k < hdist; k++)
+                               {
+                                       x += (sg_random() / hdist);
+                                       y += (sg_random() / hdist);
+                               }
+
+                               for (int k = 0; k < vdist; k++)
+                               {
+                                       z += (sg_random() / vdist);
+                               }
+
+                               x = w * (x - 0.5) + pos[0]; // N/S
+                               y = w * (y - 0.5) + pos[1]; // E/W
+                               z = h * z + pos[2]; // Up/Down. pos[2] is the cloudbase
+
+                               SGVec3f newpos = SGVec3f(x, y, z);
+
+                               double min_width = cld_def->getDoubleValue("min-cloud-width-m", 500.0);
+                               double max_width = cld_def->getDoubleValue("max-cloud-width-m", 1000.0);
+                               double min_height = cld_def->getDoubleValue("min-cloud-height-m", min_width);
+                               double max_height = cld_def->getDoubleValue("max-cloud-height-m", max_width);
+                               double min_sprite_width = cld_def->getDoubleValue("min-sprite-width-m", 200.0);
+                               double max_sprite_width = cld_def->getDoubleValue("max-sprite-width-m", min_sprite_width);
+                               double min_sprite_height = cld_def->getDoubleValue("min-sprite-height-m", min_sprite_width);
+                               double max_sprite_height = cld_def->getDoubleValue("max-sprite-height-m", max_sprite_width);
+                               int num_sprites = cld_def->getIntValue("num-sprites", 20);
+                               int num_textures_x = cld_def->getIntValue("num-textures-x", 1);
+                               int num_textures_y = cld_def->getIntValue("num-textures-y", 1);
+                               double bottom_shade = cld_def->getDoubleValue("bottom-shade", 1.0);
+                               string texture = cld_def->getStringValue("texture", "cu.png");
+
+                               SGNewCloud *cld = 
+                                       new SGNewCloud(type,
+                                               texture_root, 
+                                               texture, 
+                                               min_width, 
+                                               max_width, 
+                                               min_height,
+                                               max_height,
+                                               min_sprite_width,
+                                               max_sprite_width,
+                                               min_sprite_height,
+                                               max_sprite_height,
+                                               bottom_shade,
+                                               num_sprites,
+                                               num_textures_x,
+                                               num_textures_y);
+                               layer->addCloud(newpos, cld);
+                       }
                }
        }
+
+       // Return the maximum extent of the cloud
+       return extent;
 }
 
 void FGClouds::buildLayer(int iLayer, const string& name, double alt, double coverage) {
@@ -176,14 +220,10 @@ void FGClouds::buildLayer(int iLayer, const string& name, double alt, double cov
                        return;
                }
        }
-        
+
        // At this point, we know we've got some 3D clouds to generate.
        thesky->get_cloud_layer(iLayer)->set_enable3dClouds(true);
 
-       double grid_x_size = layer_def->getDoubleValue("grid-x-size", 1000.0);
-       double grid_y_size = layer_def->getDoubleValue("grid-y-size", 1000.0);
-       double grid_x_rand = layer_def->getDoubleValue("grid-x-rand", grid_x_size);
-       double grid_y_rand = layer_def->getDoubleValue("grid-y-rand", grid_y_size);
        double grid_z_rand = layer_def->getDoubleValue("grid-z-rand");
 
        for(int i = 0; i < layer_def->nChildren() ; i++) {
@@ -207,32 +247,26 @@ void FGClouds::buildLayer(int iLayer, const string& name, double alt, double cov
                }
        }
        totalCount = 1.0 / totalCount;
-        
-       for(double px = 0.0; px < SGCloudField::fieldSize; px += grid_x_size) {
-               for(double py = 0.0; py < SGCloudField::fieldSize; py += grid_y_size) {
-                       double x = px + grid_x_rand * (sg_random() - 0.5) - (SGCloudField::fieldSize / 2.0);
-                       double y = py + grid_y_rand * (sg_random() - 0.5) - (SGCloudField::fieldSize / 2.0);
-                       double z = grid_z_rand * (sg_random() - 0.5);
-                        
-                       if (sg_random() < coverage) {
-                               double choice = sg_random();
+
+        // Determine how much cloud coverage we need in m^2.
+        double cov = coverage * SGCloudField::fieldSize * SGCloudField::fieldSize;
+
+        while (cov > 0.0f) {
+               double choice = sg_random();
     
-                               for(int i = 0; i < CloudVarietyCount ; i ++) {
-                                       choice -= tCloudVariety[i].count * totalCount;
-                                       if( choice <= 0.0 ) {
-                                               sgVec3 pos={x,z,y};
-
-                                               buildCloud(cloud_def_root, 
-                                                       box_def_root, 
-                                                       tCloudVariety[i].name, 
-                                                       pos, 
-                                                       layer);
-                                               break;
-                                       }
-                               }
+               for(int i = 0; i < CloudVarietyCount ; i ++) {
+                       choice -= tCloudVariety[i].count * totalCount;
+                       if( choice <= 0.0 ) {
+                               cov -= buildCloud(cloud_def_root,
+                                               box_def_root,
+                                               tCloudVariety[i].name,
+                                               grid_z_rand,
+                                               layer);
+                               break;
                        }
                }
-       }
+               
+        }
 
        // Now we've built any clouds, enable them and set the density (coverage)
        //layer->setCoverage(coverage);
index fd7ca885ab9fb3065881ae0f0632feb50c062803..8a956d74829c05b05c9f8ae973ce731bae7e8a18 100644 (file)
@@ -43,7 +43,7 @@ class FGMetar;
 class FGClouds {
 
 private:
-void buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_def_root, const string& name, sgVec3 pos, SGCloudField *layer);
+       double buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_def_root, const string& name, double grid_z_rand, SGCloudField *layer);
        void buildLayer(int iLayer, const string& name, double alt, double coverage);
 
        void buildCloudLayers(void);
index c6740b4b6ab1e5485e64b0804d6096a615c90e50..6851223810d1208eaca2be7bc291c05f934a3963 100644 (file)
@@ -43,29 +43,32 @@ INCLUDES
 
 #include "FGFDMExec.h"
 #include "FGState.h"
-#include <models/FGAtmosphere.h>
-#include <models/atmosphere/FGMSIS.h>
-#include <models/atmosphere/FGMars.h>
-#include <models/FGFCS.h>
-#include <models/FGPropulsion.h>
-#include <models/FGMassBalance.h>
-#include <models/FGGroundReactions.h>
-#include <models/FGExternalReactions.h>
-#include <models/FGBuoyantForces.h>
-#include <models/FGAerodynamics.h>
-#include <models/FGInertial.h>
-#include <models/FGAircraft.h>
-#include <models/FGPropagate.h>
-#include <models/FGAuxiliary.h>
-#include <models/FGInput.h>
-#include <models/FGOutput.h>
-#include <initialization/FGInitialCondition.h>
-//#include <initialization/FGTrimAnalysis.h> // Remove until later
-#include <input_output/FGPropertyManager.h>
-#include <input_output/FGScript.h>
+#include "models/FGAtmosphere.h"
+#include "models/atmosphere/FGMSIS.h"
+#include "models/atmosphere/FGMars.h"
+#include "models/FGFCS.h"
+#include "models/FGPropulsion.h"
+#include "models/FGMassBalance.h"
+#include "models/FGGroundReactions.h"
+#include "models/FGExternalReactions.h"
+#include "models/FGBuoyantForces.h"
+#include "models/FGAerodynamics.h"
+#include "models/FGInertial.h"
+#include "models/FGAircraft.h"
+#include "models/FGPropagate.h"
+#include "models/FGAuxiliary.h"
+#include "models/FGInput.h"
+#include "models/FGOutput.h"
+#include "initialization/FGInitialCondition.h"
+//#include "initialization/FGTrimAnalysis.h" // Remove until later
+#include "input_output/FGPropertyManager.h"
+#include "input_output/FGScript.h"
 
 #include <iostream>
 #include <iterator>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -91,7 +94,8 @@ void checkTied ( FGPropertyManager *node )
   for (int i=0; i<N; i++) {
     if (node->getChild(i)->nChildren() ) {
       checkTied( (FGPropertyManager*)node->getChild(i) );
-    } else if ( node->getChild(i)->isTied() ) {
+    }
+    if ( node->getChild(i)->isTied() ) {
       name = ((FGPropertyManager*)node->getChild(i))->GetFullyQualifiedName();
       node->Untie(name);
     }
@@ -105,7 +109,6 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root) : Root(root)
 {
 
   Frame           = 0;
-  FirstModel      = 0;
   Error           = 0;
   GroundCallback  = 0;
   State           = 0;
@@ -218,30 +221,11 @@ bool FGFDMExec::Allocate(void)
                                        // class needs valid pointers to the above
                                        // model classes
 
-  // Initialize models so they can communicate with each other
-
-  Atmosphere->InitModel();
-  FCS->InitModel();
-  Propulsion->InitModel();
-  MassBalance->InitModel();
-  Aerodynamics->InitModel();
-  Inertial->InitModel();
-  GroundReactions->InitModel();
-  ExternalReactions->InitModel();
-  BuoyantForces->InitModel();
-  Aircraft->InitModel();
-  Propagate->InitModel();
-  Auxiliary->InitModel();
-  Input->InitModel();
-
-  IC = new FGInitialCondition(this);
-
   // Schedule a model. The second arg (the integer) is the pass number. For
-  // instance, the atmosphere model could get executed every fifth pass it is called
-  // by the executive. IC and Trim objects are NOT scheduled.
-
+  // instance, the atmosphere model could get executed every fifth pass it is called.
+  
   Schedule(Input,           1);
-  Schedule(Atmosphere,      1);
+  Schedule(Atmosphere,      30);
   Schedule(FCS,             1);
   Schedule(Propulsion,      1);
   Schedule(MassBalance,     1);
@@ -254,6 +238,13 @@ bool FGFDMExec::Allocate(void)
   Schedule(Propagate,       1);
   Schedule(Auxiliary,       1);
 
+  // Initialize models so they can communicate with each other
+
+  vector <FGModel*>::iterator it;
+  for (it = Models.begin(); it != Models.end(); ++it) (*it)->InitModel();
+
+  IC = new FGInitialCondition(this);
+
   modelLoaded = false;
 
   return result;
@@ -287,7 +278,6 @@ bool FGFDMExec::DeAllocate(void)
 
   delete GroundCallback;
 
-  FirstModel  = 0L;
   Error       = 0;
 
   State           = 0;
@@ -306,35 +296,18 @@ bool FGFDMExec::DeAllocate(void)
   Auxiliary       = 0;
   Script          = 0;
 
+  Models.clear();
+
   modelLoaded = false;
   return modelLoaded;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-int FGFDMExec::Schedule(FGModel* model, int rate)
+void FGFDMExec::Schedule(FGModel* model, int rate)
 {
-  FGModel* model_iterator;
-
-  model_iterator = FirstModel;
-
-  if (model_iterator == 0L) {                  // this is the first model
-
-    FirstModel = model;
-    FirstModel->NextModel = 0L;
-    FirstModel->SetRate(rate);
-
-  } else {                                     // subsequent model
-
-    while (model_iterator->NextModel != 0L) {
-      model_iterator = model_iterator->NextModel;
-    }
-    model_iterator->NextModel = model;
-    model_iterator->NextModel->SetRate(rate);
-
-  }
-
-  return 0;
+  model->SetRate(rate);
+  Models.push_back(model);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -342,10 +315,6 @@ int FGFDMExec::Schedule(FGModel* model, int rate)
 bool FGFDMExec::Run(void)
 {
   bool success=true;
-  FGModel* model_iterator;
-
-  model_iterator = FirstModel;
-  if (model_iterator == 0L) return false;
 
   Debug(2);
 
@@ -354,14 +323,11 @@ bool FGFDMExec::Run(void)
     ChildFDMList[i]->Run();
   }
 
-  // returns true if success
-  // false if complete
+  // returns true if success, false if complete
   if (Script != 0 && !State->IntegrationSuspended()) success = Script->RunScript();
 
-  while (model_iterator != 0L) {
-    model_iterator->Run();
-    model_iterator = model_iterator->NextModel;
-  }
+  vector <FGModel*>::iterator it;
+  for (it = Models.begin(); it != Models.end(); ++it) (*it)->Run();
 
   Frame++;
   if (!Holding()) State->IncrTime();
@@ -403,15 +369,10 @@ void FGFDMExec::ResetToInitialConditions(int mode)
 
 void FGFDMExec::ResetToInitialConditions(void)
 {
-  FGModel* model_iterator;
-
-  model_iterator = FirstModel;
-  if (model_iterator == 0L || Constructing) return;
+  if (Constructing) return;
 
-  while (model_iterator != 0L) {
-    model_iterator->InitModel();
-    model_iterator = model_iterator->NextModel;
-  }
+  vector <FGModel*>::iterator it;
+  for (it = Models.begin(); it != Models.end(); ++it) (*it)->InitModel();
 
   RunIC();
   if (Script) Script->ResetEvents();
@@ -713,13 +674,13 @@ void FGFDMExec::BuildPropertyCatalog(struct PropertyCatalogStructure* pcs)
 {
   struct PropertyCatalogStructure* pcsNew = new struct PropertyCatalogStructure;
   int node_idx = 0;
-  char int_buf[10];
 
-  for (unsigned int i=0; i<pcs->node->nChildren(); i++) {
+  for (int i=0; i<pcs->node->nChildren(); i++) {
     pcsNew->base_string = pcs->base_string + "/" + pcs->node->getChild(i)->getName();
     node_idx = pcs->node->getChild(i)->getIndex();
-    sprintf(int_buf, "[%d]", node_idx);
-    if (node_idx != 0) pcsNew->base_string += string(int_buf);
+    if (node_idx != 0) {
+      pcsNew->base_string = CreateIndexedPropertyName(pcsNew->base_string, node_idx);
+    }
     if (pcs->node->getChild(i)->nChildren() == 0) {
       if (pcsNew->base_string.substr(0,11) == string("/fdm/jsbsim")) {
         pcsNew->base_string = pcsNew->base_string.erase(0,12);
index 50bffeaf52f0cafc5685964d6871db5e35e504ad..c1fbbb8ef1a17f228582a9d6557223bf01b66d2b 100644 (file)
@@ -41,17 +41,17 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <models/FGModel.h>
-#include <models/FGOutput.h>
-#include <models/FGInput.h>
-#include <initialization/FGTrim.h>
-#include <initialization/FGInitialCondition.h>
-#include <FGJSBBase.h>
-#include <input_output/FGPropertyManager.h>
-#include <input_output/FGGroundCallback.h>
-#include <input_output/FGXMLFileRead.h>
-#include <models/FGPropagate.h>
-#include <math/FGColumnVector3.h>
+#include "models/FGModel.h"
+#include "models/FGOutput.h"
+#include "models/FGInput.h"
+#include "initialization/FGTrim.h"
+#include "initialization/FGInitialCondition.h"
+#include "FGJSBBase.h"
+#include "input_output/FGPropertyManager.h"
+#include "input_output/FGGroundCallback.h"
+#include "input_output/FGXMLFileRead.h"
+#include "models/FGPropagate.h"
+#include "math/FGColumnVector3.h"
 
 #include <vector>
 #include <string>
@@ -222,7 +222,7 @@ public:
       @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);
+  void Schedule(FGModel* model, int rate);
 
   /** This function executes each scheduled model in succession.
       @return true if successful, false if sim should be ended  */
@@ -488,7 +488,6 @@ private:
 
   static FGPropertyManager *master;
 
-  FGModel*            FirstModel;
   FGGroundCallback*   GroundCallback;
   FGState*            State;
   FGAtmosphere*       Atmosphere;
@@ -514,6 +513,7 @@ private:
   vector <string> PropertyCatalog;
   vector <FGOutput*> Outputs;
   vector <childData*> ChildFDMList;
+  vector <FGModel*> Models;
 
   bool ReadFileHeader(Element*);
   bool ReadChild(Element*);
index 4e02407a41025ba1262d0fae46be7fbdb3029c0a..f07a4f08158fecbd18c6718e3926a2a995bc9be3 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGJSBBase.h"
 #include <iostream>
+#include <sstream>
+#include <cstdlib>
 
 namespace JSBSim {
 
@@ -240,5 +242,43 @@ void FGJSBBase::disableHighLighting(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+string FGJSBBase::CreateIndexedPropertyName(const string& Property, int index)
+{
+  std::ostringstream buf;
+  buf << Property << '[' << index << ']';
+  return buf.str();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGJSBBase::GaussianRandomNumber(void)
+{
+  static double V1, V2, S;
+  static int phase = 0;
+  double X;
+
+  if (phase == 0) {
+    V1 = V2 = S = X = 0.0;
+
+    do {
+      double U1 = (double)rand() / RAND_MAX;
+      double U2 = (double)rand() / RAND_MAX;
+
+      V1 = 2 * U1 - 1;
+      V2 = 2 * U2 - 1;
+      S = V1 * V1 + V2 * V2;
+    } while(S >= 1 || S == 0);
+
+    X = V1 * sqrt(-2 * log(S) / S);
+  } else
+    X = V2 * sqrt(-2 * log(S) / S);
+
+  phase = 1 - phase;
+
+  return X;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 } // namespace JSBSim
 
index 6ed8832f87347b54833fda6503854d60082b316c..d4ceb2c97ad3f59de484d340e28f13ea780031f6 100644 (file)
@@ -41,21 +41,22 @@ INCLUDES
 #include <float.h>
 #include <queue>
 #include <string>
-#include <sstream>
 #include <cmath>
-#include <cstdlib>
 
 #include "input_output/string_utilities.h"
 
-using std::fabs;
-using std::string;
-
 #ifndef M_PI
 #  define M_PI 3.14159265358979323846
 #endif
 
-#if !defined(WIN32) || defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1300))
-  using std::max;
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+namespace std
+{
+  template <class T> inline T max(const T& a, const T& b)
+  {
+    return (a > b) ? a : b;
+  }
+}
 #endif
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -98,8 +99,8 @@ public:
   public:
     unsigned int fdmId;
     unsigned int messageId;
-    string text;
-    string subsystem;
+    std::string text;
+    std::string subsystem;
     enum mType {eText, eInteger, eDouble, eBool} type;
     bool bVal;
     int  iVal;
@@ -162,22 +163,22 @@ public:
   /** Creates a message with the given text and places it on the queue.
       @param text message text
       @return pointer to a Message structure */
-  void PutMessage(const string& text);
+  void PutMessage(const std::string& text);
   /** Creates a message with the given text and boolean value and places it on the queue.
       @param text message text
       @param bVal boolean value associated with the message
       @return pointer to a Message structure */
-  void PutMessage(const string& text, bool bVal);
+  void PutMessage(const std::string& text, bool bVal);
   /** Creates a message with the given text and integer value and places it on the queue.
       @param text message text
       @param iVal integer value associated with the message
       @return pointer to a Message structure */
-  void PutMessage(const string& text, int iVal);
+  void PutMessage(const std::string& text, int iVal);
   /** Creates a message with the given text and double value and places it on the queue.
       @param text message text
       @param dVal double value associated with the message
       @return pointer to a Message structure */
-  void PutMessage(const string& text, double dVal);
+  void PutMessage(const std::string& text, double dVal);
   /** Reads the message on the queue (but does not delete it).
       @return 1 if some messages */
   int SomeMessages(void);
@@ -192,7 +193,7 @@ public:
 
   /** Returns the version number of JSBSim.
   *   @return The version number of JSBSim. */
-  string GetVersion(void) {return JSBSim_version;}
+  std::string GetVersion(void) {return JSBSim_version;}
 
   /// Disables highlighting in the console output.
   void disableHighLighting(void);
@@ -268,7 +269,7 @@ public:
       @return if the two values can be considered equal up to roundoff */
   static bool EqualToRoundoff(double a, double b) {
     double eps = 2.0*DBL_EPSILON;
-    return fabs(a - b) <= eps*max(fabs(a), fabs(b));
+    return std::fabs(a - b) <= eps*std::max(std::fabs(a), std::fabs(b));
   }
 
   /** Finite precision comparison.
@@ -277,7 +278,7 @@ public:
       @return if the two values can be considered equal up to roundoff */
   static bool EqualToRoundoff(float a, float b) {
     float eps = 2.0*FLT_EPSILON;
-    return fabs(a - b) <= eps*max(fabs(a), fabs(b));
+    return std::fabs(a - b) <= eps*std::max(std::fabs(a), std::fabs(b));
   }
 
   /** Finite precision comparison.
@@ -331,44 +332,12 @@ protected:
   static const double slugtolb;
   static const double kgtolb;
   static const double kgtoslug;
-  static const string needed_cfg_version;
-  static const string JSBSim_version;
-
-  static string CreateIndexedPropertyName(string Property, int index)
-  {
-    std::stringstream str;
-    str << index;
-    string tmp;
-    str >> tmp;
-    return Property + "[" + tmp + "]";
-  }
+  static const std::string needed_cfg_version;
+  static const std::string JSBSim_version;
 
-  static double GaussianRandomNumber(void)
-  {
-    static double V1, V2, S;
-    static int phase = 0;
-    double X;
-
-    if (phase == 0) {
-      V1 = V2 = S = X = 0.0;
-
-      do {
-        double U1 = (double)rand() / RAND_MAX;
-        double U2 = (double)rand() / RAND_MAX;
-
-        V1 = 2 * U1 - 1;
-        V2 = 2 * U2 - 1;
-        S = V1 * V1 + V2 * V2;
-      } while(S >= 1 || S == 0);
+  static std::string CreateIndexedPropertyName(const std::string& Property, int index);
 
-      X = V1 * sqrt(-2 * log(S) / S);
-    } else
-      X = V2 * sqrt(-2 * log(S) / S);
-
-    phase = 1 - phase;
-
-    return X;
-  }
+  static double GaussianRandomNumber(void);
 
 public:
 /// Moments L, M, N
index f9c19d37f88e693936ecaa563bb8230959d4bfb6..372d01e79b4fd2f931a63f61a76a255b6e55f0e8 100644 (file)
@@ -37,9 +37,12 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <cmath>
+#include <iostream>
 
 #include "FGState.h"
 
+using namespace std;
+
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
index c1b6f72813816db14ca96db273033f6b12bc65bb..9fd627ebae40eb43382247bbf3937639e75f3fc0 100644 (file)
@@ -45,18 +45,18 @@ INCLUDES
 #include <string>
 #include <map>
 #include "FGJSBBase.h"
-#include <initialization/FGInitialCondition.h>
-#include <math/FGColumnVector3.h>
-#include <math/FGQuaternion.h>
+#include "initialization/FGInitialCondition.h"
+#include "math/FGColumnVector3.h"
+#include "math/FGQuaternion.h"
 #include "FGFDMExec.h"
-#include <models/FGAtmosphere.h>
-#include <models/FGFCS.h>
-#include <models/FGPropagate.h>
-#include <models/FGAuxiliary.h>
-#include <models/FGAerodynamics.h>
-#include <models/FGAircraft.h>
-#include <models/FGGroundReactions.h>
-#include <models/FGPropulsion.h>
+#include "models/FGAtmosphere.h"
+#include "models/FGFCS.h"
+#include "models/FGPropagate.h"
+#include "models/FGAuxiliary.h"
+#include "models/FGAerodynamics.h"
+#include "models/FGAircraft.h"
+#include "models/FGGroundReactions.h"
+#include "models/FGPropulsion.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index abab0414d8bdc47ad526d6b6ced11bad9c0e4d41..15daa8e22953ae67fbe69e106f4d254df3b738c1 100644 (file)
@@ -258,6 +258,10 @@ FGJSBsim::FGJSBsim( double dt )
     speedbrake_pos_pct->setDoubleValue(0);
     spoilers_pos_pct->setDoubleValue(0);
 
+    ab_brake_engaged = fgGetNode("/autopilot/autobrake/engaged", true);
+    ab_brake_left_pct = fgGetNode("/autopilot/autobrake/brake-left-output", true);
+    ab_brake_right_pct = fgGetNode("/autopilot/autobrake/brake-right-output", true);
+    
     temperature = fgGetNode("/environment/temperature-degc",true);
     pressure = fgGetNode("/environment/pressure-inhg",true);
     density = fgGetNode("/environment/density-slugft3",true);
@@ -542,8 +546,18 @@ bool FGJSBsim::copy_to_JSBsim()
         // Parking brake sets minimum braking
         // level for mains.
     double parking_brake = globals->get_controls()->get_brake_parking();
-    FCS->SetLBrake(FMAX(globals->get_controls()->get_brake_left(), parking_brake));
-    FCS->SetRBrake(FMAX(globals->get_controls()->get_brake_right(), parking_brake));
+    double left_brake = globals->get_controls()->get_brake_left();
+    double right_brake = globals->get_controls()->get_brake_right();
+    
+    if (ab_brake_engaged->getBoolValue()) {
+      left_brake = ab_brake_left_pct->getDoubleValue();
+      right_brake = ab_brake_right_pct->getDoubleValue(); 
+    }
+    
+    FCS->SetLBrake(FMAX(left_brake, parking_brake));
+    FCS->SetRBrake(FMAX(right_brake, parking_brake));
+    
+    
     FCS->SetCBrake( 0.0 );
     // FCS->SetCBrake( globals->get_controls()->get_brake(2) );
 
@@ -741,9 +755,7 @@ bool FGJSBsim::copy_from_JSBsim()
     // Copy the engine values from JSBSim.
     for ( i=0; i < Propulsion->GetNumEngines(); i++ ) {
       SGPropertyNode * node = fgGetNode("engines/engine", i, true);
-      char buf[30];
-      sprintf(buf, "engines/engine[%d]/thruster", i);
-      SGPropertyNode * tnode = fgGetNode(buf, true);
+      SGPropertyNode * tnode = node->getChild("thruster", 0, true);
       FGThruster * thruster = Propulsion->GetEngine(i)->GetThruster();
 
       switch (Propulsion->GetEngine(i)->GetType()) {
index 084d53d4c0ea0315502f4446addfd3577d52ba50..d6f5f1b8c510e92a7b34f6bcbffef7792e4ea7a9 100644 (file)
@@ -254,6 +254,10 @@ private:
     SGPropertyNode_ptr speedbrake_pos_pct;
     SGPropertyNode_ptr spoilers_pos_pct;
 
+    SGPropertyNode_ptr ab_brake_engaged;
+    SGPropertyNode_ptr ab_brake_left_pct;
+    SGPropertyNode_ptr ab_brake_right_pct;
+    
     SGPropertyNode_ptr gear_pos_pct;
     SGPropertyNode_ptr wing_fold_pos_pct;
     SGPropertyNode_ptr tailhook_pos_pct;
index 10b4b7a3e3fe429bb03bf0babed4495f2490eacd..7eb3f7f6661b01346b66a01d38c083b415ac1d15 100644 (file)
@@ -43,16 +43,21 @@ INCLUDES
 *******************************************************************************/
 
 #include "FGInitialCondition.h"
-#include <FGFDMExec.h>
-#include <models/FGInertial.h>
-#include <models/FGAtmosphere.h>
-#include <models/FGAerodynamics.h>
-#include <models/FGPropagate.h>
-#include <input_output/FGPropertyManager.h>
-#include <models/FGPropulsion.h>
-#include <input_output/FGXMLParse.h>
-#include <math/FGQuaternion.h>
+#include "FGFDMExec.h"
+#include "models/FGInertial.h"
+#include "models/FGAtmosphere.h"
+#include "models/FGAerodynamics.h"
+#include "models/FGPropagate.h"
+#include "input_output/FGPropertyManager.h"
+#include "input_output/FGXMLElement.h"
+#include "models/FGPropulsion.h"
+#include "input_output/FGXMLParse.h"
+#include "math/FGQuaternion.h"
+#include <iostream>
 #include <fstream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
index 86de126a00448a6e7045e1bc88486ab1d9149125..898acc3fdf90aef649112ad590523f1c0dadfad6 100644 (file)
@@ -47,10 +47,10 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGFDMExec.h>
-#include <FGJSBBase.h>
-#include <math/FGColumnVector3.h>
-#include <input_output/FGXMLFileRead.h>
+#include "FGFDMExec.h"
+#include "FGJSBBase.h"
+#include "math/FGColumnVector3.h"
+#include "input_output/FGXMLFileRead.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index ed69050cdea5f0ab9915238f1e297f7ad421263d..2f425b769c920f1374cf95f22cec6f59429404a5 100644 (file)
@@ -44,19 +44,21 @@ INCLUDES
 #include <cstdlib>
 #include <iomanip>
 #include "FGTrim.h"
-#include <models/FGAtmosphere.h>
+#include "models/FGAtmosphere.h"
 #include "FGInitialCondition.h"
-#include <models/FGAircraft.h>
-#include <models/FGMassBalance.h>
-#include <models/FGGroundReactions.h>
-#include <models/FGInertial.h>
-#include <models/FGAerodynamics.h>
-#include <math/FGColumnVector3.h>
+#include "models/FGAircraft.h"
+#include "models/FGMassBalance.h"
+#include "models/FGGroundReactions.h"
+#include "models/FGInertial.h"
+#include "models/FGAerodynamics.h"
+#include "math/FGColumnVector3.h"
 
 #if _MSC_VER
 #pragma warning (disable : 4786 4788)
 #endif
 
+using namespace std;
+
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
index 5124c31bbd62cc4202514ce27b85f704b3f2cd04..186b9b1df354abf8c67fc3472a486f2735f62628 100644 (file)
@@ -38,13 +38,20 @@ INCLUDES
 
 #include <string>
 #include <cstdlib>
-#include <FGFDMExec.h>
-#include <models/FGAtmosphere.h>
+#include <iomanip>
+#include "FGFDMExec.h"
+#include "models/FGAtmosphere.h"
 #include "FGInitialCondition.h"
 #include "FGTrimAxis.h"
-#include <models/FGAircraft.h>
-#include <models/FGPropulsion.h>
-#include <models/FGAerodynamics.h>
+#include "models/FGAircraft.h"
+#include "models/FGPropulsion.h"
+#include "models/FGAerodynamics.h"
+#include "models/FGFCS.h"
+#include "models/propulsion/FGEngine.h"
+#include "models/FGAuxiliary.h"
+#include "models/FGGroundReactions.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -427,13 +434,11 @@ void FGTrimAxis::setThrottlesPct(void) {
 /*****************************************************************************/
 
 void FGTrimAxis::AxisReport(void) {
-
-  char out[80];
-
-  sprintf(out,"  %20s: %6.2f %5s: %9.2e Tolerance: %3.0e",
-           GetControlName().c_str(), GetControl()*control_convert,
-           GetStateName().c_str(), GetState()+state_target, GetTolerance());
-  cout << out;
+  cout << "  " << setw(20) << GetControlName() << ": ";
+  cout << setw(6) << setprecision(2) << GetControl()*control_convert << ' ';
+  cout << setw(5) << GetStateName() << ": ";
+  cout << setw(9) << setprecision(2) << scientific << GetState()+state_target;
+  cout << " Tolerance: " << setw(3) << setprecision(0) << scientific << GetTolerance();
 
   if( fabs(GetState()+state_target) < fabs(GetTolerance()) )
      cout << "  Passed" << endl;
index 8976d7a525d3c59ccc4fceb19148b5309b7cd746..d1484115c034a612afd0154d649461e0d5293e58 100644 (file)
@@ -31,8 +31,8 @@ HISTORY
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <math/FGColumnVector3.h>
-#include <math/FGLocation.h>
+#include "math/FGColumnVector3.h"
+#include "math/FGLocation.h"
 #include "FGGroundCallback.h"
 
 namespace JSBSim {
index bb36e650c6581369345a90e043e88a240459d576..4def8c1ca35f556104cbc8694452405ebf72b976 100644 (file)
@@ -38,8 +38,8 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <math/FGColumnVector3.h>
-#include <math/FGLocation.h>
+#include "math/FGColumnVector3.h"
+#include "math/FGLocation.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 40c173fcdc0e9558585631204323266e5a8d9eb5..2db5408e33806115cf077c9d6d5336b8ea58d5e1 100644 (file)
@@ -42,10 +42,9 @@ INCLUDES
 #endif
 
 #include <string>
-#include <iostream>
-#include <simgear/props/props.hxx>
+#include "simgear/props/props.hxx"
 #if !PROPS_STANDALONE
-# include <simgear/math/SGMath.hxx>
+# include "simgear/math/SGMath.hxx"
 #endif
 
 #include "FGJSBBase.h"
@@ -60,8 +59,6 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using namespace std;
-
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -93,7 +90,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *  NOTE: this function changes its argument and thus relies
      *  on pass by value
      */
-    string mkPropertyName(string name, bool lowercase);
+    std::string mkPropertyName(std::string name, bool lowercase);
 
     /**
      * Get a property node.
@@ -103,10 +100,10 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @return The node, or 0 if none exists and none was created.
      */
     FGPropertyManager*
-    GetNode (const string &path, bool create = false);
+    GetNode (const std::string &path, bool create = false);
 
     FGPropertyManager*
-    GetNode (const string &relpath, int index, bool create = false);
+    GetNode (const std::string &relpath, int index, bool create = false);
 
     /**
      * Test whether a given node exists.
@@ -114,23 +111,23 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param path The path of the node, relative to root.
      * @return true if the node exists, false otherwise.
      */
-    bool HasNode (const string &path);
+    bool HasNode (const std::string &path);
 
     /**
      * Get the name of a node
      */
-    string GetName( void );
+    std::string GetName( void );
 
     /**
      * Get the name of a node without underscores, etc.
      */
-    string GetPrintableName( void );
+    std::string GetPrintableName( void );
 
     /**
      * Get the fully qualified name of a node
      * This function is very slow, so is probably useful for debugging only.
      */
-    string GetFullyQualifiedName(void);
+    std::string GetFullyQualifiedName(void);
 
     /**
      * Get a bool value for a property.
@@ -146,7 +143,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        does not exist.
      * @return The property's value as a bool, or the default value provided.
      */
-    bool GetBool (const string &name, bool defaultValue = false);
+    bool GetBool (const std::string &name, bool defaultValue = false);
 
 
     /**
@@ -163,7 +160,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        does not exist.
      * @return The property's value as an int, or the default value provided.
      */
-    int GetInt (const string &name, int defaultValue = 0);
+    int GetInt (const std::string &name, int defaultValue = 0);
 
 
     /**
@@ -180,7 +177,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        does not exist.
      * @return The property's value as a long, or the default value provided.
      */
-    int GetLong (const string &name, long defaultValue = 0L);
+    int GetLong (const std::string &name, long defaultValue = 0L);
 
 
     /**
@@ -197,7 +194,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        does not exist.
      * @return The property's value as a float, or the default value provided.
      */
-    float GetFloat (const string &name, float defaultValue = 0.0);
+    float GetFloat (const std::string &name, float defaultValue = 0.0);
 
 
     /**
@@ -214,7 +211,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        does not exist.
      * @return The property's value as a double, or the default value provided.
      */
-    double GetDouble (const string &name, double defaultValue = 0.0);
+    double GetDouble (const std::string &name, double defaultValue = 0.0);
 
 
     /**
@@ -231,7 +228,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        does not exist.
      * @return The property's value as a string, or the default value provided.
      */
-    string GetString (const string &name, string defaultValue = "");
+    std::string GetString (const std::string &name, std::string defaultValue = "");
 
 
     /**
@@ -247,7 +244,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param val The new value for the property.
      * @return true if the assignment succeeded, false otherwise.
      */
-    bool SetBool (const string &name, bool val);
+    bool SetBool (const std::string &name, bool val);
 
 
     /**
@@ -263,7 +260,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param val The new value for the property.
      * @return true if the assignment succeeded, false otherwise.
      */
-    bool SetInt (const string &name, int val);
+    bool SetInt (const std::string &name, int val);
 
 
     /**
@@ -279,7 +276,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param val The new value for the property.
      * @return true if the assignment succeeded, false otherwise.
      */
-    bool SetLong (const string &name, long val);
+    bool SetLong (const std::string &name, long val);
 
 
     /**
@@ -295,7 +292,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param val The new value for the property.
      * @return true if the assignment succeeded, false otherwise.
      */
-    bool SetFloat (const string &name, float val);
+    bool SetFloat (const std::string &name, float val);
 
 
     /**
@@ -311,7 +308,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param val The new value for the property.
      * @return true if the assignment succeeded, false otherwise.
      */
-    bool SetDouble (const string &name, double val);
+    bool SetDouble (const std::string &name, double val);
 
 
     /**
@@ -327,7 +324,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param val The new value for the property.
      * @return true if the assignment succeeded, false otherwise.
      */
-    bool SetString (const string &name, const string &val);
+    bool SetString (const std::string &name, const std::string &val);
 
 
     ////////////////////////////////////////////////////////////////////////
@@ -347,7 +344,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param name The property name.
      * @param state The state of the archive attribute (defaults to true).
      */
-    void SetArchivable (const string &name, bool state = true);
+    void SetArchivable (const std::string &name, bool state = true);
 
 
     /**
@@ -362,7 +359,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param name The property name.
      * @param state The state of the read attribute (defaults to true).
      */
-    void SetReadable (const string &name, bool state = true);
+    void SetReadable (const std::string &name, bool state = true);
 
 
     /**
@@ -377,7 +374,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * @param name The property name.
      * @param state The state of the write attribute (defaults to true).
      */
-    void SetWritable (const string &name, bool state = true);
+    void SetWritable (const std::string &name, bool state = true);
 
 
     ////////////////////////////////////////////////////////////////////////
@@ -391,7 +388,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      * Classes should use this function to release control of any
      * properties they are managing.
      */
-    void Untie (const string &name);
+    void Untie (const std::string &name);
 
 
         // Templates cause ambiguity here
@@ -409,7 +406,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        be modified; defaults to true.
      */
     void
-    Tie (const string &name, bool *pointer, bool useDefault = true);
+    Tie (const std::string &name, bool *pointer, bool useDefault = true);
 
 
     /**
@@ -425,7 +422,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        be modified; defaults to true.
      */
     void
-    Tie (const string &name, int *pointer, bool useDefault = true);
+    Tie (const std::string &name, int *pointer, bool useDefault = true);
 
 
     /**
@@ -441,7 +438,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        be modified; defaults to true.
      */
     void
-    Tie (const string &name, long *pointer, bool useDefault = true);
+    Tie (const std::string &name, long *pointer, bool useDefault = true);
 
 
     /**
@@ -457,7 +454,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        be modified; defaults to true.
      */
     void
-    Tie (const string &name, float *pointer, bool useDefault = true);
+    Tie (const std::string &name, float *pointer, bool useDefault = true);
 
     /**
      * Tie a property to an external double variable.
@@ -472,7 +469,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        be modified; defaults to true.
      */
     void
-    Tie (const string &name, double *pointer, bool useDefault = true);
+    Tie (const std::string &name, double *pointer, bool useDefault = true);
 
 //============================================================================
 //
@@ -482,19 +479,19 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
 //============================================================================
 
     /* template <class V> void
-    Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
+    Tie (const std::string &name, V (*getter)(), void (*setter)(V) = 0,
            bool useDefault = true);
 
     template <class V> void
-    Tie (const string &name, int index, V (*getter)(int),
+    Tie (const std::string &name, int index, V (*getter)(int),
            void (*setter)(int, V) = 0, bool useDefault = true);
 
     template <class T, class V> void
-    Tie (const string &name, T * obj, V (T::*getter)() const,
+    Tie (const std::string &name, T * obj, V (T::*getter)() const,
            void (T::*setter)(V) = 0, bool useDefault = true);
 
     template <class T, class V> void
-    Tie (const string &name, T * obj, int index,
+    Tie (const std::string &name, T * obj, int index,
            V (T::*getter)(int) const, void (T::*setter)(int, V) = 0,
            bool useDefault = true); */
 
@@ -516,12 +513,12 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      */
 
     template <class V> inline void
-    Tie (const string &name, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true)
+    Tie (const std::string &name, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault))
-        cout << "Failed to tie property " << name << " to functions" << endl;
+        std::cout << "Failed to tie property " << name << " to functions" << std::endl;
       else if (debug_lvl & 0x20)
-        cout << name << endl;
+        std::cout << name << std::endl;
     }
 
 
@@ -543,13 +540,13 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        property value should there be one; false if the old value should be
      *        discarded; defaults to true.
      */
-    template <class V> inline void Tie (const string &name, int index, V (*getter)(int),
+    template <class V> inline void Tie (const std::string &name, int index, V (*getter)(int),
                                 void (*setter)(int, V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
-        cout << "Failed to tie property " << name << " to indexed functions" << endl;
+        std::cout << "Failed to tie property " << name << " to indexed functions" << std::endl;
       else if (debug_lvl & 0x20)
-        cout << name << endl;
+        std::cout << name << std::endl;
     }
 
 
@@ -573,13 +570,13 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        discarded; defaults to true.
      */
     template <class T, class V> inline void
-    Tie (const string &name, T * obj, V (T::*getter)() const,
+    Tie (const std::string &name, T * obj, V (T::*getter)() const,
            void (T::*setter)(V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
-        cout << "Failed to tie property " << name << " to object methods" << endl;
+        std::cout << "Failed to tie property " << name << " to object methods" << std::endl;
       else if (debug_lvl & 0x20)
-        cout << name << endl;
+        std::cout << name << std::endl;
     }
 
     /**
@@ -602,13 +599,13 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
      *        discarded; defaults to true.
      */
     template <class T, class V> inline void
-    Tie (const string &name, T * obj, int index, V (T::*getter)(int) const,
+    Tie (const std::string &name, T * obj, int index, V (T::*getter)(int) const,
                          void (T::*setter)(int, V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
-        cout << "Failed to tie property " << name << " to indexed object methods" << endl;
+        std::cout << "Failed to tie property " << name << " to indexed object methods" << std::endl;
       else if (debug_lvl & 0x20)
-        cout << name << endl;
+        std::cout << name << std::endl;
    }
 };
 }
index e0fff6a13069b0a574110b2d06f6c6174dd301fa..dde76de95828c5e904bf4684ac9d44e2dc9857d6 100755 (executable)
@@ -42,10 +42,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGScript.h"
-#include <input_output/FGXMLParse.h>
-#include <initialization/FGTrim.h>
+#include "input_output/FGXMLParse.h"
+#include "initialization/FGTrim.h"
 
 #include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
index 41037c1d9589ffe1ee73b09bd1e3c59b5466715d..4dc5c8cf9eddea44611835e96e627762cb5786be 100644 (file)
@@ -40,10 +40,10 @@ INCLUDES
 #include "FGJSBBase.h"
 #include "FGState.h"
 #include "FGFDMExec.h"
-#include <math/FGFunction.h>
-#include <math/FGCondition.h>
+#include "math/FGFunction.h"
+#include "math/FGCondition.h"
 #include <vector>
-#include <input_output/FGXMLFileRead.h>
+#include "input_output/FGXMLFileRead.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index f4f628e8b9cc63b497b441ed10d46b3872d00836..df541fa3aaee1b8af04d9adc0b2c464d3a32d24e 100755 (executable)
@@ -32,6 +32,9 @@ INCLUDES
 
 #include <cmath>
 #include <cstdlib>
+#include <iostream>
+
+using namespace std;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -42,159 +45,171 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_XMLELEMENT;
 
+bool Element::converterIsInitialized = false;
+map <string, map <string, double> > Element::convert;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-Element::Element(string nm)
+Element::Element(const string& nm)
 {
   name   = nm;
   parent = 0L;
   element_index = 0;
 
-  // convert ["from"]["to"] = factor, so: from * factor = to
-  // Length
-  convert["M"]["FT"] = 3.2808399;
-  convert["FT"]["M"] = 1.0/convert["M"]["FT"];
-  convert["FT"]["IN"] = 12.0;
-  convert["IN"]["FT"] = 1.0/convert["FT"]["IN"];
-  convert["IN"]["M"] = convert["IN"]["FT"] * convert["FT"]["M"];
-  convert["M"]["IN"] = convert["M"]["FT"] * convert["FT"]["IN"];
-  // Area
-  convert["M2"]["FT2"] = convert["M"]["FT"]*convert["M"]["FT"];
-  convert["FT2"]["M2"] = 1.0/convert["M2"]["FT2"];
-  convert["M2"]["IN2"] = convert["M"]["IN"]*convert["M"]["IN"];
-  convert["IN2"]["M2"] = 1.0/convert["M2"]["IN2"];
-  convert["FT2"]["IN2"] = 144.0;
-  convert["IN2"]["FT2"] = 1.0/convert["FT2"]["IN2"];
-  // Volume
-  convert["IN3"]["CC"] = 16.387064;
-  convert["CC"]["IN3"] = 1.0/convert["IN3"]["CC"];
-  convert["FT3"]["IN3"] = 1728.0;
-  convert["IN3"]["FT3"] = 1.0/convert["FT3"]["IN3"];
-  convert["M3"]["FT3"] = 35.3146667;
-  convert["FT3"]["M3"] = 1.0/convert["M3"]["FT3"];
-  convert["LTR"]["IN3"] = 61.0237441;
-  convert["IN3"]["LTR"] = 1.0/convert["LTR"]["IN3"];
-  // Mass & Weight
-  convert["LBS"]["KG"] = 0.45359237;
-  convert["KG"]["LBS"] = 1.0/convert["LBS"]["KG"];
-  convert["SLUG"]["KG"] = 14.59390;
-  convert["KG"]["SLUG"] = 1.0/convert["SLUG"]["KG"];
-  // Moments of Inertia
-  convert["SLUG*FT2"]["KG*M2"] = 1.35594;
-  convert["KG*M2"]["SLUG*FT2"] = 1.0/convert["SLUG*FT2"]["KG*M2"];
-  // Angles
-  convert["RAD"]["DEG"] = 360.0/(2.0*3.1415926);
-  convert["DEG"]["RAD"] = 1.0/convert["RAD"]["DEG"];
-  // Spring force
-  convert["LBS/FT"]["N/M"] = 14.5939;
-  convert["N/M"]["LBS/FT"] = 1.0/convert["LBS/FT"]["N/M"];
-  // Damping force
-  convert["LBS/FT/SEC"]["N/M/SEC"] = 14.5939;
-  convert["N/M/SEC"]["LBS/FT/SEC"] = 1.0/convert["LBS/FT/SEC"]["N/M/SEC"];
-  // Damping force (Square Law)
-  convert["LBS/FT2/SEC2"]["N/M2/SEC2"] = 47.880259;
-  convert["N/M2/SEC2"]["LBS/FT2/SEC2"] = 1.0/convert["LBS/FT2/SEC2"]["N/M2/SEC2"];
-  // Power
-  convert["WATTS"]["HP"] = 0.001341022;
-  convert["HP"]["WATTS"] = 1.0/convert["WATTS"]["HP"];
-  // Force
-  convert["N"]["LBS"] = 0.22482;
-  convert["LBS"]["N"] = 1.0/convert["N"]["LBS"];
-  // Velocity
-  convert["KTS"]["FT/SEC"] = 1.68781;
-  convert["FT/SEC"]["KTS"] = 1.0/convert["KTS"]["FT/SEC"];
-  convert["M/S"]["FT/S"] = 3.2808399;
-  convert["FT/S"]["M/S"] = 1.0/convert["M/S"]["FT/S"];
-  // Torque
-  convert["FT*LBS"]["N*M"] = 1.35581795;
-  convert["N*M"]["FT*LBS"] = 1/convert["FT*LBS"]["N*M"];
-  // Valve
-  convert["M4*SEC/KG"]["FT4*SEC/SLUG"] = convert["M"]["FT"]*convert["M"]["FT"]*
-    convert["M"]["FT"]*convert["M"]["FT"]/convert["KG"]["SLUG"];
-  convert["FT4*SEC/SLUG"]["M4*SEC/KG"] =
-    1.0/convert["M4*SEC/KG"]["FT4*SEC/SLUG"];
-  // Pressure
-  convert["INHG"]["PSF"] = 70.7180803;
-  convert["PSF"]["INHG"] = 1.0/convert["INHG"]["PSF"];
-  convert["ATM"]["INHG"] = 29.9246899;
-  convert["INHG"]["ATM"] = 1.0/convert["ATM"]["INHG"];
-  convert["PSI"]["INHG"] = 2.03625437;
-  convert["INHG"]["PSI"] = 1.0/convert["PSI"]["INHG"];
-  convert["INHG"]["PA"] = 3386.0; // inches Mercury to pascals
-  convert["PA"]["INHG"] = 1.0/convert["INHG"]["PA"];
-  convert["LBS/FT2"]["N/M2"] = 14.5939/convert["FT"]["M"];
-  convert["N/M2"]["LBS/FT2"] = 1.0/convert["LBS/FT2"]["N/M2"];
-  convert["LBS/FT2"]["PA"] = convert["LBS/FT2"]["N/M2"];
-  convert["PA"]["LBS/FT2"] = 1.0/convert["LBS/FT2"]["PA"];
-  // Mass flow
-  convert["KG/MIN"]["LBS/MIN"] = convert["KG"]["LBS"];
-  // Fuel Consumption
-  convert["LBS/HP*HR"]["KG/KW*HR"] = 0.6083;
-  convert["KG/KW*HR"]["LBS/HP*HR"] = 1.0/convert["LBS/HP*HR"]["KG/KW*HR"];
-
-  // Length
-  convert["M"]["M"] = 1.00;
-  convert["FT"]["FT"] = 1.00;
-  convert["IN"]["IN"] = 1.00;
-  // Area
-  convert["M2"]["M2"] = 1.00;
-  convert["FT2"]["FT2"] = 1.00;
-  // Volume
-  convert["IN3"]["IN3"] = 1.00;
-  convert["CC"]["CC"] = 1.0;
-  convert["M3"]["M3"] = 1.0;
-  convert["FT3"]["FT3"] = 1.0;
-  convert["LTR"]["LTR"] = 1.0;
-  // Mass & Weight
-  convert["KG"]["KG"] = 1.00;
-  convert["LBS"]["LBS"] = 1.00;
-  // Moments of Inertia
-  convert["KG*M2"]["KG*M2"] = 1.00;
-  convert["SLUG*FT2"]["SLUG*FT2"] = 1.00;
-  // Angles
-  convert["DEG"]["DEG"] = 1.00;
-  convert["RAD"]["RAD"] = 1.00;
-  // Spring force
-  convert["LBS/FT"]["LBS/FT"] = 1.00;
-  convert["N/M"]["N/M"] = 1.00;
-  // Damping force
-  convert["LBS/FT/SEC"]["LBS/FT/SEC"] = 1.00;
-  convert["N/M/SEC"]["N/M/SEC"] = 1.00;
-  // Damping force (Square law)
-  convert["LBS/FT2/SEC2"]["LBS/FT2/SEC2"] = 1.00;
-  convert["N/M2/SEC2"]["N/M2/SEC2"] = 1.00;
-  // Power
-  convert["HP"]["HP"] = 1.00;
-  convert["WATTS"]["WATTS"] = 1.00;
-  // Force
-  convert["N"]["N"] = 1.00;
-  // Velocity
-  convert["FT/SEC"]["FT/SEC"] = 1.00;
-  convert["KTS"]["KTS"] = 1.00;
-  convert["M/S"]["M/S"] = 1.0;
-  // Torque
-  convert["FT*LBS"]["FT*LBS"] = 1.00;
-  convert["N*M"]["N*M"] = 1.00;
-  // Valve
-  convert["M4*SEC/KG"]["M4*SEC/KG"] = 1.0;
-  convert["FT4*SEC/SLUG"]["FT4*SEC/SLUG"] = 1.0;
-  // Pressure
-  convert["PSI"]["PSI"] = 1.00;
-  convert["PSF"]["PSF"] = 1.00;
-  convert["INHG"]["INHG"] = 1.00;
-  convert["ATM"]["ATM"] = 1.0;
-  convert["PA"]["PA"] = 1.0;
-  convert["N/M2"]["N/M2"] = 1.00;
-  convert["LBS/FT2"]["LBS/FT2"] = 1.00;
-  // Mass flow
-  convert["LBS/SEC"]["LBS/SEC"] = 1.00;
-  convert["KG/MIN"]["KG/MIN"] = 1.0;
-  convert["LBS/MIN"]["LBS/MIN"] = 1.0;
-  // Fuel Consumption
-  convert["LBS/HP*HR"]["LBS/HP*HR"] = 1.0;
-  convert["KG/KW*HR"]["KG/KW*HR"] = 1.0;
+  if (!converterIsInitialized) {
+    converterIsInitialized = true;
+    // convert ["from"]["to"] = factor, so: from * factor = to
+    // Length
+    convert["M"]["FT"] = 3.2808399;
+    convert["FT"]["M"] = 1.0/convert["M"]["FT"];
+    convert["FT"]["IN"] = 12.0;
+    convert["IN"]["FT"] = 1.0/convert["FT"]["IN"];
+    convert["IN"]["M"] = convert["IN"]["FT"] * convert["FT"]["M"];
+    convert["M"]["IN"] = convert["M"]["FT"] * convert["FT"]["IN"];
+    // Area
+    convert["M2"]["FT2"] = convert["M"]["FT"]*convert["M"]["FT"];
+    convert["FT2"]["M2"] = 1.0/convert["M2"]["FT2"];
+    convert["M2"]["IN2"] = convert["M"]["IN"]*convert["M"]["IN"];
+    convert["IN2"]["M2"] = 1.0/convert["M2"]["IN2"];
+    convert["FT2"]["IN2"] = 144.0;
+    convert["IN2"]["FT2"] = 1.0/convert["FT2"]["IN2"];
+    // Volume
+    convert["IN3"]["CC"] = 16.387064;
+    convert["CC"]["IN3"] = 1.0/convert["IN3"]["CC"];
+    convert["FT3"]["IN3"] = 1728.0;
+    convert["IN3"]["FT3"] = 1.0/convert["FT3"]["IN3"];
+    convert["M3"]["FT3"] = 35.3146667;
+    convert["FT3"]["M3"] = 1.0/convert["M3"]["FT3"];
+    convert["LTR"]["IN3"] = 61.0237441;
+    convert["IN3"]["LTR"] = 1.0/convert["LTR"]["IN3"];
+    // Mass & Weight
+    convert["LBS"]["KG"] = 0.45359237;
+    convert["KG"]["LBS"] = 1.0/convert["LBS"]["KG"];
+    convert["SLUG"]["KG"] = 14.59390;
+    convert["KG"]["SLUG"] = 1.0/convert["SLUG"]["KG"];
+    // Moments of Inertia
+    convert["SLUG*FT2"]["KG*M2"] = 1.35594;
+    convert["KG*M2"]["SLUG*FT2"] = 1.0/convert["SLUG*FT2"]["KG*M2"];
+    // Angles
+    convert["RAD"]["DEG"] = 360.0/(2.0*3.1415926);
+    convert["DEG"]["RAD"] = 1.0/convert["RAD"]["DEG"];
+    // Spring force
+    convert["LBS/FT"]["N/M"] = 14.5939;
+    convert["N/M"]["LBS/FT"] = 1.0/convert["LBS/FT"]["N/M"];
+    // Damping force
+    convert["LBS/FT/SEC"]["N/M/SEC"] = 14.5939;
+    convert["N/M/SEC"]["LBS/FT/SEC"] = 1.0/convert["LBS/FT/SEC"]["N/M/SEC"];
+    // Damping force (Square Law)
+    convert["LBS/FT2/SEC2"]["N/M2/SEC2"] = 47.880259;
+    convert["N/M2/SEC2"]["LBS/FT2/SEC2"] = 1.0/convert["LBS/FT2/SEC2"]["N/M2/SEC2"];
+    // Power
+    convert["WATTS"]["HP"] = 0.001341022;
+    convert["HP"]["WATTS"] = 1.0/convert["WATTS"]["HP"];
+    // Force
+    convert["N"]["LBS"] = 0.22482;
+    convert["LBS"]["N"] = 1.0/convert["N"]["LBS"];
+    // Velocity
+    convert["KTS"]["FT/SEC"] = 1.68781;
+    convert["FT/SEC"]["KTS"] = 1.0/convert["KTS"]["FT/SEC"];
+    convert["M/S"]["FT/S"] = 3.2808399;
+    convert["FT/S"]["M/S"] = 1.0/convert["M/S"]["FT/S"];
+    // Torque
+    convert["FT*LBS"]["N*M"] = 1.35581795;
+    convert["N*M"]["FT*LBS"] = 1/convert["FT*LBS"]["N*M"];
+    // Valve
+    convert["M4*SEC/KG"]["FT4*SEC/SLUG"] = convert["M"]["FT"]*convert["M"]["FT"]*
+      convert["M"]["FT"]*convert["M"]["FT"]/convert["KG"]["SLUG"];
+    convert["FT4*SEC/SLUG"]["M4*SEC/KG"] =
+      1.0/convert["M4*SEC/KG"]["FT4*SEC/SLUG"];
+    // Pressure
+    convert["INHG"]["PSF"] = 70.7180803;
+    convert["PSF"]["INHG"] = 1.0/convert["INHG"]["PSF"];
+    convert["ATM"]["INHG"] = 29.9246899;
+    convert["INHG"]["ATM"] = 1.0/convert["ATM"]["INHG"];
+    convert["PSI"]["INHG"] = 2.03625437;
+    convert["INHG"]["PSI"] = 1.0/convert["PSI"]["INHG"];
+    convert["INHG"]["PA"] = 3386.0; // inches Mercury to pascals
+    convert["PA"]["INHG"] = 1.0/convert["INHG"]["PA"];
+    convert["LBS/FT2"]["N/M2"] = 14.5939/convert["FT"]["M"];
+    convert["N/M2"]["LBS/FT2"] = 1.0/convert["LBS/FT2"]["N/M2"];
+    convert["LBS/FT2"]["PA"] = convert["LBS/FT2"]["N/M2"];
+    convert["PA"]["LBS/FT2"] = 1.0/convert["LBS/FT2"]["PA"];
+    // Mass flow
+    convert["KG/MIN"]["LBS/MIN"] = convert["KG"]["LBS"];
+    // Fuel Consumption
+    convert["LBS/HP*HR"]["KG/KW*HR"] = 0.6083;
+    convert["KG/KW*HR"]["LBS/HP*HR"] = 1.0/convert["LBS/HP*HR"]["KG/KW*HR"];
+    // Density
+    convert["KG/L"]["LBS/GAL"] = 8.3454045;
+    convert["LBS/GAL"]["KG/L"] = 1.0/convert["KG/L"]["LBS/GAL"];
+
+    // Length
+    convert["M"]["M"] = 1.00;
+    convert["FT"]["FT"] = 1.00;
+    convert["IN"]["IN"] = 1.00;
+    // Area
+    convert["M2"]["M2"] = 1.00;
+    convert["FT2"]["FT2"] = 1.00;
+    // Volume
+    convert["IN3"]["IN3"] = 1.00;
+    convert["CC"]["CC"] = 1.0;
+    convert["M3"]["M3"] = 1.0;
+    convert["FT3"]["FT3"] = 1.0;
+    convert["LTR"]["LTR"] = 1.0;
+    // Mass & Weight
+    convert["KG"]["KG"] = 1.00;
+    convert["LBS"]["LBS"] = 1.00;
+    // Moments of Inertia
+    convert["KG*M2"]["KG*M2"] = 1.00;
+    convert["SLUG*FT2"]["SLUG*FT2"] = 1.00;
+    // Angles
+    convert["DEG"]["DEG"] = 1.00;
+    convert["RAD"]["RAD"] = 1.00;
+    // Spring force
+    convert["LBS/FT"]["LBS/FT"] = 1.00;
+    convert["N/M"]["N/M"] = 1.00;
+    // Damping force
+    convert["LBS/FT/SEC"]["LBS/FT/SEC"] = 1.00;
+    convert["N/M/SEC"]["N/M/SEC"] = 1.00;
+    // Damping force (Square law)
+    convert["LBS/FT2/SEC2"]["LBS/FT2/SEC2"] = 1.00;
+    convert["N/M2/SEC2"]["N/M2/SEC2"] = 1.00;
+    // Power
+    convert["HP"]["HP"] = 1.00;
+    convert["WATTS"]["WATTS"] = 1.00;
+    // Force
+    convert["N"]["N"] = 1.00;
+    // Velocity
+    convert["FT/SEC"]["FT/SEC"] = 1.00;
+    convert["KTS"]["KTS"] = 1.00;
+    convert["M/S"]["M/S"] = 1.0;
+    // Torque
+    convert["FT*LBS"]["FT*LBS"] = 1.00;
+    convert["N*M"]["N*M"] = 1.00;
+    // Valve
+    convert["M4*SEC/KG"]["M4*SEC/KG"] = 1.0;
+    convert["FT4*SEC/SLUG"]["FT4*SEC/SLUG"] = 1.0;
+    // Pressure
+    convert["PSI"]["PSI"] = 1.00;
+    convert["PSF"]["PSF"] = 1.00;
+    convert["INHG"]["INHG"] = 1.00;
+    convert["ATM"]["ATM"] = 1.0;
+    convert["PA"]["PA"] = 1.0;
+    convert["N/M2"]["N/M2"] = 1.00;
+    convert["LBS/FT2"]["LBS/FT2"] = 1.00;
+    // Mass flow
+    convert["LBS/SEC"]["LBS/SEC"] = 1.00;
+    convert["KG/MIN"]["KG/MIN"] = 1.0;
+    convert["LBS/MIN"]["LBS/MIN"] = 1.0;
+    // Fuel Consumption
+    convert["LBS/HP*HR"]["LBS/HP*HR"] = 1.0;
+    convert["KG/KW*HR"]["KG/KW*HR"] = 1.0;
+    // Density
+    convert["KG/L"]["KG/L"] = 1.0;
+    convert["LBS/GAL"]["LBS/GAL"] = 1.0;
+  }
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -209,7 +224,7 @@ Element::~Element(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string Element::GetAttributeValue(string attr)
+string Element::GetAttributeValue(const string& attr)
 {
   int select=-1;
   for (unsigned int i=0; i<attribute_key.size(); i++) {
@@ -221,7 +236,7 @@ string Element::GetAttributeValue(string attr)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-double Element::GetAttributeValueAsNumber(string attr)
+double Element::GetAttributeValueAsNumber(const string& attr)
 {
   string attribute = GetAttributeValue(attr);
 
@@ -280,7 +295,7 @@ double Element::GetDataAsNumber(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-unsigned int Element::GetNumElements(string element_name)
+unsigned int Element::GetNumElements(const string& element_name)
 {
   unsigned int number_of_elements=0;
   Element* el=FindElement(element_name);
@@ -293,7 +308,7 @@ unsigned int Element::GetNumElements(string element_name)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Element* Element::FindElement(string el)
+Element* Element::FindElement(const string& el)
 {
   if (el.empty() && children.size() >= 1) {
     element_index = 1;
@@ -311,7 +326,7 @@ Element* Element::FindElement(string el)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Element* Element::FindNextElement(string el)
+Element* Element::FindNextElement(const string& el)
 {
   if (el.empty()) {
     if (element_index < children.size()) {
@@ -333,7 +348,7 @@ Element* Element::FindNextElement(string el)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-double Element::FindElementValueAsNumber(string el)
+double Element::FindElementValueAsNumber(const string& el)
 {
   Element* element = FindElement(el);
   if (element) {
@@ -346,7 +361,7 @@ double Element::FindElementValueAsNumber(string el)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string Element::FindElementValue(string el)
+string Element::FindElementValue(const string& el)
 {
   Element* element = FindElement(el);
   if (element) {
@@ -358,7 +373,7 @@ string Element::FindElementValue(string el)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-double Element::FindElementValueAsNumberConvertTo(string el, string target_units)
+double Element::FindElementValueAsNumberConvertTo(const string& el, const string& target_units)
 {
   Element* element = FindElement(el);
 
@@ -392,9 +407,9 @@ double Element::FindElementValueAsNumberConvertTo(string el, string target_units
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-double Element::FindElementValueAsNumberConvertFromTo( string el,
-                                                       string supplied_units,
-                                                       string target_units)
+double Element::FindElementValueAsNumberConvertFromTo( const string& el,
+                                                       const string& supplied_units,
+                                                       const string& target_units)
 {
   Element* element = FindElement(el);
 
@@ -426,7 +441,7 @@ double Element::FindElementValueAsNumberConvertFromTo( string el,
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGColumnVector3 Element::FindElementTripletConvertTo( string target_units)
+FGColumnVector3 Element::FindElementTripletConvertTo( const string& target_units)
 {
   FGColumnVector3 triplet;
   Element* item;
@@ -506,7 +521,7 @@ void Element::Print(unsigned int level)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void Element::AddAttribute(string name, string value)
+void Element::AddAttribute(const string& name, const string& value)
 {
   attribute_key.push_back(name);
   attributes[name] = value;
@@ -516,8 +531,8 @@ void Element::AddAttribute(string name, string value)
 
 void Element::AddData(string d)
 {
-  unsigned int string_start = (unsigned int)d.find_first_not_of(" \t");
-  if (string_start > 0) {
+  string::size_type string_start = d.find_first_not_of(" \t");
+  if (string_start != string::npos && string_start > 0) {
     d.erase(0,string_start);
   }
   data_lines.push_back(d);
index f8a85bbcdb5f92196b66bf9f2b554a1916505b47..75add86b77d83ab441d31d25b2d50931a278c06d 100755 (executable)
@@ -36,16 +36,9 @@ INCLUDES
 
 #include <string>
 #include <map>
-#include <iostream>
 #include <vector>
 
-using std::string;
-using std::map;
-using std::vector;
-using std::cout;
-using std::endl;
-
-#include <math/FGColumnVector3.h>
+#include "math/FGColumnVector3.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -92,6 +85,7 @@ CLASS DOCUMENTATION
     - convert["KG/MIN"]["LBS/MIN"] = convert["KG"]["LBS"];
     - convert["LBS/HP*HR"]["KG/KW*HR"] = 0.6083;
     - convert["KG/KW*HR"]["LBS/HP*HR"] = 1/convert["LBS/HP*HR"]["KG/KW*HR"];
+    - convert["KG/L"]["LBS/GAL"] = 8.3454045;
 
     - convert["M"]["M"] = 1.00;
     - convert["FT"]["FT"] = 1.00;
@@ -119,6 +113,8 @@ CLASS DOCUMENTATION
     - convert["LBS/MIN"]["LBS/MIN"] = 1.0;
     - convert["LBS/HP*HR"]["LBS/HP*HR"] = 1.0;
     - convert["KG/KW*HR"]["KG/KW*HR"] = 1.0;
+    - convert["KG/L"]["KG/L"] = 1.0;
+    - convert["LBS/GAL"]["LBS/GAL"] = 1.0;
 
     Where:
     - N = newtons
@@ -136,6 +132,8 @@ CLASS DOCUMENTATION
     - WATTS = watts
     - HP = horsepower
     - HR = hour
+    - L = liter
+    - GAL = gallon (U.S. liquid) 
 
     @author Jon S. Berndt
     @version $Id$
@@ -150,7 +148,7 @@ public:
   /** Constructor
       @param nm the name of this element (if given)
       */
-  Element(string nm);
+  Element(const std::string& nm);
   /// Destructor
   ~Element(void);
 
@@ -158,23 +156,23 @@ public:
       @param key specifies the attribute key to retrieve the value of.
       @return the key value (as a string), or the empty string if no such
               attribute exists. */
-  string GetAttributeValue(string key);
+  std::string GetAttributeValue(const std::string& key);
 
   /** Retrieves an attribute value as a double precision real number.
       @param key specifies the attribute key to retrieve the value of.
       @return the key value (as a number), or the HUGE_VAL if no such
               attribute exists. */
-  double GetAttributeValueAsNumber(string key);
+  double GetAttributeValueAsNumber(const std::string& key);
 
   /** Retrieves the element name.
       @return the element name, or the empty string if no name has been set.*/
-  string GetName(void) {return name;}
+  const std::string& GetName(void) const {return name;}
 
   /** Gets a line of data belonging to an element.
       @param i the index of the data line to return (0 by default).
       @return a string representing the data line requested, or the empty string
               if none exists.*/
-  string GetDataLine(unsigned int i=0);
+  std::string GetDataLine(unsigned int i=0);
 
   /// Returns the number of lines of data stored
   unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();}
@@ -183,7 +181,7 @@ public:
   unsigned int GetNumElements(void) {return (unsigned int)children.size();}
 
   /// Returns the number of named child elements for this element.
-  unsigned int GetNumElements(string);
+  unsigned int GetNumElements(const std::string& element_name);
 
   /** Converts the element data to a number.
       This function attempts to convert the first (and presumably only) line of
@@ -221,7 +219,7 @@ public:
       element counter to the first element.
       @param el the search string (empty string by default).
       @return a pointer to the first element that matches the supplied search string. */
-  Element* FindElement(string el="");
+  Element* FindElement(const std::string& el="");
 
   /** Searches for the next element as specified.
       This function would be called after FindElement() is first called (in order to
@@ -232,7 +230,7 @@ public:
       @param el the name of the next element to find.
       @return the pointer to the found element, or 0 if no appropriate element us
               found.*/
-  Element* FindNextElement(string el="");
+  Element* FindNextElement(const std::string& el="");
 
   /** Searches for the named element and returns the string data belonging to it.
       This function allows the data belonging to a named element to be returned
@@ -242,7 +240,7 @@ public:
       default)
       @return the data value for the named element as a string, or the empty
               string if the element cannot be found. */
-  string FindElementValue(string el="");
+  std::string FindElementValue(const std::string& el="");
 
   /** Searches for the named element and returns the data belonging to it as a number.
       This function allows the data belonging to a named element to be returned
@@ -252,7 +250,7 @@ public:
       default)
       @return the data value for the named element as a double, or HUGE_VAL if the
               data is missing. */
-  double FindElementValueAsNumber(string el="");
+  double FindElementValueAsNumber(const std::string& el="");
 
   /** Searches for the named element and converts and returns the data belonging to it.
       This function allows the data belonging to a named element to be returned
@@ -269,7 +267,7 @@ public:
              to which the value returned will be converted.
       @return the unit-converted data value for the named element as a double,
               or HUGE_VAL if the data is missing. */
-  double FindElementValueAsNumberConvertTo(string el, string target_units);
+  double FindElementValueAsNumberConvertTo(const std::string& el, const std::string& target_units);
 
   /** Searches for the named element and converts and returns the data belonging to it.
       This function allows the data belonging to a named element to be returned
@@ -288,9 +286,9 @@ public:
              to which the value returned will be converted.
       @return the unit-converted data value for the named element as a double,
               or HUGE_VAL if the data is missing. */
-  double FindElementValueAsNumberConvertFromTo( string el,
-                                                string supplied_units,
-                                                string target_units);
+  double FindElementValueAsNumberConvertFromTo( const std::string& el,
+                                                const std::string& supplied_units,
+                                                const std::string& target_units);
 
   /** Composes a 3-element column vector for the supplied location or orientation.
       This function processes a LOCATION or ORIENTATION construct, returning a
@@ -301,7 +299,7 @@ public:
       @param target_units the string representing the native units used by JSBSim
              to which the value returned will be converted.
       @return a column vector object built from the LOCATION or ORIENT components. */
-  FGColumnVector3 FindElementTripletConvertTo( string target_units);
+  FGColumnVector3 FindElementTripletConvertTo( const std::string& target_units);
 
   /** This function sets the value of the parent class attribute to the supplied
       Element pointer.
@@ -315,11 +313,11 @@ public:
   /** Stores an attribute belonging to this element.
   *   @param name The string name of the attribute.
   *   @param value The string value of the attribute. */
-  void AddAttribute(string name, string value);
+  void AddAttribute(const std::string& name, const std::string& value);
 
   /** Stores data belonging to this element.
   *   @param d the data to store. */
-  void AddData(string d);
+  void AddData(std::string d);
 
   /** Prints the element.
   *   Prints this element and calls the Print routine for child elements.
@@ -327,15 +325,16 @@ public:
   void Print(unsigned int level=0);
 
 private:
-  string name;
-  map <string, string> attributes;
-  vector <string> data_lines;
-  vector <Element*> children;
-  vector <string> attribute_key;
+  std::string name;
+  std::map <std::string, std::string> attributes;
+  std::vector <std::string> data_lines;
+  std::vector <Element*> children;
+  std::vector <std::string> attribute_key;
   Element *parent;
   unsigned int element_index;
-  typedef map <string, map <string, double> > tMapConvert;
-  tMapConvert convert;
+  typedef std::map <std::string, std::map <std::string, double> > tMapConvert;
+  static tMapConvert convert;
+  static bool converterIsInitialized;
 };
 
 } // namespace JSBSim
index ce33d8c5bc4bcba1ef9583ded75192643e41b2c9..204c4013851ba52cd56130e2bc9fd79513918152 100755 (executable)
@@ -35,7 +35,9 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <input_output/FGXMLParse.h>
+#include "input_output/FGXMLParse.h"
+#include <iostream>
+#include <fstream>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -56,23 +58,23 @@ public:
 
 protected:
   Element* document;
-  Element* LoadXMLDocument(string XML_filename)
+  Element* LoadXMLDocument(std::string XML_filename)
   {
-    ifstream infile;
+    std::ifstream infile;
 
     if ( !XML_filename.empty() ) {
-      if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml";
+      if (XML_filename.find(".xml") == std::string::npos) XML_filename += ".xml";
       infile.open(XML_filename.c_str());
       if ( !infile.is_open()) {
-        cerr << "Could not open file: " << XML_filename << endl;
+        std::cerr << "Could not open file: " << XML_filename << std::endl;
         return 0L;
       }
     } else {
-      cerr << "No filename given." << endl;
+      std::cerr << "No filename given." << std::endl;
       return 0L;
     }
 
-    readXML(infile, file_parser);
+    readXML(infile, file_parser, XML_filename);
     document = file_parser.GetDocument();
     infile.close();
     
index ffc3d173bc1dea36634e967ce170cc2409b777e5..7eefba94f8f5e3b93fa5e41e3bf348145e266d51 100755 (executable)
@@ -30,9 +30,14 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGXMLParse.h"
+#include "FGXMLElement.h"
+#include <string>
+#include <iostream>
 #include <cstdlib>
 #include "input_output/string_utilities.h"
 
+using namespace std;
+
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
index 74580060b8dff8924a5bcd767b8513ac4e43704c..5fdd92b06dd8a15b50e1b1b2cf56fb19699bbcfd 100755 (executable)
@@ -34,15 +34,6 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <string>
-#include <iostream>
-
-using std::string;
-using std::cout;
-using std::cerr;
-using std::endl;
-
-#include "FGXMLElement.h"
 #include "simgear/xml/easyxml.hxx"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -58,6 +49,8 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class Element;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 365c1916fe9e901686556d139d83ba33cadfc2b7..85cb88c4f9c25c70e7695afb2b9f458e8ca8ec96 100644 (file)
@@ -38,8 +38,17 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include "FGfdmSocket.h"
+#include <iostream>
+#include <iomanip>
 #include <cstring>
+#include <cstdio>
+#include "FGfdmSocket.h"
+#include "string_utilities.h"
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::string;
 
 namespace JSBSim {
 
@@ -50,9 +59,9 @@ static const char *IdHdr = ID_FDMSOCKET;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-FGfdmSocket::FGfdmSocket(string address, int port, int protocol)
+FGfdmSocket::FGfdmSocket(const string& address, int port, int protocol)
 {
-  sckt = sckt_in = size = 0;
+  sckt = sckt_in = 0;
   connected = false;
 
   #if defined(_MSC_VER) || defined(__MINGW32__)
@@ -104,9 +113,9 @@ FGfdmSocket::FGfdmSocket(string address, int port, int protocol)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGfdmSocket::FGfdmSocket(string address, int port)
+FGfdmSocket::FGfdmSocket(const string& address, int port)
 {
-  sckt = sckt_in = size = 0;
+  sckt = sckt_in = 0;
   connected = false;
 
   #if defined(_MSC_VER) || defined(__MINGW32__)
@@ -158,7 +167,6 @@ FGfdmSocket::FGfdmSocket(string address, int port)
 
 FGfdmSocket::FGfdmSocket(int port)
 {
-  size = 0;
   connected = false;
   unsigned long NoBlock = true;
 
@@ -217,9 +225,8 @@ string FGfdmSocket::Receive(void)
   char buf[1024];
   int len = sizeof(struct sockaddr_in);
   int num_chars=0;
-  int total_chars = 0;
   unsigned long NoBlock = true;
-  string data = ""; // todo: should allocate this with a standard size as a
+  string data;      // todo: should allocate this with a standard size as a
                     // class attribute and pass as a reference?
 
   if (sckt_in <= 0) {
@@ -239,9 +246,8 @@ string FGfdmSocket::Receive(void)
   }
 
   if (sckt_in > 0) {
-    while ((num_chars = recv(sckt_in, buf, 1024, 0)) > 0) {
-      data += string(buf).substr(0,num_chars);
-      total_chars += num_chars;
+    while ((num_chars = recv(sckt_in, buf, sizeof buf, 0)) > 0) {
+      data.append(buf, num_chars);
     }
 
 #if defined(_MSC_VER)
@@ -258,12 +264,12 @@ string FGfdmSocket::Receive(void)
 #endif
   }
 
-  return data.substr(0, total_chars);
+  return data;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-int FGfdmSocket::Reply(string text)
+int FGfdmSocket::Reply(const string& text)
 {
   int num_chars_sent=0;
 
@@ -288,71 +294,58 @@ void FGfdmSocket::Close(void)
 
 void FGfdmSocket::Clear(void)
 {
-  buffer = "";
-  size = 0;
+  buffer.str(string());
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGfdmSocket::Clear(string s)
+void FGfdmSocket::Clear(const string& s)
 {
-  buffer = s + " ";
-  size = buffer.size();
+  Clear();
+  buffer << s << ' ';
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGfdmSocket::Append(const char* item)
 {
-  if (size == 0) buffer += string(item);
-  else buffer += string(",") + string(item);
-  size++;
+  if (buffer.tellp() > 0) buffer << ',';
+  buffer << item;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGfdmSocket::Append(double item)
 {
-  char s[25];
-
-  sprintf(s,"%12.7f",item);
-
-  if (size == 0) buffer += string(s);
-  else buffer += string(",") + string(s);
-  size++;
+  if (buffer.tellp() > 0) buffer << ',';
+  buffer << std::setw(12) << std::setprecision(7) << item;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGfdmSocket::Append(long item)
 {
-  char s[25];
-
-  sprintf(s,"%12ld",item);
-
-  if (size == 0) buffer += string(s);
-  else buffer += string(",") + string(s);
-  size++;
+  if (buffer.tellp() > 0) buffer << ',';
+  buffer << std::setw(12) << item;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGfdmSocket::Send(void)
 {
-  buffer += string("\n");
-  if ((send(sckt,buffer.c_str(),buffer.size(),0)) <= 0) {
+  buffer << '\n';
+  string str = buffer.str();
+  if ((send(sckt,str.c_str(),str.size(),0)) <= 0) {
     perror("send");
-  } else {
   }
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGfdmSocket::Send(char *data, int length)
+void FGfdmSocket::Send(const char *data, int length)
 {
   if ((send(sckt,data,length,0)) <= 0) {
     perror("send");
-  } else {
   }
 }
 
index fc133473d90724f255392a89005672d5a4e33fdd..46b41ad56f5f8c93f91df468e1ee6cbaeac895c1 100644 (file)
@@ -39,16 +39,11 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <cstdio>
 #include <string>
-#include <iostream>
-#include <fstream>
+#include <sstream>
 #include <sys/types.h>
 #include "FGJSBBase.h"
 
-using std::cout;
-using std::endl;
-
 #if defined(_MSC_VER) || defined(__MINGW32__)
   #include <winsock.h>
   #include <io.h>
@@ -90,27 +85,24 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using std::string;
-using std::cerr;
-
 class FGfdmSocket : public FGJSBBase
 {
 public:
-  FGfdmSocket(string, int);
-  FGfdmSocket(string, int, int);
+  FGfdmSocket(const std::string&, int);
+  FGfdmSocket(const std::string&, int, int);
   FGfdmSocket(int);
   ~FGfdmSocket();
   void Send(void);
-  void Send(char *data, int length);
+  void Send(const char *data, int length);
 
-  string Receive(void);
-  int Reply(string text);
-  void Append(const string s) {Append(s.c_str());}
+  std::string Receive(void);
+  int Reply(const std::string& text);
+  void Append(const std::string& s) {Append(s.c_str());}
   void Append(const char*);
   void Append(double);
   void Append(long);
   void Clear(void);
-  void Clear(string s);
+  void Clear(const std::string& s);
   void Close(void);
   bool GetConnectStatus(void) {return connected;}
 
@@ -119,10 +111,9 @@ public:
 private:
   int sckt;
   int sckt_in;
-  int size;
   struct sockaddr_in scktName;
   struct hostent *host;
-  string buffer;
+  std::ostringstream buffer;
   bool connected;
   void Debug(int from);
 };
index 4b4f197410f196a30c39e09d94449bd0098bb5a6..f649a5f2eaed3552a05d25f59edeb3d258b41ad8 100644 (file)
 
 #include <time.h> // time_t
 
-#ifdef _MSC_VER
-typedef unsigned long uint32_t;
-typedef long int32_t;
-#endif
-
-//--->>>#include <simgear/misc/stdint.hxx> //not required for JSBSim
+#include <simgear/misc/stdint.hxx> //not required for JSBSim
 
 
 // NOTE: this file defines an external interface structure.  Due to
index 38ab806282d783d09575776c5419d61900f52294..bc3a152a9e105df37b06c890254c61862156cab8 100644 (file)
@@ -4,7 +4,7 @@
  Author:       Jon S. Berndt
  Date started: 06/01/09
 
- ------------- Copyright (C) 2009  Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 2009  Jon S. Berndt (jon@jsbsim.org) -------------
 
  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU Lesser General Public License as published by the Free Software
@@ -38,8 +38,8 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <string>
 #include <vector>
-#include <ctype.h>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -51,8 +51,6 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using namespace std;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -63,29 +61,30 @@ CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #if !defined(BASE)
-  extern string& trim_left(string& str);
-  extern string& trim_right(string& str);
-  extern string& trim(string& str);
-  extern string& to_upper(string& str);
-  extern string& to_lower(string& str);
-  extern bool is_number(string& str);
-  vector <string> split(string str, char d);
+  extern std::string& trim_left(std::string& str);
+  extern std::string& trim_right(std::string& str);
+  extern std::string& trim(std::string& str);
+  extern std::string& to_upper(std::string& str);
+  extern std::string& to_lower(std::string& str);
+  extern bool is_number(const std::string& str);
+  std::vector <std::string> split(std::string str, char d);
 #else
+  #include <ctype.h>
+
+  using namespace std;
 
   string& trim_left(string& str)
   {
-    while ( !isgraph(str[0]) ) {
+    while (str.size() && !isgraph(str[0])) {
       str = str.erase(0,1);
-      if (str.size() == 0) break;
     }
     return str;
   }
 
   string& trim_right(string& str)
   {
-    while (!isgraph(str[str.size()-1])) {
+    while (str.size() && !isgraph(str[str.size()-1])) {
       str = str.erase(str.size()-1,1);
-      if (str.size() == 0) break;
     }
     return str;
   }
@@ -99,17 +98,17 @@ CLASS DECLARATION
 
   string& to_upper(string& str)
   {
-    for (int i=0; i<str.size(); i++) str[i] = toupper(str[i]);
+    for (size_t i=0; i<str.size(); i++) str[i] = toupper(str[i]);
     return str;
   }
 
   string& to_lower(string& str)
   {
-    for (int i=0; i<str.size(); i++) str[i] = tolower(str[i]);
+    for (size_t i=0; i<str.size(); i++) str[i] = tolower(str[i]);
     return str;
   }
 
-  bool is_number(string& str)
+  bool is_number(const string& str)
   {
     return (str.find_first_not_of("+-.0123456789Ee") == string::npos);
   }
@@ -117,7 +116,7 @@ CLASS DECLARATION
   vector <string> split(string str, char d)
   {
     vector <string> str_array;
-    int index=0;
+    size_t index=0;
     string temp = "";
 
     trim(str);
@@ -142,3 +141,4 @@ CLASS DECLARATION
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 #endif
+
index fc7b80595d536c9482513456fa0c1ad3a3daccbc..8a85454e2ce5bb322500905e268f799cd75f3d05 100644 (file)
@@ -38,7 +38,12 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGColumnVector3.h"
-#include <cstdio>
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+#include <cmath>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -57,11 +62,13 @@ FGColumnVector3::FGColumnVector3(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGColumnVector3::Dump(string delimeter) const
+string FGColumnVector3::Dump(const string& delimiter) const
 {
-  char buffer[256];
-  sprintf(buffer, "%18.16f%s%18.16f%s%18.16f", Entry(1), delimeter.c_str(), Entry(2), delimeter.c_str(), Entry(3));
-  return string(buffer);
+  ostringstream buffer;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(1) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(2) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(3);
+  return buffer.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 9b16a6df11036dac18ffdd9e94fd657af85068be..2817f9571fd880a11fb910107a62225279a1c2e2 100644 (file)
@@ -39,20 +39,8 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <cstdlib>
+#include <iosfwd>
 #include <string>
-#include <fstream>
-#include <iostream>
-#include <cmath>
-
-using std::ostream;
-using std::istream;
-using std::cerr;
-using std::cout;
-using std::endl;
-using std::sqrt;
-using std::string;
-
 #include "FGJSBBase.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -149,7 +137,7 @@ public:
   /** Prints the contents of the vector
       @param delimeter the item separator (tab or comma)
       @return a string with the delimeter-separated contents of the vector  */
-  string Dump(string delimeter) const;
+  std::string Dump(const std::string& delimeter) const;
 
   /** Assignment operator.
       @param b source vector.
@@ -291,7 +279,7 @@ inline FGColumnVector3 operator*(double scalar, const FGColumnVector3& A) {
     @param os Stream to write to.
     @param M Matrix to write.
     Write the matrix to a stream.*/
-ostream& operator<<(ostream& os, const FGColumnVector3& col);
+std::ostream& operator<<(std::ostream& os, const FGColumnVector3& col);
 
 } // namespace JSBSim
 
index 6f40a72dff8d77ba52d5460dfcc0d478e7fc8911..ff2f77543b89f92a9b3dc917a0519942efafda5f 100644 (file)
@@ -35,7 +35,12 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGCondition.h"
-#include <vector>
+#include "input_output/FGXMLElement.h"
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -91,7 +96,7 @@ FGCondition::FGCondition(Element* element, FGPropertyManager* PropertyManager) :
 // This constructor is called when there are no nested test groups inside the
 // condition
 
-FGCondition::FGCondition(string test, FGPropertyManager* PropertyManager) :
+FGCondition::FGCondition(const string& test, FGPropertyManager* PropertyManager) :
   PropertyManager(PropertyManager), isGroup(false)
 {
   string property1, property2, compare_string;
index cc63d117a4333c039e29a7b7d420cd42bf4835f2..6272a8371cfa98add3f50e167d59bb0a8b9e4f97 100644 (file)
@@ -38,9 +38,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <map>
-#include <FGJSBBase.h>
-#include <input_output/FGXMLElement.h>
-#include <input_output/FGPropertyManager.h>
+#include "FGJSBBase.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -54,6 +52,9 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class FGPropertyManager;
+class Element;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -69,7 +70,7 @@ class FGCondition : public FGJSBBase
 {
 public:
   FGCondition(Element* element, FGPropertyManager* PropertyManager);
-  FGCondition(string test, FGPropertyManager* PropertyManager);
+  FGCondition(const std::string& test, FGPropertyManager* PropertyManager);
   ~FGCondition(void);
 
   bool Evaluate(void);
@@ -78,18 +79,18 @@ public:
 private:
   enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE};
   enum eLogic {elUndef=0, eAND, eOR};
-  map <string, eComparison> mComparison;
+  std::map <std::string, eComparison> mComparison;
   eLogic Logic;
 
   FGPropertyManager *TestParam1, *TestParam2, *PropertyManager;
   double TestValue;
   eComparison Comparison;
   bool isGroup;
-  string conditional;
+  std::string conditional;
 
-  static string indent;
+  static std::string indent;
 
-  vector <FGCondition*> conditions;
+  std::vector <FGCondition*> conditions;
   void InitializeConditionals(void);
 
   void Debug(int from);
index 7a185ec01ccdbcabc7eee58c840bada112115ae6..e45e6d9aa23c1a14181e4a9371fb2f2f9ad9e44b 100755 (executable)
@@ -28,12 +28,18 @@ Purpose: Stores various parameter types for functions
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <stdio.h>
-
+#include <sstream>
+#include <iomanip>
+#include <cstdlib>
+#include <cmath>
 #include "FGFunction.h"
 #include "FGTable.h"
 #include "FGPropertyValue.h"
 #include "FGRealValue.h"
+#include "input_output/FGXMLElement.h"
+#include "input_output/FGPropertyManager.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -44,14 +50,14 @@ static const char *IdHdr = ID_FUNCTION;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-FGFunction::FGFunction(FGPropertyManager* propMan, Element* el, string prefix)
+FGFunction::FGFunction(FGPropertyManager* propMan, Element* el, const string& prefix)
                                       : PropertyManager(propMan), Prefix(prefix)
 {
   Element* element;
   string operation, property_name;
-  int size = el->GetNumElements();
   cached = false;
   cachedValue = -HUGE_VAL;
+  invlog2val = 1.0/log10(2.0);
 
   property_string = "property";
   value_string = "value";
@@ -68,6 +74,9 @@ FGFunction::FGFunction(FGPropertyManager* propMan, Element* el, string prefix)
   quotient_string = "quotient";
   pow_string = "pow";
   exp_string = "exp";
+  log2_string = "log2";
+  ln_string = "ln";
+  log10_string = "log10";
   abs_string = "abs";
   sin_string = "sin";
   cos_string = "cos";
@@ -99,6 +108,12 @@ FGFunction::FGFunction(FGPropertyManager* propMan, Element* el, string prefix)
     Type = eQuotient;
   } else if (operation == pow_string) {
     Type = ePow;
+  } else if (operation == log2_string) {
+    Type = eLog2;
+  } else if (operation == ln_string) {
+    Type = eLn;
+  } else if (operation == log10_string) {
+    Type = eLog10;
   } else if (operation == abs_string) {
     Type = eAbs;
   } else if (operation == sin_string) {
@@ -170,6 +185,9 @@ FGFunction::FGFunction(FGPropertyManager* propMan, Element* el, string prefix)
                operation == quotient_string ||
                operation == pow_string ||
                operation == exp_string ||
+               operation == log2_string ||
+               operation == ln_string ||
+               operation == log10_string ||
                operation == abs_string ||
                operation == sin_string ||
                operation == cos_string ||
@@ -255,6 +273,18 @@ double FGFunction::GetValue(void) const
   case eExp:
     temp = exp(temp);
     break;
+  case eLog2:
+    if (temp > 0.00) temp = log10(temp)*invlog2val;
+    else temp = -HUGE_VAL;
+    break;
+  case eLn:
+    if (temp > 0.00) temp = log(temp);
+    else temp = -HUGE_VAL;
+    break;
+  case eLog10:
+    if (temp > 0.00) temp = log10(temp);
+    else temp = -HUGE_VAL;
+    break;
   case eAbs:
     temp = fabs(temp);
     break;
@@ -320,12 +350,10 @@ double FGFunction::GetValue(void) const
 
 string FGFunction::GetValueAsString(void) const
 {
-  char buffer[20];
-  string value;
+  ostringstream buffer;
 
-  sprintf(buffer,"%9.6f",GetValue());
-  value = string(buffer);
-  return value;
+  buffer << setw(9) << setprecision(6) << GetValue();
+  return buffer.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -333,7 +361,12 @@ string FGFunction::GetValueAsString(void) const
 void FGFunction::bind(void)
 {
   if ( !Name.empty() ) {
-    string tmp = PropertyManager->mkPropertyName(Prefix + Name, false); // Allow upper case
+    string tmp;
+    if (Prefix.empty())
+      tmp  = PropertyManager->mkPropertyName(Name, false); // Allow upper case
+    else
+      tmp  = PropertyManager->mkPropertyName(Prefix + "/" + Name, false); // Allow upper case
+
     PropertyManager->Tie( tmp, this, &FGFunction::GetValue);
   }
 }
index a4ba9694ba13dde4dd17c0525b6d8ef446cdc4f7..d122ffe20755952aa66a38b2704cbf067e51bde4 100755 (executable)
@@ -37,8 +37,6 @@ INCLUDES
 #include <vector>
 #include <string>
 #include "FGParameter.h"
-#include <input_output/FGXMLElement.h>
-#include <input_output/FGPropertyManager.h>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -52,6 +50,9 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class FGPropertyManager;
+class Element;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -69,6 +70,9 @@ A function definition consists of an operation, a value, a table, or a property
 - quotient (takes 2 args)
 - pow (takes 2 args)
 - exp (takes 2 args)
+- log2 (takes 1 arg)
+- ln (takes 1 arg)
+- log10 (takes 1 arg)
 - abs (takes n args)
 - sin (takes 1 arg)
 - cos (takes 1 arg)
@@ -165,7 +169,7 @@ public:
     @param prefix an optional prefix to prepend to the name given to the property
            that represents this function (if given).
 */
-  FGFunction(FGPropertyManager* PropertyManager, Element* element, string prefix="");
+  FGFunction(FGPropertyManager* PropertyManager, Element* element, const std::string& prefix="");
   /// Destructor.
   virtual ~FGFunction();
 
@@ -175,10 +179,10 @@ public:
 
 /** The value that the function evaluates to, as a string.
   @return the value of the function as a string. */
-  string GetValueAsString(void) const;
+  std::string GetValueAsString(void) const;
 
 /// Retrieves the name of the function.
-  string GetName(void) const {return Name;}
+  std::string GetName(void) const {return Name;}
 
 /** Specifies whether to cache the value of the function, so it is calculated only
     once per frame.
@@ -189,44 +193,48 @@ public:
   void cacheValue(bool shouldCache);
 
 private:
-  vector <FGParameter*> Parameters;
+  std::vector <FGParameter*> Parameters;
   FGPropertyManager* const PropertyManager;
   bool cached;
-  string Prefix;
-  string description_string;
-  string property_string;
-  string value_string;
-  string table_string;
-  string p_string;
-  string v_string;
-  string t_string;
-  string function_string;
-  string sum_string;
-  string difference_string;
-  string product_string;
-  string quotient_string;
-  string pow_string;
-  string exp_string;
-  string abs_string;
-  string sin_string;
-  string cos_string;
-  string tan_string;
-  string asin_string;
-  string acos_string;
-  string atan_string;
-  string atan2_string;
-  string min_string;
-  string max_string;
-  string avg_string;
-  string fraction_string;
-  string mod_string;
-  string random_string;
-  string integer_string;
+  double invlog2val;
+  std::string Prefix;
+  std::string description_string;
+  std::string property_string;
+  std::string value_string;
+  std::string table_string;
+  std::string p_string;
+  std::string v_string;
+  std::string t_string;
+  std::string function_string;
+  std::string sum_string;
+  std::string difference_string;
+  std::string product_string;
+  std::string quotient_string;
+  std::string pow_string;
+  std::string exp_string;
+  std::string log2_string;
+  std::string ln_string;
+  std::string log10_string;
+  std::string abs_string;
+  std::string sin_string;
+  std::string cos_string;
+  std::string tan_string;
+  std::string asin_string;
+  std::string acos_string;
+  std::string atan_string;
+  std::string atan2_string;
+  std::string min_string;
+  std::string max_string;
+  std::string avg_string;
+  std::string fraction_string;
+  std::string mod_string;
+  std::string random_string;
+  std::string integer_string;
   double cachedValue;
   enum functionType {eTopLevel=0, eProduct, eDifference, eSum, eQuotient, ePow,
                      eExp, eAbs, eSin, eCos, eTan, eASin, eACos, eATan, eATan2,
-                     eMin, eMax, eAvg, eFrac, eInteger, eMod, eRandom} Type;
-  string Name;
+                     eMin, eMax, eAvg, eFrac, eInteger, eMod, eRandom, eLog2, eLn, eLog10} Type;
+  std::string Name;
   void bind(void);
   void Debug(int from);
 };
index d740d01b120dc4e135737180f8ea5c07fbfd9320..42619b93fbac45f03566f36174389a78578b551f 100644 (file)
@@ -41,7 +41,7 @@ INCLUDES
 #include <cmath>
 
 #include "FGLocation.h"
-#include <input_output/FGPropertyManager.h>
+#include "input_output/FGPropertyManager.h"
 
 namespace JSBSim {
 
index e55f31c81e627a8086df4e67eaf8a8997e915d66..b61ffa966cbbc287553edf15dd8523732ce09776 100644 (file)
@@ -39,8 +39,8 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
-#include <input_output/FGPropertyManager.h>
+#include "FGJSBBase.h"
+#include "input_output/FGPropertyManager.h"
 #include "FGColumnVector3.h"
 #include "FGMatrix33.h"
 
index 91976f100244e5fafeb9dcb3f2d8319d2c423cae..5eccfdfce13576107bd707316b10c1c8bbc12393 100644 (file)
@@ -39,6 +39,12 @@ INCLUDES
 
 #include "FGMatrix33.h"
 #include "FGColumnVector3.h"
+#include <sstream>
+#include <iomanip>
+
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -61,6 +67,23 @@ FGMatrix33::FGMatrix33(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+string FGMatrix33::Dump(const string& delimiter) const
+{
+  ostringstream buffer;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(1,1) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(1,2) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(1,3) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(2,1) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(2,2) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(2,3) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(3,1) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(3,2) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(3,3);
+  return buffer.str();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 ostream& operator<<(ostream& os, const FGMatrix33& M)
 {
   for (unsigned int i=1; i<=M.Rows(); i++) {
index 98babfcd0d2b4287d0ec76441a9deb0df233212c..d07687ea9808de43b31aaa2c5ef00e4a9d3570d0 100644 (file)
@@ -40,18 +40,8 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <cstdlib>
 #include <string>
-#include <fstream>
-#include <iostream>
-#include <cmath>
-
-using std::ostream;
-using std::istream;
-using std::cerr;
-using std::cout;
-using std::endl;
-using std::string;
+#include <iosfwd>
 
 #include "FGColumnVector3.h"
 #include "FGJSBBase.h"
@@ -84,7 +74,7 @@ DECLARATION: MatrixException
 class MatrixException : public FGJSBBase
 {
 public:
-  string Message;
+  std::string Message;
 };
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -168,6 +158,11 @@ public:
    */
   ~FGMatrix33(void) { Debug(1); }
 
+  /** Prints the contents of the matrix.
+      @param delimeter the item separator (tab or comma)
+      @return a string with the delimeter-separated contents of the matrix  */
+  std::string Dump(const std::string& delimeter) const;
+
   /** Read access the entries of the matrix.
       @param row Row index.
       @param col Column index.
@@ -450,7 +445,7 @@ inline FGMatrix33 operator*(double scalar, const FGMatrix33& A) {
 
     Write the matrix to a stream.
 */
-ostream& operator<<(ostream& os, const FGMatrix33& M);
+std::ostream& operator<<(std::ostream& os, const FGMatrix33& M);
 
 /** Read matrix from a stream.
 
@@ -459,7 +454,7 @@ ostream& operator<<(ostream& os, const FGMatrix33& M);
 
     Read matrix from a stream.
 */
-istream& operator>>(istream& is, FGMatrix33& M);
+std::istream& operator>>(std::istream& is, FGMatrix33& M);
 
 } // namespace JSBSim
 
index 60ad5f5ce4b3df4ee1227c801ce97a15001c26cc..82803f55818e6cd2f1600829ef9e75eb50f5dec5 100755 (executable)
@@ -35,7 +35,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGParameter.h"
-#include <input_output/FGPropertyManager.h>
+#include "input_output/FGPropertyManager.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 3607c2064f3bc771bca29765f73903112710fd35..73c0e009a0833807242b1d1efb87e284caee9c62 100644 (file)
@@ -40,10 +40,10 @@ SENTRY
   INCLUDES
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
+#include "FGJSBBase.h"
 #include "FGMatrix33.h"
 #include "FGColumnVector3.h"
-#include <input_output/FGPropertyManager.h>
+#include "input_output/FGPropertyManager.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   DEFINITIONS
index 079631db55615da53fdaa204dc8b9ecb58c4a623..f19669191c00f8d8fe725fa0317106d218886d7e 100644 (file)
@@ -37,7 +37,11 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGTable.h"
-#include <iomanip>
+#include "input_output/FGXMLElement.h"
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+#include <sstream>
+#include <cstdlib>
 
 using namespace std;
 
@@ -307,7 +311,7 @@ FGTable::~FGTable()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-unsigned int FGTable::FindNumColumns(string test_line)
+unsigned int FGTable::FindNumColumns(const string& test_line)
 {
   // determine number of data columns in table (first column is row lookup - don't count)
   size_t position=0;
@@ -466,7 +470,7 @@ double FGTable::GetValue(double rowKey, double colKey, double tableKey) const
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGTable::operator<<(stringstream& in_stream)
+void FGTable::operator<<(istream& in_stream)
 {
   int startRow=0;
   int startCol=0;
@@ -488,7 +492,7 @@ void FGTable::operator<<(stringstream& in_stream)
 FGTable& FGTable::operator<<(const double n)
 {
   Data[rowCounter][colCounter] = n;
-  if (colCounter == nCols) {
+  if (colCounter == (int)nCols) {
     colCounter = 0;
     rowCounter++;
   } else {
index a90654a18c2fb19f1ac947df8e2d964fa94b74a3..1b0d22e16e5f4ca8cbb3c9d5ae48aadbbfc292f5 100644 (file)
@@ -38,11 +38,10 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <input_output/FGXMLElement.h>
 #include "FGParameter.h"
-#include <input_output/FGPropertyManager.h>
-#include <sstream>
+#include <iosfwd>
 #include <vector>
+#include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -54,11 +53,11 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using std::vector;
-using std::stringstream;
-
 namespace JSBSim {
 
+class FGPropertyManager;
+class Element;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -280,7 +279,7 @@ public:
        </pre>
        */
 
-  void operator<<(stringstream&);
+  void operator<<(std::istream&);
   FGTable& operator<<(const double n);
   FGTable& operator<<(const int n);
 
@@ -298,16 +297,16 @@ private:
   bool internal;
   FGPropertyManager *lookupProperty[3];
   double** Data;
-  vector <FGTable*> Tables;
-  unsigned int FindNumColumns(string);
+  std::vector <FGTable*> Tables;
   unsigned int nRows, nCols, nTables, dimension;
   int colCounter, rowCounter, tableCounter;
   mutable int lastRowIndex, lastColumnIndex, lastTableIndex;
   double** Allocate(void);
   FGPropertyManager* const PropertyManager;
-  string Name;
+  std::string Name;
   void bind(void);
 
+  unsigned int FindNumColumns(const std::string&);
   void Debug(int from);
 };
 }
index 829697024ae7143df6f7e4131c5cfe330de2deff..a793cce2f443df453b2cbc586688f02814c6b14c 100644 (file)
@@ -36,13 +36,19 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+#include <cstdlib>
 #include <FGFDMExec.h>
 #include "FGAerodynamics.h"
 #include "FGPropagate.h"
 #include "FGAircraft.h"
 #include "FGAuxiliary.h"
 #include "FGMassBalance.h"
-#include <input_output/FGPropertyManager.h>
+#include "input_output/FGPropertyManager.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -102,9 +108,6 @@ FGAerodynamics::~FGAerodynamics()
 
   delete[] Coeff;
 
-  for (i=0; i<variables.size(); i++)
-    delete variables[i];
-
   delete AeroRPShift;
 
   Debug(1);
@@ -131,12 +134,14 @@ bool FGAerodynamics::InitModel(void)
 
 bool FGAerodynamics::Run(void)
 {
-  unsigned int axis_ctr, ctr, i;
+  unsigned int axis_ctr, ctr;
   double alpha, twovel;
 
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false; // if paused don't execute
 
+  RunPreFunctions();
+
   // calculate some oft-used quantities for speed
 
   twovel = 2*Auxiliary->GetVt();
@@ -167,13 +172,6 @@ bool FGAerodynamics::Run(void)
   vFw.InitMatrix();
   vFnative.InitMatrix();
 
-  // Tell the variable functions to cache their values, so while the aerodynamic
-  // functions are being calculated for each axis, these functions do not get
-  // calculated each time, but instead use the values that have already
-  // been calculated for this frame.
-
-  for (i=0; i<variables.size(); i++) variables[i]->cacheValue(true);
-
   for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) {
     for (ctr=0; ctr < Coeff[axis_ctr].size(); ctr++) {
       vFnative(axis_ctr+1) += Coeff[axis_ctr][ctr]->GetValue();
@@ -227,6 +225,8 @@ bool FGAerodynamics::Run(void)
     }
   }
 
+  RunPostFunctions();
+
   return false;
 }
 
@@ -318,37 +318,31 @@ bool FGAerodynamics::Load(Element *element)
     document = element;
   }
 
-  FGModel::Load(element); // Perform base class Load
+  FGModel::Load(document); // Perform base class Pre-Load
 
   DetermineAxisSystem(); // Detemine if Lift/Side/Drag, etc. is used.
 
   Debug(2);
 
-  if (temp_element = document->FindElement("alphalimits")) {
+  if ((temp_element = document->FindElement("alphalimits"))) {
     scratch_unit = temp_element->GetAttributeValue("unit");
     if (scratch_unit.empty()) scratch_unit = "RAD";
     alphaclmin = temp_element->FindElementValueAsNumberConvertFromTo("min", scratch_unit, "RAD");
     alphaclmax = temp_element->FindElementValueAsNumberConvertFromTo("max", scratch_unit, "RAD");
   }
 
-  if (temp_element = document->FindElement("hysteresis_limits")) {
+  if ((temp_element = document->FindElement("hysteresis_limits"))) {
     scratch_unit = temp_element->GetAttributeValue("unit");
     if (scratch_unit.empty()) scratch_unit = "RAD";
     alphahystmin = temp_element->FindElementValueAsNumberConvertFromTo("min", scratch_unit, "RAD");
     alphahystmax = temp_element->FindElementValueAsNumberConvertFromTo("max", scratch_unit, "RAD");
   }
 
-  if (temp_element = document->FindElement("aero_ref_pt_shift_x")) {
+  if ((temp_element = document->FindElement("aero_ref_pt_shift_x"))) {
     function_element = temp_element->FindElement("function");
     AeroRPShift = new FGFunction(PropertyManager, function_element);
   }
 
-  function_element = document->FindElement("function");
-  while (function_element) {
-    variables.push_back( new FGFunction(PropertyManager, function_element) );
-    function_element = document->FindNextElement("function");
-  }
-
   axis_element = document->FindElement("axis");
   while (axis_element) {
     CoeffArray ca;
@@ -362,6 +356,8 @@ bool FGAerodynamics::Load(Element *element)
     axis_element = document->FindNextElement("axis");
   }
 
+  FGModel::PostLoad(document); // Perform base class Post-Load
+
   return true;
 }
 
@@ -415,21 +411,12 @@ void FGAerodynamics::DetermineAxisSystem()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGAerodynamics::GetCoefficientStrings(string delimeter)
+string FGAerodynamics::GetCoefficientStrings(const string& delimeter) const
 {
   string CoeffStrings = "";
   bool firstime = true;
   unsigned int axis, sd;
 
-  for (sd = 0; sd < variables.size(); sd++) {
-    if (firstime) {
-      firstime = false;
-    } else {
-      CoeffStrings += delimeter;
-    }
-    CoeffStrings += variables[sd]->GetName();
-  }
-
   for (axis = 0; axis < 6; axis++) {
     for (sd = 0; sd < Coeff[axis].size(); sd++) {
       if (firstime) {
@@ -445,33 +432,18 @@ string FGAerodynamics::GetCoefficientStrings(string delimeter)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGAerodynamics::GetCoefficientValues(string delimeter)
+string FGAerodynamics::GetCoefficientValues(const string& delimeter) const
 {
-  string SDValues = "";
-  bool firstime = true;
-  unsigned int sd;
-
-  for (sd = 0; sd < variables.size(); sd++) {
-    if (firstime) {
-      firstime = false;
-    } else {
-      SDValues += delimeter;
-    }
-    SDValues += variables[sd]->GetValueAsString();
-  }
+  ostringstream buf;
 
   for (unsigned int axis = 0; axis < 6; axis++) {
     for (unsigned int sd = 0; sd < Coeff[axis].size(); sd++) {
-      if (firstime) {
-        firstime = false;
-      } else {
-        SDValues += delimeter;
-      }
-      SDValues += Coeff[axis][sd]->GetValueAsString();
+      if (buf.tellp() > 0) buf << delimeter;
+      buf << setw(9) << Coeff[axis][sd]->GetValue();
     }
   }
 
-  return SDValues;
+  return buf.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -558,6 +530,9 @@ void FGAerodynamics::Debug(int from)
         case (atBodyXYZ):
           cout << endl << "  Aerodynamics (X|Y|Z axes):" << endl << endl;
           break;
+      case (atNone):
+          cout << endl << "  Aerodynamics (undefined axes):" << endl << endl;
+          break;
       }
     }
   }
index 9e2e47b22e9dbf2dccd418ce9887148a76a66fb3..8c26e527729d5d35e10668e05b6abe992f58a361 100644 (file)
@@ -38,14 +38,15 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <string>
 #include <vector>
 #include <map>
 
 #include "FGModel.h"
-#include <math/FGFunction.h>
-#include <math/FGColumnVector3.h>
-#include <math/FGMatrix33.h>
-#include <input_output/FGXMLFileRead.h>
+#include "math/FGFunction.h"
+#include "math/FGColumnVector3.h"
+#include "math/FGMatrix33.h"
+#include "input_output/FGXMLFileRead.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -188,13 +189,13 @@ public:
   /** Gets the strings for the current set of coefficients.
       @param delimeter either a tab or comma string depending on output type
       @return a string containing the descriptive names for all coefficients */
-  string GetCoefficientStrings(string delimeter);
+  std::string GetCoefficientStrings(const std::string& delimeter) const;
 
   /** Gets the coefficient values.
       @param delimeter either a tab or comma string depending on output type
       @return a string containing the numeric values for the current set of
       coefficients */
-  string GetCoefficientValues(string delimeter);
+  std::string GetCoefficientValues(const std::string& delimeter) const;
 
   /** Calculates and returns the wind-to-body axis transformation matrix.
       @return a reference to the wind-to-body transformation matrix.
@@ -206,14 +207,14 @@ public:
       */
   FGMatrix33& GetTb2w(void);
 
-  vector <FGFunction*> * GetCoeff(void) const { return Coeff; }
+  std::vector <FGFunction*> * GetCoeff(void) const { return Coeff; }
 
 private:
   enum eAxisType {atNone, atLiftDrag, atAxialNormal, atBodyXYZ} axisType;
-  typedef map<string,int> AxisIndex;
+  typedef std::map<std::string,int> AxisIndex;
   AxisIndex AxisIdx;
   FGFunction* AeroRPShift;
-  vector <FGFunction*> variables;
+  std::vector <FGFunction*> variables;
   typedef vector <FGFunction*> CoeffArray;
   CoeffArray* Coeff;
   FGColumnVector3 vFnative;
index 9c6ffef856ac47a6585fcaa43f476fe5cfb80bf3..75f9fba590b680eeb7b79a6273d8228e26fd2145 100644 (file)
@@ -50,9 +50,13 @@ INCLUDES
 #include "FGExternalReactions.h"
 #include "FGBuoyantForces.h"
 #include "FGAerodynamics.h"
-#include <FGFDMExec.h>
+#include "FGFDMExec.h"
 #include "FGPropagate.h"
-#include <input_output/FGPropertyManager.h>
+#include "FGPropulsion.h"
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -110,6 +114,8 @@ bool FGAircraft::Run(void)
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   vForces.InitMatrix();
   if (!HoldDown) {
     vForces += Aerodynamics->GetForces();
@@ -135,6 +141,8 @@ bool FGAircraft::Run(void)
   vNwcg = Aerodynamics->GetTb2w() * vNcg;
   vNwcg(3) = -1*vNwcg(3) + 1;
 
+  RunPostFunctions();
+
   return false;
 }
 
@@ -195,6 +203,8 @@ bool FGAircraft::Load(Element* el)
     }
   }
 
+  FGModel::PostLoad(el);
+
   Debug(2);
 
   return true;
index bc32b1afbd7b1ff8959f5264ef2f5dba415c2c99..a66665c061c7df63305609752f7f9921dd983f7d 100644 (file)
@@ -38,11 +38,12 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <string>
 #include <vector>
 
 #include "FGModel.h"
-#include <input_output/FGXMLElement.h>
-#include <math/FGColumnVector3.h>
+#include "input_output/FGXMLElement.h"
+#include "math/FGColumnVector3.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -131,7 +132,7 @@ public:
 
   /** Gets the aircraft name
       @return the name of the aircraft as a string type */
-  inline string GetAircraftName(void) { return AircraftName; }
+  const std::string& GetAircraftName(void) const { return AircraftName; }
 
   /// Gets the wing area
   double GetWingArea(void) const { return WingArea; }
@@ -163,7 +164,7 @@ public:
   inline double GetXYZrp(int idx) const { return vXYZrp(idx); }
   inline double GetXYZvrp(int idx) const { return vXYZvrp(idx); }
   inline double GetXYZep(int idx) const { return vXYZep(idx); }
-  inline void SetAircraftName(string name) {AircraftName = name;}
+  inline void SetAircraftName(const std::string& name) {AircraftName = name;}
   inline void SetHoldDown(int hd) {HoldDown = hd;}
   inline int GetHoldDown(void) const {return HoldDown;}
 
@@ -193,7 +194,7 @@ private:
   double HTailArea, VTailArea, HTailArm, VTailArm;
   double lbarh,lbarv,vbarh,vbarv;
   int HoldDown;
-  string AircraftName;
+  std::string AircraftName;
 
   void Debug(int from);
 };
index b1826b716083cf929fabffa0fe36b9c6906a547d..8acb17c1b42056c7c112169b7023c5294727a8f8 100644 (file)
@@ -48,12 +48,16 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGAtmosphere.h"
-#include <FGState.h>
-#include <FGFDMExec.h>
+#include "FGState.h"
+#include "FGFDMExec.h"
 #include "FGAircraft.h"
 #include "FGPropagate.h"
 #include "FGInertial.h"
-#include <input_output/FGPropertyManager.h>
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -135,6 +139,8 @@ bool FGAtmosphere::Run(void)
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   T_dev = 0.0;
   h = Propagate->GetAltitudeASL();
 
@@ -145,6 +151,8 @@ bool FGAtmosphere::Run(void)
     CalculateDerived();
   }
 
+  RunPostFunctions();
+
   Debug(2);
   return false;
 }
@@ -454,10 +462,12 @@ void FGAtmosphere::Turbulence(void)
     vDirectiondAccelDt(eX) = GaussianRandomNumber();
     vDirectiondAccelDt(eY) = GaussianRandomNumber();
     vDirectiondAccelDt(eZ) = GaussianRandomNumber();
-
+/*
     MagnitudedAccelDt = GaussianRandomNumber();
     MagnitudeAccel    += MagnitudedAccelDt * DeltaT;
     Magnitude         += MagnitudeAccel * DeltaT;
+*/
+    Magnitude         += GaussianRandomNumber() * DeltaT;
 
     vDirectiondAccelDt.Normalize();
     vDirectionAccel += TurbRate * vDirectiondAccelDt * DeltaT;
index bd550246e378d6cff2f46dec7a617b852e4be7f6..2a7443e5d02c8557e3b9a142beffc9901a76f01b 100644 (file)
@@ -43,7 +43,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGModel.h"
-#include <math/FGColumnVector3.h>
+#include "math/FGColumnVector3.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index be578ae1c4c95805f1e3d8db1cf3721c83c15ab4..815a1b400d09e0e0790f2ffc83b687c62743f2e8 100755 (executable)
@@ -44,14 +44,18 @@ INCLUDES
 #include "FGAerodynamics.h"
 #include "FGPropagate.h"
 #include "FGAtmosphere.h"
-#include <FGFDMExec.h>
+#include "FGFDMExec.h"
 #include "FGAircraft.h"
 #include "FGInertial.h"
 #include "FGExternalReactions.h"
 #include "FGBuoyantForces.h"
 #include "FGGroundReactions.h"
 #include "FGPropulsion.h"
-#include <input_output/FGPropertyManager.h>
+#include "FGMassBalance.h"
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -138,6 +142,8 @@ bool FGAuxiliary::Run()
   if (FGModel::Run()) return true; // return true if error returned from base class
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   const FGColumnVector3& vPQR = Propagate->GetPQR();
   const FGColumnVector3& vUVW = Propagate->GetUVW();
   const FGColumnVector3& vUVWdot = Propagate->GetUVWdot();
@@ -286,6 +292,8 @@ bool FGAuxiliary::Run()
 
   CalculateRelativePosition();
 
+  RunPostFunctions();
+
   return false;
 }
 
@@ -392,6 +400,13 @@ void FGAuxiliary::CalculateRelativePosition(void)
   relative_position = sqrt(lat_relative_position*lat_relative_position + lon_relative_position*lon_relative_position);
 };
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGAuxiliary::BadUnits(void) const
+{
+  cerr << "Bad units" << endl; return 0.0;
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index 6420e3b975bce333e338e0dfe275ab371e489b79..e3baa49117a8d1e64fe9741302d6b56009a1d370 100644 (file)
@@ -40,9 +40,8 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGModel.h"
-#include <FGFDMExec.h>
-#include <math/FGColumnVector3.h>
-#include <math/FGLocation.h>
+#include "math/FGColumnVector3.h"
+#include "math/FGLocation.h"
 #include "FGPropagate.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -172,15 +171,15 @@ public:
   double GetMagBeta (void) const { return fabs(beta); }
 
   double Getalpha   (int unit) const { if (unit == inDegrees) return alpha*radtodeg;
-                                       else cerr << "Bad units" << endl; return 0.0;}
+                                       else return BadUnits(); }
   double Getbeta    (int unit) const { if (unit == inDegrees) return beta*radtodeg;
-                                       else cerr << "Bad units" << endl; return 0.0;}
+                                       else return BadUnits(); }
   double Getadot    (int unit) const { if (unit == inDegrees) return adot*radtodeg;
-                                       else cerr << "Bad units" << endl; return 0.0;}
+                                       else return BadUnits(); }
   double Getbdot    (int unit) const { if (unit == inDegrees) return bdot*radtodeg;
-                                       else cerr << "Bad units" << endl; return 0.0;}
+                                       else return BadUnits(); }
   double GetMagBeta (int unit) const { if (unit == inDegrees) return fabs(beta)*radtodeg;
-                                       else cerr << "Bad units" << endl; return 0.0;}
+                                       else return BadUnits(); }
 
   double Getqbar          (void) const { return qbar;       }
   double GetqbarUW        (void) const { return qbarUW;     }
@@ -281,6 +280,7 @@ private:
   void CalculateRelativePosition(void);
 
   void bind(void);
+  double BadUnits(void) const;
   void Debug(int from);
 };
 
index 12979754919ec29c41416b12e2f8534db4366515..49d9cb2e5069402f35c9db616e99debf5bd6a17f 100644 (file)
@@ -38,7 +38,10 @@ INCLUDES
 
 #include "FGBuoyantForces.h"
 #include "FGMassBalance.h"
-#include <input_output/FGPropertyManager.h>  // Need?
+#include "input_output/FGPropertyManager.h"  // Need?
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -92,6 +95,8 @@ bool FGBuoyantForces::Run(void)
   if (FDMExec->Holding()) return false; // if paused don't execute
   if (NoneDefined) return true;
 
+  RunPreFunctions();
+
   vTotalForces.InitMatrix();
   vTotalMoments.InitMatrix();
 
@@ -101,6 +106,8 @@ bool FGBuoyantForces::Run(void)
     vTotalMoments += Cells[i]->GetMoments();
   }
 
+  RunPostFunctions();
+
   return false;
 }
 
@@ -132,6 +139,8 @@ bool FGBuoyantForces::Load(Element *element)
     gas_cell_element = document->FindNextElement("gas_cell");
   }
   
+  FGModel::PostLoad(element);
+
   return true;
 }
 
index f03a00df26e152f72f6e70558a632aa9fd46cfe9..ec664b3abde02c096869c8751da1a83b082129ed 100644 (file)
@@ -44,8 +44,8 @@ INCLUDES
 
 #include "FGModel.h"
 #include "FGGasCell.h"
-#include <math/FGColumnVector3.h>
-#include <input_output/FGXMLFileRead.h>
+#include "math/FGColumnVector3.h"
+#include "input_output/FGXMLFileRead.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 48884c4d198da135ea4d18170697bf5e21ee02f5..fa1d35d22fe90fc2dc07e9b7e08ee93ab0845195 100755 (executable)
 */
 
 #include "FGExternalForce.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
index c6573924891d5782bc1b2202528e94760a3cc4ba..d4a90db83b2b1437f6ef57c3aed35b6774f8510f 100755 (executable)
@@ -39,13 +39,13 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGFDMExec.h>
-#include <FGJSBBase.h>
-#include <models/propulsion/FGForce.h>
+#include "FGFDMExec.h"
+#include "FGJSBBase.h"
+#include "models/propulsion/FGForce.h"
 #include <string>
-#include <input_output/FGPropertyManager.h>
-#include <math/FGColumnVector3.h>
-#include <math/FGFunction.h>
+#include "input_output/FGPropertyManager.h"
+#include "math/FGColumnVector3.h"
+#include "math/FGFunction.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 6bff2bb46184e6fd05d5e6f9c1c3ef8f182221a1..a9b6ee2753b33f4c45331656e6c5ad2aad078d5a 100755 (executable)
@@ -37,8 +37,12 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGExternalReactions.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
 #include <string>
 
+using namespace std;
+
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -81,6 +85,8 @@ bool FGExternalReactions::Load(Element* el)
     force_element = el->FindNextElement("force");
   }
 
+  FGModel::PostLoad(el);
+
   return true;
 }
 
@@ -111,6 +117,8 @@ bool FGExternalReactions::Run()
   if (FDMExec->Holding()) return false; // if paused don't execute
   if (NoneDefined) return true;
 
+  RunPreFunctions();
+
   vTotalForces.InitMatrix();
   vTotalMoments.InitMatrix();
 
@@ -119,6 +127,8 @@ bool FGExternalReactions::Run()
     vTotalMoments += Forces[i]->GetMoments();
   }
 
+  RunPostFunctions();
+
   return false;
 }
 
index 60cca4440ba53c4123ead7c7669c64947cce3c6b..c6f65fe1048bcb6bb5423a38e563cadb8974070c 100755 (executable)
@@ -40,7 +40,7 @@ INCLUDES
 
 #include "FGModel.h"
 #include "FGExternalForce.h"
-#include <input_output/FGXMLElement.h>
+#include <vector>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -54,6 +54,8 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class Element;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -154,7 +156,7 @@ public:
 
 private:
 
-  vector <FGExternalForce*> Forces;
+  std::vector <FGExternalForce*> Forces;
   unsigned int numForces;
   FGColumnVector3 vTotalForces;
   FGColumnVector3 vTotalMoments;
index e1b7b9fb42e6a29aa2f790c9d6288bda5cf68798..477890295478671424b026873c20664dfeb362fb 100644 (file)
@@ -38,24 +38,28 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCS.h"
-#include <FGFDMExec.h>
-#include <input_output/FGPropertyManager.h>
+#include "FGFDMExec.h"
+#include "FGGroundReactions.h"
+#include "input_output/FGPropertyManager.h"
 #include <fstream>
 #include <sstream>
 #include <iomanip>
 
-#include <models/flight_control/FGFilter.h>
-#include <models/flight_control/FGDeadBand.h>
-#include <models/flight_control/FGGain.h>
-#include <models/flight_control/FGPID.h>
-#include <models/flight_control/FGSwitch.h>
-#include <models/flight_control/FGSummer.h>
-#include <models/flight_control/FGKinemat.h>
-#include <models/flight_control/FGFCSFunction.h>
-#include <models/flight_control/FGSensor.h>
-#include <models/flight_control/FGActuator.h>
-#include <models/flight_control/FGAccelerometer.h>
-#include <models/flight_control/FGGyro.h>
+#include "models/flight_control/FGFilter.h"
+#include "models/flight_control/FGDeadBand.h"
+#include "models/flight_control/FGGain.h"
+#include "models/flight_control/FGPID.h"
+#include "models/flight_control/FGSwitch.h"
+#include "models/flight_control/FGSummer.h"
+#include "models/flight_control/FGKinemat.h"
+#include "models/flight_control/FGFCSFunction.h"
+#include "models/flight_control/FGSensor.h"
+#include "models/flight_control/FGActuator.h"
+#include "models/flight_control/FGAccelerometer.h"
+#include "models/flight_control/FGMagnetometer.h"
+#include "models/flight_control/FGGyro.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -194,6 +198,8 @@ bool FGFCS::Run(void)
   if (FGModel::Run()) return true; // fast exit if nothing to do
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   for (i=0; i<ThrottlePos.size(); i++) ThrottlePos[i] = ThrottleCmd[i];
   for (i=0; i<MixturePos.size(); i++) MixturePos[i] = MixtureCmd[i];
   for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = PropAdvanceCmd[i];
@@ -214,6 +220,8 @@ bool FGFCS::Run(void)
   // Execute Flight Control System
   for (i=0; i<FCSComponents.size(); i++) FCSComponents[i]->Run();
 
+  RunPostFunctions();
+
   return false;
 }
 
@@ -643,6 +651,8 @@ bool FGFCS::Load(Element* el, SystemType systype)
           Components->push_back(new FGSensor(this, component_element));
         } else if (component_element->GetName() == string("accelerometer")) {
           Components->push_back(new FGAccelerometer(this, component_element));
+        } else if (component_element->GetName() == string("magnetometer")) {
+          Components->push_back(new FGMagnetometer(this, component_element));
         } else if (component_element->GetName() == string("gyro")) {
           Components->push_back(new FGGyro(this, component_element));
         } else {
@@ -682,7 +692,7 @@ double FGFCS::GetBrake(FGLGear::BrakeGroup bg)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGFCS::FindSystemFullPathname(string system_filename)
+string FGFCS::FindSystemFullPathname(const string& system_filename)
 {
   string fullpath, localpath;
   string systemPath = FDMExec->GetSystemsPath();
@@ -710,7 +720,7 @@ string FGFCS::FindSystemFullPathname(string system_filename)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-ifstream* FGFCS::FindSystemFile(string system_filename)
+ifstream* FGFCS::FindSystemFile(const string& system_filename)
 {
   string fullpath, localpath;
   string systemPath = FDMExec->GetSystemsPath();
@@ -735,7 +745,7 @@ ifstream* FGFCS::FindSystemFile(string system_filename)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGFCS::GetComponentStrings(string delimeter)
+string FGFCS::GetComponentStrings(const string& delimiter)
 {
   unsigned int comp;
   string CompStrings = "";
@@ -744,7 +754,7 @@ string FGFCS::GetComponentStrings(string delimeter)
 
   for (unsigned int i=0; i<Systems.size(); i++) {
     if (firstime) firstime = false;
-    else          CompStrings += delimeter;
+    else          CompStrings += delimiter;
 
     CompStrings += Systems[i]->GetName();
     total_count++;
@@ -753,7 +763,7 @@ string FGFCS::GetComponentStrings(string delimeter)
   for (comp = 0; comp < APComponents.size(); comp++)
   {
     if (firstime) firstime = false;
-    else          CompStrings += delimeter;
+    else          CompStrings += delimiter;
 
     CompStrings += APComponents[comp]->GetName();
     total_count++;
@@ -761,7 +771,7 @@ string FGFCS::GetComponentStrings(string delimeter)
 
   for (comp = 0; comp < FCSComponents.size(); comp++) {
     if (firstime) firstime = false;
-    else          CompStrings += delimeter;
+    else          CompStrings += delimiter;
 
     CompStrings += FCSComponents[comp]->GetName();
     total_count++;
@@ -772,7 +782,7 @@ string FGFCS::GetComponentStrings(string delimeter)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGFCS::GetComponentValues(string delimeter)
+string FGFCS::GetComponentValues(const string& delimiter)
 {
   std::ostringstream buf;
 
@@ -782,7 +792,7 @@ string FGFCS::GetComponentValues(string delimeter)
 
   for (unsigned int i=0; i<Systems.size(); i++) {
     if (firstime) firstime = false;
-    else          buf << delimeter;
+    else          buf << delimiter;
 
     buf << setprecision(9) << Systems[i]->GetOutput();
     total_count++;
@@ -790,7 +800,7 @@ string FGFCS::GetComponentValues(string delimeter)
 
   for (comp = 0; comp < APComponents.size(); comp++) {
     if (firstime) firstime = false;
-    else          buf << delimeter;
+    else          buf << delimiter;
 
     buf << setprecision(9) << APComponents[comp]->GetOutput();
     total_count++;
@@ -798,7 +808,7 @@ string FGFCS::GetComponentValues(string delimeter)
 
   for (comp = 0; comp < FCSComponents.size(); comp++) {
     if (firstime) firstime = false;
-    else          buf << delimeter;
+    else          buf << delimiter;
 
     buf << setprecision(9) << FCSComponents[comp]->GetOutput();
     total_count++;
index 79535f261dda2c0b83edf5fee016cbb668637722..b00c037a9ef447dc464406c084504b55a63d5c31 100644 (file)
@@ -38,13 +38,14 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <iosfwd>
 #include <vector>
 
 #include <string>
-#include <models/flight_control/FGFCSComponent.h>
-#include <models/FGModel.h>
-#include <models/FGLGear.h>
-#include <input_output/FGXMLFileRead.h>
+#include "models/flight_control/FGFCSComponent.h"
+#include "models/FGModel.h"
+#include "models/FGLGear.h"
+#include "input_output/FGXMLFileRead.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -352,15 +353,15 @@ public:
   FGState* GetState(void) { return State; }
 
   /** Retrieves all component names for inclusion in output stream
-      @param delimeter either a tab or comma string depending on output type
+      @param delimiter either a tab or comma string depending on output type
       @return a string containing the descriptive names for all components */
-  string GetComponentStrings(string delimeter);
+  std::string GetComponentStrings(const std::string& delimiter);
 
   /** Retrieves all component outputs for inclusion in output stream
-      @param delimeter either a tab or comma string depending on output type
+      @param delimiter either a tab or comma string depending on output type
       @return a string containing the numeric values for the current set of
       component outputs */
-  string GetComponentValues(string delimeter);
+  std::string GetComponentValues(const std::string& delimiter);
 
   /// @name Pilot input command setting
   //@{
@@ -537,8 +538,8 @@ public:
       @return true if succesful */
   bool Load(Element* el, SystemType systype);
 
-  ifstream* FindSystemFile(string system_filename);
-  string FindSystemFullPathname(string system_filename);
+  std::ifstream* FindSystemFile(const std::string& system_filename);
+  std::string FindSystemFullPathname(const std::string& system_filename);
 
   void AddThrottle(void);
   void AddGear(void);
@@ -551,20 +552,20 @@ private:
   double DePos[NForms], DaLPos[NForms], DaRPos[NForms], DrPos[NForms];
   double DfPos[NForms], DsbPos[NForms], DspPos[NForms];
   double PTrimCmd, YTrimCmd, RTrimCmd;
-  vector <double> ThrottleCmd;
-  vector <double> ThrottlePos;
-  vector <double> MixtureCmd;
-  vector <double> MixturePos;
-  vector <double> PropAdvanceCmd;
-  vector <double> PropAdvance;
-  vector <bool> PropFeatherCmd;
-  vector <bool> PropFeather;
-  vector <double> SteerPosDeg;
+  std::vector <double> ThrottleCmd;
+  std::vector <double> ThrottlePos;
+  std::vector <double> MixtureCmd;
+  std::vector <double> MixturePos;
+  std::vector <double> PropAdvanceCmd;
+  std::vector <double> PropAdvance;
+  std::vector <bool> PropFeatherCmd;
+  std::vector <bool> PropFeather;
+  std::vector <double> SteerPosDeg;
   double LeftBrake, RightBrake, CenterBrake; // Brake settings
   double GearCmd,GearPos;
   double TailhookPos, WingFoldPos;
 
-  typedef vector <FGFCSComponent*> FCSCompVec;
+  typedef std::vector <FGFCSComponent*> FCSCompVec;
   FCSCompVec Systems;
   FCSCompVec FCSComponents;
   FCSCompVec APComponents;
index e6b32b6e00ec1ccd967d4f7b35397210a78653de..73c5091dd0659aeac38e140d005678291042206e 100644 (file)
@@ -35,16 +35,21 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGFDMExec.h>
-#include <models/FGAuxiliary.h>
-#include <models/FGAtmosphere.h>
-#include <models/FGInertial.h>
-#include <models/FGMassBalance.h>
+#include "FGFDMExec.h"
+#include "models/FGAuxiliary.h"
+#include "models/FGAtmosphere.h"
+#include "models/FGInertial.h"
+#include "models/FGMassBalance.h"
 #include "FGGasCell.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+#include <cstdlib>
 
 using std::cerr;
 using std::endl;
 using std::cout;
+using std::string;
+using std::max;
 
 namespace JSBSim {
 
index fa7021ff474bd8a54f9691077164847f9c292b7b..0aae911b1076033d7bd620f17c622dd20d3558b1 100644 (file)
@@ -39,17 +39,12 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
-#include <input_output/FGXMLElement.h>
-#include <math/FGColumnVector3.h>
-#include <models/propulsion/FGForce.h>
-#include <math/FGFunction.h>
+#include "FGJSBBase.h"
+#include "math/FGColumnVector3.h"
+#include "models/propulsion/FGForce.h"
+#include "math/FGFunction.h"
 
 #include <string>
-using std::string;
-using std::cerr;
-using std::endl;
-using std::cout;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -64,6 +59,7 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 class FGBallonet;
+class Element;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -230,7 +226,7 @@ private:
   enum GasType {ttUNKNOWN, ttHYDROGEN, ttHELIUM, ttAIR};
 
   GasType Type;
-  string type;
+  std::string type;
   int CellNum;
   // Structural constants
   double MaxVolume;                 // [ft�]
index 4a430144d6045966df1d64b3c98dc2a95d5cd849..c8afc723b711578848d01d2dd4b6cad3f31977d9 100644 (file)
@@ -39,7 +39,10 @@ INCLUDES
 #include <iomanip>
 
 #include "FGGroundReactions.h"
-#include <input_output/FGPropertyManager.h>
+#include "FGFCS.h"
+#include "input_output/FGPropertyManager.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -86,6 +89,8 @@ bool FGGroundReactions::Run(void)
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   vForces.InitMatrix();
   vMoments.InitMatrix();
 
@@ -95,10 +100,12 @@ bool FGGroundReactions::Run(void)
   // Perhaps there is some commonality for things which only need to be
   // calculated once.
   for (unsigned int i=0; i<lGear.size(); i++) {
-    vForces  += lGear[i]->Force();
-    vMoments += lGear[i]->Moment();
+    vForces  += lGear[i]->GetBodyForces();
+    vMoments += lGear[i]->GetMoments();
   }
 
+  RunPostFunctions();
+
   return false;
 }
 
@@ -135,6 +142,8 @@ bool FGGroundReactions::Load(Element* el)
 
   for (unsigned int i=0; i<lGear.size();i++) lGear[i]->bind();
 
+  FGModel::PostLoad(el);
+
   return true;
 }
 
@@ -182,7 +191,7 @@ string FGGroundReactions::GetGroundReactionValues(string delimeter)
   for (unsigned int i=0;i<lGear.size();i++) {
     if (lGear[i]->IsBogey()) {
       FGLGear *gear = lGear[i];
-      buf << (gear->GetWOW() ? "1, " : "0, ")
+      buf << (gear->GetWOW() ? "1" : "0") << delimeter
           << setprecision(5) << gear->GetCompLen() << delimeter
           << setprecision(6) << gear->GetCompVel() << delimeter
           << setprecision(10) << gear->GetCompForce() << delimeter
index 9ad5ae8365fc91aa17fe1c0cf6f48a5f6ecadedb..a5785d6ca72139060cf1daf39966e87169b8bb02 100644 (file)
@@ -42,8 +42,8 @@ INCLUDES
 
 #include "FGModel.h"
 #include "FGLGear.h"
-#include <math/FGColumnVector3.h>
-#include <input_output/FGXMLElement.h>
+#include "math/FGColumnVector3.h"
+#include "input_output/FGXMLElement.h"
 
 #define ID_GROUNDREACTIONS "$Id$"
 
index 6db0555e0caadb99f7f71b04eec9ef7dab84db59..4ff657a51e8774471cab7986cd67374a10d56371 100644 (file)
@@ -36,10 +36,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGInertial.h"
-#include <FGFDMExec.h>
+#include "FGFDMExec.h"
 #include "FGPropagate.h"
 #include "FGState.h"
 #include "FGMassBalance.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -111,11 +114,15 @@ bool FGInertial::Run(void)
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   // Gravitation accel
   double r = Propagate->GetRadius();
   gAccel = GetGAccel(r);
   earthPosAngle += State->Getdt()*RotationRate;
 
+  RunPostFunctions();
+
   return false;
 }
 
index f17d0c7ffdf29358706cec523820be76acdd6cab..cf457923636242ad26510d8eb416bcae13dfcc89 100644 (file)
@@ -41,7 +41,7 @@ INCLUDES
 #include <vector>
 
 #include "FGModel.h"
-#include <math/FGColumnVector3.h>
+#include "math/FGColumnVector3.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index e36abc27161ddc988d0500f874be369f6cdcfd17..dd124efa0937f74ddda21a65e130bfe87788a58e 100755 (executable)
@@ -42,8 +42,14 @@ INCLUDES
 #include "FGState.h"
 #include "FGFDMExec.h"
 
-#include <fstream>
+#include "input_output/FGfdmSocket.h"
+#include "input_output/FGXMLElement.h"
+
+#include <sstream>
 #include <iomanip>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -89,10 +95,8 @@ bool FGInput::InitModel(void)
 
 bool FGInput::Run(void)
 {
-  string line, token, info_string;
-  int start=0, string_start=0, string_end=0;
-  int token_start=0, token_end=0;
-  char buf[100];
+  string line, token;
+  size_t start=0, string_start=0, string_end=0;
   double value=0;
   FGPropertyManager* node=0;
 
@@ -101,6 +105,8 @@ bool FGInput::Run(void)
                                     // return false if no error
   // This model DOES execute if "Exec->Holding"
 
+  RunPreFunctions();
+
   data = socket->Receive(); // get socket transmission if present
 
   if (data.size() > 0) {
@@ -158,8 +164,9 @@ bool FGInput::Run(void)
             socket->Reply("Must be in HOLD to search properties\n");
           }
         } else if (node > 0) {
-          sprintf(buf, "%s = %12.6f\n", argument.c_str(), node->getDoubleValue());
-          socket->Reply(buf);
+          ostringstream buf;
+          buf << argument << " = " << setw(12) << setprecision(6) << node->getDoubleValue() << endl;
+          socket->Reply(buf.str());
         }
 
       } else if (command == "hold") {                  // PAUSE
@@ -181,12 +188,12 @@ bool FGInput::Run(void)
       } else if (command == "info") {                   // INFO
 
         // get info about the sim run and/or aircraft, etc.
-        sprintf(buf, "%8.3f\0", State->Getsim_time());
-        info_string  = "JSBSim version: " + JSBSim_version + "\n";
-        info_string += "Config File version: " + needed_cfg_version + "\n";
-        info_string += "Aircraft simulated: " + Aircraft->GetAircraftName() + "\n";
-        info_string += "Simulation time: " + string(buf) + "\n";
-        socket->Reply(info_string);
+        ostringstream info;
+        info << "JSBSim version: " << JSBSim_version << endl;
+        info << "Config File version: " << needed_cfg_version << endl;
+        info << "Aircraft simulated: " << Aircraft->GetAircraftName() << endl;
+        info << "Simulation time: " << setw(8) << setprecision(3) << State->Getsim_time() << endl;
+        socket->Reply(info.str());
 
       } else if (command == "help") {                   // HELP
 
@@ -208,6 +215,8 @@ bool FGInput::Run(void)
     }
   }
 
+  RunPostFunctions();
+
   return false;
 }
 
index 2344c3a799bd4ea95717459b748804e51d393469..58aa9ebdbd4070fec76852900f1c93560c463abf 100755 (executable)
@@ -40,11 +40,7 @@ INCLUDES
 
 #include "FGModel.h"
 
-#include <iostream>
-#include <fstream>
-
-#include <input_output/FGfdmSocket.h>
-#include <input_output/FGXMLElement.h>
+#include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -58,6 +54,10 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class FGFDMExec;
+class Element;
+class FGfdmSocket;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -78,7 +78,6 @@ public:
   bool InitModel(void);
   bool Run(void);
 
-  void SetType(string);
   inline void Enable(void) { enabled = true; }
   inline void Disable(void) { enabled = false; }
   inline bool Toggle(void) {enabled = !enabled; return enabled;}
@@ -88,7 +87,7 @@ private:
   bool sFirstPass, dFirstPass, enabled;
   unsigned int port;
   FGfdmSocket* socket;
-  string data;
+  std::string data;
   void Debug(int from);
 };
 }
index e3cfeadf21f44c6eed4f0fa465332458e9b7c55b..b0c448b41777baf98a5ff7375f6017505f067c27 100644 (file)
@@ -41,6 +41,16 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGLGear.h"
+#include "FGState.h"
+#include "FGGroundReactions.h"
+#include "FGFCS.h"
+#include "FGAuxiliary.h"
+#include "FGAtmosphere.h"
+#include "FGMassBalance.h"
+#include "math/FGTable.h"
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -55,13 +65,18 @@ GLOBAL DATA
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_LGEAR;
 
+// Body To Structural (body frame is rotated 180 deg about Y and lengths are given in
+// ft instead of inches)
+const FGMatrix33 FGLGear::Tb2s(-1./inchtoft, 0., 0., 0., 1./inchtoft, 0., 0., 0., -1./inchtoft);
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
+  FGForce(fdmex),
   GearNumber(number),
-  Exec(fdmex)
+  SteerAngle(0.0)
 {
   Element *force_table=0;
   Element *dampCoeff=0;
@@ -81,7 +96,8 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
   } else if (sContactType == "STRUCTURE") {
     eContactType = ctSTRUCTURE;
   } else {
-    eContactType = ctUNKNOWN;
+    // Unknown contact point types will be treated as STRUCTURE.
+    eContactType = ctSTRUCTURE;
   }
 
   if (el->FindElement("spring_coeff"))
@@ -125,7 +141,7 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
   while (force_table) {
     force_type = force_table->GetAttributeValue("type");
     if (force_type == "CORNERING_COEFF") {
-      ForceY_Table = new FGTable(Exec->GetPropertyManager(), force_table);
+      ForceY_Table = new FGTable(fdmex->GetPropertyManager(), force_table);
     } else {
       cerr << "Undefined force table for " << name << " contact point" << endl;
     }
@@ -139,8 +155,37 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
   else sSteerType = "STEERABLE";
 
   Element* element = el->FindElement("location");
-  if (element) vXYZ = element->FindElementTripletConvertTo("IN");
+  if (element) vXYZn = element->FindElementTripletConvertTo("IN");
   else {cerr << "No location given for contact " << name << endl; exit(-1);}
+  SetTransformType(FGForce::tCustom);
+
+  element = el->FindElement("orientation");
+  if (element && (eContactType == ctBOGEY)) {
+    vGearOrient = element->FindElementTripletConvertTo("RAD");
+
+    double cp,sp,cr,sr,cy,sy;
+
+    cp=cos(vGearOrient(ePitch)); sp=sin(vGearOrient(ePitch));
+    cr=cos(vGearOrient(eRoll));  sr=sin(vGearOrient(eRoll));
+    cy=cos(vGearOrient(eYaw));   sy=sin(vGearOrient(eYaw));
+
+    mTGear(1,1) =  cp*cy;
+    mTGear(2,1) =  cp*sy;
+    mTGear(3,1) = -sp;
+
+    mTGear(1,2) = sr*sp*cy - cr*sy;
+    mTGear(2,2) = sr*sp*sy + cr*cy;
+    mTGear(3,2) = sr*cp;
+
+    mTGear(1,3) = cr*sp*cy + sr*sy;
+    mTGear(2,3) = cr*sp*sy - sr*cy;
+    mTGear(3,3) = cr*cp;
+  }
+  else {
+    mTGear(1,1) = 1.;
+    mTGear(2,2) = 1.;
+    mTGear(3,3) = 1.;
+  }
 
   if      (sBrakeGroup == "LEFT"  ) eBrakeGrp = bgLeft;
   else if (sBrakeGroup == "RIGHT" ) eBrakeGrp = bgRight;
@@ -178,7 +223,13 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
     }
   }
 
-  State = Exec->GetState();
+  State       = fdmex->GetState();
+  Aircraft    = fdmex->GetAircraft();
+  Propagate   = fdmex->GetPropagate();
+  Auxiliary   = fdmex->GetAuxiliary();
+  FCS         = fdmex->GetFCS();
+  MassBalance = fdmex->GetMassBalance();
+
   LongForceLagFilterCoeff = 1/State->Getdt(); // default longitudinal force filter coefficient
   LatForceLagFilterCoeff  = 1/State->Getdt(); // default lateral force filter coefficient
 
@@ -213,13 +264,6 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
 // Add some AI here to determine if gear is located properly according to its
 // brake group type ??
 
-  State       = Exec->GetState();
-  Aircraft    = Exec->GetAircraft();
-  Propagate   = Exec->GetPropagate();
-  Auxiliary   = Exec->GetAuxiliary();
-  FCS         = Exec->GetFCS();
-  MassBalance = Exec->GetMassBalance();
-
   WOW = lastWOW = false;
   ReportEnable = true;
   FirstContact = false;
@@ -229,11 +273,9 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
   MaximumStrutForce = MaximumStrutTravel = 0.0;
   SinkRate = GroundSpeed = 0.0;
 
-  vWhlBodyVec = MassBalance->StructuralToBody(vXYZ);
-
+  vWhlBodyVec = MassBalance->StructuralToBody(vXYZn);
   vLocalGear = Propagate->GetTb2l() * vWhlBodyVec;
-
-  vLocalWhlVel.InitMatrix();
+  vWhlVelVec.InitMatrix();
 
   compressLength  = 0.0;
   compressSpeed   = 0.0;
@@ -263,36 +305,38 @@ FGLGear::~FGLGear()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGColumnVector3& FGLGear::Force(void)
+FGColumnVector3& FGLGear::GetBodyForces(void)
 {
-  double t = Exec->GetState()->Getsim_time();
-  dT = State->Getdt()*Exec->GetGroundReactions()->GetRate();
+  double t = fdmex->GetState()->Getsim_time();
+  dT = State->Getdt()*fdmex->GetGroundReactions()->GetRate();
 
-  vForce.InitMatrix();
-  vLocalForce.InitMatrix();
-  vMoment.InitMatrix();
+  vFn.InitMatrix();
 
   if (isRetractable) ComputeRetractionState();
 
   if (GearDown) {
+    double verticalZProj = 0.;
 
-    vWhlBodyVec = MassBalance->StructuralToBody(vXYZ); // Get wheel in body frame
+    vWhlBodyVec = MassBalance->StructuralToBody(vXYZn); // Get wheel in body frame
     vLocalGear = Propagate->GetTb2l() * vWhlBodyVec; // Get local frame wheel location
 
     gearLoc = Propagate->GetLocation().LocalToLocation(vLocalGear);
     // Compute the height of the theoretical location of the wheel (if strut is not compressed) with
     // respect to the ground level
-    double height = Exec->GetGroundCallback()->GetAGLevel(t, gearLoc, contact, normal, cvel);
+    double height = fdmex->GetGroundCallback()->GetAGLevel(t, gearLoc, contact, normal, cvel);
     vGroundNormal = -1. * Propagate->GetTec2b() * normal;
 
+    // The height returned above is the AGL and is expressed in the Z direction of the local
+    // coordinate frame. We now need to transform this height in actual compression of the strut (BOGEY)
+    // of in the normal direction to the ground (STRUCTURE)
     switch (eContactType) {
     case ctBOGEY:
-      // Project the height in the local coordinate frame of the strut to compute the actual compression
-      // length. The strut is assumed to be parallel to Z in the body frame.
-      compressLength = vGroundNormal(eZ) < 0.0 ? height / vGroundNormal(eZ) : 0.0;
+      verticalZProj = (Propagate->GetTb2l()*mTGear*FGColumnVector3(0.,0.,1.))(eZ);
+      compressLength = verticalZProj > 0.0 ? -height / verticalZProj : 0.0;
       break;
     case ctSTRUCTURE:
-      compressLength = -height;
+      verticalZProj = (Propagate->GetTec2l()*normal)(eZ);
+      compressLength = fabs(verticalZProj) > 0.0 ? -height / verticalZProj : 0.0;
       break;
     }
 
@@ -303,20 +347,28 @@ FGColumnVector3& FGLGear::Force(void)
       // [The next equation should really use the vector to the contact patch of
       // the tire including the strut compression and not the original vWhlBodyVec.]
 
-      FGColumnVector3 vWhlContactVec = vWhlBodyVec - FGColumnVector3(0., 0., compressLength);
-      vWhlVelVec      =  Propagate->GetPQR() * vWhlContactVec;
-      vWhlVelVec     +=  Propagate->GetUVW() - Propagate->GetTec2b() * cvel;
+      FGColumnVector3 vWhlDisplVec = mTGear * FGColumnVector3(0., 0., compressLength);
+      FGColumnVector3 vWhlContactVec = vWhlBodyVec - vWhlDisplVec;
+      vActingXYZn = vXYZn - Tb2s * vWhlDisplVec;
+      FGColumnVector3 vBodyWhlVel  = Propagate->GetPQR() * vWhlContactVec;
+      vBodyWhlVel += Propagate->GetUVW() - Propagate->GetTec2b() * cvel;
+
+      vWhlVelVec = mTGear.Transposed() * vBodyWhlVel;
 
       InitializeReporting();
       ComputeSteeringAngle();
       ComputeGroundCoordSys();
 
-      vLocalWhlVel = Tb2g * vWhlVelVec;
+      vLocalWhlVel = Transform().Transposed() * vBodyWhlVel;
 
-      compressSpeed = -vLocalWhlVel(eZ);
-      if (eContactType == ctBOGEY)
-        // Project the compression speed in the local coordinate frame of the strut
-        compressSpeed /= -vGroundNormal(eZ);
+      switch (eContactType) {
+      case ctBOGEY:
+        // Compression speed along the strut
+        compressSpeed = -vWhlVelVec(eZ);
+      case ctSTRUCTURE:
+        // Compression speed along the ground normal
+        compressSpeed = -vLocalWhlVel(eX);
+      }
 
       ComputeVerticalStrutForce();
 
@@ -325,15 +377,15 @@ FGColumnVector3& FGLGear::Force(void)
         ComputeSlipAngle();
         ComputeBrakeForceCoefficient();
         ComputeSideForceCoefficient();
-        double sign = vLocalWhlVel(eX)>0?1.0:(vLocalWhlVel(eX)<0?-1.0:0.0);
-        vLocalForce(eX) = - ((1.0 - TirePressureNorm) * 30 + vLocalForce(eZ) * BrakeFCoeff) * sign;
-        vLocalForce(eY) = vLocalForce(eZ) * FCoeff;
+        double sign = vLocalWhlVel(eY)>0?1.0:(vLocalWhlVel(eY)<0?-1.0:0.0);
+        vFn(eY) = - ((1.0 - TirePressureNorm) * 30 + vFn(eX) * BrakeFCoeff) * sign;
+        vFn(eZ) = vFn(eX) * FCoeff;
       }
       else if (eContactType == ctSTRUCTURE) {
         FGColumnVector3 vSlipVec = vLocalWhlVel;
-        vSlipVec(eZ) = 0.;
+        vSlipVec(eX) = 0.;
         vSlipVec.Normalize();
-        vLocalForce -= staticFCoeff * vLocalForce(eZ) * vSlipVec;
+        vFn -= staticFCoeff * vFn(eX) * vSlipVec;
       }
 
       // Lag and attenuate the XY-plane forces dependent on velocity. This code
@@ -343,28 +395,25 @@ FGColumnVector3& FGLGear::Force(void)
       // If a coefficient is set to something equal to or less than zero, the
       // filter is bypassed.
 
-      if (LongForceLagFilterCoeff > 0) vLocalForce(eX) = LongForceFilter.execute(vLocalForce(eX));
-      if (LatForceLagFilterCoeff > 0)  vLocalForce(eY) = LatForceFilter.execute(vLocalForce(eY));
+      if (LongForceLagFilterCoeff > 0) vFn(eY) = LongForceFilter.execute(vFn(eY));
+      if (LatForceLagFilterCoeff > 0)  vFn(eZ) = LatForceFilter.execute(vFn(eZ));
 
-      if ((fabs(vLocalWhlVel(eX)) <= RFRV) && RFRV > 0) vLocalForce(eX) *= fabs(vLocalWhlVel(eX))/RFRV;
-      if ((fabs(vLocalWhlVel(eY)) <= SFRV) && SFRV > 0) vLocalForce(eY) *= fabs(vLocalWhlVel(eY))/SFRV;
+      if ((fabs(vLocalWhlVel(eY)) <= RFRV) && RFRV > 0) vFn(eY) *= fabs(vLocalWhlVel(eY))/RFRV;
+      if ((fabs(vLocalWhlVel(eZ)) <= SFRV) && SFRV > 0) vFn(eZ) *= fabs(vLocalWhlVel(eZ))/SFRV;
 
       // End section for attenuating gear jitter
 
-      // Transform the forces back to the body frame and compute the moment.
-
-      vForce  = Tg2b * vLocalForce;
-      vMoment = vWhlContactVec * vForce;
-
     } else { // Gear is NOT compressed
 
       WOW = false;
       compressLength = 0.0;
       compressSpeed = 0.0;
+      WheelSlip = 0.0;
+      StrutForce = 0.0;
 
       // Let wheel spin down slowly
-      vLocalWhlVel(eX) -= 13.0*dT;
-      if (vLocalWhlVel(eX) < 0.0) vLocalWhlVel(eX) = 0.0;
+      vWhlVelVec(eX) -= 13.0*dT;
+      if (vWhlVelVec(eX) < 0.0) vWhlVelVec(eX) = 0.0;
 
       // Return to neutral position between 1.0 and 0.8 gear pos.
       SteerAngle *= max(GetGearUnitPos()-0.8, 0.0)/0.2;
@@ -381,64 +430,46 @@ FGColumnVector3& FGLGear::Force(void)
 
   lastWOW = WOW;
 
-  return vForce;
+  return FGForce::GetBodyForces();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 // Build a local "ground" coordinate system defined by
-//  eX : projection of the rolling direction on the ground
-//  eY : projection of the sliping direction on the ground
-//  eZ : normal to the ground
+//  eX : normal to the ground
+//  eY : projection of the rolling direction on the ground
+//  eZ : projection of the sliping direction on the ground
 
 void FGLGear::ComputeGroundCoordSys(void)
 {
-  FGColumnVector3 vRollingGroundVec;
+  // Euler angles are built up to create a local frame to describe the forces
+  // applied to the gear by the ground. Here pitch, yaw and roll do not have
+  // any physical meaning. It is just a convenient notation.
+  // First, "pitch" and "yaw" are determined in order to align eX with the
+  // ground normal.
+  if (vGroundNormal(eZ) < -1.0)
+    vOrient(ePitch) = 0.5*M_PI;
+  else if (1.0 < vGroundNormal(eZ))
+    vOrient(ePitch) = -0.5*M_PI;
+  else
+    vOrient(ePitch) = asin(-vGroundNormal(eZ));
+
+  if (fabs(vOrient(ePitch)) == 0.5*M_PI)
+    vOrient(eYaw) = 0.;
+  else
+    vOrient(eYaw) = atan2(vGroundNormal(eY), vGroundNormal(eX));
+  
+  vOrient(eRoll) = 0.;
+  UpdateCustomTransformMatrix();
 
   if (eContactType == ctBOGEY) {
-    // Compute the rolling direction projected on the ground
-    // It consists in finding a vector 'r' such that 'r' lies in the plane (w,z) and r.n = 0 (scalar
-    // product) where:
-    // 'n' is the normal to the ground,
-    // (x,y,z) are the directions defined in the body coord system
-    // and 'w' is 'x' rotated by the steering angle (SteerAngle) in the plane (x,y). 
-    // r = u * w + v * z and r.n = 0 => v/u = -w.n/z.n = a
-    // We also want u**2+v**2=1 and u > 0 (i.e. r orientated in the same 'direction' than w)
-    // after some arithmetic, one finds that :
-    double a = -(vGroundNormal(eX)*cos(SteerAngle)+vGroundNormal(eY)*sin(SteerAngle)) / vGroundNormal(eZ);
-    double u = 1. / sqrt(1. + a*a);
-    double v = a * u;
-    vRollingGroundVec = FGColumnVector3(u * cos(SteerAngle), u * sin(SteerAngle), v);
-  }
-  else {
-    // Here the only significant direction is the normal to the ground "vGroundNormal". Since there is
-    // no wheel the 2 other vectors of the orthonormal basis are not meaningful and are only used to
-    // create the transformation matrix Tg2b. So we are building vRollingGroundVec as an arbitrary
-    // vector normal to vGroundNormal
-    if (fabs(vGroundNormal(eX)) > 0.)
-      vRollingGroundVec = FGColumnVector3(-vGroundNormal(eZ)/vGroundNormal(eX), 0., 1.);
-    else if (fabs(vGroundNormal(eY)) > 0.)
-      vRollingGroundVec = FGColumnVector3(0., -vGroundNormal(eZ)/vGroundNormal(eY), 1.);
-    else
-      vRollingGroundVec = FGColumnVector3(1., 0., -vGroundNormal(eX)/vGroundNormal(eZ));
+    // In the case of a bogey, the third angle "roll" is used to align the axis eY and eZ
+    // to the rolling and sliping direction respectively.
+    FGColumnVector3 updatedRollingAxis = Transform().Transposed() * mTGear
+                                       * FGColumnVector3(-sin(SteerAngle), cos(SteerAngle), 0.);
 
-    vRollingGroundVec.Normalize();
+    vOrient(eRoll) = atan2(updatedRollingAxis(eY), -updatedRollingAxis(eZ));
+    UpdateCustomTransformMatrix();
   }
-
-  // The sliping direction is the cross product multiplication of the ground normal and rolling
-  // directions
-  FGColumnVector3 vSlipGroundVec = vGroundNormal * vRollingGroundVec;
-
-  Tg2b(1,1) = vRollingGroundVec(eX);
-  Tg2b(2,1) = vRollingGroundVec(eY);
-  Tg2b(3,1) = vRollingGroundVec(eZ);
-  Tg2b(1,2) = vSlipGroundVec(eX);
-  Tg2b(2,2) = vSlipGroundVec(eY);
-  Tg2b(3,2) = vSlipGroundVec(eZ);
-  Tg2b(1,3) = vGroundNormal(eX);
-  Tg2b(2,3) = vGroundNormal(eY);
-  Tg2b(3,3) = vGroundNormal(eZ);
-
-  Tb2g = Tg2b.Transposed();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -450,7 +481,7 @@ void FGLGear::ComputeRetractionState(void)
     GearUp   = true;
     WOW      = false;
     GearDown = false;
-    vLocalWhlVel.InitMatrix();
+    vWhlVelVec.InitMatrix();
   } else if (gearPos > 0.99) {
     GearDown = true;
     GearUp   = false;
@@ -465,7 +496,7 @@ void FGLGear::ComputeRetractionState(void)
 void FGLGear::ComputeSlipAngle(void)
 {
   // Calculate tire slip angle.
-  WheelSlip = -atan2(vLocalWhlVel(eY), fabs(vLocalWhlVel(eX)))*radtodeg;
+  WheelSlip = -atan2(vLocalWhlVel(eZ), fabs(vLocalWhlVel(eY)))*radtodeg;
 
   // Filter the wheel slip angle
   if (WheelSlipLagFilterCoeff > 0) WheelSlip = WheelSlipFilter.execute(WheelSlip);
@@ -485,7 +516,7 @@ void FGLGear::ComputeSteeringAngle(void)
     SteerAngle = 0.0;
     break;
   case stCaster:
-    SteerAngle = atan2(fabs(vWhlVelVec(eX)), vWhlVelVec(eY));
+    SteerAngle = atan2(vWhlVelVec(eY), fabs(vWhlVelVec(eX)));
     break;
   default:
     cerr << "Improper steering type membership detected for this gear." << endl;
@@ -540,7 +571,7 @@ void FGLGear::InitializeReporting(void)
 
 void FGLGear::ReportTakeoffOrLanding(void)
 {
-  double deltaT = State->Getdt()*Exec->GetGroundReactions()->GetRate();
+  double deltaT = State->Getdt()*fdmex->GetGroundReactions()->GetRate();
 
   if (FirstContact)
     LandingDistanceTraveled += Auxiliary->GetVground()*deltaT;
@@ -553,7 +584,7 @@ void FGLGear::ReportTakeoffOrLanding(void)
   if ( ReportEnable
        && Auxiliary->GetVground() <= 0.05
        && !LandingReported
-       && Exec->GetGroundReactions()->GetWOW())
+       && fdmex->GetGroundReactions()->GetWOW())
   {
     if (debug_lvl > 0) Report(erLand);
   }
@@ -561,7 +592,7 @@ void FGLGear::ReportTakeoffOrLanding(void)
   if ( ReportEnable
        && !TakeoffReported
        && (Propagate->GetDistanceAGL() - vLocalGear(eZ)) > 50.0
-       && !Exec->GetGroundReactions()->GetWOW())
+       && !fdmex->GetGroundReactions()->GetWOW())
   {
     if (debug_lvl > 0) Report(erTakeoff);
   }
@@ -575,8 +606,8 @@ void FGLGear::ReportTakeoffOrLanding(void)
 void FGLGear::CrashDetect(void)
 {
   if ( (compressLength > 500.0 ||
-      vForce.Magnitude() > 100000000.0 ||
-      vMoment.Magnitude() > 5000000000.0 ||
+      vFn.Magnitude() > 100000000.0 ||
+      GetMoments().Magnitude() > 5000000000.0 ||
       SinkRate > 1.4666*30 ) && !State->IntegrationSuspended())
   {
     PutMessage("Crash Detected: Simulation FREEZE.");
@@ -678,10 +709,10 @@ void FGLGear::ComputeVerticalStrutForce(void)
   switch (eContactType) {
   case ctBOGEY:
     // Project back the strut force in the local coordinate frame of the ground
-    vLocalForce(eZ) =  StrutForce / vGroundNormal(eZ);
+    vFn(eX) = StrutForce / (mTGear.Transposed()*vGroundNormal)(eZ);
     break;
   case ctSTRUCTURE:
-    vLocalForce(eZ) = -StrutForce;
+    vFn(eX) = -StrutForce;
     break;
   }
 
@@ -711,30 +742,33 @@ void FGLGear::bind(void)
   base_property_name = CreateIndexedPropertyName("gear/unit", GearNumber);
   if (eContactType == ctBOGEY) {
     property_name = base_property_name + "/slip-angle-deg";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), &WheelSlip );
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), &WheelSlip );
     property_name = base_property_name + "/WOW";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), &WOW );
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), &WOW );
     property_name = base_property_name + "/wheel-speed-fps";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), (FGLGear*)this,
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), (FGLGear*)this,
                           &FGLGear::GetWheelRollVel);
     property_name = base_property_name + "/z-position";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), (FGLGear*)this,
-                          &FGLGear::GetZPosition, &FGLGear::SetZPosition);
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), (FGForce*)this,
+                          &FGForce::GetLocationZ, &FGForce::SetLocationZ);
     property_name = base_property_name + "/compression-ft";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), &compressLength );
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), &compressLength );
     property_name = base_property_name + "/side_friction_coeff";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), &FCoeff );
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), &FCoeff );
 
     property_name = base_property_name + "/static_friction_coeff";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), &staticFCoeff );
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), &staticFCoeff );
 
+    if (eSteerType == stCaster) {
+      property_name = base_property_name + "/steering-angle-rad";
+      fdmex->GetPropertyManager()->Tie( property_name.c_str(), &SteerAngle );
+    }
   }
 
   if( isRetractable ) {
     property_name = base_property_name + "/pos-norm";
-    Exec->GetPropertyManager()->Tie( property_name.c_str(), &GearPos );
+    fdmex->GetPropertyManager()->Tie( property_name.c_str(), &GearPos );
   }
-
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -746,7 +780,7 @@ void FGLGear::Report(ReportType repType)
   switch(repType) {
   case erLand:
     cout << endl << "Touchdown report for " << name << " (WOW at time: "
-         << Exec->GetState()->Getsim_time() << " seconds)" << endl;
+         << fdmex->GetState()->Getsim_time() << " seconds)" << endl;
     cout << "  Sink rate at contact:  " << SinkRate                << " fps,    "
                                 << SinkRate*0.3048          << " mps"     << endl;
     cout << "  Contact ground speed:  " << GroundSpeed*.5925       << " knots,  "
@@ -761,18 +795,20 @@ void FGLGear::Report(ReportType repType)
     break;
   case erTakeoff:
     cout << endl << "Takeoff report for " << name << " (Liftoff at time: "
-         << Exec->GetState()->Getsim_time() << " seconds)" << endl;
+         << fdmex->GetState()->Getsim_time() << " seconds)" << endl;
     cout << "  Distance traveled:                " << TakeoffDistanceTraveled
          << " ft,     " << TakeoffDistanceTraveled*0.3048  << " meters"  << endl;
     cout << "  Distance traveled (over 50'):     " << TakeoffDistanceTraveled50ft
          << " ft,     " << TakeoffDistanceTraveled50ft*0.3048 << " meters" << endl;
-    cout << "  [Altitude (ASL): " << Exec->GetPropagate()->GetAltitudeASL() << " ft. / "
-         << Exec->GetPropagate()->GetAltitudeASLmeters() << " m  | Temperature: "
-         << Exec->GetAtmosphere()->GetTemperature() - 459.67 << " F / "
-         << RankineToCelsius(Exec->GetAtmosphere()->GetTemperature()) << " C]" << endl;
-    cout << "  [Velocity (KCAS): " << Exec->GetAuxiliary()->GetVcalibratedKTS() << "]" << endl;
+    cout << "  [Altitude (ASL): " << fdmex->GetPropagate()->GetAltitudeASL() << " ft. / "
+         << fdmex->GetPropagate()->GetAltitudeASLmeters() << " m  | Temperature: "
+         << fdmex->GetAtmosphere()->GetTemperature() - 459.67 << " F / "
+         << RankineToCelsius(fdmex->GetAtmosphere()->GetTemperature()) << " C]" << endl;
+    cout << "  [Velocity (KCAS): " << fdmex->GetAuxiliary()->GetVcalibratedKTS() << "]" << endl;
     TakeoffReported = true;
     break;
+  case erNone:
+    break;
   }
 }
 
@@ -802,7 +838,7 @@ void FGLGear::Debug(int from)
   if (debug_lvl & 1) { // Standard console startup message output
     if (from == 0) { // Constructor - loading and initialization
       cout << "    " << sContactType << " " << name          << endl;
-      cout << "      Location: "         << vXYZ          << endl;
+      cout << "      Location: "         << vXYZn          << endl;
       cout << "      Spring Constant:  " << kSpring       << endl;
 
       if (eDampType == dtLinear)
index b7e2f1b83de5e55c08728bc9c8a47ad66a5a90e4..9b86b68794d174fb5565ca324d979b4caaf85d7a 100644 (file)
@@ -38,11 +38,8 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
-#include <FGFDMExec.h>
-#include <input_output/FGXMLElement.h>
-#include <math/FGColumnVector3.h>
-#include <math/FGTable.h>
+#include "models/propulsion/FGForce.h"
+#include "math/FGColumnVector3.h"
 #include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -63,6 +60,8 @@ class FGFCS;
 class FGState;
 class FGMassBalance;
 class FGAuxiliary;
+class FGTable;
+class Element;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -163,12 +162,17 @@ CLASS DOCUMENTATION
                 <y> {number} </y>
                 <z> {number} </z>
             </location>
+            <orientation unit="{RAD | DEG}">
+                <pitch> {number} </pitch>
+                <roll> {number} </roll>
+                <yaw> {number} </yaw>
+            </orientation>
             <static_friction> {number} </static_friction>
             <dynamic_friction> {number} </dynamic_friction>
             <rolling_friction> {number} </rolling_friction>
             <spring_coeff unit="{LBS/FT | N/M}"> {number} </spring_coeff>
-            <damping_coeff unit="{LBS/FT/SEC | N/M/SEC}"> {number} </damping_coeff>
-            <damping_coeff_rebound unit="{LBS/FT/SEC | N/M/SEC}"> {number} </damping_coeff_rebound>
+            <damping_coeff [type="SQUARE"] unit="{LBS/FT/SEC | N/M/SEC}"> {number} </damping_coeff>
+            <damping_coeff_rebound [type="SQUARE"] unit="{LBS/FT/SEC | N/M/SEC}"> {number} </damping_coeff_rebound>
             <max_steer unit="DEG"> {number | 0 | 360} </max_steer>
             <brake_group> {NONE | LEFT | RIGHT | CENTER | NOSE | TAIL} </brake_group>
             <retractable>{0 | 1}</retractable>
@@ -199,7 +203,7 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGLGear : public FGJSBBase
+class FGLGear : public FGForce
 {
 public:
   /// Brake grouping enumerators
@@ -207,7 +211,7 @@ public:
   /// Steering group membership enumerators
   enum SteerType {stSteer, stFixed, stCaster};
   /// Contact point type
-  enum ContactType {ctBOGEY, ctSTRUCTURE, ctUNKNOWN};
+  enum ContactType {ctBOGEY, ctSTRUCTURE};
   /// Report type enumerators
   enum ReportType {erNone=0, erTakeoff, erLand};
   /// Damping types
@@ -222,9 +226,7 @@ public:
   ~FGLGear();
 
   /// The Force vector for this gear
-  FGColumnVector3& Force(void);
-  /// The Moment vector for this gear
-  FGColumnVector3& Moment(void) {return vMoment;}
+  FGColumnVector3& GetBodyForces(void);
 
   /// Gets the location of the gear in Body axes
   FGColumnVector3& GetBodyLocation(void) { return vWhlBodyVec; }
@@ -269,35 +271,34 @@ public:
   int GetBrakeGroup(void) const { return (int)eBrakeGrp; }
   int GetSteerType(void) const  { return (int)eSteerType; }
 
-  double GetZPosition(void) const { return vXYZ(3); }
-  void SetZPosition(double z) { vXYZ(3) = z; }
-
-  bool GetSteerable(void) const { return eSteerType != stFixed; }
+  bool GetSteerable(void) const        { return eSteerType != stFixed; }
   bool GetRetractable(void) const      { return isRetractable;   }
   bool GetGearUnitUp(void) const       { return GearUp;          }
   bool GetGearUnitDown(void) const     { return GearDown;        }
-  double GetWheelSideForce(void) const { return vLocalForce(eY); }
-  double GetWheelRollForce(void) const { return vLocalForce(eX); }
-  double GetWheelSideVel(void) const   { return vWhlVelVec(eY);  }
-  double GetWheelRollVel(void) const   { return vWhlVelVec(eX);  }
-  double GetBodyXForce(void) const     { return vForce(eX);      }
-  double GetBodyYForce(void) const     { return vForce(eY);      }
+  double GetWheelRollForce(void) {
+    FGColumnVector3 vForce = mTGear.Transposed() * FGForce::GetBodyForces();
+    return vForce(eX)*cos(SteerAngle) + vForce(eY)*sin(SteerAngle); }
+  double GetWheelSideForce(void) {
+    FGColumnVector3 vForce = mTGear.Transposed() * FGForce::GetBodyForces();
+    return vForce(eY)*cos(SteerAngle) - vForce(eX)*sin(SteerAngle); }
+  double GetWheelRollVel(void) const   { return vWhlVelVec(eX)*cos(SteerAngle)
+                                              + vWhlVelVec(eY)*sin(SteerAngle);  }
+  double GetWheelSideVel(void) const   { return vWhlVelVec(eY)*cos(SteerAngle)
+                                              - vWhlVelVec(eX)*sin(SteerAngle);  }
   double GetWheelSlipAngle(void) const { return WheelSlip;       }
-  double GetWheelVel(int axis) const          { return vWhlVelVec(axis);}
-  bool IsBogey(void) const                    { return (eContactType == ctBOGEY);}
+  double GetWheelVel(int axis) const   { return vWhlVelVec(axis);}
+  bool IsBogey(void) const             { return (eContactType == ctBOGEY);}
   double GetGearUnitPos(void);
 
   void bind(void);
 
 private:
   int GearNumber;
-  FGMatrix33 Tg2b, Tb2g;
-  FGColumnVector3 vXYZ;
-  FGColumnVector3 vMoment;
+  static const FGMatrix33 Tb2s;
+  FGMatrix33 mTGear;
+  FGColumnVector3 vGearOrient;
   FGColumnVector3 vWhlBodyVec;
   FGColumnVector3 vLocalGear;
-  FGColumnVector3 vForce;
-  FGColumnVector3 vLocalForce;
   FGColumnVector3 vWhlVelVec, vLocalWhlVel;     // Velocity of this wheel
   FGColumnVector3 normal, cvel, vGroundNormal;
   FGLocation contact, gearLoc;
@@ -336,11 +337,11 @@ private:
   bool isRetractable;
   bool GearUp, GearDown;
   bool Servicable;
-  string name;
-  string sSteerType;
-  string sBrakeGroup;
-  string sRetractable;
-  string sContactType;
+  std::string name;
+  std::string sSteerType;
+  std::string sBrakeGroup;
+  std::string sRetractable;
+  std::string sContactType;
 
   BrakeGroup  eBrakeGrp;
   ContactType eContactType;
@@ -358,7 +359,6 @@ private:
   Filter LatForceFilter;
   Filter WheelSlipFilter;
 
-  FGFDMExec*     Exec;
   FGState*       State;
   FGAircraft*    Aircraft;
   FGPropagate*   Propagate;
@@ -381,12 +381,6 @@ private:
   void Debug(int from);
 };
 }
-#include "FGAircraft.h"
-#include "FGPropagate.h"
-#include "FGAuxiliary.h"
-#include "FGFCS.h"
-#include "FGMassBalance.h"
-#include "FGState.h"
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
index 2b599ffcc9947186f3ee5dfbbfb56b7a5e30c479..7b6752a3ea7e00e4a58bed237f28d3cbe419187b 100644 (file)
@@ -41,7 +41,11 @@ INCLUDES
 #include "FGMassBalance.h"
 #include "FGPropulsion.h"
 #include "FGBuoyantForces.h"
-#include <input_output/FGPropertyManager.h>
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -148,6 +152,8 @@ bool FGMassBalance::Load(Element* el)
 
   Mass = lbtoslug*Weight;
 
+  FGModel::PostLoad(el);
+
   Debug(2);
   return true;
 }
@@ -162,6 +168,8 @@ bool FGMassBalance::Run(void)
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   double ChildFDMWeight = 0.0;
   for (int fdm=0; fdm<FDMExec->GetFDMCount(); fdm++) {
     if (FDMExec->GetChildFDM(fdm)->mated) ChildFDMWeight += FDMExec->GetChildFDM(fdm)->exec->GetMassBalance()->GetWeight();
@@ -222,6 +230,8 @@ bool FGMassBalance::Run(void)
                     k2, k4, k5,
                     k3, k5, k6 );
 
+  RunPostFunctions();
+
   Debug(0);
 
   return false;
@@ -338,6 +348,24 @@ void FGMassBalance::bind(void)
                        (PMF)&FGMassBalance::GetXYZcg);
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGMassBalance::PointMass::bind(FGPropertyManager* PropertyManager, int num) {
+  string tmp = CreateIndexedPropertyName("inertia/pointmass-weight-lbs", num);
+  PropertyManager->Tie( tmp.c_str(), this, &PointMass::GetPointMassWeight,
+                                       &PointMass::SetPointMassWeight);
+
+  tmp = CreateIndexedPropertyName("inertia/pointmass-location-X-inches", num);
+  PropertyManager->Tie( tmp.c_str(), this, eX, &PointMass::GetPointMassLocation,
+                                           &PointMass::SetPointMassLocation);
+  tmp = CreateIndexedPropertyName("inertia/pointmass-location-Y-inches", num);
+  PropertyManager->Tie( tmp.c_str(), this, eY, &PointMass::GetPointMassLocation,
+                                           &PointMass::SetPointMassLocation);
+  tmp = CreateIndexedPropertyName("inertia/pointmass-location-Z-inches", num);
+  PropertyManager->Tie( tmp.c_str(), this, eZ, &PointMass::GetPointMassLocation,
+                                           &PointMass::SetPointMassLocation);
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index 9abb191721c6472a373678313745ef3af50e284b..686b27b74de18571702f571dee6ba07d81ff489d 100644 (file)
@@ -39,9 +39,9 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGModel.h"
-#include <math/FGColumnVector3.h>
-#include <math/FGMatrix33.h>
-#include <input_output/FGXMLElement.h>
+#include "math/FGColumnVector3.h"
+#include "math/FGMatrix33.h"
+#include "input_output/FGXMLElement.h"
 #include <vector>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -189,24 +189,10 @@ private:
     void SetPointMassWeight(double wt) {Weight = wt;}
     double GetPointMassWeight(void) const {return Weight;}
 
-    void bind(FGPropertyManager* PropertyManager, int num) {
-      string tmp = CreateIndexedPropertyName("inertia/pointmass-weight-lbs", num);
-      PropertyManager->Tie( tmp.c_str(), this, &PointMass::GetPointMassWeight,
-                                       &PointMass::SetPointMassWeight);
-
-      tmp = CreateIndexedPropertyName("inertia/pointmass-location-X-inches", num);
-      PropertyManager->Tie( tmp.c_str(), this, eX, &PointMass::GetPointMassLocation,
-                                           &PointMass::SetPointMassLocation);
-      tmp = CreateIndexedPropertyName("inertia/pointmass-location-Y-inches", num);
-      PropertyManager->Tie( tmp.c_str(), this, eY, &PointMass::GetPointMassLocation,
-                                           &PointMass::SetPointMassLocation);
-      tmp = CreateIndexedPropertyName("inertia/pointmass-location-Z-inches", num);
-      PropertyManager->Tie( tmp.c_str(), this, eZ, &PointMass::GetPointMassLocation,
-                                           &PointMass::SetPointMassLocation);
-    }
+    void bind(FGPropertyManager* PropertyManager, int num);
   };
 
-  vector <struct PointMass*> PointMasses;
+  std::vector <struct PointMass*> PointMasses;
 
   void bind(void);
   void Debug(int from);
index bb41c22f8ee62f19e0f119119b958990deef457a..2e2b8357e5bf70efe6a5e32039a675f22f3414f7 100644 (file)
@@ -52,6 +52,9 @@ INCLUDES
 #include "FGAircraft.h"
 #include "FGPropagate.h"
 #include "FGAuxiliary.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -102,6 +105,9 @@ FGModel::~FGModel()
   for (unsigned int i=0; i<interface_properties.size(); i++) delete interface_properties[i];
   interface_properties.clear();
 
+  for (unsigned int i=0; i<PreFunctions.size(); i++) delete PreFunctions[i];
+  for (unsigned int i=0; i<PostFunctions.size(); i++) delete PostFunctions[i];
+
   if (debug_lvl & 2) cout << "Destroyed:    FGModel" << endl;
 }
 
@@ -143,15 +149,16 @@ bool FGModel::InitModel(void)
 bool FGModel::Load(Element* el)
 {
   // Interface properties are all stored in the interface properties array.
-
   string interface_property_string = "";
 
   Element *property_element = el->FindElement("property");
-  if (property_element && debug_lvl > 0) cout << endl << "    Declared properties" << endl << endl;
+  if (property_element && debug_lvl > 0) cout << endl << "    Declared properties" 
+                                              << endl << endl;
   while (property_element) {
     interface_property_string = property_element->GetDataLine();
     if (PropertyManager->HasNode(interface_property_string)) {
-      cerr << "      Property " << interface_property_string << " is already defined." << endl;
+      cerr << "      Property " << interface_property_string 
+           << " is already defined." << endl;
     } else {
       double value=0.0;
       if ( ! property_element->GetAttributeValue("value").empty())
@@ -159,23 +166,82 @@ bool FGModel::Load(Element* el)
       interface_properties.push_back(new double(value));
       PropertyManager->Tie(interface_property_string, interface_properties.back());
       if (debug_lvl > 0)
-        cout << "      " << interface_property_string << " (initial value: " << value << ")" << endl;
+        cout << "      " << interface_property_string << " (initial value: " 
+             << value << ")" << endl << endl;
     }
     property_element = el->FindNextElement("property");
   }
   
+  // End of interface property loading logic
+
+  // Load model pre-functions, if any
+
+  Element *function = el->FindElement("function");
+  while (function) {
+    if (function->GetAttributeValue("type") == "pre") {
+      PreFunctions.push_back(new FGFunction(PropertyManager, function));
+    } else if (function->GetAttributeValue("type").empty()) { // Assume pre-function
+      string funcname = function->GetAttributeValue("name");
+      PreFunctions.push_back(new FGFunction(PropertyManager, function));
+    }
+    function = el->FindNextElement("function");
+  }
+
   return true;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+void FGModel::PostLoad(Element* el)
+{
+  // Load model post-functions, if any
+
+  Element *function = el->FindElement("function");
+  while (function) {
+    if (function->GetAttributeValue("type") == "post") {
+      PostFunctions.push_back(new FGFunction(PropertyManager, function));
+    }
+    function = el->FindNextElement("function");
+  }
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+// Tell the Functions to cache values, so when the function values 
+// are being used in the model, the functions do not get
+// calculated each time, but instead use the values that have already
+// been calculated for this frame.
+
+void FGModel::RunPreFunctions(void)
+{
+  vector <FGFunction*>::iterator it;
+  for (it = PreFunctions.begin(); it != PreFunctions.end(); it++)
+    (*it)->GetValue();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+// Tell the Functions to cache values, so when the function values 
+// are being used in the model, the functions do not get
+// calculated each time, but instead use the values that have already
+// been calculated for this frame.
+
+void FGModel::RunPostFunctions(void)
+{
+  vector <FGFunction*>::iterator it;
+  for (it = PostFunctions.begin(); it != PostFunctions.end(); it++)
+    (*it)->GetValue();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 bool FGModel::Run()
 {
   if (debug_lvl & 4) cout << "Entering Run() for model " << Name << endl;
 
-  if (exe_ctr++ >= rate) exe_ctr = 1;
+  if (rate == 1) return false; // Fast exit if nothing to do
+
+  if (exe_ctr >= rate) exe_ctr = 1;
 
-  if (exe_ctr == 1) return false;
+  if (exe_ctr++ == 1) return false;
   else              return true;
 }
 
index 1464296aabd417599295eac0f3d2c33f770171c4..5907328f9e0514249f512ca8619ec8f65866be0c 100644 (file)
@@ -38,11 +38,9 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
-#include <input_output/FGPropertyManager.h>
-#include <input_output/FGXMLElement.h>
+#include "FGJSBBase.h"
+#include "math/FGFunction.h"
 
-#include <iostream>
 #include <string>
 #include <vector>
 
@@ -52,8 +50,6 @@ DEFINITIONS
 
 #define ID_MODEL "$Id$"
 
-using namespace std;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -74,6 +70,8 @@ class FGBuoyantForces;
 class FGAircraft;
 class FGPropagate;
 class FGAuxiliary;
+class Element;
+class FGPropertyManager;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -96,13 +94,8 @@ public:
   /// Destructor
   ~FGModel();
 
-  /** Loads this model.
-      @param el a pointer to the element
-      @return true if model is successfully loaded*/
-  virtual bool Load(Element* el);
-
   FGModel* NextModel;
-  string Name;
+  std::string Name;
 
   /** Runs the model; called by the Executive
       @see JSBSim.cpp documentation
@@ -119,6 +112,16 @@ protected:
   int exe_ctr;
   int rate;
 
+  void RunPreFunctions(void);
+  void RunPostFunctions(void);
+
+  /** Loads this model.
+      @param el a pointer to the element
+      @return true if model is successfully loaded*/
+  virtual bool Load(Element* el);
+
+  void PostLoad(Element* el);
+
   virtual void Debug(int from);
 
   FGFDMExec*         FDMExec;
@@ -136,8 +139,10 @@ protected:
   FGPropagate*       Propagate;
   FGAuxiliary*       Auxiliary;
   FGPropertyManager* PropertyManager;
+  std::vector <FGFunction*> PreFunctions;
+  std::vector <FGFunction*> PostFunctions;
 
-  vector <double*> interface_properties;
+  std::vector <double*> interface_properties;
 };
 }
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 4a34a5c22d2c6680ef5f11c70032a62f50f3f13a..e358ce0285a9340136f19142254bda24606a80f5 100644 (file)
@@ -53,13 +53,16 @@ INCLUDES
 #include "FGPropagate.h"
 #include "FGAuxiliary.h"
 #include "FGInertial.h"
-#include "FGPropulsion.h"   //access to FGEngine, FGTank
+#include "models/propulsion/FGEngine.h"
+#include "models/propulsion/FGTank.h"
 #include "models/propulsion/FGPiston.h"
-#include <fstream>
+#include <sstream>
 #include <iomanip>
 #include <cstring>
+#include <cstdlib>
 
 #include "input_output/net_fdm.hxx"
+#include "input_output/FGfdmSocket.h"
 
 #if defined(WIN32) && !defined(__CYGWIN__)
 #  include <windows.h>
@@ -70,6 +73,8 @@ INCLUDES
 static const int endianTest = 1;
 #define isLittleEndian (*((char *) &endianTest ) != 0)
 
+using namespace std;
+
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
@@ -157,20 +162,17 @@ FGOutput::~FGOutput()
 
 bool FGOutput::InitModel(void)
 {
-  char fname[1000] = "";
-
   if (!FGModel::InitModel()) return false;
 
   if (Filename.size() > 0 && StartNewFile) {
-    int idx = BaseFilename.find_last_of(".");
-    int len = BaseFilename.length();
-    string extension = "";
-    if (idx != string::npos) {
-      extension = BaseFilename.substr(idx, len-idx);
-      len -= extension.length();
+    ostringstream buf;
+    string::size_type dot = BaseFilename.find_last_of('.');
+    if (dot != string::npos) {
+      buf << BaseFilename.substr(0, dot) << '_' << runID_postfix++ << BaseFilename.substr(dot);
+    } else {
+      buf << BaseFilename << '_' << runID_postfix++;
     }
-    sprintf(fname, "%s_%d%s", BaseFilename.substr(0,len).c_str(), runID_postfix++, extension.c_str());
-    Filename = string(fname);
+    Filename = buf.str();
     datafile.close();
     StartNewFile = false;
     dFirstPass = true;
@@ -186,6 +188,7 @@ bool FGOutput::Run(void)
   if (FGModel::Run()) return true;
 
   if (enabled && !State->IntegrationSuspended()&& !FDMExec->Holding()) {
+    RunPreFunctions();
     if (Type == otSocket) {
       SocketOutput();
     } else if (Type == otFlightGear) {
@@ -199,13 +202,14 @@ bool FGOutput::Run(void)
     } else {
       // Not a valid type of output
     }
+    RunPostFunctions();
   }
   return false;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGOutput::SetType(string type)
+void FGOutput::SetType(const string& type)
 {
   if (type == "CSV") {
     Type = otCSV;
@@ -227,7 +231,7 @@ void FGOutput::SetType(string type)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGOutput::DelimitedOutput(string fname)
+void FGOutput::DelimitedOutput(const string& fname)
 {
   streambuf* buffer;
   string scratch = "";
@@ -394,22 +398,22 @@ void FGOutput::DelimitedOutput(string fname)
   }
   if (SubSystems & ssForces) {
     outstream << delimeter;
-    outstream << Aerodynamics->GetvFw() << delimeter;
+    outstream << Aerodynamics->GetvFw().Dump(delimeter) << delimeter;
     outstream << Aerodynamics->GetLoD() << delimeter;
-    outstream << Aerodynamics->GetForces() << delimeter;
-    outstream << Propulsion->GetForces() << delimeter;
-    outstream << GroundReactions->GetForces() << delimeter;
-    outstream << ExternalReactions->GetForces() << delimeter;
-    outstream << BuoyantForces->GetForces() << delimeter;
+    outstream << Aerodynamics->GetForces().Dump(delimeter) << delimeter;
+    outstream << Propulsion->GetForces().Dump(delimeter) << delimeter;
+    outstream << GroundReactions->GetForces().Dump(delimeter) << delimeter;
+    outstream << ExternalReactions->GetForces().Dump(delimeter) << delimeter;
+    outstream << BuoyantForces->GetForces().Dump(delimeter) << delimeter;
     outstream << Aircraft->GetForces().Dump(delimeter);
   }
   if (SubSystems & ssMoments) {
     outstream << delimeter;
-    outstream << Aerodynamics->GetMoments() << delimeter;
-    outstream << Propulsion->GetMoments() << delimeter;
-    outstream << GroundReactions->GetMoments() << delimeter;
-    outstream << ExternalReactions->GetMoments() << delimeter;
-    outstream << BuoyantForces->GetMoments() << delimeter;
+    outstream << Aerodynamics->GetMoments().Dump(delimeter) << delimeter;
+    outstream << Propulsion->GetMoments().Dump(delimeter) << delimeter;
+    outstream << GroundReactions->GetMoments().Dump(delimeter) << delimeter;
+    outstream << ExternalReactions->GetMoments().Dump(delimeter) << delimeter;
+    outstream << BuoyantForces->GetMoments().Dump(delimeter) << delimeter;
     outstream << Aircraft->GetMoments().Dump(delimeter);
   }
   if (SubSystems & ssAtmosphere) {
@@ -426,9 +430,9 @@ void FGOutput::DelimitedOutput(string fname)
   }
   if (SubSystems & ssMassProps) {
     outstream << delimeter;
-    outstream << MassBalance->GetJ() << delimeter;
+    outstream << MassBalance->GetJ().Dump(delimeter) << delimeter;
     outstream << MassBalance->GetMass() << delimeter;
-    outstream << MassBalance->GetXYZcg();
+    outstream << MassBalance->GetXYZcg().Dump(delimeter);
   }
   if (SubSystems & ssPropagate) {
     outstream.precision(14);
@@ -918,7 +922,7 @@ void FGOutput::SocketOutput(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGOutput::SocketStatusOutput(string out_str)
+void FGOutput::SocketStatusOutput(const string& out_str)
 {
   string asciiData;
 
@@ -1084,6 +1088,7 @@ void FGOutput::Debug(int from)
         cout << scratch << " in CSV format output at rate " << 1/(State->Getdt()*rate) << " Hz" << endl;
         break;
       case otNone:
+      default:
         cout << "  No log output" << endl;
         break;
       }
index 1646dadb008e680faccc6285aed4fb4c13f8a1cb..cd1ca6e30881c39587eb101bd983a772e0b547f6 100644 (file)
@@ -41,14 +41,11 @@ INCLUDES
 
 #include "FGModel.h"
 
-#include <iostream>
 #include <fstream>
 
-#include "input_output/FGfdmSocket.h"
 #include "input_output/FGXMLFileRead.h"
 #include "input_output/net_fdm.hxx"
 
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -61,6 +58,8 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class FGfdmSocket;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -140,22 +139,22 @@ public:
   bool InitModel(void);
   bool Run(void);
 
-  void DelimitedOutput(string);
+  void DelimitedOutput(const std::string&);
   void SocketOutput(void);
   void FlightGearSocketOutput(void);
-  void SocketStatusOutput(string);
+  void SocketStatusOutput(const std::string&);
   void SocketDataFill(FGNetFDM* net);
 
 
-  void SetType(string);
+  void SetType(const std::string& type);
   void SetStartNewFile(bool tt) {StartNewFile = tt;}
   void SetSubsystems(int tt) {SubSystems = tt;}
   void Enable(void) { enabled = true; }
   void Disable(void) { enabled = false; }
   bool Toggle(void) {enabled = !enabled; return enabled;}
   bool Load(Element* el);
-  void SetOutputFileName(string fname) {Filename = fname;}
-  void SetDirectivesFile(string fname) {DirectivesFile = fname;}
+  void SetOutputFileName(const std::string& fname) {Filename = fname;}
+  void SetDirectivesFile(const std::string& fname) {DirectivesFile = fname;}
   void SetRate(int rt);
   string GetOutputFileName(void) const {return Filename;}
 
@@ -185,11 +184,11 @@ private:
   int SubSystems;
   int runID_postfix;
   bool StartNewFile;
-  string output_file_name, delimeter, BaseFilename, Filename, DirectivesFile;
-  ofstream datafile;
+  std::string output_file_name, delimeter, BaseFilename, Filename, DirectivesFile;
+  std::ofstream datafile;
   FGfdmSocket* socket;
   FGfdmSocket* flightGearSocket;
-  vector <FGPropertyManager*> OutputProperties;
+  std::vector <FGPropertyManager*> OutputProperties;
 
   void Debug(int from);
 };
index 93d6d4749e89f14dc7d80ce6195d21547a4bec79..9bd50289882d378cae31575ecb69f13b59e308a2 100644 (file)
@@ -54,15 +54,18 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <cmath>
-#include <iomanip>
+#include <cstdlib>
+#include <iostream>
 
 #include "FGPropagate.h"
-#include <FGFDMExec.h>
-#include <FGState.h>
+#include "FGFDMExec.h"
+#include "FGState.h"
 #include "FGAircraft.h"
 #include "FGMassBalance.h"
 #include "FGInertial.h"
-#include <input_output/FGPropertyManager.h>
+#include "input_output/FGPropertyManager.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -230,6 +233,8 @@ bool FGPropagate::Run(void)
   if (FGModel::Run()) return true;  // Fast return if we have nothing to do ...
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   RecomputeLocalTerrainRadius();
 
   // Calculate current aircraft radius from center of planet
@@ -341,6 +346,8 @@ bool FGPropagate::Run(void)
   last2_vLocationDot = last_vLocationDot;
   last_vLocationDot = vLocationDot;
 
+  RunPreFunctions();
+
   Debug(2);
   return false;
 }
index 6de7d11c4a0921f964e90531f7d54edc921e7c1c..c8400531870c6c46568cc272f83a01a5516605fd 100644 (file)
@@ -38,11 +38,11 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <models/FGModel.h>
-#include <math/FGColumnVector3.h>
-#include <math/FGLocation.h>
-#include <math/FGQuaternion.h>
-#include <math/FGMatrix33.h>
+#include "models/FGModel.h"
+#include "math/FGColumnVector3.h"
+#include "math/FGLocation.h"
+#include "math/FGQuaternion.h"
+#include "math/FGMatrix33.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -538,6 +538,6 @@ private:
 }
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-#include <initialization/FGInitialCondition.h>
+#include "initialization/FGInitialCondition.h"
 
 #endif
index ed066b26c3ecf2fce85daa4b7f6cefff87737166..e71dfeaf03d11cc9dcb0fb8e017801a3a6b075a1 100644 (file)
@@ -45,15 +45,24 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGPropulsion.h"
-#include <models/propulsion/FGRocket.h>
-#include <models/propulsion/FGTurbine.h>
-#include <models/propulsion/FGPiston.h>
-#include <models/propulsion/FGElectric.h>
-#include <models/propulsion/FGTurboProp.h>
-#include <input_output/FGPropertyManager.h>
-#include <input_output/FGXMLParse.h>
-#include <math/FGColumnVector3.h>
+#include "FGState.h"
+#include "models/FGFCS.h"
+#include "models/FGMassBalance.h"
+#include "models/propulsion/FGThruster.h"
+#include "models/propulsion/FGRocket.h"
+#include "models/propulsion/FGTurbine.h"
+#include "models/propulsion/FGPiston.h"
+#include "models/propulsion/FGElectric.h"
+#include "models/propulsion/FGTurboProp.h"
+#include "models/propulsion/FGTank.h"
+#include "input_output/FGPropertyManager.h"
+#include "input_output/FGXMLParse.h"
+#include "math/FGColumnVector3.h"
+#include <iostream>
 #include <sstream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -138,6 +147,8 @@ bool FGPropulsion::Run(void)
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   double dt = State->Getdt();
 
   vForces.InitMatrix();
@@ -160,6 +171,8 @@ bool FGPropulsion::Run(void)
   if (refuel) DoRefuel( dt * rate );
   if (dump) DumpFuel( dt * rate );
 
+  RunPostFunctions();
+
   return false;
 }
 
@@ -255,6 +268,20 @@ bool FGPropulsion::Load(Element* el)
 
   FGModel::Load(el); // Perform base class Load.
 
+  // Process tank definitions first to establish the number of fuel tanks
+
+  Element* tank_element = el->FindElement("tank");
+  while (tank_element) {
+    Tanks.push_back(new FGTank(FDMExec, tank_element, numTanks));
+    if (Tanks.back()->GetType() == FGTank::ttFUEL) numFuelTanks++;
+    else if (Tanks.back()->GetType() == FGTank::ttOXIDIZER) numOxiTanks++;
+    else {cerr << "Unknown tank type specified." << endl; return false;}
+    numTanks++;
+    tank_element = el->FindNextElement("tank");
+  }
+  numSelectedFuelTanks = numFuelTanks;
+  numSelectedOxiTanks  = numOxiTanks;
+
   Element* engine_element = el->FindElement("engine");
   while (engine_element) {
     engine_filename = engine_element->GetAttributeValue("file");
@@ -303,20 +330,6 @@ bool FGPropulsion::Load(Element* el)
     ResetParser();
   }
 
-  // Process tank definitions
-
-  Element* tank_element = el->FindElement("tank");
-  while (tank_element) {
-    Tanks.push_back(new FGTank(FDMExec, tank_element, numTanks));
-    if (Tanks.back()->GetType() == FGTank::ttFUEL) numFuelTanks++;
-    else if (Tanks.back()->GetType() == FGTank::ttOXIDIZER) numOxiTanks++;
-    else {cerr << "Unknown tank type specified." << endl; return false;}
-    numTanks++;
-    tank_element = el->FindNextElement("tank");
-  }
-  numSelectedFuelTanks = numFuelTanks;
-  numSelectedOxiTanks  = numOxiTanks;
-
   CalculateTankInertias();
   if (!ThrottleAdded) FCS->AddThrottle(); // need to have at least one throttle
 
@@ -324,13 +337,14 @@ bool FGPropulsion::Load(Element* el)
   if (el->FindElement("dump-rate"))
     DumpRate = el->FindElementValueAsNumberConvertTo("dump-rate", "LBS/MIN");
 
+  FGModel::PostLoad(el);
 
   return true;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGPropulsion::FindEngineFullPathname(string engine_filename)
+string FGPropulsion::FindEngineFullPathname(const string& engine_filename)
 {
   string fullpath, localpath;
   string enginePath = FDMExec->GetEnginePath();
@@ -358,7 +372,7 @@ string FGPropulsion::FindEngineFullPathname(string engine_filename)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-ifstream* FGPropulsion::FindEngineFile(string engine_filename)
+ifstream* FGPropulsion::FindEngineFile(const string& engine_filename)
 {
   string fullpath, localpath;
   string enginePath = FDMExec->GetEnginePath();
@@ -383,7 +397,7 @@ ifstream* FGPropulsion::FindEngineFile(string engine_filename)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGPropulsion::GetPropulsionStrings(string delimeter)
+string FGPropulsion::GetPropulsionStrings(const string& delimiter)
 {
   unsigned int i;
 
@@ -393,13 +407,13 @@ string FGPropulsion::GetPropulsionStrings(string delimeter)
 
   for (i=0; i<Engines.size(); i++) {
     if (firstime)  firstime = false;
-    else           PropulsionStrings += delimeter;
+    else           PropulsionStrings += delimiter;
 
-    PropulsionStrings += Engines[i]->GetEngineLabels(delimeter);
+    PropulsionStrings += Engines[i]->GetEngineLabels(delimiter);
   }
   for (i=0; i<Tanks.size(); i++) {
-    if (Tanks[i]->GetType() == FGTank::ttFUEL) buf << delimeter << "Fuel Tank " << i;
-    else if (Tanks[i]->GetType() == FGTank::ttOXIDIZER) buf << delimeter << "Oxidizer Tank " << i;
+    if (Tanks[i]->GetType() == FGTank::ttFUEL) buf << delimiter << "Fuel Tank " << i;
+    else if (Tanks[i]->GetType() == FGTank::ttOXIDIZER) buf << delimiter << "Oxidizer Tank " << i;
   }
 
   return PropulsionStrings;
@@ -407,7 +421,7 @@ string FGPropulsion::GetPropulsionStrings(string delimeter)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGPropulsion::GetPropulsionValues(string delimeter)
+string FGPropulsion::GetPropulsionValues(const string& delimiter)
 {
   unsigned int i;
 
@@ -417,12 +431,12 @@ string FGPropulsion::GetPropulsionValues(string delimeter)
 
   for (i=0; i<Engines.size(); i++) {
     if (firstime)  firstime = false;
-    else           PropulsionValues += delimeter;
+    else           PropulsionValues += delimiter;
 
-    PropulsionValues += Engines[i]->GetEngineValues(delimeter);
+    PropulsionValues += Engines[i]->GetEngineValues(delimiter);
   }
   for (i=0; i<Tanks.size(); i++) {
-    buf << delimeter;
+    buf << delimiter;
     buf << Tanks[i]->GetContents();
   }
 
index e356c0b154a5b1a7d560f6f0de3ce1674dfcb726..ce62a60ea0f4d6719fca5bcb4c4e1546e2294ab4 100644 (file)
@@ -39,13 +39,11 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <vector>
-#include <fstream>
+#include <iosfwd>
 
 #include "FGModel.h"
-#include <models/propulsion/FGEngine.h>
-#include <models/propulsion/FGTank.h>
-#include <math/FGMatrix33.h>
-#include <input_output/FGXMLFileRead.h>
+#include "math/FGMatrix33.h"
+#include "input_output/FGXMLFileRead.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -59,6 +57,9 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class FGTank;
+class FGEngine;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -157,8 +158,8 @@ public:
   /** Sets up the engines as running */
   void InitRunning(int n);
 
-  string GetPropulsionStrings(string delimeter);
-  string GetPropulsionValues(string delimeter);
+  std::string GetPropulsionStrings(const std::string& delimiter);
+  std::string GetPropulsionValues(const std::string& delimiter);
 
   inline FGColumnVector3& GetForces(void)  {return vForces; }
   inline double GetForces(int n) const { return vForces(n);}
@@ -176,8 +177,8 @@ public:
   FGColumnVector3& GetTanksMoment(void);
   double GetTanksWeight(void);
 
-  ifstream* FindEngineFile(string filename);
-  string FindEngineFullPathname(string engine_filename);
+  std::ifstream* FindEngineFile(const std::string& filename);
+  std::string FindEngineFullPathname(const std::string& engine_filename);
   inline int GetActiveEngine(void) const {return ActiveEngine;}
   inline bool GetFuelFreeze(void) {return fuel_freeze;}
   double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;}
@@ -190,8 +191,8 @@ public:
   FGMatrix33& CalculateTankInertias(void);
 
 private:
-  vector <FGEngine*>   Engines;
-  vector <FGTank*>     Tanks;
+  std::vector <FGEngine*>   Engines;
+  std::vector <FGTank*>     Tanks;
   unsigned int numSelectedFuelTanks;
   unsigned int numSelectedOxiTanks;
   unsigned int numFuelTanks;
index 590e3f6d3ed3e41a7963274af30fd9937a947af9..bd2a0abb86872db53b43457af7b300b217f2cefd 100755 (executable)
@@ -59,11 +59,11 @@ INCLUDES
 
 #include "FGMSIS.h"
 #include "FGState.h"
-#include <math.h>          /* maths functions */
-#include <stdlib.h>        /* for malloc/free */
-#include <stdio.h>         /* for printf      */
+#include <cmath>          /* maths functions */
 #include <iostream>        // for cout, endl
 
+using namespace std;
+
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
@@ -148,6 +148,8 @@ bool MSIS::Run(void)
   if (FGModel::Run()) return true;
   if (FDMExec->Holding()) return false;
 
+  RunPreFunctions();
+
   //do temp, pressure, and density first
   if (!useExternal) {
     // get sea-level values
@@ -180,6 +182,8 @@ bool MSIS::Run(void)
 
   CalculateDerived();
 
+  RunPostFunctions();
+
   Debug(2);
 
   return false;
@@ -322,7 +326,7 @@ double MSIS::dnet (double dd, double dm, double zhm, double xmm, double xm)
   double ylog;
   a  = zhm / (xmm-xm);
   if (!((dm>0) && (dd>0))) {
-    printf("dnet log error %e %e %e\n",dm,dd,xm);
+    cerr << "dnet log error " << dm << ' ' << dd << ' ' << xm << ' ' << endl;
     if ((dd==0) && (dm==0))
       dd=1;
     if (dm==0)
@@ -400,7 +404,7 @@ void MSIS::splint (double *xa, double *ya, double *y2a, int n, double x, double
   }
   h = xa[khi] - xa[klo];
   if (h==0.0)
-    printf("bad XA input to splint");
+    cerr << "bad XA input to splint" << endl;
   a = (xa[khi] - x)/h;
   b = (x - xa[klo])/h;
   yi = a * ya[klo] + b * ya[khi] + ((a*a*a - a) * y2a[klo] + (b*b*b - b) * y2a[khi]) * h * h/6.0;
@@ -422,9 +426,9 @@ void MSIS::spline (double *x, double *y, int n, double yp1, double ypn, double *
   double *u;
   double sig, p, qn, un;
   int i, k;
-  u=(double*)malloc(sizeof(double)*n);
+  u=new double[n];
   if (u==NULL) {
-    printf("Out Of Memory in spline - ERROR");
+    cerr << "Out Of Memory in spline - ERROR" << endl;
     return;
   }
   if (yp1>0.99E30) {
@@ -451,7 +455,7 @@ void MSIS::spline (double *x, double *y, int n, double yp1, double ypn, double *
   for (k=n-2;k>=0;k--)
     y2[k] = y2[k] * y2[k+1] + u[k];
 
-  free(u);
+  delete u;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -964,7 +968,7 @@ double MSIS::glob7s(double *p, struct nrlmsise_input *input,
   if (p[99]==0)
     p[99]=pset;
   if (p[99]!=pset) {
-    printf("Wrong parameter set for glob7s\n");
+    cerr << "Wrong parameter set for glob7s" << endl;
     return -1;
   }
   for (j=0;j<14;j++)
@@ -1247,7 +1251,7 @@ void MSIS::ghp7(struct nrlmsise_input *input, struct nrlmsise_flags *flags,
     if (sqrt(diff*diff)<test)
       return;
     if (l==ltest) {
-      printf("ERROR: ghp7 not converging for press %e, diff %e",press,diff);
+      cerr << "ERROR: ghp7 not converging for press " << press << ", diff " << diff << endl;
       return;
     }
     xm = output->d[5] / xn / 1.66E-24;
index 02de74903d684d5892d531818031770c60f84a8b..1765388a7e9a75bb97965b817ddc401e34c6241f 100755 (executable)
@@ -40,7 +40,7 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <models/FGAtmosphere.h>
+#include "models/FGAtmosphere.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 3bd73792629b3b1c698b2d0736baaec91ec8a4ec..7bebc7d3400dabf4221a5f1ca56bdeacf2b597a2 100755 (executable)
@@ -43,6 +43,9 @@ INCLUDES
 
 #include "FGMars.h"
 #include "FGState.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
index c07a789655e417c5121d23c10582271ce00f472f..5f4bba35083f89c1ce51bcc7e7211232338c5a6f 100755 (executable)
@@ -38,7 +38,7 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <models/FGAtmosphere.h>
+#include "models/FGAtmosphere.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index b2c3ca573b25024accc64934e8f64db259d612af..1148c81b6fe64fff7e88647b79d222f48a590cc9 100755 (executable)
@@ -38,6 +38,10 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGAccelerometer.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -48,7 +52,9 @@ static const char *IdHdr = ID_ACCELEROMETER;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-FGAccelerometer::FGAccelerometer(FGFCS* fcs, Element* element) : FGSensor(fcs, element)
+FGAccelerometer::FGAccelerometer(FGFCS* fcs, Element* element)
+  : FGSensor(fcs, element),
+    FGSensorOrientation(element)
 {
   Propagate = fcs->GetExec()->GetPropagate();
   MassBalance = fcs->GetExec()->GetMassBalance();
@@ -60,27 +66,6 @@ FGAccelerometer::FGAccelerometer(FGFCS* fcs, Element* element) : FGSensor(fcs, e
 
   vRadius = MassBalance->StructuralToBody(vLocation);
 
-  Element* orient_element = element->FindElement("orientation");
-  if (orient_element) vOrient = orient_element->FindElementTripletConvertTo("RAD");
-  else {cerr << "No orientation given for accelerometer. " << endl;}
-
-  Element* axis_element = element->FindElement("axis");
-  if (axis_element) {
-    string sAxis = element->FindElementValue("axis");
-    if (sAxis == "X" || sAxis == "x") {
-      axis = 1;
-    } else if (sAxis == "Y" || sAxis == "y") {
-      axis = 2;
-    } else if (sAxis == "Z" || sAxis == "z") {
-      axis = 3;
-    } else {
-      cerr << "  Incorrect/no axis specified for accelerometer; assuming X axis" << endl;
-      axis = 1;
-    }
-  }
-
-  CalculateTransformMatrix();
-
   Debug(0);
 }
 
@@ -96,7 +81,7 @@ FGAccelerometer::~FGAccelerometer()
 bool FGAccelerometer::Run(void )
 {
   // There is no input assumed. This is a dedicated acceleration sensor.
-  
+
   vRadius = MassBalance->StructuralToBody(vLocation);
     
   //gravitational forces
@@ -112,59 +97,11 @@ bool FGAccelerometer::Run(void )
 
   Input = vAccel(axis);
 
-  Output = Input; // perfect accelerometer
-
-  // Degrade signal as specified
-
-  if (fail_stuck) {
-    Output = PreviousOutput;
-    return true;
-  }
-
-  if (lag != 0.0)            Lag();       // models accelerometer lag
-  if (noise_variance != 0.0) Noise();     // models noise
-  if (drift_rate != 0.0)     Drift();     // models drift over time
-  if (bias != 0.0)           Bias();      // models a finite bias
-  if (gain != 0.0)           Gain();      // models a gain
-
-  if (fail_low)  Output = -HUGE_VAL;
-  if (fail_high) Output =  HUGE_VAL;
+  ProcessSensorSignal();
 
-  if (bits != 0)             Quantize();  // models quantization degradation
-//  if (delay != 0.0)          Delay();     // models system signal transport latencies
-
-  Clip(); // Is it right to clip an accelerometer?
   return true;
 }
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-void FGAccelerometer::CalculateTransformMatrix(void)
-{
-  double cp,sp,cr,sr,cy,sy;
-
-  cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
-  cr=cos(vOrient(eRoll));  sr=sin(vOrient(eRoll));
-  cy=cos(vOrient(eYaw));   sy=sin(vOrient(eYaw));
-
-  mT(1,1) =  cp*cy;
-  mT(1,2) =  cp*sy;
-  mT(1,3) = -sp;
-
-  mT(2,1) = sr*sp*cy - cr*sy;
-  mT(2,2) = sr*sp*sy + cr*cy;
-  mT(2,3) = sr*cp;
-
-  mT(3,1) = cr*sp*cy + sr*sy;
-  mT(3,2) = cr*sp*sy - sr*cy;
-  mT(3,3) = cr*cp;
-
-  // This transform is different than for FGForce, where we want a native nozzle
-  // force in body frame. Here we calculate the body frame accel and want it in
-  // the transformed accelerometer frame. So, the next line is commented out.
-  // mT = mT.Inverse();
-}
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index bf3a58c6e666b8f461071b580706f52a05a78b04..d552fe434de6846fbcadf270ec7e643ab817ff1f 100755 (executable)
@@ -38,12 +38,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSensor.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
 #include "models/FGPropagate.h"
 #include "models/FGMassBalance.h"
 #include "models/FGInertial.h"
 #include "math/FGColumnVector3.h"
 #include "math/FGMatrix33.h"
+#include "FGSensorOrientation.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -116,7 +117,7 @@ time.
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGAccelerometer  : public FGSensor
+class FGAccelerometer  : public FGSensor, public FGSensorOrientation
 {
 public:
   FGAccelerometer(FGFCS* fcs, Element* element);
@@ -129,12 +130,8 @@ private:
   FGMassBalance* MassBalance;
   FGInertial* Inertial;
   FGColumnVector3 vLocation;
-  FGColumnVector3 vOrient;
   FGColumnVector3 vRadius;
   FGColumnVector3 vAccel;
-  FGMatrix33 mT;
-  void CalculateTransformMatrix(void);
-  int axis;
   
   void Debug(int from);
 };
index 9b0a3cc8a6da773b1b56cc330e349739ba12cb04..ae2aa38b7a0cd5b186c62036e2c7e81d171c2d8b 100755 (executable)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGActuator.h"
 
+using namespace std;
+
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
@@ -52,7 +54,6 @@ CLASS IMPLEMENTATION
 FGActuator::FGActuator(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element)
 {
   double denom;
-  dt = fcs->GetDt();
 
   // inputs are read from the base class constructor
 
@@ -101,8 +102,6 @@ FGActuator::~FGActuator()
 
 bool FGActuator::Run(void )
 {
-  dt = fcs->GetDt();
-
   Input = InputNodes[0]->getDoubleValue() * InputSigns[0];
 
   if (fail_zero) Input = 0;
@@ -237,7 +236,10 @@ void FGActuator::Debug(int from)
       else
         cout << "      INPUT: " << InputNodes[0]->getName() << endl;
 
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
       if (bias != 0.0) cout << "      Bias: " << bias << endl;
       if (rate_limit != 0) cout << "      Rate limit: " << rate_limit << endl;
       if (lag != 0) cout << "      Actuator lag: " << lag << endl;
index 79571fbe66107ec926384c296c0cc4537e38d152..ecfb3bf8af0dfb72688cca59029b714ddd95224d 100755 (executable)
@@ -38,7 +38,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -144,7 +144,6 @@ public:
   inline bool GetFailStuck(void) const {return fail_stuck;}
   
 private:
-  double dt;
   double span;
   double bias;
   double rate_limit;
index 745f8ad281d5804fa14fa14ae82b0c2009ea7c35..3d0689d382e0a364a2800cc23b66ccfce9155827 100644 (file)
@@ -38,6 +38,11 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGDeadBand.h"
+#include "input_output/FGXMLElement.h"
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -144,7 +149,10 @@ void FGDeadBand::Debug(int from)
         cout << "      DEADBAND WIDTH: " << width << endl;
       }
       cout << "      GAIN: " << gain << endl;
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index d07b88cc4fbaacb33ac0afef4808f8e220eb7015..9dd4a39a354cb819ae5dabc2126378c4feab9a9d 100644 (file)
@@ -38,7 +38,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -53,6 +52,8 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 class FGFCS;
+class Element;
+class FGPropertyManager;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
index 954be235449c224144106c6681bd269155efd94a..d1f454555f5e73f931e75d187ba34a93579a2c0b 100644 (file)
@@ -38,6 +38,12 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
+#include "input_output/FGPropertyManager.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -52,11 +58,13 @@ FGFCSComponent::FGFCSComponent(FGFCS* _fcs, Element* element) : fcs(_fcs)
 {
   Element *input_element, *clip_el;
   Input = Output = clipmin = clipmax = 0.0;
-  OutputNode = treenode = 0;
+  treenode = 0;
+  delay = index = 0;
   ClipMinPropertyNode = ClipMaxPropertyNode = 0;
   clipMinSign = clipMaxSign = 1.0;
   IsOutput   = clip = false;
   string input, clip_string;
+  dt = fcs->GetDt();
 
   PropertyManager = fcs->GetPropertyManager();
   if        (element->GetName() == string("lag_filter")) {
@@ -91,6 +99,8 @@ FGFCSComponent::FGFCSComponent(FGFCS* _fcs, Element* element) : fcs(_fcs)
     Type = "SENSOR";
   } else if (element->GetName() == string("accelerometer")) {
     Type = "ACCELEROMETER";
+  } else if (element->GetName() == string("magnetometer")) {
+    Type = "MAGNETOMETER";
   } else if (element->GetName() == string("gyro")) {
     Type = "GYRO";
   } else if (element->GetName() == string("actuator")) {
@@ -123,13 +133,36 @@ FGFCSComponent::FGFCSComponent(FGFCS* _fcs, Element* element) : fcs(_fcs)
     input_element = element->FindNextElement("input");
   }
 
-  if (element->FindElement("output")) {
+  Element *out_elem = element->FindElement("output");
+  while (out_elem) {
     IsOutput = true;
-    OutputNode = PropertyManager->GetNode( element->FindElementValue("output"), true );
+    string output_node_name = out_elem->GetDataLine();
+    FGPropertyManager* OutputNode = PropertyManager->GetNode( output_node_name, true );
+    OutputNodes.push_back(OutputNode);
     if (!OutputNode) {
-      cerr << endl << "  Unable to process property: " << element->FindElementValue("output") << endl;
+      cerr << endl << "  Unable to process property: " << output_node_name << endl;
       throw(string("Invalid output property name in flight control definition"));
     }
+    out_elem = element->FindNextElement("output");
+  }
+
+  Element* delay_elem = element->FindElement("delay");
+  if ( delay_elem ) {
+    delay = (unsigned int)delay_elem->GetDataAsNumber();
+    string delayType = delay_elem->GetAttributeValue("type");
+    if (delayType.length() > 0) {
+      if (delayType == "time") {
+        delay = (int)(delay / dt);
+      } else if (delayType == "frames") {
+        // no op. the delay type of "frames" is assumed and is the default.
+      } else {
+        cerr << "Unallowed delay type" << endl;
+      }
+    } else {
+      delay = (int)(delay / dt);
+    }
+    output_array.resize(delay);
+    for (int i=0; i<delay; i++) output_array[i] = 0.0;
   }
 
   clip_el = element->FindElement("clipto");
@@ -171,7 +204,7 @@ FGFCSComponent::~FGFCSComponent()
 
 void FGFCSComponent::SetOutput(void)
 {
-  OutputNode->setDoubleValue(Output);
+  for (unsigned int i=0; i<OutputNodes.size(); i++) OutputNodes[i]->setDoubleValue(Output);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -183,6 +216,16 @@ bool FGFCSComponent::Run(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+void FGFCSComponent::Delay(void)
+{
+  output_array[index] = Output;
+  if (index == delay-1) index = 0;
+  else index++;
+  Output = output_array[index];
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGFCSComponent::Clip(void)
 {
   if (clip) {
@@ -258,6 +301,8 @@ void FGFCSComponent::Debug(int from)
           cout << "      Maximum limit: " << clipmax << endl;
         }
       }  
+      if (delay > 0) cout <<"      Frame delay: " << delay
+                                   << " frames (" << delay*dt << " sec)" << endl;
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index fa8506131c560864e080b16b692c624e0ad41e1e..b1fc2c6c5d7057742bf9ba6640f152d5330fea2d 100644 (file)
@@ -37,9 +37,7 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
-#include <input_output/FGPropertyManager.h>
-#include <input_output/FGXMLElement.h>
+#include "FGJSBBase.h"
 #include <string>
 #include <vector>
 
@@ -49,9 +47,6 @@ DEFINITIONS
 
 #define ID_FCSCOMPONENT "$Id$"
 
-using std::string;
-using std::vector;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -59,6 +54,8 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 class FGFCS;
+class FGPropertyManager;
+class Element;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -101,30 +98,34 @@ public:
 
   virtual bool Run(void);
   virtual void SetOutput(void);
-  inline double GetOutput (void) const {return Output;}
-  inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
-  inline string GetName(void) const {return Name;}
-  inline string GetType(void) const { return Type; }
+  double GetOutput (void) const {return Output;}
+  std::string GetName(void) const {return Name;}
+  std::string GetType(void) const { return Type; }
   virtual double GetOutputPct(void) const { return 0; }
 
 protected:
   FGFCS* fcs;
   FGPropertyManager* PropertyManager;
   FGPropertyManager* treenode;
-  FGPropertyManager* OutputNode;
+  std::vector <FGPropertyManager*> OutputNodes;
   FGPropertyManager* ClipMinPropertyNode;
   FGPropertyManager* ClipMaxPropertyNode;
-  vector <FGPropertyManager*> InputNodes;
-  vector <float> InputSigns;
-  string Type;
-  string Name;
+  std::vector <FGPropertyManager*> InputNodes;
+  std::vector <float> InputSigns;
+  std::vector <double> output_array;
+  std::string Type;
+  std::string Name;
   double Input;
   double Output;
   double clipmax, clipmin;
+  int delay;
+  int index;
   float clipMinSign, clipMaxSign;
+  double dt;
   bool IsOutput;
   bool clip;
 
+  void Delay(void);
   void Clip(void);
   virtual void bind();
   virtual void Debug(int from);
index ea86d4114c2d7ea1c11dc27275154fdc8b8de0d6..d8a91572e3879e7492c24fdc1de9bcca6002c73e 100755 (executable)
@@ -38,6 +38,10 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSFunction.h"
+#include <cstdlib>
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -119,7 +123,10 @@ void FGFCSFunction::Debug(int from)
       if (InputNodes.size()>0)
         cout << "      INPUT: " << InputNodes[0]->getName() << endl;
 //    cout << "      Function: " << endl;
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index 422d0b0930e9bead004bc09759b82ac32f0d420c..fe731e8c3f25a8db1ee566ae5b8c9625a2f52ec6 100755 (executable)
@@ -38,8 +38,8 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
-#include <math/FGFunction.h>
+#include "input_output/FGXMLElement.h"
+#include "math/FGFunction.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 99793923871efc2c86870efa0de2613352a62f14..f0ca4906406cf6b2f04ade940e8da0538c5ff0be 100644 (file)
@@ -38,6 +38,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFilter.h"
+#include "input_output/FGXMLElement.h"
+#include "input_output/FGPropertyManager.h"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -50,14 +57,14 @@ CLASS IMPLEMENTATION
 
 FGFilter::FGFilter(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element)
 {
-  dt = fcs->GetState()->Getdt();
   Trigger = 0;
   DynamicFilter = false;
 
   C[1] = C[2] = C[3] = C[4] = C[5] = C[6] = 0.0;
-  for (int i=0; i<7; i++) {
+  for (int i=1; i<7; i++) {
     PropertySign[i] = 1.0;
     PropertyNode[i] = 0L;
+    ReadFilterCoefficients(element, i);
   }
 
   if      (Type == "LAG_FILTER")          FilterType = eLag        ;
@@ -67,13 +74,6 @@ FGFilter::FGFilter(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element)
   else if (Type == "INTEGRATOR")          FilterType = eIntegrator ;
   else                                    FilterType = eUnknown    ;
 
-  ReadFilterCoefficients(element, 1);
-  ReadFilterCoefficients(element, 2);
-  ReadFilterCoefficients(element, 3);
-  ReadFilterCoefficients(element, 4);
-  ReadFilterCoefficients(element, 5);
-  ReadFilterCoefficients(element, 6);
-
   if (element->FindElement("trigger")) {
     Trigger =  PropertyManager->GetNode(element->FindElementValue("trigger"));
   }
@@ -98,13 +98,13 @@ FGFilter::~FGFilter()
 
 void FGFilter::ReadFilterCoefficients(Element* element, int index)
 {
-  char buf[3];
-  sprintf(buf, "c%d", index);
-  string coefficient = string(buf);
-  string property_string="";
-
+  // index is known to be 1-7. 
+  // A stringstream would be overkill, but also trying to avoid sprintf
+  string coefficient = "c0";
+  coefficient[1] += index;
+  
   if ( element->FindElement(coefficient) ) {
-    property_string = element->FindElementValue(coefficient);
+    string property_string = element->FindElementValue(coefficient);
     if (!is_number(property_string)) { // property
       if (property_string[0] == '-') {
        PropertySign[index] = -1.0;
@@ -323,8 +323,13 @@ void FGFilter::Debug(int from)
           if (PropertyNode[1] == 0L) cout << "      C[1]: " << C[1] << endl;
           else cout << "      C[1] is the value of property: " << sgn << PropertyNode[1]->GetName() << endl;
           break;
+        case eUnknown:
+          break;
        } 
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index c7c0a4143b2933d523f06bbffb6c461a7cc706e0..7aeafc202c293eea8432d4a2c0bb1dcadb5bf253 100644 (file)
@@ -38,7 +38,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -52,6 +51,10 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class Element;
+class FGPropertyManager;
+class FGFCS;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -249,7 +252,6 @@ public:
   enum {eLag, eLeadLag, eOrder2, eWashout, eIntegrator, eUnknown} FilterType;
 
 private:
-  double dt;
   double ca;
   double cb;
   double cc;
index f8f73daf38d0bc5171ee75140e14555514ac7b2d..0ecb8c6459fe0f60dcc6a184f1c66c2767899bce 100644 (file)
@@ -38,6 +38,12 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGGain.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+#include <string>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -212,7 +218,10 @@ void FGGain::Debug(int from)
       } else {
         cout << "      GAIN: " << Gain << endl;
       }
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
       if (Type == "AEROSURFACE_SCALE") {
         cout << "      In/Out Mapping:" << endl;
         cout << "        Input MIN: " << InMin << endl;
index faf535c6908444e7317710e2941d3557c69b707a..525c4e449cbcd0de44882ef5e0d1b21bcb6daf8b 100644 (file)
@@ -38,11 +38,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <string>
-#include <input_output/FGXMLElement.h>
-#include <math/FGTable.h>
-
-using std::string;
+#include "math/FGTable.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -57,6 +53,7 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 class FGFCS;
+class Element;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
index 15af4c5f3517ee54a6d1054cf1dc50c8c165f4b6..2325dec1e25135a9afaf9b87e65f8ea797ed6389 100644 (file)
@@ -38,6 +38,9 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGGradient.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
index 0d2ad21db0f7a2e16998292159c524e9dca962ae..ce7dac4f8042ddf48c0a53089a281dcf2d24fe74 100644 (file)
@@ -38,7 +38,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 0fcd127e836fdc5885a778c74e7fe9645e9b9169..740c01e3a554bf1166ffad03211370e3d433a26d 100755 (executable)
@@ -38,6 +38,9 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGGyro.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -48,31 +51,11 @@ static const char *IdHdr = ID_GYRO;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-FGGyro::FGGyro(FGFCS* fcs, Element* element) : FGSensor(fcs, element)
+FGGyro::FGGyro(FGFCS* fcs, Element* element) : FGSensor(fcs, element),
+                                               FGSensorOrientation(element)
 {
   Propagate = fcs->GetExec()->GetPropagate();
   
-  Element* orient_element = element->FindElement("orientation");
-  if (orient_element) vOrient = orient_element->FindElementTripletConvertTo("RAD");
-  else {cerr << "No orientation given for gyro. " << endl;}
-
-  Element* axis_element = element->FindElement("axis");
-  if (axis_element) {
-    string sAxis = element->FindElementValue("axis");
-    if (sAxis == "ROLL" || sAxis == "roll") {
-      axis = 1;
-    } else if (sAxis == "PITCH" || sAxis == "pitch") {
-      axis = 2;
-    } else if (sAxis == "YAW" || sAxis == "yaw") {
-      axis = 3;
-    } else {
-      cerr << "  Incorrect/no axis specified for gyro; assuming Roll axis" << endl;
-      axis = 1;
-    }
-  }
-
-  CalculateTransformMatrix();
-
   Debug(0);
 }
 
@@ -94,59 +77,11 @@ bool FGGyro::Run(void )
 
   Input = vAccel(axis);
 
-  Output = Input; // perfect gyro
-
-  // Degrade signal as specified
-
-  if (fail_stuck) {
-    Output = PreviousOutput;
-    return true;
-  }
-
-  if (lag != 0.0)            Lag();       // models gyro lag
-  if (noise_variance != 0.0) Noise();     // models noise
-  if (drift_rate != 0.0)     Drift();     // models drift over time
-  if (bias != 0.0)           Bias();      // models a finite bias
-  if (gain != 0.0)           Gain();      // models a gain
-
-  if (fail_low)  Output = -HUGE_VAL;
-  if (fail_high) Output =  HUGE_VAL;
-
-  if (bits != 0)             Quantize();  // models quantization degradation
-//  if (delay != 0.0)          Delay();     // models system signal transport latencies
+  ProcessSensorSignal();
 
-  Clip(); // Is it right to clip a gyro?
   return true;
 }
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-void FGGyro::CalculateTransformMatrix(void)
-{
-  double cp,sp,cr,sr,cy,sy;
-
-  cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
-  cr=cos(vOrient(eRoll));  sr=sin(vOrient(eRoll));
-  cy=cos(vOrient(eYaw));   sy=sin(vOrient(eYaw));
-
-  mT(1,1) =  cp*cy;
-  mT(1,2) =  cp*sy;
-  mT(1,3) = -sp;
-
-  mT(2,1) = sr*sp*cy - cr*sy;
-  mT(2,2) = sr*sp*sy + cr*cy;
-  mT(2,3) = sr*cp;
-
-  mT(3,1) = cr*sp*cy + sr*sy;
-  mT(3,2) = cr*sp*sy - sr*cy;
-  mT(3,3) = cr*cp;
-
-  // This transform is different than for FGForce, where we want a native nozzle
-  // force in body frame. Here we calculate the body frame accel and want it in
-  // the transformed gyro frame. So, the next line is commented out.
-  // mT = mT.Inverse();
-}
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index c486eee5073a5a60724a49b2ccdf172750a8639a..af10851bfa463f8e091d96538bf36e4102d21511 100755 (executable)
@@ -38,12 +38,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSensor.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
 #include "models/FGPropagate.h"
 #include "models/FGMassBalance.h"
 #include "models/FGInertial.h"
 #include "math/FGColumnVector3.h"
 #include "math/FGMatrix33.h"
+#include "FGSensorOrientation.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -116,7 +117,7 @@ time.
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGGyro  : public FGSensor
+class FGGyro  : public FGSensor, public FGSensorOrientation
 {
 public:
   FGGyro(FGFCS* fcs, Element* element);
@@ -126,11 +127,8 @@ public:
 
 private:
   FGPropagate* Propagate;
-  FGColumnVector3 vOrient;
   FGColumnVector3 vAccel;
-  FGMatrix33 mT;
   void CalculateTransformMatrix(void);
-  int axis;
   
   void Debug(int from);
 };
index 5949cf710b7c2572824789ad84d8e306baea3d46..931c1740caf2612803218b03dfd273edec153c26 100644 (file)
@@ -38,8 +38,11 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGKinemat.h"
-#include <math.h>
-#include <float.h>
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -98,13 +101,13 @@ FGKinemat::~FGKinemat()
 
 bool FGKinemat::Run(void )
 {
-  double dt = fcs->GetState()->Getdt();
+  double dt0 = dt;
 
   Input = InputNodes[0]->getDoubleValue() * InputSigns[0];
 
   if (DoScale) Input *= Detents[NumDetents-1];
 
-  if (IsOutput) Output = OutputNode->getDoubleValue();
+  if (IsOutput) Output = OutputNodes[0]->getDoubleValue();
 
   if (Input < Detents[0])
     Input = Detents[0];
@@ -113,7 +116,7 @@ bool FGKinemat::Run(void )
 
   // Process all detent intervals the movement traverses until either the
   // final value is reached or the time interval has finished.
-  while ( 0.0 < dt && !EqualToRoundoff(Input, Output) ) {
+  while ( dt0 > 0.0 && !EqualToRoundoff(Input, Output) ) {
 
     // Find the area where Output is in
     int ind;
@@ -137,8 +140,8 @@ bool FGKinemat::Run(void )
       double ThisDt = fabs((ThisInput-Output)/Rate);
 
       // and clip to the timestep size
-      if (dt < ThisDt) {
-        ThisDt = dt;
+      if (dt0 < ThisDt) {
+        ThisDt = dt0;
         if (Output < Input)
           Output += ThisDt*Rate;
         else
@@ -148,7 +151,7 @@ bool FGKinemat::Run(void )
         // is met even in inexact arithmetics ...
         Output = ThisInput;
 
-      dt -= ThisDt;
+      dt0 -= ThisDt;
     }
   }
 
@@ -190,7 +193,10 @@ void FGKinemat::Debug(int from)
       for (int i=0;i<NumDetents;i++) {
         cout << "        " << Detents[i] << " " << TransitionTimes[i] << endl;
       }
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
       if (!DoScale) cout << "      NOSCALE" << endl;
     }
   }
index 13d2ec7d967491de46c220ad22b386834d8d96db..8dcc73bb876cc9c1478ef4e4fc0ca16dc00e11f1 100644 (file)
@@ -38,12 +38,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
 #include <vector>
-#include <string>
-
-using std::vector;
-using std::string;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -134,8 +129,8 @@ public:
   bool Run (void);
 
 private:
-  vector<double> Detents;
-  vector<double> TransitionTimes;
+  std::vector<double> Detents;
+  std::vector<double> TransitionTimes;
   int NumDetents;
   double OutputPct;
   bool  DoScale;
index 561e0dcca3aa82101cb966025f547ed3ddb39e2b..368d3524e9daf28b114336d7a5012c40f9ce90bc 100755 (executable)
@@ -40,6 +40,10 @@ INCLUDES
 #include "FGMagnetometer.h"
 #include "simgear/magvar/coremag.hxx"
 #include <ctime>
+#include <cstdlib>
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -51,7 +55,8 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGMagnetometer::FGMagnetometer(FGFCS* fcs, Element* element) : FGSensor(fcs, element),\
+FGMagnetometer::FGMagnetometer(FGFCS* fcs, Element* element) : FGSensor(fcs, element),
+                                                               FGSensorOrientation(element),
                                                                counter(0),
                                                                INERTIAL_UPDATE_RATE(1000)
 {
@@ -65,27 +70,6 @@ FGMagnetometer::FGMagnetometer(FGFCS* fcs, Element* element) : FGSensor(fcs, ele
 
   vRadius = MassBalance->StructuralToBody(vLocation);
 
-  Element* orient_element = element->FindElement("orientation");
-  if (orient_element) vOrient = orient_element->FindElementTripletConvertTo("RAD");
-  else {cerr << "No orientation given for magnetometer. " << endl;}
-
-  Element* axis_element = element->FindElement("axis");
-  if (axis_element) {
-    string sAxis = element->FindElementValue("axis");
-    if (sAxis == "X" || sAxis == "x") {
-      axis = 1;
-    } else if (sAxis == "Y" || sAxis == "y") {
-      axis = 2;
-    } else if (sAxis == "Z" || sAxis == "z") {
-      axis = 3;
-    } else {
-      cerr << "  Incorrect/no axis specified for magnetometer; assuming X axis" << endl;
-      axis = 1;
-    }
-  }
-
-  CalculateTransformMatrix();
-
   //assuming date wont significantly change over a flight to affect mag field
   //would be better to get the date from the sim if its simulated...
   time_t rawtime;
@@ -114,7 +98,7 @@ FGMagnetometer::~FGMagnetometer()
 void FGMagnetometer::updateInertialMag(void)
 {
   counter++;
-  if(counter > INERTIAL_UPDATE_RATE)//dont need to update every iteration
+  if (counter > INERTIAL_UPDATE_RATE)//dont need to update every iteration
   {
       counter = 0;
 
@@ -123,11 +107,11 @@ void FGMagnetometer::updateInertialMag(void)
       usedAlt = (Propagate->GetGeodeticAltitude()*fttom*0.001);//km
 
       //this should be done whenever the position changes significantly (in nTesla)
-      double magvar = calc_magvar( usedLat,
-                                 usedLon,
-                                 usedAlt,
-                                 date,
-                                 field );
+      calc_magvar( usedLat,
+                   usedLon,
+                   usedAlt,
+                   date,
+                   field );
   }
 }
 
@@ -135,75 +119,25 @@ void FGMagnetometer::updateInertialMag(void)
 
 bool FGMagnetometer::Run(void )
 {
-  // There is no input assumed. This is a dedicated acceleration sensor.
+  // There is no input assumed. This is a dedicated magnetic field sensor.
   
   vRadius = MassBalance->StructuralToBody(vLocation);
 
-
   updateInertialMag();
-  //Inertial magnetic field rotated to the body frame
+
+  // Inertial magnetic field rotated to the body frame
   vMag = Propagate->GetTl2b() * FGColumnVector3(field[3], field[4], field[5]);
 
-  //allow for sensor orientation
+  // Allow for sensor orientation
   vMag = mT * vMag;
   
   Input = vMag(axis);
 
-  Output = Input; // perfect magnetometer
-
-  // Degrade signal as specified
-
-  if (fail_stuck) {
-    Output = PreviousOutput;
-    return true;
-  }
-
-  if (lag != 0.0)            Lag();       // models magnetometer lag
-  if (noise_variance != 0.0) Noise();     // models noise
-  if (drift_rate != 0.0)     Drift();     // models drift over time
-  if (bias != 0.0)           Bias();      // models a finite bias
-  if (gain != 0.0)           Gain();      // models a gain
-
-  if (fail_low)  Output = -HUGE_VAL;
-  if (fail_high) Output =  HUGE_VAL;
-
-  if (bits != 0)             Quantize();  // models quantization degradation
-//  if (delay != 0.0)          Delay();     // models system signal transport latencies
+  ProcessSensorSignal();
 
-  Clip(); // Is it right to clip an magnetometer?
   return true;
 }
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-void FGMagnetometer::CalculateTransformMatrix(void)
-{
-  double cp,sp,cr,sr,cy,sy;
-
-  cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
-  cr=cos(vOrient(eRoll));  sr=sin(vOrient(eRoll));
-  cy=cos(vOrient(eYaw));   sy=sin(vOrient(eYaw));
-
-
-  mT(1,1) =  cp*cy;
-  mT(1,2) =  cp*sy;
-  mT(1,3) = -sp;
-
-  mT(2,1) = sr*sp*cy - cr*sy;
-  mT(2,2) = sr*sp*sy + cr*cy;
-  mT(2,3) = sr*cp;
-
-  mT(3,1) = cr*sp*cy + sr*sy;
-  mT(3,2) = cr*sp*sy - sr*cy;
-  mT(3,3) = cr*cp;
-
-  
-  // This transform is different than for FGForce, where we want a native nozzle
-  // force in body frame. Here we calculate the body frame accel and want it in
-  // the transformed magnetometer frame. So, the next line is commented out.
-  // mT = mT.Inverse();
-}
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index 456d14d6d356ae764fcd05331f29e284d639716c..e806fb62280a8b614203f30d24d3cd1649651020 100755 (executable)
@@ -38,12 +38,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSensor.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
 #include "models/FGPropagate.h"
 #include "models/FGMassBalance.h"
 #include "models/FGInertial.h"
 #include "math/FGColumnVector3.h"
 #include "math/FGMatrix33.h"
+#include "FGSensorOrientation.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -118,7 +119,7 @@ time.
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGMagnetometer  : public FGSensor
+class FGMagnetometer  : public FGSensor, public FGSensorOrientation
 {
 public:
   FGMagnetometer(FGFCS* fcs, Element* element);
@@ -131,13 +132,9 @@ private:
   FGMassBalance* MassBalance;
   FGInertial* Inertial;
   FGColumnVector3 vLocation;
-  FGColumnVector3 vOrient;
   FGColumnVector3 vRadius;
   FGColumnVector3 vMag;
-  FGMatrix33 mT;
-  void CalculateTransformMatrix(void);
   void updateInertialMag(void);
-  int axis;
   double field[6];
   double usedLat;
   double usedLon;
index da1b4b0cd1a6f45c40f1465161d675947a0b6f85..3dda266f208c4ddc37037d13061cbad4a3ae254a 100755 (executable)
@@ -36,6 +36,11 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGPID.h"
+#include "input_output/FGXMLElement.h"
+#include <string>
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -49,7 +54,6 @@ CLASS IMPLEMENTATION
 FGPID::FGPID(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element)
 {
   string kp_string, ki_string, kd_string;
-  dt = fcs->GetState()->Getdt();
 
   Kp = Ki = Kd = 0.0;
   KpPropertyNode = 0;
@@ -189,7 +193,10 @@ void FGPID::Debug(int from)
       else
         cout << "      INPUT: " << InputNodes[0]->getName() << endl;
 
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index 5839b238a2d75f4f1a7266e77da625bc2600ed3f..adad3606c571874af027162d560863bfecc74285 100755 (executable)
@@ -39,8 +39,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
-#include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -48,10 +46,6 @@ DEFINITIONS
 
 #define ID_PID "$Id$"
 
-using std::string;
-
-using std::string;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -59,6 +53,7 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 class FGFCS;
+class Element;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -105,7 +100,6 @@ public:
   void ResetPastStates(void) {Input_prev = Input_prev2 = Output = I_out_total = 0.0;}
 
 private:
-  double dt;
   FGPropertyManager *Trigger;
   double Kp, Ki, Kd;
   double I_out_total;
index bd6a384179a172b913a4835db9513bfaa9508d51..1ca89b6ba7eb66a3f9db8c035880e6d5628ef7ee 100755 (executable)
@@ -38,6 +38,11 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSensor.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -52,11 +57,10 @@ CLASS IMPLEMENTATION
 FGSensor::FGSensor(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element)
 {
   double denom;
-  dt = fcs->GetDt();
 
   // inputs are read from the base class constructor
 
-  bits = quantized = divisions = index = delay = 0;
+  bits = quantized = divisions = 0;
   PreviousInput = PreviousOutput = 0.0;
   min = max = bias = gain = noise_variance = lag = drift_rate = drift = span = 0.0;
   granularity = 0.0;
@@ -117,11 +121,6 @@ FGSensor::FGSensor(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element)
       cerr << "  defaulting to UNIFORM." << endl;
     }
   }
-  if ( element->FindElement("delay") ) {
-    delay = (unsigned int)element->FindElementValueAsNumber("delay");
-    output_array.resize(delay);
-    for (unsigned int i=0; i<delay; i++) output_array[i] = 0.0;
-  }
 
   FGFCSComponent::bind();
   bind();
@@ -138,34 +137,41 @@ FGSensor::~FGSensor()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGSensor::Run(void )
+bool FGSensor::Run(void)
 {
   Input = InputNodes[0]->getDoubleValue() * InputSigns[0];
 
+  ProcessSensorSignal();
+
+  return true;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGSensor::ProcessSensorSignal(void)
+{
   Output = Input; // perfect sensor
 
   // Degrade signal as specified
 
   if (fail_stuck) {
     Output = PreviousOutput;
-    return true;
-  }
-
-  if (lag != 0.0)            Lag();       // models sensor lag and filter
-  if (noise_variance != 0.0) Noise();     // models noise
-  if (drift_rate != 0.0)     Drift();     // models drift over time
-  if (bias != 0.0)           Bias();      // models a finite bias
-  if (gain != 0.0)           Gain();      // models a finite gain
+  } else {
+    if (lag != 0.0)            Lag();       // models sensor lag and filter
+    if (noise_variance != 0.0) Noise();     // models noise
+    if (drift_rate != 0.0)     Drift();     // models drift over time
+    if (gain != 0.0)           Gain();      // models a finite gain
+    if (bias != 0.0)           Bias();      // models a finite bias
 
-  if (delay != 0.0)          Delay();     // models system signal transport latencies
+    if (delay != 0)            Delay();     // models system signal transport latencies
 
-  if (fail_low)  Output = -HUGE_VAL;
-  if (fail_high) Output =  HUGE_VAL;
+    if (fail_low)  Output = -HUGE_VAL;
+    if (fail_high) Output =  HUGE_VAL;
 
-  if (bits != 0)             Quantize();  // models quantization degradation
+    if (bits != 0)             Quantize();  // models quantization degradation
 
-  Clip(); // Is it right to clip a sensor?
-  return true;
+    Clip();
+  }
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -237,16 +243,6 @@ void FGSensor::Lag(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGSensor::Delay(void)
-{
-  output_array[index] = Output;
-  if (index == delay-1) index = 0;
-  else index++;
-  Output = output_array[index];
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 void FGSensor::bind(void)
 {
   string tmp = Name;
@@ -301,8 +297,6 @@ void FGSensor::Debug(int from)
         else
           cout << "      INPUT: " << InputNodes[0]->getName() << endl;
       }
-      if (delay > 0) cout <<"      Frame delay: " << delay
-                                   << " frames (" << delay*dt << " sec)" << endl;
       if (bits != 0) {
         if (quant_property.empty())
           cout << "      Quantized output" << endl;
@@ -332,7 +326,10 @@ void FGSensor::Debug(int from)
           cout << "      Random noise is gaussian distributed." << endl;
         }
       }
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index 1e8701c90c5e1491a165c60ffee9e8036e5c0503..136099536e51d8b93cff0c7800d9e49c60cbefad 100755 (executable)
@@ -38,8 +38,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
-#include <vector>
+#include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -53,8 +52,8 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-using std::vector;
 class FGFCS;
+class Element;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -135,7 +134,6 @@ public:
 protected:
   enum eNoiseType {ePercent=0, eAbsolute} NoiseType;
   enum eDistributionType {eUniform=0, eGaussian} DistributionType;
-  double dt;
   double min, max;
   double span;
   double bias;
@@ -153,20 +151,17 @@ protected:
   int bits;
   int quantized;
   int divisions;
-  int delay;
-  int index;
   bool fail_low;
   bool fail_high;
   bool fail_stuck;
-  string quant_property;
-  vector <double> output_array;
+  std::string quant_property;
 
+  void ProcessSensorSignal(void);
   void Noise(void);
   void Bias(void);
   void Drift(void);
   void Quantize(void);
   void Lag(void);
-  void Delay(void);
   void Gain(void);
 
   void bind(void);
diff --git a/src/FDM/JSBSim/models/flight_control/FGSensorOrientation.h b/src/FDM/JSBSim/models/flight_control/FGSensorOrientation.h
new file mode 100755 (executable)
index 0000000..4f6d52f
--- /dev/null
@@ -0,0 +1,138 @@
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Header:       FGSensorOrientation.h
+ Author:       Jon Berndt
+ Date started: September 2009
+
+ ------------- Copyright (C) 2009 -------------
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser 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 Lesser General Public License for more
+ details.
+
+ You should have received a copy of the GNU Lesser 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 Lesser General Public License can also be found on
+ the world wide web at http://www.gnu.org.
+
+HISTORY
+--------------------------------------------------------------------------------
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+SENTRY
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#ifndef FGSENSORORIENTATION_H
+#define FGSENSORORIENTATION_H
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+INCLUDES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#include "FGSensor.h"
+#include "input_output/FGXMLElement.h"
+#include "math/FGColumnVector3.h"
+#include "math/FGMatrix33.h"
+
+#include <iostream>
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#define ID_SensorOrientation "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+namespace JSBSim {
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a SensorOrientation capability for a sensor.
+
+Syntax:
+
+@author Jon S. Berndt
+@version $Revision$
+*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DECLARATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+class FGSensorOrientation  : public FGJSBBase
+{
+public:
+  FGSensorOrientation(Element* element)
+  {
+    Element* orient_element = element->FindElement("orientation");
+    if (orient_element) vOrient = orient_element->FindElementTripletConvertTo("RAD");
+    else { std::cerr << "No orientation given for this sensor. " << std::endl;}
+
+    Element* axis_element = element->FindElement("axis");
+    if (axis_element) {
+      string sAxis = element->FindElementValue("axis");
+      if (sAxis == "X" || sAxis == "x") {
+        axis = 1;
+      } else if (sAxis == "Y" || sAxis == "y") {
+        axis = 2;
+      } else if (sAxis == "Z" || sAxis == "z") {
+        axis = 3;
+      } else {
+        std::cerr << "  Incorrect/no axis specified for this sensor; assuming X axis" << std::endl;
+        axis = 1;
+      }
+    }
+
+    CalculateTransformMatrix();
+  }
+
+//  ~FGSensorOrientation();
+
+protected:
+  FGColumnVector3 vOrient;
+  FGMatrix33 mT;
+  int axis;
+  void CalculateTransformMatrix(void)
+  {
+    double cp,sp,cr,sr,cy,sy;
+
+    cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
+    cr=cos(vOrient(eRoll));  sr=sin(vOrient(eRoll));
+    cy=cos(vOrient(eYaw));   sy=sin(vOrient(eYaw));
+
+    mT(1,1) =  cp*cy;
+    mT(1,2) =  cp*sy;
+    mT(1,3) = -sp;
+
+    mT(2,1) = sr*sp*cy - cr*sy;
+    mT(2,2) = sr*sp*sy + cr*cy;
+    mT(2,3) = sr*cp;
+
+    mT(3,1) = cr*sp*cy + sr*sy;
+    mT(3,2) = cr*sp*sy - sr*cy;
+    mT(3,3) = cr*cp;
+
+    // This transform is different than for FGForce, where we want a native nozzle
+    // force in body frame. Here we calculate the body frame accel and want it in
+    // the transformed accelerometer frame. So, the next line is commented out.
+    // mT = mT.Inverse();
+  }
+
+private:
+  void Debug(int from);
+};
+}
+#endif
index 5071e7a2d1a440d87faf65af7940e84895858e3d..e77ee72082ea1b503bbc1365a6fe5623c06edf7e 100644 (file)
@@ -38,6 +38,10 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSummer.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -119,7 +123,10 @@ void FGSummer::Debug(int from)
           cout << "       " << InputNodes[i]->getName() << endl;
       }
       if (Bias != 0.0) cout << "       Bias: " << Bias << endl;
-      if (IsOutput) cout << "      OUTPUT: " <<OutputNode->getName() <<  endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index cc11352f50d42d976dbefe65d3f5c3d5f975bdb3..e37642855b6f5ed0f35c1e2f78c24a87ba594a89 100644 (file)
@@ -38,9 +38,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
-#include <vector>
-#include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -48,18 +45,14 @@ DEFINITIONS
 
 #define ID_SUMMER "$Id$"
 
-using std::vector;
-using std::string;
-
-using std::vector;
-using std::string;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 namespace JSBSim {
 
+class Element;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 5ed272155b32175cfb68d8c89cac55937fcb642c..c29c7227752ccfe485453afd30ec96512cf23e6f 100644 (file)
@@ -62,6 +62,10 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSwitch.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -261,7 +265,10 @@ void FGSwitch::Debug(int from)
         }
         cout << endl;
       }
-      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
+      if (IsOutput) {
+        for (unsigned int i=0; i<OutputNodes.size(); i++)
+          cout << "      OUTPUT: " << OutputNodes[i]->getName() << endl;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index 4efec9dfbf141a29aa15a09042fa77af353bc7cd..a68c2c4a55829a24dd992a83e61885c70f36b52a 100644 (file)
@@ -38,8 +38,8 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
-#include <math/FGCondition.h>
+#include "input_output/FGXMLElement.h"
+#include "math/FGCondition.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index ca924fdd9d712c7237354a36c4765c8144e22868..2d7a1aa679b662c07229ec283724b8f622f2ca58 100644 (file)
@@ -9,6 +9,7 @@ libFlightControl_a_SOURCES = \
 noinst_HEADERS = \
        FGPID.h FGDeadBand.h FGFCSComponent.h FGFilter.h \
        FGGain.h FGGradient.h FGKinemat.h FGSummer.h FGSwitch.h FGFCSFunction.h\
-       FGSensor.h FGActuator.h FGAccelerometer.h FGGyro.h FGMagnetometer.h
+       FGSensor.h FGActuator.h FGAccelerometer.h FGGyro.h FGMagnetometer.h \
+       FGSensorOrientation.h
 
 INCLUDES = -I$(top_srcdir)/src/FDM/JSBSim
index 32b05ea19254b273b7fd1f40b69a1acb2cd35fed..1ab17c7b60c0a9529908f553d04d41f042c110f4 100644 (file)
@@ -40,7 +40,14 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGElectric.h"
-#include <models/FGPropulsion.h>
+#include "FGState.h"
+#include "models/FGPropulsion.h"
+#include "models/propulsion/FGThruster.h"
+
+#include <iostream>
+#include <sstream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -92,24 +99,24 @@ double FGElectric::Calculate(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGElectric::GetEngineLabels(string delimeter)
+string FGElectric::GetEngineLabels(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << Name << " HP (engine " << EngineNumber << ")" << delimeter
-      << Thruster->GetThrusterLabels(EngineNumber, delimeter);
+  buf << Name << " HP (engine " << EngineNumber << ")" << delimiter
+      << Thruster->GetThrusterLabels(EngineNumber, delimiter);
 
   return buf.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGElectric::GetEngineValues(string delimeter)
+string FGElectric::GetEngineValues(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << HP << delimeter
-     << Thruster->GetThrusterValues(EngineNumber, delimeter);
+  buf << HP << delimiter
+     << Thruster->GetThrusterValues(EngineNumber, delimiter);
 
   return buf.str();
 }
index ed5a93f57de26ade3ed4a1223bde9d0ab93b60c8..da4a575bb0349f869f137276da85dad762584d9d 100644 (file)
@@ -39,7 +39,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGEngine.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -83,8 +83,8 @@ public:
   double Calculate(void);
   double GetPowerAvailable(void) {return PowerAvailable;}
   double getRPM(void) {return RPM;}
-  string GetEngineLabels(string delimeter);
-  string GetEngineValues(string delimeter);
+  std::string GetEngineLabels(const std::string& delimiter);
+  std::string GetEngineValues(const std::string& delimiter);
 
 private:
 
index edddc11fa3947395f2f679ac44f0248bb0e71e0c..b95837b041a2d1140be051992091d9aa97654255 100644 (file)
@@ -41,9 +41,16 @@ INCLUDES
 #include "FGTank.h"
 #include "FGPropeller.h"
 #include "FGNozzle.h"
-#include <input_output/FGXMLParse.h>
-#include <math/FGColumnVector3.h>
+#include "FGState.h"
+#include "models/FGPropulsion.h"
+#include "input_output/FGXMLParse.h"
+#include "math/FGColumnVector3.h"
+
+#include <iostream>
 #include <fstream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -67,6 +74,8 @@ FGEngine::FGEngine(FGFDMExec* exec, Element* engine_element, int engine_number)
   SLFuelFlowMax = 0.0;
   MaxThrottle = 1.0;
   MinThrottle = 0.0;
+  FuelDensity = 6.0;
+  unsigned int i;
 
   ResetToIC(); // initialize dynamic terms
 
@@ -104,11 +113,19 @@ FGEngine::FGEngine(FGFDMExec* exec, Element* engine_element, int engine_number)
     cerr << "No thruster definition supplied with engine definition." << endl;
   }
 
+  // Build and initialize the feed tank vector.
+  for (i=0; i<(Propulsion->GetNumTanks()); i++) {
+    SourceTanks.push_back(0);
+  }
+
   // Load feed tank[s] references
   local_element = engine_element->GetParent()->FindElement("feed");
   if (local_element) {
     while (local_element) {
-      AddFeedTank((int)local_element->GetDataAsNumber());
+      int tankID = (int)local_element->GetDataAsNumber();
+      FGTank* tank = Propulsion->GetTank(tankID); 
+      AddFeedTank( tankID , tank->GetPriority());
+      FuelDensity = tank->GetDensity();
       local_element = engine_element->GetParent()->FindNextElement("feed");
     }
   } else {
@@ -125,6 +142,8 @@ FGEngine::FGEngine(FGFDMExec* exec, Element* engine_element, int engine_number)
   property_name = base_property_name + "/fuel-flow-rate-pps";
   PropertyManager->Tie( property_name.c_str(), this, &FGEngine::GetFuelFlowRate);
 
+  //cout << "Engine[" << EngineNumber << "] using fuel density: " << FuelDensity << endl;
+
   Debug(0);
 }
 
@@ -165,35 +184,50 @@ void FGEngine::ConsumeFuel(void)
   if (TrimMode) return;
 
   unsigned int i;
-  double Fshortage, TanksWithFuel;
+  double Fshortage, FuelNeeded;
   FGTank* Tank;
-  Fshortage = TanksWithFuel = 0.0;
-
-  // count how many assigned tanks have fuel
-  for (i=0; i<SourceTanks.size(); i++) {
-    Tank = Propulsion->GetTank(SourceTanks[i]);
-    if (Tank->GetType() == FGTank::ttFUEL){
-      if (Tank->GetContents() > 0.0) ++TanksWithFuel;
-    } else {
-       cerr << "No oxidizer tanks should be used for this engine type." << endl;
+  unsigned int TanksWithFuel = 0;
+  Fshortage = FuelNeeded = 0.0;
+  double FuelToBurn;
+  unsigned int CurrentPriority = 1;
+  vector <int> FeedList;
+  Starved = false;
+
+  FuelToBurn = CalcFuelNeed();
+  if (FuelToBurn == 0.0) return;
+
+  // Count how many fuel tanks with the current priority level have fuel.
+  // If none, then try next lower priority.  Build the feed list.
+  while ((TanksWithFuel == 0) && (CurrentPriority <= Propulsion->GetNumTanks())) {
+    for (i=0; i<Propulsion->GetNumTanks(); i++) {
+      if (SourceTanks[i] != 0) {
+        Tank = Propulsion->GetTank(i);
+        if (Tank->GetType() == FGTank::ttFUEL) {
+          if ((Tank->GetContents() > 0.0) && ((unsigned int)Tank->GetPriority() == CurrentPriority)) {
+             ++TanksWithFuel;
+             FeedList.push_back(i);
+           } 
+        } else {
+           cerr << "No oxidizer tanks should be used for this engine type." << endl;
+        }
+      }
     }
+    if (TanksWithFuel == 0) CurrentPriority++;
   }
-  if (TanksWithFuel==0) {
+
+  // No fuel found at any priority!
+  if (TanksWithFuel == 0) {
     Starved = true;
     return;
   }
 
-  for (i=0; i<SourceTanks.size(); i++) {
-    Tank = Propulsion->GetTank(SourceTanks[i]);
-    if (Tank->GetType() == FGTank::ttFUEL) {
-       Fshortage += Tank->Drain(CalcFuelNeed()/TanksWithFuel);
-    } else {
-       cerr << "No oxidizer tanks should be used for this engine type." << endl;
-    }
+  // Remove equal amount of fuel from each feed tank.  
+  FuelNeeded = FuelToBurn/TanksWithFuel;
+  for (i=0; i<FeedList.size(); i++) {
+    Tank = Propulsion->GetTank(FeedList[i]);
+    Tank->Drain(FuelNeeded); 
   }
 
-  if (Fshortage < 0.00) Starved = true;
-  else Starved = false;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -219,9 +253,9 @@ void FGEngine::SetPlacement(FGColumnVector3& location, FGColumnVector3& orientat
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGEngine::AddFeedTank(int tkID)
+void FGEngine::AddFeedTank(int tkID, int priority)
 {
-  SourceTanks.push_back(tkID);
+  SourceTanks[tkID] = priority;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -244,7 +278,6 @@ bool FGEngine::LoadThruster(Element *thruster_element)
 {
   string token, fullpath, localpath;
   string thruster_filename, thruster_fullpathname, thrType;
-  double P_Factor = 0, Sense = 0.0;
   string enginePath = FDMExec->GetEnginePath();
   string aircraftPath = FDMExec->GetFullAircraftPath();
   ifstream thruster_file;
index 0e79e3a725d106c8ed219a88ca2c2ada3af5ffc5..c758d3bc7620a7701a0f65c08b6efcf39802971e 100644 (file)
@@ -43,10 +43,9 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
-#include "FGThruster.h"
-#include <input_output/FGPropertyManager.h>
-#include <input_output/FGXMLFileRead.h>
+#include "FGJSBBase.h"
+#include "input_output/FGXMLFileRead.h"
+#include "math/FGColumnVector3.h"
 #include <vector>
 #include <string>
 
@@ -56,9 +55,6 @@ DEFINITIONS
 
 #define ID_ENGINE "$Id$"
 
-using std::string;
-using std::vector;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -75,6 +71,7 @@ class FGPropulsion;
 class FGAuxiliary;
 class FGThruster;
 class Element;
+class FGPropertyManager;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -116,8 +113,7 @@ CLASS DOCUMENTATION
 @endcode
 <pre>
     NOTES:
-       Engines feed from all tanks equally.
-
+       
        Not all thruster types can be matched with a given engine type.  See the class
        documentation for engine and thruster classes.
 </pre>     
@@ -159,7 +155,7 @@ public:
 
   virtual void SetRunning(bool bb) { Running=bb; }
   virtual void SetName(string name) { Name = name; }
-  virtual void AddFeedTank(int tkID);
+  virtual void AddFeedTank(int tkID, int priority);
   virtual void SetFuelFreeze(bool f) { FuelFreeze = f; }
 
   virtual void SetStarter(bool s) { Starter = s; }
@@ -187,8 +183,8 @@ public:
   bool LoadThruster(Element *el);
   FGThruster* GetThruster(void) {return Thruster;}
 
-  virtual string GetEngineLabels(string delimeter) = 0;
-  virtual string GetEngineValues(string delimeter) = 0;
+  virtual std::string GetEngineLabels(const std::string& delimiter) = 0;
+  virtual std::string GetEngineValues(const std::string& delimiter) = 0;
 
 protected:
   /** Reduces the fuel in the active tanks by the amount required.
@@ -205,7 +201,7 @@ protected:
   virtual double CalcFuelNeed(void);
 
   FGPropertyManager* PropertyManager;
-  string Name;
+  std::string Name;
   const int   EngineNumber;
   EngineType Type;
   double X, Y, Z;
@@ -229,6 +225,7 @@ protected:
 
   double FuelFlow_gph;
   double FuelFlow_pph;
+  double FuelDensity;
 
   FGFDMExec*      FDMExec;
   FGState*        State;
@@ -240,20 +237,10 @@ protected:
   FGAuxiliary*    Auxiliary;
   FGThruster*     Thruster;
 
-  vector <int> SourceTanks;
+  std::vector <int> SourceTanks;
   void Debug(int from);
 };
 }
-#include <FGState.h>
-#include <FGFDMExec.h>
-#include <models/FGAtmosphere.h>
-#include <models/FGFCS.h>
-#include <models/FGAircraft.h>
-#include <models/FGPropagate.h>
-#include <models/FGPropulsion.h>
-#include <models/FGAuxiliary.h>
-#include <models/propulsion/FGThruster.h>
-#include <input_output/FGXMLElement.h>
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
index 9f39088d7788d5702fadb42a32d71e1c1f2487b8..ff7532916325914025583df537d86be4388e5979 100644 (file)
@@ -41,11 +41,15 @@ and the cg.
 */
 
 #include "FGForce.h"
-#include <FGFDMExec.h>
-#include <models/FGAircraft.h>
-#include <models/FGPropagate.h>
-#include <models/FGMassBalance.h>
-#include <models/FGAerodynamics.h>
+#include "FGFDMExec.h"
+#include "models/FGAircraft.h"
+#include "models/FGPropagate.h"
+#include "models/FGMassBalance.h"
+#include "models/FGAerodynamics.h"
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -55,8 +59,8 @@ static const char *IdHdr = ID_FORCE;
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGForce::FGForce(FGFDMExec *FDMExec) :
-                 ttype(tNone),
-                 fdmex(FDMExec)
+                 fdmex(FDMExec),
+                 ttype(tNone)
 {
   mT(1,1) = 1; //identity matrix
   mT(2,2) = 1;
@@ -112,23 +116,27 @@ FGMatrix33 FGForce::Transform(void)
 void FGForce::UpdateCustomTransformMatrix(void)
 {
   double cp,sp,cr,sr,cy,sy;
+  double srsp, crcy, crsy;
 
   cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
   cr=cos(vOrient(eRoll));  sr=sin(vOrient(eRoll));
   cy=cos(vOrient(eYaw));   sy=sin(vOrient(eYaw));
 
+  srsp = sr*sp;
+  crcy = cr*cy;
+  crsy = cr*sy;
+
   mT(1,1) =  cp*cy;
-  mT(1,2) =  cp*sy;
-  mT(1,3) = -sp;
+  mT(2,1) =  cp*sy;
+  mT(3,1) = -sp;
 
-  mT(2,1) = sr*sp*cy - cr*sy;
-  mT(2,2) = sr*sp*sy + cr*cy;
-  mT(2,3) = sr*cp;
+  mT(1,2) = srsp*cy - crsy;
+  mT(2,2) = srsp*sy + crcy;
+  mT(3,2) = sr*cp;
 
-  mT(3,1) = cr*sp*cy + sr*sy;
-  mT(3,2) = cr*sp*sy - sr*cy;
+  mT(1,3) = crcy*sp + sr*sy;
+  mT(2,3) = crsy*sp - sr*cy;
   mT(3,3) = cr*cp;
-  mT = mT.Inverse();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 0798d00e27c16184097449b2f6ef7151c318c72a..eb2f59506290ca98fc3f537fb81eea7262e335fd 100644 (file)
@@ -57,10 +57,10 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGFDMExec.h>
-#include <FGJSBBase.h>
-#include <math/FGMatrix33.h>
-#include <math/FGColumnVector3.h>
+#include "FGFDMExec.h"
+#include "FGJSBBase.h"
+#include "math/FGMatrix33.h"
+#include "math/FGColumnVector3.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -240,6 +240,9 @@ public:
 
   virtual FGColumnVector3& GetBodyForces(void);
 
+  inline double GetBodyXForce(void) const { return vFb(eX); }
+  inline double GetBodyYForce(void) const { return vFb(eY); }
+  inline double GetBodyZForce(void) const { return vFb(eZ); }
   inline FGColumnVector3& GetMoments(void) { return vM; }
 
   // Normal point of application, JSBsim structural coords
@@ -273,12 +276,12 @@ public:
   inline void SetLocation(FGColumnVector3 vv) { vXYZn = vv; SetActingLocation(vv);}
   inline void SetActingLocation(FGColumnVector3 vv) { vActingXYZn = vv; }
 
-  inline double GetLocationX( void ) { return vXYZn(eX);}
-  inline double GetLocationY( void ) { return vXYZn(eY);}
-  inline double GetLocationZ( void ) { return vXYZn(eZ);}
-  inline double GetActingLocationX( void ) { return vActingXYZn(eX);}
-  inline double GetActingLocationY( void ) { return vActingXYZn(eY);}
-  inline double GetActingLocationZ( void ) { return vActingXYZn(eZ);}
+  inline double GetLocationX( void ) const { return vXYZn(eX);}
+  inline double GetLocationY( void ) const { return vXYZn(eY);}
+  inline double GetLocationZ( void ) const { return vXYZn(eZ);}
+  inline double GetActingLocationX( void ) const { return vActingXYZn(eX);}
+  inline double GetActingLocationY( void ) const { return vActingXYZn(eY);}
+  inline double GetActingLocationZ( void ) const { return vActingXYZn(eZ);}
   FGColumnVector3& GetLocation(void) { return vXYZn; }
   FGColumnVector3& GetActingLocation(void) { return vActingXYZn; }
 
@@ -302,10 +305,10 @@ public:
   double GetYaw(void) const {return vOrient(eYaw);}
 
   inline FGColumnVector3& GetAnglesToBody(void) {return vOrient;}
-  inline double GetAnglesToBody(int axis) {return vOrient(axis);}
+  inline double GetAnglesToBody(int axis) const {return vOrient(axis);}
 
   inline void SetTransformType(TransformType ii) { ttype=ii; }
-  inline TransformType GetTransformType(void) { return ttype; }
+  inline TransformType GetTransformType(void) const { return ttype; }
 
   FGMatrix33 Transform(void);
 
index 78059bd2b2f58ae493fd30e6c5de2fb968cd03e4..fdbd1533fe8cf9f6b020595eb4970b522a6740e0 100644 (file)
@@ -35,10 +35,15 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <iostream>
 #include <sstream>
+#include <cstdlib>
 
 #include "FGNozzle.h"
-#include <models/FGAtmosphere.h>
+#include "models/FGAtmosphere.h"
+#include "input_output/FGXMLElement.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -59,14 +64,14 @@ FGNozzle::FGNozzle(FGFDMExec* FDMExec, Element* nozzle_element, int num)
     cerr << "Fatal Error: Nozzle exit area must be given in nozzle config file." << endl;
     exit(-1);
   }
-
+/*
   if (nozzle_element->FindElement("pe"))
     PE = nozzle_element->FindElementValueAsNumberConvertTo("pe", "PSF");
   else {
     cerr << "Fatal Error: Nozzle exit pressure must be given in nozzle config file." << endl;
     exit(-1);
   }
-
+*/
   Thrust = 0;
   Type = ttNozzle;
   
index 5f1d070bffe2733ee387f886ab75e5fd91c5f795..4b5dc40a559afa2cf25e1ef348b1ef58263e1ce1 100644 (file)
@@ -95,7 +95,7 @@ public:
   string GetThrusterValues(int id, string delimeter);
 
 private:
-  double PE;
+//  double PE;
   double Area;
   void Debug(int from);
 };
index 19150d4bbb2b31bd250078e5917d721e3a16133d..7f484e6b9e97ae5594abef65ca45e505f3b29084 100644 (file)
@@ -43,8 +43,13 @@ INCLUDES
 #include <sstream>
 
 #include "FGPiston.h"
-#include <models/FGPropulsion.h>
+#include "FGState.h"
+#include "models/FGAtmosphere.h"
+#include "models/FGPropulsion.h"
 #include "FGPropeller.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -61,7 +66,8 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
   rho_fuel(800),                 // estimate
   calorific_value_fuel(47.3e6),
   Cp_air(1005),                  // Specific heat (constant pressure) J/Kg/K
-  Cp_fuel(1700)
+  Cp_fuel(1700),
+  standard_pressure(101320.73)
 {
   string token;
 
@@ -82,11 +88,14 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
   MinManifoldPressure_inHg = 6.5;
   MaxManifoldPressure_inHg = 28.5;
   ISFC = -1;
-  volumetric_efficiency = -0.1;
+  volumetric_efficiency = 0.85;
   Bore = 5.125;
   Stroke = 4.375;
   Cylinders = 4;
   CompressionRatio = 8.5;
+  Z_airbox = -999;
+  Ram_Air_Factor = 1;
+  PeakMeanPistonSpeed_fps = 100;
 
   // These are internal program variables
 
@@ -102,6 +111,7 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
   BoostSpeed = 0;
   Boosted = false;
   BoostOverride = 0;
+  BoostManual = 0;
   bBoostOverride = false;
   bTakeoffBoost = false;
   TakeoffBoost = 0.0;   // Default to no extra takeoff-boost
@@ -187,10 +197,18 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
     Stroke = el->FindElementValueAsNumberConvertTo("stroke","IN");
   if (el->FindElement("cylinders"))
     Cylinders = el->FindElementValueAsNumber("cylinders");
+  if (el->FindElement("air-intake-impedance-factor"))
+    Z_airbox = el->FindElementValueAsNumber("air-intake-impedance-factor");
+  if (el->FindElement("ram-air-factor"))
+    Ram_Air_Factor  = el->FindElementValueAsNumber("ram-air-factor");
+  if (el->FindElement("peak-piston-speed"))
+    PeakMeanPistonSpeed_fps  = el->FindElementValueAsNumber("peak-piston-speed");
   if (el->FindElement("numboostspeeds")) { // Turbo- and super-charging parameters
     BoostSpeeds = (int)el->FindElementValueAsNumber("numboostspeeds");
     if (el->FindElement("boostoverride"))
       BoostOverride = (int)el->FindElementValueAsNumber("boostoverride");
+    if (el->FindElement("boostmanual"))
+      BoostManual = (int)el->FindElementValueAsNumber("boostmanual");
     if (el->FindElement("takeoffboost"))
       TakeoffBoost = el->FindElementValueAsNumberConvertTo("takeoffboost", "PSI");
     if (el->FindElement("ratedboost1"))
@@ -221,28 +239,45 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
 
   StarterHP = sqrt(MaxHP) * 0.4;
   displacement_SI = Displacement * in3tom3;
+  RatedMeanPistonSpeed_fps =  ( MaxRPM * Stroke) / (360); // AKA 2 * (RPM/60) * ( Stroke / 12) or 2NS
 
-  // Create IFSC and VE to match the engine if not provided
-  int calculated_ve=0;
-  if (volumetric_efficiency < 0) {
-      volumetric_efficiency = MaxManifoldPressure_inHg / 29.92;
-      calculated_ve=1;
-  }
+  // Create IFSC to match the engine if not provided
   if (ISFC < 0) {
-      double pmep = MaxManifoldPressure_inHg > 29.92 ? 0 : 29.92 - MaxManifoldPressure_inHg;
+      double pmep = 29.92 - MaxManifoldPressure_inHg;
       pmep *= inhgtopa;
-      double fmep = (18400 * (2*(Stroke/12)*(MaxRPM/60)) * fttom + 46500)/2;
+      double fmep = (18400 * RatedMeanPistonSpeed_fps * fttom + 46500);
       double hp_loss = ((pmep + fmep) * displacement_SI * MaxRPM)/(Cycles*22371);
-      ISFC = ( Displacement * MaxRPM * volumetric_efficiency ) / (9411 * (MaxHP+hp_loss));
+      ISFC = ( 1.1*Displacement * MaxRPM * volumetric_efficiency *(MaxManifoldPressure_inHg / 29.92) ) / (9411 * (MaxHP+hp_loss));
 // cout <<"FMEP: "<< fmep <<" PMEP: "<< pmep << " hp_loss: " <<hp_loss <<endl;
   }
   if ( MaxManifoldPressure_inHg > 29.9 ) {   // Don't allow boosting with a bogus number
       MaxManifoldPressure_inHg = 29.9;
-      if (calculated_ve) volumetric_efficiency = 1.0;
   }
   minMAP = MinManifoldPressure_inHg * inhgtopa;  // inHg to Pa
   maxMAP = MaxManifoldPressure_inHg * inhgtopa;
 
+// For throttle
+/*
+ * Pm = ( Ze / ( Ze + Zi + Zt ) ) * Pa
+ * Where:
+ * Pm = Manifold Pressure
+ * Pa = Ambient Pressre
+ * Ze = engine impedance, Ze is effectively 1 / Mean Piston Speed  
+ * Zi = airbox impedance
+ * Zt = throttle impedance
+ * 
+ * For the calculation below throttle is fully open or Zt = 0
+ *
+ * 
+ *
+ */
+
+  if(Z_airbox < 0.0){
+    double Ze=PeakMeanPistonSpeed_fps/RatedMeanPistonSpeed_fps; // engine impedence
+    Z_airbox = (standard_pressure *Ze / maxMAP) - Ze; // impedence of airbox
+  }
+  Z_throttle=(((MaxRPM * Stroke) / 360)/((IdleRPM * Stroke) / 360))*(standard_pressure/minMAP - 1) - Z_airbox; // Constant for Throttle impedence
+
   string property_name, base_property_name;
   base_property_name = CreateIndexedPropertyName("propulsion/engine", EngineNumber);
   property_name = base_property_name + "/power-hp";
@@ -255,6 +290,12 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
   PropertyManager->Tie(property_name, &MAP);
   property_name = base_property_name + "/map-inhg";
   PropertyManager->Tie(property_name, &ManifoldPressure_inHg);
+  property_name = base_property_name + "/air-intake-impedance-factor";
+  PropertyManager->Tie(property_name, &Z_airbox);
+  property_name = base_property_name + "/ram-air-factor";
+  PropertyManager->Tie(property_name, &Ram_Air_Factor);
+  property_name = base_property_name + "/boost-speed";
+  PropertyManager->Tie(property_name, &BoostSpeed);
 
   // Set up and sanity-check the turbo/supercharging configuration based on the input values.
   if (TakeoffBoost > RatedBoost[0]) bTakeoffBoost = true;
@@ -302,6 +343,7 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
     BoostSpeed = 0;
   }
   bBoostOverride = (BoostOverride == 1 ? true : false);
+  bBoostManual   = (BoostManual   == 1 ? true : false);
   Debug(0); // Call Debug() routine from constructor if needed
 }
 
@@ -349,6 +391,8 @@ double FGPiston::Calculate(void)
   //
 
   p_amb = Atmosphere->GetPressure() * psftopa;
+  double p = Auxiliary->GetTotalPressure() * psftopa;
+  p_ram = (p - p_amb) * Ram_Air_Factor + p_amb;
   T_amb = RankineToKelvin(Atmosphere->GetTemperature());
 
   RPM = Thruster->GetRPM() * Thruster->GetGearRatio();
@@ -488,15 +532,20 @@ void FGPiston::doEngineStartup(void)
 
 void FGPiston::doBoostControl(void)
 {
-  if(BoostSpeed < BoostSpeeds - 1) {
-    // Check if we need to change to a higher boost speed
-    if(p_amb < BoostSwitchPressure[BoostSpeed] - BoostSwitchHysteresis) {
-      BoostSpeed++;
-    }
-  } else if(BoostSpeed > 0) {
-    // Check if we need to change to a lower boost speed
-    if(p_amb > BoostSwitchPressure[BoostSpeed - 1] + BoostSwitchHysteresis) {
-      BoostSpeed--;
+  if(BoostManual) {
+    if(BoostSpeed > BoostSpeeds-1) BoostSpeed = BoostSpeeds-1;
+    if(BoostSpeed < 0) BoostSpeed = 0;
+  } else {
+    if(BoostSpeed < BoostSpeeds - 1) {
+      // Check if we need to change to a higher boost speed
+      if(p_amb < BoostSwitchPressure[BoostSpeed] - BoostSwitchHysteresis) {
+        BoostSpeed++;
+      }
+    } else if(BoostSpeed > 0) {
+      // Check if we need to change to a lower boost speed
+      if(p_amb > BoostSwitchPressure[BoostSpeed - 1] + BoostSwitchHysteresis) {
+        BoostSpeed--;
+      }
     }
   }
 }
@@ -518,15 +567,13 @@ void FGPiston::doBoostControl(void)
 
 void FGPiston::doMAP(void)
 {
- // estimate throttle plate area.
-  double throttle_area = ThrottleAngle*ThrottleAngle;
- // Internal Combustion Engine in Theory and Practice, Volume 2.  Charles Fayette Taylor.  Revised Edition, 1985 fig 6-13
-  double map_coefficient = 1-((MeanPistonSpeed_fps*MeanPistonSpeed_fps)/(24978*throttle_area));
+  double Zt =(1-Throttle)*(1-Throttle)*Z_throttle; // throttle impedence
+  double Ze= MeanPistonSpeed_fps > 0 ? PeakMeanPistonSpeed_fps/MeanPistonSpeed_fps : 999999; // engine impedence
 
-  if ( map_coefficient < 0.1 ) map_coefficient = 0.1;
+  double map_coefficient = Ze/(Ze+Z_airbox+Zt);
 
   // Add a one second lag to manifold pressure changes
-  double dMAP = (TMAP - p_amb * map_coefficient) * dt;
+  double dMAP = (TMAP - p_ram * map_coefficient) * dt;
   TMAP -=dMAP;
 
   // Find the mean effective pressure required to achieve this manifold pressure
@@ -548,8 +595,7 @@ void FGPiston::doMAP(void)
       }
     }
     // Boost the manifold pressure.
-    double boost_factor = BoostMul[BoostSpeed] * RPM/RatedRPM[BoostSpeed];
-    if (boost_factor < 1.0) boost_factor = 1.0;  // boost will never reduce the MAP
+    double boost_factor = (( BoostMul[BoostSpeed] - 1 ) / RatedRPM[BoostSpeed] ) * RPM + 1;
     MAP = TMAP * boost_factor;
     // Now clip the manifold pressure to BCV or Wastegate setting.
     if (bTakeoffPos) {
@@ -581,7 +627,7 @@ void FGPiston::doMAP(void)
 
 void FGPiston::doAirFlow(void)
 {
-  double gamma = 1.4; // specific heat constants
+  double gamma = 1.1; // specific heat constants
 // loss of volumentric efficiency due to difference between MAP and exhaust pressure
   double ve =((gamma-1)/gamma)+( CompressionRatio -(p_amb/MAP))/(gamma*( CompressionRatio - 1));
 
@@ -806,28 +852,28 @@ void FGPiston::doOilPressure(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGPiston::GetEngineLabels(string delimeter)
+string FGPiston::GetEngineLabels(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << Name << " Power Available (engine " << EngineNumber << " in HP)" << delimeter
-      << Name << " HP (engine " << EngineNumber << ")" << delimeter
-      << Name << " equivalent ratio (engine " << EngineNumber << ")" << delimeter
-      << Name << " MAP (engine " << EngineNumber << " in inHg)" << delimeter
-      << Thruster->GetThrusterLabels(EngineNumber, delimeter);
+  buf << Name << " Power Available (engine " << EngineNumber << " in HP)" << delimiter
+      << Name << " HP (engine " << EngineNumber << ")" << delimiter
+      << Name << " equivalent ratio (engine " << EngineNumber << ")" << delimiter
+      << Name << " MAP (engine " << EngineNumber << " in inHg)" << delimiter
+      << Thruster->GetThrusterLabels(EngineNumber, delimiter);
 
   return buf.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGPiston::GetEngineValues(string delimeter)
+string FGPiston::GetEngineValues(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << PowerAvailable << delimeter << HP << delimeter
-      << equivalence_ratio << delimeter << ManifoldPressure_inHg << delimeter
-      << Thruster->GetThrusterValues(EngineNumber, delimeter);
+  buf << PowerAvailable << delimiter << HP << delimiter
+      << equivalence_ratio << delimiter << ManifoldPressure_inHg << delimiter
+      << Thruster->GetThrusterValues(EngineNumber, delimiter);
 
   return buf.str();
 }
@@ -872,10 +918,13 @@ void FGPiston::Debug(int from)
       cout << "      MaxHP: "               << MaxHP                    << endl;
       cout << "      Cycles: "              << Cycles                   << endl;
       cout << "      IdleRPM: "             << IdleRPM                  << endl;
+      cout << "      MaxRPM: "              << MaxRPM                   << endl;
       cout << "      MaxThrottle: "         << MaxThrottle              << endl;
       cout << "      MinThrottle: "         << MinThrottle              << endl;
       cout << "      ISFC: "                << ISFC                     << endl;
-      cout << "      Volumentric Efficiency: " << volumetric_efficiency    << endl;
+      cout << "      Volumetric Efficiency: " << volumetric_efficiency    << endl;
+      cout << "      PeakMeanPistonSpeed_fps: " << PeakMeanPistonSpeed_fps << endl;
+      cout << "      Intake Impedance Factor: " << Z_airbox << endl;
 
       cout << endl;
       cout << "      Combustion Efficiency table:" << endl;
index 4c40565a42ee346f23fbe0b4847611594691d087..2bfb1971a8ec7c3ce129c5c57c10be1f2c042a21 100644 (file)
@@ -40,8 +40,8 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGEngine.h"
-#include <math/FGTable.h>
-#include <input_output/FGXMLElement.h>
+#include "math/FGTable.h"
+#include "input_output/FGXMLElement.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -81,9 +81,10 @@ CLASS DOCUMENTATION
   <maxthrottle> {number} </maxthrottle>
   <minthrottle> {number} </minthrottle>
   <bsfc unit="{LBS/HP*HR | "KG/KW*HR"}"> {number} </bsfc>
-  <volumetric_efficiency> {number} </volumetric_efficiency>
+  <volumetric-efficiency> {number} </volumetric-efficiency>
   <numboostspeeds> {number} </numboostspeeds>
   <boostoverride> {0 | 1} </boostoverride>
+  <boostmanual> {0 | 1} </boostmanual>
   <ratedboost1 unit="{INHG | PA | ATM}"> {number} </ratedboost1>
   <ratedpower1 unit="{HP | WATTS}"> {number} </ratedpower1>
   <ratedrpm1> {number} </ratedrpm1>
@@ -97,6 +98,8 @@ CLASS DOCUMENTATION
   <ratedrpm3> {number} </ratedrpm3>
   <ratedaltitude3 unit="{FT | M}"> {number} </ratedaltitude3>
   <takeoffboost unit="{INHG | PA | ATM}"> {number} </takeoffboost>
+  <air-intake-impedance-factor> {number} </air-intake-impedance-factor>
+  <ram-air-factor> {number} </ram-air-factor>
 </piston_engine>
 @endcode
 
@@ -120,6 +123,10 @@ CLASS DOCUMENTATION
       some way of getting the boost control cutout lever position (on or off)
       from FlightGear first.
 
+    - BOOSTMANUAL - whether a multispeed supercharger will manually or
+      automatically shift boost speeds.  On manual shifting the boost speeds
+      is accomplished by controling propulsion/engine/boostspeed
+
     - The next items are all appended with either 1, 2 or 3 depending on which
       boost speed they refer to, eg RATEDBOOST1.  The rated values seems to have
       been a common convention at the time to express the maximum continuously
@@ -188,8 +195,8 @@ public:
   /// Destructor
   ~FGPiston();
 
-  string GetEngineLabels(string delimeter);
-  string GetEngineValues(string delimeter);
+  std::string GetEngineLabels(const std::string& delimiter);
+  std::string GetEngineValues(const std::string& delimiter);
 
   double Calculate(void);
   double GetPowerAvailable(void) {return PowerAvailable;}
@@ -247,6 +254,8 @@ private:
   const double calorific_value_fuel;  // W/Kg (approximate)
   const double Cp_air;      // J/KgK
   const double Cp_fuel;     // J/KgK
+  const double standard_pressure; //Pa
+
 
   FGTable *Lookup_Combustion_Efficiency;
   FGTable *Mixture_Efficiency_Correlation;
@@ -267,12 +276,19 @@ private:
   double Bore;                     // inches
   double Stroke;                   // inches
   double Cylinders;                // number
-  double CompressionRatio;        // number
+  double CompressionRatio;         // number
+  double Z_airbox; // number representing intake impediance before the throttle
+  double Z_throttle; // number representing slope of throttle impediance
+  double PeakMeanPistonSpeed_fps; // ft/sec speed where intake valves begin to choke. Typically 33-50 fps
+  double RatedMeanPistonSpeed_fps; // ft/sec derived from MaxRPM and stroke.
+  double Ram_Air_Factor;           // number
 
   double StarterHP;                // initial horsepower of starter motor
   int BoostSpeeds;     // Number of super/turbocharger boost speeds - zero implies no turbo/supercharging.
   int BoostSpeed;      // The current boost-speed (zero-based).
   bool Boosted;                // Set true for boosted engine.
+  int BoostManual;     // The raw value read in from the config file - should be 1 or 0 - see description below.
+  bool bBoostManual;   // Set true if pilot must manually control the boost speed.
   int BoostOverride;   // The raw value read in from the config file - should be 1 or 0 - see description below.
   bool bBoostOverride; // Set true if pilot override of the boost regulator was fitted.
               // (Typically called 'war emergency power').
@@ -302,6 +318,7 @@ private:
   // Inputs (in addition to those in FGEngine).
   //
   double p_amb;              // Pascals
+  double p_ram;              // Pascals
   double T_amb;              // degrees Kelvin
   double RPM;                // revolutions per minute
   double IAS;                // knots
index 2f5b39523940b2be6f1e5bade71c5bbdc3aa4f6d..fb1be8ac125de1d236b4014a6dfbf1c9c97c7c97 100644 (file)
@@ -35,12 +35,16 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <iostream>
 #include <sstream>
 
 #include "FGPropeller.h"
-#include <models/FGPropagate.h>
-#include <models/FGAtmosphere.h>
-#include <models/FGAuxiliary.h>
+#include "models/FGPropagate.h"
+#include "models/FGAtmosphere.h"
+#include "models/FGAuxiliary.h"
+#include "input_output/FGXMLElement.h"
+
+using namespace std;
 
 namespace JSBSim {
 
index a2ddc9f419fc4223bd4612d9cd48fa49e849e8f4..500e6798599bf2372f7eedd2f052887525a26f0f 100644 (file)
@@ -39,7 +39,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGThruster.h"
-#include <math/FGTable.h>
+#include "math/FGTable.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
index 1f4ca5a6f0b04d42ed144d23169947ef821a9080..85b0fd57f63324291181f0aa1ae13c65b3d3eeda 100644 (file)
@@ -38,9 +38,15 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <iostream>
 #include <sstream>
-
 #include "FGRocket.h"
+#include "FGState.h"
+#include "models/FGPropulsion.h"
+#include "FGThruster.h"
+#include "FGTank.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -63,7 +69,10 @@ FGRocket::FGRocket(FGFDMExec* exec, Element *el, int engine_number)
   FuelFlowRate = 0.0;
   OxidizerFlowRate = 0.0;
   SLOxiFlowMax = 0.0;
+  BuildupTime = 0.0;
   It = 0.0;
+  ThrustVariation = 0.0;
+  TotalIspVariation = 0.0;
 
   // Defaults
    MinThrottle = 0.0;
@@ -71,6 +80,8 @@ FGRocket::FGRocket(FGFDMExec* exec, Element *el, int engine_number)
 
   if (el->FindElement("isp"))
     Isp = el->FindElementValueAsNumber("isp");
+  if (el->FindElement("builduptime"))
+    BuildupTime = el->FindElementValueAsNumber("builduptime");
   if (el->FindElement("maxthrottle"))
     MaxThrottle = el->FindElementValueAsNumber("maxthrottle");
   if (el->FindElement("minthrottle"))
@@ -80,9 +91,19 @@ FGRocket::FGRocket(FGFDMExec* exec, Element *el, int engine_number)
   if (el->FindElement("sloxiflowmax"))
     SLOxiFlowMax = el->FindElementValueAsNumberConvertTo("sloxiflowmax", "LBS/SEC");
 
+  // If there is a thrust table element, this is a solid propellant engine.
   thrust_table_element = el->FindElement("thrust_table");
   if (thrust_table_element) {
     ThrustTable = new FGTable(PropertyManager, thrust_table_element);
+    Element* variation_element = el->FindElement("variation");
+    if (variation_element) {
+      if (variation_element->FindElement("thrust")) {
+        ThrustVariation = variation_element->FindElementValueAsNumber("thrust");
+      }
+      if (variation_element->FindElement("total_isp")) {
+        TotalIspVariation = variation_element->FindElementValueAsNumber("total_isp");
+      }
+    }
   }
 
   bindmodel();
@@ -114,21 +135,29 @@ double FGRocket::Calculate(void)
   PropellantFlowRate = (FuelExpended + OxidizerExpended)/dT;
   Throttle = FCS->GetThrottlePos(EngineNumber);
 
-  // If there is a thrust table, it is a function of propellant remaining. The
+  // If there is a thrust table, it is a function of propellant burned. The
   // engine is started when the throttle is advanced to 1.0. After that, it
-  // burns without regard to throttle setting. The table returns a value between
-  // zero and one, representing the percentage of maximum vacuum thrust being
-  // applied.
+  // burns without regard to throttle setting.
 
   if (ThrustTable != 0L) { // Thrust table given -> Solid fuel used
 
     if ((Throttle == 1 || BurnTime > 0.0 ) && !Starved) {
-      BurnTime += State->Getdt();
-      double TotalEngineFuelAvailable=0.0;
-      for (int i=0; i<(int)SourceTanks.size(); i++)
-        TotalEngineFuelAvailable += Propulsion->GetTank(SourceTanks[i])->GetContents();
-
-      VacThrust = ThrustTable->GetValue(TotalEngineFuelAvailable);
+      double TotalEngineFuelBurned=0.0;
+      for (int i=0; i<(int)SourceTanks.size(); i++) {
+        FGTank* tank = Propulsion->GetTank(i);
+        if (SourceTanks[i] == 1) {
+          TotalEngineFuelBurned += tank->GetCapacity() - tank->GetContents();
+        }
+      }
+
+      VacThrust = ThrustTable->GetValue(TotalEngineFuelBurned)
+                * (ThrustVariation + 1)
+                * (TotalIspVariation + 1);
+      if (BurnTime <= BuildupTime && BuildupTime > 0.0) {
+        VacThrust *= sin((BurnTime/BuildupTime)*M_PI/2.0);
+        // VacThrust *= (1-cos((BurnTime/BuildupTime)*M_PI))/2.0; // 1 - cos approach
+      }
+      BurnTime += State->Getdt(); // Increment burn time
     } else {
       VacThrust = 0.0;
     }
@@ -143,7 +172,12 @@ double FGRocket::Calculate(void)
 
     } else { // Calculate thrust
 
-      PctPower = Throttle / MaxThrottle; // Min and MaxThrottle range from 0.0 to 1.0, normally.
+      // This is nonsensical. Max throttle should be assumed to be 1.0. One might
+      // conceivably have a throttle setting > 1.0 for some rocket engines. But, 1.0
+      // should always be the default.
+      // PctPower = Throttle / MaxThrottle; // Min and MaxThrottle range from 0.0 to 1.0, normally.
+      
+      PctPower = Throttle;
       Flameout = false;
       VacThrust = Isp * PropellantFlowRate;
 
@@ -221,6 +255,11 @@ void FGRocket::ConsumeFuel(void)
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+// 
+// The FuelFlowRate can be affected by the TotalIspVariation value (settable
+// in a config file or via properties). The TotalIspVariation parameter affects
+// thrust, but the thrust determines fuel flow rate, so it must be adjusted
+// for Total Isp Variation.
 
 double FGRocket::CalcFuelNeed(void)
 {
@@ -228,6 +267,7 @@ double FGRocket::CalcFuelNeed(void)
 
   if (ThrustTable != 0L) {          // Thrust table given - infers solid fuel
     FuelFlowRate = VacThrust/Isp;   // This calculates wdot (weight flow rate in lbs/sec)
+    FuelFlowRate /= (1 + TotalIspVariation);
   } else {
     FuelFlowRate = SLFuelFlowMax*PctPower;
   }
@@ -248,29 +288,29 @@ double FGRocket::CalcOxidizerNeed(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGRocket::GetEngineLabels(string delimeter)
+string FGRocket::GetEngineLabels(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << Name << " Total Impulse (engine " << EngineNumber << " in psf)" << delimeter
-      << Thruster->GetThrusterLabels(EngineNumber, delimeter);
+  buf << Name << " Total Impulse (engine " << EngineNumber << " in psf)" << delimiter
+      << Thruster->GetThrusterLabels(EngineNumber, delimiter);
 
   return buf.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGRocket::GetEngineValues(string delimeter)
+string FGRocket::GetEngineValues(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << It << delimeter << Thruster->GetThrusterValues(EngineNumber, delimeter);
+  buf << It << delimiter << Thruster->GetThrusterValues(EngineNumber, delimiter);
 
   return buf.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-// This funciton should tie properties to rocket engine specific properties
+// This function should tie properties to rocket engine specific properties
 // that are not bound in the base class (FGEngine) code.
 //
 void FGRocket::bindmodel()
@@ -280,10 +320,20 @@ void FGRocket::bindmodel()
 
   property_name = base_property_name + "/total-impulse";
   PropertyManager->Tie( property_name.c_str(), this, &FGRocket::GetTotalImpulse);
-  property_name = base_property_name + "/oxi-flow-rate-pps";
-  PropertyManager->Tie( property_name.c_str(), this, &FGRocket::GetOxiFlowRate);
   property_name = base_property_name + "/vacuum-thrust_lbs";
   PropertyManager->Tie( property_name.c_str(), this, &FGRocket::GetVacThrust);
+
+  if (ThrustTable) { // Solid rocket motor
+    property_name = base_property_name + "/thrust-variation_pct";
+    PropertyManager->Tie( property_name.c_str(), this, &FGRocket::GetThrustVariation,
+                                                       &FGRocket::SetThrustVariation);
+    property_name = base_property_name + "/total-isp-variation_pct";
+    PropertyManager->Tie( property_name.c_str(), this, &FGRocket::GetTotalIspVariation,
+                                                       &FGRocket::SetTotalIspVariation);
+  } else { // Liquid rocket motor
+    property_name = base_property_name + "/oxi-flow-rate-pps";
+    PropertyManager->Tie( property_name.c_str(), this, &FGRocket::GetOxiFlowRate);
+  }
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 4e6e8120a5af3a49e4b07ce2eb1b9ef53f1fe858..4ff539572ff97cc6863a5c2a0009e3a777dd1a35 100644 (file)
@@ -39,8 +39,8 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGEngine.h"
-#include <math/FGTable.h>
-#include <input_output/FGXMLElement.h>
+#include "math/FGTable.h"
+#include "input_output/FGXMLElement.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -159,8 +159,34 @@ public:
 
   double GetOxiFlowRate(void) const {return OxidizerFlowRate;}
 
-  string GetEngineLabels(string delimeter);
-  string GetEngineValues(string delimeter);
+  std::string GetEngineLabels(const std::string& delimiter);
+  std::string GetEngineValues(const std::string& delimiter);
+
+  /** Sets the thrust variation for a solid rocket engine. 
+      Solid propellant rocket motor thrust characteristics are typically
+      defined at 70 degrees F temperature. At any other temperature,
+      performance will be different. Warmer propellant grain will
+      burn quicker and at higher thrust.  Total motor impulse is
+      not changed for change in thrust.
+      @param var the variation in percent. That is, a 2 percent
+      variation would be specified as 0.02. A positive 2% variation
+      in thrust would increase the thrust by 2%, and shorten the burn time. */
+  void SetThrustVariation(double var) {ThrustVariation = var;}
+
+  /** Sets the variation in total motor energy.
+      The total energy present in a solid rocket motor can be modified
+      (such as might happen with manufacturing variations) by setting
+      the total Isp variation. 
+      @param var the variation in percent. That is, a 2 percent
+      variation would be specified as 0.02. This variation will 
+      affect the total thrust, but not the burn time.*/
+  void SetTotalIspVariation(double var) {TotalIspVariation = var;}
+
+  /** Returns the thrust variation, if any. */
+  double GetThrustVariation(void) const {return ThrustVariation;}
+
+  /** Returns the Total Isp variation, if any. */
+  double GetTotalIspVariation(void) const {return TotalIspVariation;}
 
 private:
   /** Reduces the fuel in the active tanks by the amount required.
@@ -192,6 +218,8 @@ private:
   double It;
   double MxR; // Mixture Ratio
   double BurnTime;
+  double ThrustVariation;
+  double TotalIspVariation;
   double VacThrust;
   double previousFuelNeedPerTank;
   double previousOxiNeedPerTank;
@@ -200,6 +228,7 @@ private:
   double OxidizerFlowRate;
   double PropellantFlowRate;
   bool Flameout;
+  double BuildupTime;
   FGTable* ThrustTable;
 
   void Debug(int from);
index 7c3de71a6219fea8789139630a2c873c9bffedce..6ef33e7c03feb540ce5a8c517126b73c30f82abd 100644 (file)
@@ -36,6 +36,9 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGRotor.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
index 289fbb197c7aa769a1104d230ba59f5bfa099d91..f05831b73a0bf6ab7129a32784644f16cb781d0c 100644 (file)
@@ -37,11 +37,14 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGTank.h"
-#include <models/FGAuxiliary.h>
+#include "FGFDMExec.h"
+#include "models/FGAuxiliary.h"
+#include "input_output/FGXMLElement.h"
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+#include <cstdlib>
 
-using std::cerr;
-using std::endl;
-using std::cout;
+using namespace std;
 
 namespace JSBSim {
 
@@ -55,13 +58,16 @@ CLASS IMPLEMENTATION
 FGTank::FGTank(FGFDMExec* exec, Element* el, int tank_number)
                   : TankNumber(tank_number), Exec(exec)
 {
-  string token;
+  string token, strFuelName;
   Element* element;
   Element* element_Grain;
   Area = 1.0;
-  Temperature = -9999.0;
+  Density = 6.6;
+  InitialTemperature = Temperature = -9999.0;
   Ixx = Iyy = Izz = 0.0;
-  Radius = Capacity = Contents = Standpipe = Length = InnerRadius = 0.0;
+  Radius = Contents = Standpipe = Length = InnerRadius = 0.0;
+  Capacity = 0.00001;
+  Priority = InitialPriority = 1;
   PropertyManager = Exec->GetPropertyManager();
   vXYZ.InitMatrix();
   vXYZ_drain.InitMatrix();
@@ -92,15 +98,22 @@ FGTank::FGTank(FGFDMExec* exec, Element* el, int tank_number)
     InitialTemperature = Temperature = el->FindElementValueAsNumber("temperature");
   if (el->FindElement("standpipe"))
     InitialStandpipe = Standpipe = el->FindElementValueAsNumberConvertTo("standpipe", "LBS");
+  if (el->FindElement("priority"))
+    InitialPriority = Priority = el->FindElementValueAsNumber("priority");
+  if (el->FindElement("density"))
+    Density = el->FindElementValueAsNumberConvertTo("density", "LBS/GAL");
+  if (el->FindElement("type"))
+    strFuelName = el->FindElementValue("type");
 
-  Selected = true;
 
-  if (Capacity != 0) {
-    PctFull = 100.0*Contents/Capacity;            // percent full; 0 to 100.0
-  } else {
-    Contents = 0;
-    PctFull  = 0;
+  SetPriority( InitialPriority );     // this will also set the Selected flag
+
+  if (Capacity == 0) {
+    cerr << "Tank capacity must not be zero. Reset to 0.00001 lbs!" << endl;
+    Capacity = 0.00001;
+    Contents = 0.0;
   }
+  PctFull = 100.0*Contents/Capacity;            // percent full; 0 to 100.0
 
   // Check whether this is a solid propellant "tank". Initialize it if true.
 
@@ -145,10 +158,16 @@ FGTank::FGTank(FGFDMExec* exec, Element* el, int tank_number)
   property_name = base_property_name + "/contents-lbs";
   PropertyManager->Tie( property_name.c_str(), (FGTank*)this, &FGTank::GetContents,
                                        &FGTank::SetContents );
+  property_name = base_property_name + "/priority";
+  PropertyManager->Tie( property_name.c_str(), (FGTank*)this, &FGTank::GetPriority,
+                                       &FGTank::SetPriority );
 
   if (Temperature != -9999.0)  InitialTemperature = Temperature = FahrenheitToCelsius(Temperature);
   Area = 40.0 * pow(Capacity/1975, 0.666666667);
 
+  // A named fuel type will override a previous density value
+  if (!strFuelName.empty()) Density = ProcessFuelName(strFuelName); 
+
   Debug(0);
 }
 
@@ -163,11 +182,11 @@ FGTank::~FGTank()
 
 void FGTank::ResetToIC(void)
 {
-  Temperature = InitialTemperature;
-  Standpipe = InitialStandpipe;
-  Contents = InitialContents;
+  SetTemperature( InitialTemperature );
+  SetStandpipe ( InitialStandpipe );
+  SetContents ( InitialContents );
   PctFull = 100.0*Contents/Capacity;
-  Selected = true;
+  SetPriority( InitialPriority );
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -199,7 +218,6 @@ double FGTank::Drain(double used)
 
     Contents = 0.0;
     PctFull = 0.0;
-    Selected = false;
   }
 
   if (grainType != gtUNKNOWN) CalculateInertias();
@@ -238,6 +256,14 @@ void FGTank::SetContents(double amount)
   }
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGTank::SetContentsGallons(double gallons)
+{
+  SetContents(gallons * Density);
+}
+
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 double FGTank::Calculate(double dt)
@@ -284,11 +310,52 @@ void FGTank::CalculateInertias(void)
       Ixx = 0.5*Mass*Rad2/144.0;
       Iyy = Mass*(3.0*Rad2 + Length*Length)/(144.0*12.0);
       break;
+    case gtUNKNOWN:
+      cerr << "Unknown grain type found." << endl;
+      exit(-1);
+      break;
   }
   Izz  = Iyy;
 
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGTank::ProcessFuelName(std::string const& name)
+{
+   if      (name == "AVGAS")    return 6.02; 
+   else if (name == "JET-A")    return 6.74;
+   else if (name == "JET-A1")   return 6.74;
+   else if (name == "JET-B")    return 6.48;
+   else if (name == "JP-1")     return 6.76;
+   else if (name == "JP-2")     return 6.38;
+   else if (name == "JP-3")     return 6.34;
+   else if (name == "JP-4")     return 6.48;
+   else if (name == "JP-5")     return 6.81;
+   else if (name == "JP-6")     return 6.55;
+   else if (name == "JP-7")     return 6.61;
+   else if (name == "JP-8")     return 6.66;
+   else if (name == "JP-8+100") return 6.66;
+ //else if (name == "JP-9")     return 6.74;
+ //else if (name == "JPTS")     return 6.74;
+   else if (name == "RP-1")     return 6.73;
+   else if (name == "T-1")      return 6.88;
+   else if (name == "ETHANOL")  return 6.58;
+   else if (name == "HYDRAZINE")return 8.61;
+   else if (name == "F-34")     return 6.66;
+   else if (name == "F-35")     return 6.74;
+   else if (name == "F-40")     return 6.48;
+   else if (name == "F-44")     return 6.81;
+   else if (name == "AVTAG")    return 6.48;
+   else if (name == "AVCAT")    return 6.81;
+   else {
+     cerr << "Unknown fuel type specified: "<< name << endl;
+   } 
+
+   return 6.6;
+}
+
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -319,6 +386,7 @@ void FGTank::Debug(int from)
       cout << "      Tank location (X, Y, Z): " << vXYZ(eX) << ", " << vXYZ(eY) << ", " << vXYZ(eZ) << endl;
       cout << "      Effective radius: " << Radius << " inches" << endl;
       cout << "      Initial temperature: " << Temperature << " Fahrenheit" << endl;
+      cout << "      Priority: " << Priority << endl;
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
index 479fcb6c69318bd861fd20a27e5cb63b34597c70..55930543f660ef5c4f4227ebc135434bff683ceb 100644 (file)
@@ -44,17 +44,10 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include "FGFDMExec.h"
-#include <FGJSBBase.h>
-#include <input_output/FGXMLElement.h>
-#include <math/FGColumnVector3.h>
+#include "FGJSBBase.h"
+#include "math/FGColumnVector3.h"
 #include <string>
 
-using std::string;
-using std::cerr;
-using std::endl;
-using std::cout;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -67,6 +60,10 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class Element;
+class FGPropertyManager;
+class FGFDMExec;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -127,6 +124,9 @@ CLASS DOCUMENTATION
   <contents unit="{LBS | KG}"> {number} </contents>
   <temperature> {number} </temperature> <!-- must be degrees fahrenheit -->
   <standpipe unit="{LBS | KG"}> {number} </standpipe>
+  <priority> {integer} </priority>
+  <density unit="{KG/L | LBS/GAL}"> {number} </density>
+  <type> {string} </type> <!-- will override previous density setting -->
 </tank>
 @endcode
 
@@ -140,6 +140,11 @@ CLASS DOCUMENTATION
 - \b contents - Initial contents, defaults to pounds.
 - \b temperature - Initial temperature, defaults to degrees Fahrenheit.
 - \b standpipe - Minimum contents to which tank can dump, defaults to pounds.
+- \b priority - Establishes feed sequence of tank. "1" is the highest priority.
+- \b density - Density of liquid tank contents.
+- \b type - Named fuel type. One of AVGAS, JET-A, JET-A1, JET-B, JP-1, JP-2, JP-3,
+- \b        JP-4, JP-5, JP-6, JP-7, JP-8, JP-8+100, RP-1, T-1, ETHANOL, HYDRAZINE,
+- \b        F-34, F-35, F-40, F-44, AVTAG, AVCAT
 
 location:
 - \b x - Location of tank on aircraft's x-axis, defaults to inches.
@@ -160,10 +165,12 @@ be printed to the console if the location is not given
 - \b y - 0.0  (both full and drained CG locations)
 - \b z - 0.0  (both full and drained CG locations)
 - \b radius - 0.0
-- \b capacity - 0.0
+- \b capacity - 0.00001 (tank capacity must not be zero)
 - \b contents - 0.0
-- \b temperature - -9999.0
-- \b standpipe - 0.0
+- \b temperature - -9999.0 (flag which indicates no temperature is set)
+- \b standpipe - 0.0 (all contents may be dumped)
+- \b priority - 1 (highest feed sequence priority)
+- \b density - 6.6
 
     @author Jon Berndt, Dave Culp
     @see Akbar, Raza et al. "A Simple Analysis of Fuel Addition to the CWT of
@@ -211,8 +218,8 @@ public:
   /** Resets the tank parameters to the initial conditions */
   void ResetToIC(void);
 
-  /** If the tank is supplying fuel, this function returns true.
-      @return true if this tank is feeding an engine.*/
+  /** If the tank is set to supply fuel, this function returns true.
+      @return true if this tank is set to a non-zero priority.*/
   bool GetSelected(void) {return Selected;}
 
   /** Gets the tank fill level.
@@ -223,10 +230,18 @@ public:
       @return the capacity of the tank in pounds. */
   double GetCapacity(void) {return Capacity;}
 
+  /** Gets the capacity of the tank.
+      @return the capacity of the tank in gallons. */
+  double GetCapacityGallons(void) {return Capacity/Density;}
+
   /** Gets the contents of the tank.
       @return the contents of the tank in pounds. */
   double GetContents(void) const {return Contents;}
 
+  /** Gets the contents of the tank.
+      @return the contents of the tank in gallons. */
+  double GetContentsGallons(void) const {return Contents/Density;}
+
   /** Gets the temperature of the fuel.
       The temperature of the fuel is calculated if an initial tempearture is
       given in the configuration file. 
@@ -241,19 +256,31 @@ public:
       is given, otherwise 32 degrees F is returned. */
   double GetTemperature(void) {return CelsiusToFahrenheit(Temperature);}
 
+  /** Returns the density of a named fuel type.
+      @return the density, in lbs/gal, or 6.6 if name cannot be resolved. */
+  double ProcessFuelName(std::string const& name); 
+
   double GetIxx(void) {return Ixx;}
   double GetIyy(void) {return Iyy;}
   double GetIzz(void) {return Izz;}
 
   double GetStandpipe(void) {return Standpipe;}
 
+  int  GetPriority(void) const {return Priority;}
+  void SetPriority(int p) { Priority = p; Selected = p>0 ? true:false; } 
+
+  double GetDensity(void) const {return Density;}
+  void   SetDensity(double d) { Density = d; }
+
   const FGColumnVector3 GetXYZ(void);
   const double GetXYZ(int idx);
 
   double Fill(double amount);
   void SetContents(double amount);
+  void SetContentsGallons(double gallons);
   void SetTemperature(double temp) { Temperature = temp; }
   void SetStandpipe(double amount) { Standpipe = amount; }
+  void SetSelected(bool sel) { sel==true ? SetPriority(1):SetPriority(0); }
 
   enum TankType {ttUNKNOWN, ttFUEL, ttOXIDIZER};
   enum GrainType {gtUNKNOWN, gtCYLINDRICAL, gtENDBURNING};
@@ -262,8 +289,8 @@ private:
   TankType Type;
   GrainType grainType;
   int TankNumber;
-  string type;
-  string strGType;
+  std::string type;
+  std::string strGType;
   FGColumnVector3 vXYZ;
   FGColumnVector3 vXYZ_drain;
   double Capacity;
@@ -281,6 +308,7 @@ private:
   double Temperature, InitialTemperature;
   double Standpipe, InitialStandpipe;
   bool  Selected;
+  int Priority, InitialPriority;
   FGFDMExec* Exec;
   FGPropertyManager* PropertyManager;
   void CalculateInertias(void);
index 9a5c38340a3fb42513475eba7c35df6ea7299771..32a508ee17c9f55111a805fe138d776d94537d9d 100644 (file)
@@ -35,9 +35,13 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <iostream>
 #include <sstream>
 
 #include "FGThruster.h"
+#include "input_output/FGXMLElement.h"
+
+using namespace std;
 
 namespace JSBSim {
 
index 860db5a554acd2504c1fc061b87195b68ae895d1..886b678dc5c96d89b09b17b808812ab63c7e0ba0 100644 (file)
@@ -39,9 +39,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGForce.h"
-#include <input_output/FGXMLElement.h>
-#include <input_output/FGPropertyManager.h>
-#include <math/FGColumnVector3.h>
+#include "math/FGColumnVector3.h"
 #include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -56,6 +54,9 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class Element;
+class FGPropertyManager;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 6c4a7818c4a14a39d599e26f53315546479d8e60..b690d72f0cbf5e5b54cec99af18d763f1f1e3ceb 100644 (file)
@@ -39,10 +39,14 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <vector>
+#include <iostream>
 #include <sstream>
-
 #include "FGTurbine.h"
+#include "FGState.h"
+#include "models/FGPropulsion.h"
+#include "FGThruster.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -99,8 +103,9 @@ void FGTurbine::ResetToIC(void)
   Stalled = Seized = Overtemp = Fire = Augmentation = Injection = Reversed = false;
   Cutoff = true;
   phase = tpOff;
-  EGT_degC = 0.0;
-  OilTemp_degK = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556 + 273.0;
+  TAT = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556;
+  EGT_degC = TAT;
+  OilTemp_degK = TAT + 273.0;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -112,6 +117,7 @@ double FGTurbine::Calculate(void)
   double thrust;
 
   TAT = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556;
+  double qbar = Auxiliary->Getqbar();
   dt = State->Getdt() * Propulsion->GetRate();
   ThrottlePos = FCS->GetThrottlePos(EngineNumber);
   if (ThrottlePos > 1.0) {
@@ -140,7 +146,12 @@ double FGTurbine::Calculate(void)
   if (!Running && Cutoff && Starter) {
      if (phase == tpOff) phase = tpSpinUp;
      }
-  if (!Running && !Cutoff && (N2 > 15.0)) phase = tpStart;
+
+  // start
+  if ((Starter == true) || (qbar > 30.0)) {
+    if (!Running && !Cutoff && (N2 > 15.0)) phase = tpStart;
+  }
+
   if (Cutoff && (phase != tpSpinUp)) phase = tpOff;
   if (dt == 0) phase = tpTrim;
   if (Starved) phase = tpOff;
@@ -271,6 +282,7 @@ double FGTurbine::SpinUp(void)
   OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
   EPR = 1.0;
   NozzlePosition = 1.0;
+  if (Starter == false) phase = tpOff;
   return 0.0;
 }
 
@@ -278,15 +290,17 @@ double FGTurbine::SpinUp(void)
 
 double FGTurbine::Start(void)
 {
+  double qbar = Auxiliary->Getqbar();
   if ((N2 > 15.0) && !Starved) {       // minimum 15% N2 needed for start
     Cranking = true;                   // provided for sound effects signal
     if (N2 < IdleN2) {
       N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
       N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
       EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
-      FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
+      FuelFlow_pph = IdleFF * N2 / IdleN2;
       OilPressure_psi = N2 * 0.62;
       ConsumeFuel();
+      if ((Starter == false) && (qbar < 30.0)) phase = tpOff; // aborted start
       }
     else {
       phase = tpRun;
@@ -313,8 +327,10 @@ double FGTurbine::Stall(void)
   N1 = Seek(&N1, qbar/10.0, 0, N1/10.0);
   N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
   ConsumeFuel();
-  if (ThrottlePos < 0.01) phase = tpRun;        // clear the stall with throttle
-
+  if (ThrottlePos < 0.01) {
+    phase = tpRun;               // clear the stall with throttle to idle
+    Stalled = false;
+    }
   return 0.0;
 }
 
@@ -325,7 +341,7 @@ double FGTurbine::Seize(void)
     double qbar = Auxiliary->Getqbar();
     N2 = 0.0;
     N1 = Seek(&N1, qbar/20.0, 0, N1/15.0);
-    FuelFlow_pph = IdleFF;
+    FuelFlow_pph = Cutoff ? 0.0 : IdleFF;
     ConsumeFuel();
     OilPressure_psi = 0.0;
     OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0, 0.2);
@@ -477,26 +493,26 @@ bool FGTurbine::Load(FGFDMExec* exec, Element *el)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGTurbine::GetEngineLabels(string delimeter)
+string FGTurbine::GetEngineLabels(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << Name << "_N1[" << EngineNumber << "]" << delimeter
-      << Name << "_N2[" << EngineNumber << "]" << delimeter
-      << Thruster->GetThrusterLabels(EngineNumber, delimeter);
+  buf << Name << "_N1[" << EngineNumber << "]" << delimiter
+      << Name << "_N2[" << EngineNumber << "]" << delimiter
+      << Thruster->GetThrusterLabels(EngineNumber, delimiter);
 
   return buf.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGTurbine::GetEngineValues(string delimeter)
+string FGTurbine::GetEngineValues(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << N1 << delimeter
-      << N2 << delimeter
-      << Thruster->GetThrusterValues(EngineNumber, delimeter);
+  buf << N1 << delimiter
+      << N2 << delimiter
+      << Thruster->GetThrusterValues(EngineNumber, delimiter);
 
   return buf.str();
 }
@@ -514,6 +530,10 @@ void FGTurbine::bindmodel()
   property_name = base_property_name + "/injection_cmd";
   PropertyManager->Tie( property_name.c_str(), (FGTurbine*)this, 
                         &FGTurbine::GetInjection, &FGTurbine::SetInjection);
+  property_name = base_property_name + "/seized";
+  PropertyManager->Tie( property_name.c_str(), &Seized);
+  property_name = base_property_name + "/stalled";
+  PropertyManager->Tie( property_name.c_str(), &Stalled);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -522,7 +542,7 @@ int FGTurbine::InitRunning(void) {
   State->SuspendIntegration();
   Cutoff=false;
   Running=true;  
-  N2=16.0;
+  N2=IdleN2;
   Calculate();
   State->ResumeIntegration();
   return phase==tpRun;
index 552c258b14a9d4b5a31fd492f78391085c9370bb..9eebc335d9dc7c0be7ec989a622ebe5e26304374 100644 (file)
@@ -40,10 +40,7 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <vector>
 #include "FGEngine.h"
-#include <input_output/FGXMLElement.h>
-#include <math/FGFunction.h>
 
 #define ID_TURBINE "$Id$"
 
@@ -53,6 +50,9 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
+class Element;
+class FGFunction;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -209,8 +209,8 @@ public:
   int InitRunning(void);
   void ResetToIC(void);
 
-  string GetEngineLabels(string delimeter);
-  string GetEngineValues(string delimeter);
+  std::string GetEngineLabels(const std::string& delimiter);
+  std::string GetEngineValues(const std::string& delimiter);
 
 private:
 
index dce83141299f64d0a81d451f96368096bea93311..9ebef96df9b4ced5f41fd20cadd556073f2be0b6 100755 (executable)
@@ -41,11 +41,15 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <vector>
+#include <iostream>
 #include <sstream>
 #include "FGTurboProp.h"
 
 #include "FGPropeller.h"
+#include "FGState.h"
+#include "models/FGAuxiliary.h"
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -245,7 +249,10 @@ double FGTurboProp::Calculate(void)
   }
 
   //printf ("EngHP: %lf / Requi: %lf\n",Eng_HP,Prop_Required_Power);
-  return Thruster->Calculate((Eng_HP * hptoftlbssec)-Thruster->GetPowerRequired());
+  PowerAvailable = (Eng_HP * hptoftlbssec) - Thruster->GetPowerRequired();
+
+  return Thruster->Calculate(PowerAvailable);
+
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -438,7 +445,7 @@ double FGTurboProp::ExpSeek(double *var, double target, double accel_tau, double
 
 void FGTurboProp::SetDefaults(void)
 {
-  Name = "Not defined";
+//  Name = "Not defined";
   N1 = N2 = 0.0;
   Type = etTurboprop;
   MilThrust = 10000.0;
@@ -468,27 +475,28 @@ void FGTurboProp::SetDefaults(void)
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
-string FGTurboProp::GetEngineLabels(string delimeter)
+string FGTurboProp::GetEngineLabels(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << Name << "_N1[" << EngineNumber << "]" << delimeter
-      << Name << "_N2[" << EngineNumber << "]" << delimeter
-      << Name << "__PwrAvailJVK[" << EngineNumber << "]" << delimeter
-      << Thruster->GetThrusterLabels(EngineNumber, delimeter);
+  buf << Name << "_N1[" << EngineNumber << "]" << delimiter
+      << Name << "_N2[" << EngineNumber << "]" << delimiter
+      << Name << "_PwrAvail[" << EngineNumber << "]" << delimiter
+      << Thruster->GetThrusterLabels(EngineNumber, delimiter);
 
   return buf.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGTurboProp::GetEngineValues(string delimeter)
+string FGTurboProp::GetEngineValues(const string& delimiter)
 {
   std::ostringstream buf;
 
-  buf << N1 << delimeter
-      << N2 << delimeter
-      << Thruster->GetThrusterValues(EngineNumber,delimeter);
+  buf << PowerAvailable << delimiter
+      << N1 << delimiter
+      << N2 << delimiter
+      << Thruster->GetThrusterValues(EngineNumber,delimiter);
 
   return buf.str();
 }
index 6501452b14bfb2b566e3fd7cf8ccde1099c5fb16..cb10f85b99dcce08f030a75fbb30c8cf00a93fe2 100755 (executable)
@@ -43,8 +43,8 @@ INCLUDES
 
 #include <vector>
 #include "FGEngine.h"
-#include <input_output/FGXMLElement.h>
-#include <math/FGTable.h>
+#include "input_output/FGXMLElement.h"
+#include "math/FGTable.h"
 
 #define ID_TURBOPROP "$Id$"
 
@@ -147,8 +147,8 @@ public:
   inline void SetGeneratorPower(bool gp) { GeneratorPower=gp; }
   inline void SetCondition(bool c) { Condition=c; }
   int InitRunning(void);
-  string GetEngineLabels(string delimeter);  // added from Turbine 0.9.6
-  string GetEngineValues(string delimeter);  // added from Turbine 0.9.6
+  std::string GetEngineLabels(const std::string& delimiter);
+  std::string GetEngineValues(const std::string& delimiter);
 
 private:
 
@@ -167,6 +167,7 @@ private:
   double N2_factor;        ///< factor to tie N2 and throttle
   double ThrottleCmd;      ///< FCS-supplied throttle position
   double TAT;              ///< total air temperature (deg C)
+  double PowerAvailable;
   bool Stalled;            ///< true if engine is compressor-stalled
   bool Seized;             ///< true if inner spool is seized
   bool Overtemp;           ///< true if EGT exceeds limits
index 802a90d38f090e9b0c2b1b85d6817f812da07c45..35628407b85b976b9ec471f43554d8f51382500d 100644 (file)
@@ -100,9 +100,12 @@ void uiuc_getwind()
        /* Get wind vector */
        double windmag = 0; //Wind magnitude
        double a = 0; //Parabola: Altitude = a*windmag^2 + zoff
+        double x = pow(uref,2.);
        
-       a = zref/pow(uref,2.);
-       if (Altitude >= zoff)
+        if (x) {
+           a = zref/x;
+        }
+       if ((Altitude >= zoff) && (a > 0))
                windmag = sqrt(Altitude/a);
        else
                windmag = 0.;
index 1b3fbd4ba8ebfa47c4b2980f57ce8dbb8e6ccefe..483da426911dcdcd73addc1da6bb6991d6068551 100644 (file)
@@ -51,6 +51,8 @@ Airplane::Airplane()
     _liftRatio = 1;
     _cruiseAoA = 0;
     _tailIncidence = 0;
+
+    _failureMsg = 0;
 }
 
 Airplane::~Airplane()
@@ -507,6 +509,10 @@ float Airplane::compileFuselage(Fuselage* f)
     float fwd[3];
     Math::sub3(f->front, f->back, fwd);
     float len = Math::mag3(fwd);
+    if (len == 0) {
+        _failureMsg = "Zero length fuselage";
+       return 0;
+    }
     float wid = f->width;
     int segs = (int)Math::ceil(len/wid);
     float segWgt = len*wid/segs;
@@ -688,6 +694,10 @@ void Airplane::compile()
         _model.setGroundEffect(gepos, gespan, 0.15f);
     }
 
+    // solve function below resets failure message
+    // so check if we have any problems and abort here
+    if (_failureMsg) return;
+
     solveGear();
     if(_wing && _tail) solve();
     else
index 449979e7ede5775f2cb92dd3a0f428ec4fb5b8fe..95fe5f04c1fad5f40f56783fb492facf157f66b0 100644 (file)
@@ -355,8 +355,41 @@ void fgPopup::applySize(puObject *object)
     object->setSize(w, h);
 }
 
-\f
 ////////////////////////////////////////////////////////////////////////
+
+void FGDialog::ConditionalObject::update(FGDialog* aDlg)
+{
+  if (_name == "visible") {
+    bool wasVis = _pu->isVisible();
+    bool newVis = test();
+    
+    if (newVis == wasVis) {
+      return;
+    }
+    
+    if (newVis) { // puObject needs a setVisible. Oh well.
+    _pu->reveal();
+    } else {
+      _pu->hide();
+    }
+  } else if (_name == "enable") {
+    bool wasEnabled = _pu->isActive();
+    bool newEnable = test();
+    
+    if (wasEnabled == newEnable) {
+      return;
+    }
+    
+    if (newEnable) {
+      _pu->activate();
+    } else {
+      _pu->greyOut();
+    }
+  }
+  
+  aDlg->setNeedsLayout();
+}
+\f////////////////////////////////////////////////////////////////////////
 // Callbacks.
 ////////////////////////////////////////////////////////////////////////
 
@@ -462,9 +495,11 @@ copy_from_pui (puObject *object, SGPropertyNode *node)
 FGDialog::FGDialog (SGPropertyNode *props) :
     _object(0),
     _gui((NewGUI *)globals->get_subsystem("gui")),
-    _props(props)
+    _props(props),
+    _needsRelayout(false)
 {
     _module = string("__dlg:") + props->getStringValue("name", "[unnamed]");
+        
     SGPropertyNode *nasal = props->getNode("nasal");
     if (nasal) {
         _nasal_close = nasal->getNode("close");
@@ -518,18 +553,24 @@ FGDialog::updateValues (const char *objectName)
     if (objectName && !objectName[0])
         objectName = 0;
 
-    for (unsigned int i = 0; i < _propertyObjects.size(); i++) {
-        const string &name = _propertyObjects[i]->name;
-        if (objectName && name != objectName)
-            continue;
-
-        puObject *obj = _propertyObjects[i]->object;
-        if ((obj->getType() & PUCLASS_LIST) && (dynamic_cast<GUI_ID *>(obj)->id & FGCLASS_LIST)) {
-            fgList *pl = static_cast<fgList *>(obj);
-            pl->update();
-        } else
-            copy_to_pui(_propertyObjects[i]->node, obj);
+  for (unsigned int i = 0; i < _propertyObjects.size(); i++) {
+    const string &name = _propertyObjects[i]->name;
+    if (objectName && name != objectName) {
+      continue;
+    }
+    
+    puObject *widget = _propertyObjects[i]->object;
+    int widgetType = widget->getType();
+    if ((widgetType & PUCLASS_LIST) && (dynamic_cast<GUI_ID *>(widget)->id & FGCLASS_LIST)) {
+      fgList *pl = static_cast<fgList*>(widget);
+      pl->update();
+    } else if (widgetType & PUCLASS_COMBOBOX) {
+      fgComboBox* combo = static_cast<fgComboBox*>(widget);
+      combo->update();
+    } else {
+      copy_to_pui(_propertyObjects[i]->node, widget);
     }
+  } // of property objects iteration
 }
 
 void
@@ -558,6 +599,14 @@ FGDialog::update ()
 
         copy_to_pui(_liveObjects[i]->node, obj);
     }
+    
+  for (unsigned int j=0; j < _conditionalObjects.size(); ++j) {
+    _conditionalObjects[j]->update(this);
+  }
+  
+  if (_needsRelayout) {
+    relayout();
+  }
 }
 
 void
@@ -853,6 +902,18 @@ FGDialog::setupObject (puObject *object, SGPropertyNode *props)
        object->setLabelFont(*_font);
     }
 
+    if (props->hasChild("visible")) {
+      ConditionalObject* cnd = new ConditionalObject("visible", object);
+      cnd->setCondition(sgReadCondition(globals->get_props(), props->getChild("visible")));
+      _conditionalObjects.push_back(cnd);
+    }
+
+    if (props->hasChild("enable")) {
+      ConditionalObject* cnd = new ConditionalObject("enable", object);
+      cnd->setCondition(sgReadCondition(globals->get_props(), props->getChild("enable")));
+      _conditionalObjects.push_back(cnd);
+    }
+
     string type = props->getName();
     if (type == "input" && props->getBoolValue("live"))
         object->setDownCallback(action_callback);
@@ -1072,8 +1133,97 @@ FGDialog::getKeyCode(const char *str)
     return key;
 }
 
+void\fFGDialog::relayout()
+{
+  _needsRelayout = false;
+  
+  int screenw = globals->get_props()->getIntValue("/sim/startup/xsize");
+  int screenh = globals->get_props()->getIntValue("/sim/startup/ysize");
+
+  bool userx = _props->hasValue("x");
+  bool usery = _props->hasValue("y");
+  bool userw = _props->hasValue("width");
+  bool userh = _props->hasValue("height");
+
+  // Let the layout widget work in the same property subtree.
+  LayoutWidget wid(_props);
+  wid.setDefaultFont(_font, int(_font->getPointSize()));
+
+  int pw = 0, ph = 0;
+  int px, py, savex, savey;
+  if (!userw || !userh) {
+    wid.calcPrefSize(&pw, &ph);
+  }
+  
+  pw = _props->getIntValue("width", pw);
+  ph = _props->getIntValue("height", ph);
+  px = savex = _props->getIntValue("x", (screenw - pw) / 2);
+  py = savey = _props->getIntValue("y", (screenh - ph) / 2);
+
+  // Negative x/y coordinates are interpreted as distance from the top/right
+  // corner rather than bottom/left.
+  if (userx && px < 0)
+    px = screenw - pw + px;
+  if (usery && py < 0)
+    py = screenh - ph + py;
+
+  // Define "x", "y", "width" and/or "height" in the property tree if they
+  // are not specified in the configuration file.
+  wid.layout(px, py, pw, ph);
+
+  applySize(_object);
+  
+  // Remove automatically generated properties, so the layout looks
+  // the same next time around, or restore x and y to preserve negative coords.
+  if (userx)
+      _props->setIntValue("x", savex);
+  else
+      _props->removeChild("x");
+
+  if (usery)
+      _props->setIntValue("y", savey);
+  else
+      _props->removeChild("y");
+
+  if (!userw) _props->removeChild("width");
+  if (!userh) _props->removeChild("height");
+}
+
+void
+FGDialog::applySize(puObject *object)
+{
+  // compound plib widgets use setUserData() for internal purposes, so refuse
+  // to descend into anything that has other bits set than the following
+  const int validUserData = PUCLASS_VALUE|PUCLASS_OBJECT|PUCLASS_GROUP|PUCLASS_INTERFACE
+          |PUCLASS_FRAME|PUCLASS_TEXT|PUCLASS_BUTTON|PUCLASS_ONESHOT|PUCLASS_INPUT
+          |PUCLASS_ARROW|PUCLASS_DIAL|PUCLASS_POPUP;
+
+  int type = object->getType();
+  if ((type & PUCLASS_GROUP) && !(type & ~validUserData)) {
+    puObject* c = ((puGroup *)object)->getFirstChild();
+    for (; c != NULL; c = c->getNextObject()) {
+      applySize(c);
+    } // of child iteration
+  } // of group object case
+  
+  GUIInfo *info = (GUIInfo *)object->getUserData();
+  if (!info)
+    return;
+
+  SGPropertyNode *n = info->node;
+  if (!n) {
+    SG_LOG(SG_GENERAL, SG_ALERT, "FGDialog::applySize: no props");
+    return;
+  }
+  
+  int x = n->getIntValue("x");
+  int y = n->getIntValue("y");
+  int w = n->getIntValue("width", 4);
+  int h = n->getIntValue("height", 4);
+  object->setPosition(x, y);
+  object->setSize(w, h);
+}
 
-\f
 ////////////////////////////////////////////////////////////////////////
 // Implementation of FGDialog::PropertyObject.
 ////////////////////////////////////////////////////////////////////////
@@ -1115,12 +1265,26 @@ fgValueList::~fgValueList()
 void
 fgValueList::make_list()
 {
-    vector<SGPropertyNode_ptr> value_nodes = _props->getChildren("value");
-    _list = new char *[value_nodes.size() + 1];
-    unsigned int i;
-    for (i = 0; i < value_nodes.size(); i++)
-        _list[i] = strdup((char *)value_nodes[i]->getStringValue());
-    _list[i] = 0;
+  SGPropertyNode_ptr values = _props;
+  const char* vname = "value";
+  
+  if (_props->hasChild("properties")) {
+    // dynamic values, read from a property's children
+    const char* path = _props->getStringValue("properties");
+    values = fgGetNode(path, true);
+  }
+  
+  if (_props->hasChild("property-name")) {
+    vname = _props->getStringValue("property-name");
+  }
+  
+  vector<SGPropertyNode_ptr> value_nodes = values->getChildren(vname);
+  _list = new char *[value_nodes.size() + 1];
+  unsigned int i;
+  for (i = 0; i < value_nodes.size(); i++) {
+    _list[i] = strdup((char *)value_nodes[i]->getStringValue());
+  }
+  _list[i] = 0;
 }
 
 void
@@ -1143,4 +1307,10 @@ fgList::update()
     setTopItem(top);
 }
 
+void fgComboBox::update()
+{
+  fgValueList::update();
+  newList(_list);
+}
+
 // end of dialog.cxx
index 749c355cbdd6f215e75e7b5441e95cac783016db..63aef704b1d2ec3354c7b4261749a2054db43515 100644 (file)
@@ -12,6 +12,7 @@
 #include <simgear/compiler.h>  // for SG_USING_STD
 #include <simgear/props/props.hxx>
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/props/condition.hxx>
 
 #include <vector>
 using std::vector;
@@ -91,6 +92,15 @@ public:
      */
     virtual void update ();
 
+    /**
+     * Recompute the dialog's layout
+     */
+    void relayout();
+    
+    
+    void setNeedsLayout() {
+      _needsRelayout = true;
+    }
 private:
 
     enum {
@@ -127,6 +137,11 @@ private:
     // return key code number for keystring
     int getKeyCode(const char *keystring);
 
+    /**
+     * Apply layout sizes to a tree of puObjects
+     */
+    void applySize(puObject *object);
+
     // The top-level PUI object.
     puObject * _object;
 
@@ -141,6 +156,8 @@ private:
     // last position.
     SGPropertyNode_ptr _props;
 
+    bool _needsRelayout;
+
     // Nasal module.
     string _module;
     SGPropertyNode_ptr _nasal_close;
@@ -160,6 +177,24 @@ private:
     };
     vector<PropertyObject *> _propertyObjects;
     vector<PropertyObject *> _liveObjects;
+    
+    class ConditionalObject : public SGConditional
+    {
+    public:
+      ConditionalObject(const std::string& aName, puObject* aPu) :
+        _name(aName),
+        _pu(aPu)
+      { ; }
+    
+      void update(FGDialog* aDlg);
+    
+    private:
+      const std::string _name;
+      puObject* _pu;      
+    };
+    
+    typedef SGSharedPtr<ConditionalObject> ConditionalObjectRef;
+    vector<ConditionalObjectRef> _conditionalObjects;
 };
 
 //
@@ -223,6 +258,8 @@ class fgComboBox : public fgValueList, public puaComboBox {
 public:
     fgComboBox(int x1, int y1, int x2, int y2, SGPropertyNode *p, bool editable) :
         fgValueList(p), puaComboBox(x1, y1, x2, y2, _list, editable) {}
+        
+    void update();
 };
 
 class fgSelectBox : public fgValueList, public puaSelectBox {
index 1b7acf2b27bfbf9ca89e9f0da3ff6032895d1953..5b943d662733386a7af74a89613f414216d1312c 100644 (file)
@@ -506,7 +506,7 @@ bool fgDumpSnapShot () {
     char filename[24];
     static int count = 1;
     while (count < 1000) {
-        snprintf(filename, 24, "fgfs-screen-%03d.ppm", count++);
+        snprintf(filename, 24, "fgfs-screen-%03d.png", count++);
 
         SGPath p(dir);
         p.append(filename);
index 902e61bdfdc1f25736312bb3a3f186e9d4f21fdc..75d7b5f58fc70a4824a0f18a337536aec6d614c3 100644 (file)
@@ -46,7 +46,7 @@
 #define PACKAGE "FlightGear"
 
 /* Define to package version - use in main.cxx */
-#define FLIGHTGEAR_VERSION "MSVC6-WIN32-1.9.0"
+#define FLIGHTGEAR_VERSION "MSVC6-WIN32-1.9.1"
 
 /* Define as the return type of signal handlers (int or void).  */
 #define RETSIGTYPE void
@@ -64,7 +64,7 @@
 #define TM_IN_SYS_TIME 1
 
 /* Define to version number */
-#define VERSION "1.9.0"
+#define VERSION "1.9.1"
 
 /* Define if compiling on a Winbloze (95, NT, etc.) platform */
 #define WIN32 1
index 06ce7ec0f797df76a221c7e32691aa8a86d7cc12..0692f0049d250f5825c22bdeed324a0fdb58603c 100755 (executable)
@@ -19,7 +19,7 @@
 #define PACKAGE "FlightGear"
 
 /* Define to package version - use in main.cxx */
-#define FLIGHTGEAR_VERSION "MSVC7.1-WIN32-1.9.0"
+#define FLIGHTGEAR_VERSION "MSVC7.1-WIN32-1.9.1"
 
 /* Define as the return type of signal handlers (int or void).  */
 #define RETSIGTYPE void
@@ -37,7 +37,7 @@
 #define TM_IN_SYS_TIME 1
 
 /* Define to version number */
-#define VERSION "1.9.0"
+#define VERSION "1.9.1"
 #ifndef  FG_VERSION     /* allow override */
 #define  FG_VERSION     7
 #endif   /* FG_VERSION */
index f6fac3a08e8101d81fc62f71dc2c656672f10e5b..87664a6a093893af14347a01fa8dd2600ba1e261 100755 (executable)
@@ -50,7 +50,7 @@
 #define PACKAGE "FlightGear"
 
 /* Define to package version - use in main.cxx */
-#define FLIGHTGEAR_VERSION "MSVC8-WIN32-1.9.0"
+#define FLIGHTGEAR_VERSION "MSVC8-WIN32-1.9.1"
 
 /* Define as the return type of signal handlers (int or void).  */
 #define RETSIGTYPE void
@@ -68,7 +68,7 @@
 #define TM_IN_SYS_TIME 1
 
 /* Define to version number */
-#define VERSION "1.9.0"
+#define VERSION "1.9.1"
 
 /* Define if compiling on a Winbloze (95, NT, etc.) platform */
 #define WIN32 1
index 1cd4f1c4d3e07f029422aa9cd709c1494a853cc8..431a6fa5ecc47bb73e647ca160adec86b399d00c 100644 (file)
 #  include <config.h>
 #endif
 
+#include <simgear/math/SGMath.hxx>
+
 #include "FGDeviceConfigurationMap.hxx"
+
+#include <plib/ul.h>
+
 #include <simgear/props/props_io.hxx>
 #include <Main/globals.hxx>
 
index 6ac1dd4af642b67c80877defd75664de973d45ca..928c20c242a58ddee1ea5e97eafef1f0f89580ff 100644 (file)
@@ -74,10 +74,10 @@ FGInputEvent * FGInputEvent::NewObject( FGInputDevice * device, SGPropertyNode_p
     return new FGButtonEvent( device, node );
 
   if( StartsWith( name, "rel-" ) )
-    return new FGAxisEvent( device, node );
+    return new FGRelAxisEvent( device, node );
 
   if( StartsWith( name, "abs-" ) )
-    return new FGAxisEvent( device, node );
+    return new FGAbsAxisEvent( device, node );
 
   return new FGInputEvent( device, node );
 }
@@ -121,18 +121,25 @@ void FGInputEvent::fire( FGEventData & eventData )
   if( lastDt >= intervalSec ) {
 
     for( binding_list_t::iterator it = bindings[eventData.modifiers].begin(); it != bindings[eventData.modifiers].end(); it++ )
-      (*it)->fire( eventData.value, 1.0 );
+      fire( *it, eventData );
 
     lastDt -= intervalSec;
   }
 }
 
+void FGInputEvent::fire( SGBinding * binding, FGEventData & eventData )
+{
+  binding->fire();
+}
+
+
+
 FGAxisEvent::FGAxisEvent( FGInputDevice * device, SGPropertyNode_ptr node ) :
   FGInputEvent( device, node )
 {
   tolerance = node->getDoubleValue("tolerance", 0.002);
-  minRange = node->getDoubleValue("min-range", -1024.0);
-  maxRange = node->getDoubleValue("max-range", 1024.0);
+  minRange = node->getDoubleValue("min-range", 0.0 );
+  maxRange = node->getDoubleValue("max-range", 0.0 );
   center = node->getDoubleValue("center", 0.0);
   deadband = node->getDoubleValue("dead-band", 0.0);
   lowThreshold = node->getDoubleValue("low-threshold", -0.9);
@@ -145,7 +152,36 @@ void FGAxisEvent::fire( FGEventData & eventData )
   if (fabs( eventData.value - lastValue) < tolerance)
     return;
   lastValue = eventData.value;
-  FGInputEvent::fire( eventData );
+
+  // We need a copy of the  FGEventData struct to set the new value and to avoid side effects
+  FGEventData ed = eventData;
+
+  if( fabs(ed.value) < deadband )
+    ed.value = 0.0;
+
+  if( minRange != maxRange )
+    ed.value = 2.0*(eventData.value-minRange)/(maxRange-minRange)-1.0;
+
+  FGInputEvent::fire( ed );
+}
+
+void FGAbsAxisEvent::fire( SGBinding * binding, FGEventData & eventData )
+{
+  // sets the "setting" node
+  binding->fire( eventData.value );
+}
+
+FGRelAxisEvent::FGRelAxisEvent( FGInputDevice * device, SGPropertyNode_ptr node ) : 
+  FGAxisEvent( device, node ) 
+{
+  // relative axes can't use tolerance
+  tolerance = 0.0;
+}
+
+void FGRelAxisEvent::fire( SGBinding * binding, FGEventData & eventData )
+{
+  // sets the "offset" node
+  binding->fire( eventData.value, 1.0 );
 }
 
 FGButtonEvent::FGButtonEvent( FGInputDevice * device, SGPropertyNode_ptr node ) :
index 973821bd0584452c7bb10a8ecfc3ed3edc150aa5..7188c83813f112d844e0d2afae40a27c09465d34 100644 (file)
@@ -83,6 +83,7 @@ typedef vector<FGEventSetting_ptr> setting_list_t;
 class FGInputDevice;
 class FGInputEvent : public SGReferenced,FGCommonInput {
 public:
+
   /*
    * Constructor for the class. The arg node shall point
    * to the property corresponding to the <event>  node
@@ -110,6 +111,7 @@ public:
   static FGInputEvent * NewObject( FGInputDevice * device, SGPropertyNode_ptr node );
 
 protected:
+  virtual void fire( SGBinding * binding, FGEventData & eventData );
   /* A more or less meaningfull description of the event */
   string desc;
 
@@ -143,6 +145,9 @@ protected:
 class FGAxisEvent : public FGInputEvent {
 public:
   FGAxisEvent( FGInputDevice * device, SGPropertyNode_ptr node );
+  void SetMaxRange( double value ) { maxRange = value; }
+  void SetMinRange( double value ) { minRange = value; }
+  void SetRange( double min, double max ) { minRange = min; maxRange = max; }
 protected:
   virtual void fire( FGEventData & eventData );
   double tolerance;
@@ -155,6 +160,20 @@ protected:
   double lastValue;
 };
 
+class FGRelAxisEvent : public FGAxisEvent {
+public:
+  FGRelAxisEvent( FGInputDevice * device, SGPropertyNode_ptr node );
+protected:
+  virtual void fire( SGBinding * binding, FGEventData & eventData );
+};
+
+class FGAbsAxisEvent : public FGAxisEvent {
+public:
+  FGAbsAxisEvent( FGInputDevice * device, SGPropertyNode_ptr node ) : FGAxisEvent( device, node ) {}
+protected:
+  virtual void fire( SGBinding * binding, FGEventData & eventData );
+};
+
 typedef class SGSharedPtr<FGInputEvent> FGInputEvent_ptr;
 
 /*
index 382a99c8aa0d2b9c5ef51997ae0d26a72e66d795..183c7b3ab805c319b84bee27b0c3de372d611ac6 100644 (file)
@@ -273,6 +273,11 @@ FGLinuxInputDevice::FGLinuxInputDevice() :
 {
 }
 
+static inline bool bitSet( unsigned char * buf, unsigned char bit )
+{
+  return (buf[bit/sizeof(bit)/8] >> (bit%(sizeof(bit)*8))) & 1;
+}
+
 void FGLinuxInputDevice::Open()
 {
   if( fd != -1 ) return;
@@ -280,9 +285,38 @@ void FGLinuxInputDevice::Open()
     throw exception();
   }
 
-  if( GetGrab() && ioctl( fd, EVIOCGRAB, 2 ) != 0 ) {
+  if( GetGrab() && ioctl( fd, EVIOCGRAB, 2 ) == -1 ) {
     SG_LOG( SG_INPUT, SG_WARN, "Can't grab " << devname << " for exclusive access" );
   }
+
+  unsigned char buf[ABS_CNT/sizeof(unsigned char)/8];
+  // get axes maximums
+  if( ioctl( fd, EVIOCGBIT(EV_ABS,ABS_MAX), buf ) == -1 ) {
+    SG_LOG( SG_INPUT, SG_WARN, "Can't get abs-axes for " << devname );
+  } else {
+    for( unsigned i = 0; i < ABS_MAX; i++ ) {
+      if( bitSet( buf, i ) ) {
+        struct input_absinfo ai;
+        if( ioctl(fd, EVIOCGABS(i), &ai) == -1 ) {
+          SG_LOG( SG_INPUT, SG_WARN, "Can't get abs-axes maximums for " << devname );
+          continue;
+        }
+        absinfo[i] = ai;
+      }
+    }
+  }
+}
+
+double FGLinuxInputDevice::Normalize( struct input_event & event ) 
+{
+  if( absinfo.count(event.code) > 0 ) {
+     const struct input_absinfo & ai = absinfo[(unsigned int)event.code];
+     if( ai.maximum == ai.minimum )
+       return 0.0;
+     return ((double)event.value-(double)ai.minimum)/((double)ai.maximum-(double)ai.minimum);
+  } else {
+    return (double)event.value;
+  }
 }
 
 void FGLinuxInputDevice::Close()
@@ -437,7 +471,6 @@ void FGLinuxEventInput::AddHalDevice( const char * udi )
 void FGLinuxEventInput::update( double dt )
 {
   FGEventInput::update( dt );
-
   // index the input devices by the associated fd and prepare
   // the pollfd array by filling in the file descriptor
   struct pollfd fds[input_devices.size()];
@@ -468,6 +501,9 @@ void FGLinuxEventInput::update( double dt )
 
         FGLinuxEventData eventData( event, dt, modifiers );
 
+        if( event.type == EV_ABS )
+          eventData.value = devicesByFd[fds[i].fd]->Normalize( event );
+
         // let the FGInputDevice handle the data
         devicesByFd[fds[i].fd]->HandleEvent( eventData );
       }
index 5f7a58117282597d27770f833507c8b46dca1bf0..3676c48cbb8ee3a37b657384d3ea09da7654a647 100644 (file)
@@ -56,9 +56,12 @@ public:
 
   int GetFd() { return fd; }
 
+  double Normalize( struct input_event & event );
 private:
   string devname;
   int fd;
+
+  map<unsigned int,input_absinfo> absinfo;
 };
 
 class FGLinuxEventInput : public FGEventInput {
@@ -71,6 +74,7 @@ public:
   void AddHalDevice( const char * udi );
 protected:
   LibHalContext *halcontext;
+
 };
 
 #endif
index 4722e965392f856a76697b047e52e793545707f2..c028e17aeee061f7fa61e69cbec76182d5e9acaf 100644 (file)
 #include <ATCDCL/ATCProjection.hxx>
 #include <Main/fg_props.hxx>
 #include <simgear/math/SGMath.hxx>
+#include <simgear/structure/commands.hxx>
 #include <Airports/simple.hxx>
 
 using std::cout;
 
+// Command callbacks for FlightGear
+
+static bool do_kln89_msg_pressed(const SGPropertyNode* arg) {
+       //cout << "do_kln89_msg_pressed called!\n";
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->MsgPressed();
+       return(true);
+}
+
+static bool do_kln89_obs_pressed(const SGPropertyNode* arg) {
+       //cout << "do_kln89_obs_pressed called!\n";
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->OBSPressed();
+       return(true);
+}
+
+static bool do_kln89_alt_pressed(const SGPropertyNode* arg) {
+       //cout << "do_kln89_alt_pressed called!\n";
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->AltPressed();
+       return(true);
+}
+
+static bool do_kln89_nrst_pressed(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->NrstPressed();
+       return(true);
+}
+
+static bool do_kln89_dto_pressed(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->DtoPressed();
+       return(true);
+}
+
+static bool do_kln89_clr_pressed(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->ClrPressed();
+       return(true);
+}
+
+static bool do_kln89_ent_pressed(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->EntPressed();
+       return(true);
+}
+
+static bool do_kln89_crsr_pressed(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->CrsrPressed();
+       return(true);
+}
+
+static bool do_kln89_knob1left1(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->Knob1Left1();
+       return(true);
+}
+
+static bool do_kln89_knob1right1(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->Knob1Right1();
+       return(true);
+}
+
+static bool do_kln89_knob2left1(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->Knob2Left1();
+       return(true);
+}
+
+static bool do_kln89_knob2right1(const SGPropertyNode* arg) {
+       KLN89* gps = (KLN89*)globals->get_subsystem("kln89");
+       gps->Knob2Right1();
+       return(true);
+}
+
+// End command callbacks
+
 KLN89::KLN89(RenderArea2D* instrument) 
 : DCLGPS(instrument) {
        _mode = KLN89_MODE_DISP;
@@ -77,27 +157,28 @@ KLN89::KLN89(RenderArea2D* instrument)
        _pixelated = false;
 
        // Cyclic pages
-       GPSPage* apt_page = new KLN89AptPage(this);
+       _pages.clear();
+       KLN89Page* apt_page = new KLN89AptPage(this);
        _pages.push_back(apt_page);
-       GPSPage* vor_page = new KLN89VorPage(this);
+       KLN89Page* vor_page = new KLN89VorPage(this);
        _pages.push_back(vor_page);
-       GPSPage* ndb_page = new KLN89NDBPage(this);
+       KLN89Page* ndb_page = new KLN89NDBPage(this);
        _pages.push_back(ndb_page);
-       GPSPage* int_page = new KLN89IntPage(this);
+       KLN89Page* int_page = new KLN89IntPage(this);
        _pages.push_back(int_page);
-       GPSPage* usr_page = new KLN89UsrPage(this);
+       KLN89Page* usr_page = new KLN89UsrPage(this);
        _pages.push_back(usr_page);
-       GPSPage* act_page = new KLN89ActPage(this);
+       KLN89Page* act_page = new KLN89ActPage(this);
        _pages.push_back(act_page);
-       GPSPage* nav_page = new KLN89NavPage(this);
+       KLN89Page* nav_page = new KLN89NavPage(this);
        _pages.push_back(nav_page);
-       GPSPage* fpl_page = new KLN89FplPage(this);
+       KLN89Page* fpl_page = new KLN89FplPage(this);
        _pages.push_back(fpl_page);
-       GPSPage* cal_page = new KLN89CalPage(this);
+       KLN89Page* cal_page = new KLN89CalPage(this);
        _pages.push_back(cal_page);
-       GPSPage* set_page = new KLN89SetPage(this);
+       KLN89Page* set_page = new KLN89SetPage(this);
        _pages.push_back(set_page);
-       GPSPage* oth_page = new KLN89OthPage(this);
+       KLN89Page* oth_page = new KLN89OthPage(this);
        _pages.push_back(oth_page);
        _nPages = _pages.size();
        _curPage = 0;
@@ -125,6 +206,8 @@ KLN89::KLN89(RenderArea2D* instrument)
        _entRestoreCrsr = false;
        
        _dispMsg = false;
+       
+       _dtoReview = false;
 
        // Moving map stuff
        _mapOrientation = 0;
@@ -196,6 +279,23 @@ void KLN89::unbind() {
        DCLGPS::unbind();
 }
 
+void KLN89::init() {
+       globals->get_commands()->addCommand("kln89_msg_pressed", do_kln89_msg_pressed);
+       globals->get_commands()->addCommand("kln89_obs_pressed", do_kln89_obs_pressed);
+       globals->get_commands()->addCommand("kln89_alt_pressed", do_kln89_alt_pressed);
+       globals->get_commands()->addCommand("kln89_nrst_pressed", do_kln89_nrst_pressed);
+       globals->get_commands()->addCommand("kln89_dto_pressed", do_kln89_dto_pressed);
+       globals->get_commands()->addCommand("kln89_clr_pressed", do_kln89_clr_pressed);
+       globals->get_commands()->addCommand("kln89_ent_pressed", do_kln89_ent_pressed);
+       globals->get_commands()->addCommand("kln89_crsr_pressed", do_kln89_crsr_pressed);
+       globals->get_commands()->addCommand("kln89_knob1left1", do_kln89_knob1left1);
+       globals->get_commands()->addCommand("kln89_knob1right1", do_kln89_knob1right1);
+       globals->get_commands()->addCommand("kln89_knob2left1", do_kln89_knob2left1);
+       globals->get_commands()->addCommand("kln89_knob2right1", do_kln89_knob2right1);
+       
+       DCLGPS::init();
+}
+
 void KLN89::update(double dt) {
        // Run any positional calc's required first
        DCLGPS::update(dt);
@@ -267,11 +367,7 @@ void KLN89::CreateDefaultFlightPlans() {
        wps.clear();
        ids.push_back("KCCR");
        wps.push_back(GPS_WP_APT);
-       ids.push_back("SUZYE");
-       wps.push_back(GPS_WP_INT);
-       ids.push_back("ALTAM");
-       wps.push_back(GPS_WP_INT);
-       ids.push_back("C83");
+       ids.push_back("KHAF");
        wps.push_back(GPS_WP_APT);
        CreateFlightPlan(_flightPlans[4], ids, wps);
        
@@ -429,9 +525,15 @@ void KLN89::ClrPressed() {
 
 void KLN89::DtoPressed() {
        if(_activePage != _dir_page) {
-               // Figure out which waypoint the dir page should display
+               // Figure out which waypoint the dir page should display, according to the following rules:
+               // 1. If the FPL 0 page is displayed AND the cursor is over one of the waypoints, display that waypoint.
+               // 2. If the NAV 4 page is displayed with the inner knob pulled out, display the waypoint highlighted in the lower RH corner of the nav page.
+               // 3. If any of APT, VOR, NDB, INT, USR or ACT pages is displayed then display the waypoint being viewed.
+               // 4. If none of the above, display the active waypoint, unless the active waypoint is the MAP of an approach and it has been flown past 
+               // (no waypoint sequence past the MAP), in which case display the first waypoint of the missed approach procedure.
+               // 5. If none of the above (i.e. no active waypoint) then display blanks.
                if(_curPage <= 5) {
-                       // Apt, Vor, Ndb, Int, Usr or Act
+                       // APT, VOR, NDB, INT, USR or ACT
                        if(!_activePage->GetId().empty()) {     // Guard against no user waypoints defined
                                _dir_page->SetId(_activePage->GetId());
                        } else {
@@ -441,7 +543,6 @@ void KLN89::DtoPressed() {
                        // NAV 4
                        _dir_page->SetId(((KLN89NavPage*)_activePage)->GetNav4WpId());
                } else if(_curPage == 7 && _activePage->GetSubPage() == 0 && _mode == KLN89_MODE_CRSR) {
-                       //cout << "Checking the fpl page!\n";
                        // FPL 0
                        if(!_activePage->GetId().empty()) {
                                //cout << "Not empty!!!\n";
@@ -476,7 +577,7 @@ void KLN89::NrstPressed() {
 void KLN89::AltPressed() {}
 
 void KLN89::OBSPressed() {
-       DCLGPS::OBSPressed();
+       ToggleOBSMode();
        if(_obsMode) {
                // if(ORS 02)
                _mode = KLN89_MODE_CRSR;
@@ -494,6 +595,21 @@ void KLN89::MsgPressed() {
        _dispMsg = !_dispMsg;
 }
 
+void KLN89::ToggleOBSMode() {
+       DCLGPS::ToggleOBSMode();
+}
+
+void KLN89::DtoInitiate(const string& id) {
+       _dtoReview = false;
+       // Set the current page to NAV1
+       _curPage = 6;
+       _activePage = _pages[_curPage];
+       _activePage->SetSubPage(0);
+       // TODO - need to output a scratchpad message with the new course, but we don't know it yet!
+       // Call the base class to actually initiate the DTO.
+       DCLGPS::DtoInitiate(id);
+}
+
 void KLN89::DrawBar(int page) {
        int px = 1 + (page * 15);
        int py = 1;
index 44f0ee09a1a209817e322adf7c922c1137b4e8f2..2206fb1b0139dff69a710bfd50864d35f5a937b1 100644 (file)
@@ -31,6 +31,8 @@
 #include <Instrumentation/dclgps.hxx>
 #include "kln89_page.hxx"
 
+class KLN89Page;
+
 const int KLN89MapScales[2][21] = {{1, 2, 3, 5, 7, 10, 12, 15, 17, 20, 25, 30, 40, 60, 80, 100, 120, 160, 240, 320, 500},
                                       {2, 4, 6, 9, 13, 18, 22, 28, 32, 37, 46, 55, 75, 110, 150, 185, 220, 300, 440, 600, 925}};
 
@@ -48,6 +50,9 @@ const char* KLN89TimeCodes[20] = { "UTC", "GST", "GDT", "ATS", "ATD", "EST", "ED
 typedef map<string, string> airport_id_str_map_type;
 typedef airport_id_str_map_type::iterator airport_id_str_map_iterator;
 
+typedef vector<KLN89Page*> kln89_page_list_type;
+typedef kln89_page_list_type::iterator kln89_page_list_itr;
+
 class KLN89 : public DCLGPS {
        
        friend class KLN89Page;
@@ -71,6 +76,7 @@ public:
        
        void bind();
        void unbind();
+       void init();
        void update(double dt);
        
        inline void SetTurnAnticipation(bool b) { _turnAnticipationEnabled = b; }
@@ -100,6 +106,11 @@ public:
        void CreateDefaultFlightPlans();
 
 private:
+       void ToggleOBSMode();
+       
+       // Initiate Direct To operation to the supplied ID.
+       void DtoInitiate(const string& id);
+
        //----------------------- Drawing functions which take CHARACTER units -------------------------
        // Render string s in display field field at position x, y
        // WHERE POSITION IS IN CHARACTER UNITS!
@@ -192,16 +203,26 @@ private:
        // Set gap to true to get a space between A and 9 when wrapping, set wrap to false to disable wrap.
        char IncChar(char c, bool gap = false, bool wrap = true);
        char DecChar(char c, bool gap = false, bool wrap = true);
+
+       // ==================== Page organisation stuff =============
+       // The list of cyclical pages that the user can cycle through
+       kln89_page_list_type _pages;
+       
+       // The currently active page
+       KLN89Page* _activePage;
+       // And a facility to save the immediately preceeding active page
+       KLN89Page* _lastActivePage;
        
        // Hackish
        int _entJump;   // The page to jump back to if ent is pressed.  -1 indicates no jump
        bool _entRestoreCrsr;   // Indicates that pressing ENT at this point should restore cursor mode
        
-       // Misc pages
+       // Misc pages that aren't in the cyclic list.
        // Direct To
-       GPSPage* _dir_page;
+       KLN89Page* _dir_page;
        // Nearest
-       GPSPage* _nrst_page;
+       KLN89Page* _nrst_page;
+       // ====================== end of page stuff ===================
        
        // Moving-map display stuff
        int _mapOrientation;    // 0 => North (true) up, 1 => DTK up, 2 => TK up, 3 => heading up (only when connected to external heading source).
@@ -264,6 +285,10 @@ private:
        // since button events get directed to the page that was active before the
        // message was displayed, not the message page itself.
        bool _dispMsg;  // Set true while the message page is being displayed
+       
+       // Sometimes the datapages can be used to review a waypoint whilst the user makes a decision,
+       // and we need to remember why.
+       bool _dtoReview;        // Set true when we a reviewing a waypoint for DTO operation.
 };
 
 #endif  // _KLN89_HXX
index f278cd4af24f3e6c9ec1791132be3a80b236cc53..43c78550be7d08396b5131eb997333e3ad520a03 100644 (file)
 #include "kln89_page.hxx"
 #include <Main/fg_props.hxx>
 
-KLN89Page::KLN89Page(KLN89* parent) 
-: GPSPage(parent) {
-       _kln89 = (KLN89*)parent;
+KLN89Page::KLN89Page(KLN89* parent) {
+       _kln89 = parent;
        _entInvert = false;
        _to_flag = true;
+       _subPage = 0;
 }
 
 KLN89Page::~KLN89Page() {
@@ -74,14 +74,14 @@ void KLN89Page::Update(double dt) {
                }
        }
        _kln89->DrawText((_kln89->GetDistVelUnitsSI() ? "km" : "nm"), 1, 4, 3);
-       GPSWaypoint* awp = _parent->GetActiveWaypoint();
+       GPSWaypoint* awp = _kln89->GetActiveWaypoint();
        if(_kln89->_navFlagged) {
                _kln89->DrawText("--.-", 1, 0 ,3);
                // Only nav1 still gets speed drawn if nav is flagged - not ACT
                if(!nav1) _kln89->DrawText("------", 1, 0, 2);
        } else {
                char buf[8];
-               float f = _parent->GetDistToActiveWaypoint() * (_kln89->GetDistVelUnitsSI() ? 0.001 : SG_METER_TO_NM);
+               float f = _kln89->GetDistToActiveWaypoint() * (_kln89->GetDistVelUnitsSI() ? 0.001 : SG_METER_TO_NM);
                snprintf(buf, 5, (f >= 100.0 ? "%4.0f" : "%4.1f"), f);
                string s = buf;
                _kln89->DrawText(s, 1, 4 - s.size(), 3, true);
@@ -132,7 +132,9 @@ void KLN89Page::Knob1Right1() {
 
 void KLN89Page::Knob2Left1() {
        if(_kln89->_mode != KLN89_MODE_CRSR && !fgGetBool("/instrumentation/kln89/scan-pull")) {
-               GPSPage::Knob2Left1(); 
+               _kln89->_activePage->LooseFocus();
+               _subPage--;
+               if(_subPage < 0) _subPage = _nSubPages - 1;
        } else {
                if(_uLinePos == 0 && _kln89->_obsMode) {
                        _kln89->_obsHeading--;
@@ -146,7 +148,9 @@ void KLN89Page::Knob2Left1() {
 
 void KLN89Page::Knob2Right1() {
        if(_kln89->_mode != KLN89_MODE_CRSR && !fgGetBool("/instrumentation/kln89/scan-pull")) {
-               GPSPage::Knob2Right1(); 
+               _kln89->_activePage->LooseFocus();
+               _subPage++;
+               if(_subPage >= _nSubPages) _subPage = 0;
        } else {
                if(_uLinePos == 0 && _kln89->_obsMode) {
                        _kln89->_obsHeading++;
@@ -200,6 +204,21 @@ void KLN89Page::SetId(const string& s) {
        _id = s;
 }
 
+void KLN89Page::SetSubPage(int n) {
+       if(n < 0) n = 0;
+       if(n >= _nSubPages) n = _nSubPages-1;
+       _subPage = n;
+}
+
 const string& KLN89Page::GetId() {
        return(_id);
 }
+
+// TODO - this function probably shouldn't be here - FG almost certainly has better handling
+// of this somewhere already.
+string KLN89Page::GPSitoa(int n) {
+       char buf[6];
+       snprintf(buf, 6, "%i", n);
+       string s = buf;
+       return(s);
+}
index 741942e3d15470d2ac3aa61388a7179a5a965c41..89ea5a7e7a0ca38c8af344823d21b34afd1fa017 100644 (file)
@@ -29,7 +29,7 @@
 
 class KLN89;
 
-class KLN89Page : public GPSPage {
+class KLN89Page {
 
 public:
        KLN89Page(KLN89* parent);
@@ -51,10 +51,15 @@ public:
        virtual void OBSPressed();
        virtual void MsgPressed();
        
-       // See base class comments for this.
+       // Sometimes a page needs to maintain state for some return paths,
+       // but change it for others.  The CleanUp function can be used for
+       // changing state for non-ENT return  paths in conjunction with
+       // GPS::_cleanUpPage
        virtual void CleanUp();
        
-       // ditto
+       // The LooseFocus function is called when a page or subpage looses focus
+       // and allows pages to clean up state that is maintained whilst focus is
+       // retained, but lost on return.
        virtual void LooseFocus();
        
        inline void SetEntInvert(bool b) { _entInvert = b; }
@@ -63,9 +68,22 @@ public:
        virtual void SetId(const string& s);
        virtual const string& GetId();
        
+       inline int GetSubPage() { return(_subPage); }
+       void SetSubPage(int n);
+       
+       inline int GetNSubPages() { return(_nSubPages); }
+       
+       inline const string& GetName() { return(_name); }
+       
 protected:
+
        KLN89* _kln89;
        
+       string _name;   // eg. "APT", "NAV" etc
+       int _nSubPages;
+       // _subpage is zero based
+       int _subPage;   // The subpage gets remembered when other pages are displayed
+       
        // Underline position in cursor mode is not persistant when subpage is changed - hence we only need one variable per page for it.
        // Note that pos 0 is special - this is the leg pos in field 1, so pos will normally be set to 1 when crsr is pressed.
        // Also note that in general it doesn't seem to wrap.
@@ -88,6 +106,9 @@ protected:
        double _scratchpadTimer;        // Used for displaying the scratchpad messages for the right amount of time.
        string _scratchpadLine1;
        string _scratchpadLine2;
+       
+       // TODO - remove this function from this class and use a built in method instead.
+       string GPSitoa(int n);
 };
 
 #endif // _KLN89_PAGE_HXX
index 4a1b04195e7a235efd2d5d82bb5d44e625c55066..016fd3fddc04745e1325a0a22d9d354728c1e97e 100644 (file)
@@ -52,13 +52,13 @@ private:
        GPSWaypoint* _actWp;
        
        // The actual ACT page that gets displayed...
-       GPSPage* _actPage;
+       KLN89Page* _actPage;
        // ...which points to one of the below.
-       GPSPage* _aptPage;
-       GPSPage* _vorPage;
-       GPSPage* _ndbPage;
-       GPSPage* _intPage;
-       GPSPage* _usrPage;
+       KLN89Page* _aptPage;
+       KLN89Page* _vorPage;
+       KLN89Page* _ndbPage;
+       KLN89Page* _intPage;
+       KLN89Page* _usrPage;
 };
 
 #endif // _KLN89_PAGE_ACT_HXX
index c17dbff1213ed25c0330d02ed95163b443b64a14..96cceea0d0c6c21e48b6295010bdba6f5aa22dd6 100644 (file)
@@ -353,19 +353,19 @@ void KLN89AptPage::Update(double dt) {
                                _kln89->DrawText("For This Airport", 2, 0, 0);
                        } else {
                                if(_iafDialog) {
-                                       _kln89->DrawText(_iaps[_curIap]->_abbrev, 2, 1, 3);
+                                       _kln89->DrawText(_iaps[_curIap]->_ident, 2, 1, 3);
                                        _kln89->DrawText(_iaps[_curIap]->_rwyStr, 2, 7, 3);
-                                       _kln89->DrawText(_iaps[_curIap]->_id, 2, 12, 3);
+                                       _kln89->DrawText(_iaps[_curIap]->_aptIdent, 2, 12, 3);
                                        _kln89->DrawText("IAF", 2, 2, 2);
                                        unsigned int line = 0;
-                                       for(unsigned int i=_iafStart; i<_IAF.size(); ++i) {
+                                       for(unsigned int i=_iafStart; i<_approachRoutes.size(); ++i) {
                                                if(line == 2) {
-                                                       i = _IAF.size() - 1;
+                                                       i = _approachRoutes.size() - 1;
                                                }
                                                // Assume that the IAF number is always single digit!
                                                _kln89->DrawText(GPSitoa(i+1), 2, 6, 2-line);
                                                if(!(_kln89->_mode == KLN89_MODE_CRSR && _kln89->_blink && _uLinePos == (line + 1))) {
-                                                       _kln89->DrawText(_IAF[i]->id, 2, 8, 2-line);
+                                                       _kln89->DrawText(_approachRoutes[i]->waypoints[0]->id, 2, 8, 2-line);
                                                }
                                                if(_kln89->_mode == KLN89_MODE_CRSR && _uLinePos == (line + 1) && !(_kln89->_blink )) {
                                                        _kln89->Underline(2, 8, 2-line, 5);
@@ -376,9 +376,9 @@ void KLN89AptPage::Update(double dt) {
                                                _kln89->DrawEnt();
                                        }
                                } else if(_addDialog) {
-                                       _kln89->DrawText(_iaps[_curIap]->_abbrev, 2, 1, 3);
+                                       _kln89->DrawText(_iaps[_curIap]->_ident, 2, 1, 3);
                                        _kln89->DrawText(_iaps[_curIap]->_rwyStr, 2, 7, 3);
-                                       _kln89->DrawText(_iaps[_curIap]->_id, 2, 12, 3);
+                                       _kln89->DrawText(_iaps[_curIap]->_aptIdent, 2, 12, 3);
                                        string s = GPSitoa(_fStart + 1);
                                        _kln89->DrawText(s, 2, 2-s.size(), 2);
                                        s = GPSitoa(_kln89->_approachFP->waypoints.size());
@@ -399,9 +399,9 @@ void KLN89AptPage::Update(double dt) {
                                                }
                                        }
                                } else if(_replaceDialog) {
-                                       _kln89->DrawText(_iaps[_curIap]->_abbrev, 2, 1, 3);
+                                       _kln89->DrawText(_iaps[_curIap]->_ident, 2, 1, 3);
                                        _kln89->DrawText(_iaps[_curIap]->_rwyStr, 2, 7, 3);
-                                       _kln89->DrawText(_iaps[_curIap]->_id, 2, 12, 3);
+                                       _kln89->DrawText(_iaps[_curIap]->_aptIdent, 2, 12, 3);
                                        _kln89->DrawText("Replace Existing", 2, 0, 2);
                                        _kln89->DrawText("Approach", 2, 4, 1);
                                        if(_uLinePos > 0 && !(_kln89->_blink)) {
@@ -411,24 +411,35 @@ void KLN89AptPage::Update(double dt) {
                                        }
                                } else {
                                        _kln89->DrawText("IAP", 2, 11, 3);
-                                       int check = 0;
                                        bool selApp = false;
                                        if(_kln89->_mode == KLN89_MODE_CRSR && _uLinePos > 4) {
                                                selApp = true;
                                                if(!_kln89->_blink) _kln89->DrawEnt();
                                        }
-                                       for(unsigned int i=0; i<_iaps.size(); ++i) {    // TODO - do this properly when > 3 IAPs
-                                               string s = GPSitoa(i+1);
-                                               _kln89->DrawText(s, 2, 2 - s.size(), 2-i);
-                                               if(!(selApp && _uLinePos == 5+i && _kln89->_blink)) {
-                                                       _kln89->DrawText(_iaps[i]->_abbrev, 2, 3, 2-i);
-                                                       _kln89->DrawText(_iaps[i]->_rwyStr, 2, 9, 2-i);
-                                               }
-                                               if(selApp && _uLinePos == 5+i && !_kln89->_blink) {
-                                                       _kln89->Underline(2, 3, 2-i, 9);
+                                       // _maxULine pos should be 4 + iaps.size() at this point.
+                                       // Draw a maximum of 3 IAPs.
+                                       // If there are more than 3 IAPs for this airport, then we need to offset the start
+                                       // of the list if _uLinePos is pointing at the 4th or later IAP.
+                                       unsigned int offset = 0;
+                                       unsigned int index;
+                                       if(_uLinePos > 7) {
+                                               offset = _uLinePos - 7;
+                                       }
+                                       for(unsigned int i=0; i<3; ++i) {
+                                               index = offset + i;
+                                               if(index < _iaps.size()) {
+                                                       string s = GPSitoa(index+1);
+                                                       _kln89->DrawText(s, 2, 2 - s.size(), 2-i);
+                                                       if(!(selApp && _uLinePos == index+5 && _kln89->_blink)) {
+                                                               _kln89->DrawText(_iaps[index]->_ident, 2, 3, 2-i);
+                                                               _kln89->DrawText(_iaps[index]->_rwyStr, 2, 9, 2-i);
+                                                       }
+                                                       if(selApp && _uLinePos == index+5 && !_kln89->_blink) {
+                                                               _kln89->Underline(2, 3, 2-i, 9);
+                                                       }
+                                               } else {
+                                                       break;
                                                }
-                                               check++;
-                                               if(check > 2) break;
                                        }
                                }
                        }
@@ -571,7 +582,7 @@ void KLN89AptPage::CrsrPressed() {
        } else if(_subPage == 7) {
                // Don't *think* we need some of this since some of it we can only get to by pressing ENT, not CRSR.
                if(_iafDialog) {
-                       _maxULinePos = _IAF.size();
+                       _maxULinePos = _approachRoutes.size();
                        _uLinePos = 1;
                } else if(_addDialog) {
                        _maxULinePos = 1;
@@ -607,7 +618,7 @@ void KLN89AptPage::ClrPressed() {
                        }
                } else if(_addDialog) {
                        _addDialog = false;
-                       if(_IAF.size() > 1) {
+                       if(_approachRoutes.size() > 1) {
                                _iafDialog = true;
                                _maxULinePos = 1;
                                // Don't reset _curIaf since it is remembed.
@@ -632,15 +643,19 @@ void KLN89AptPage::ClrPressed() {
 void KLN89AptPage::EntPressed() {
        if(_entInvert) {
                _entInvert = false;
-               _last_apt_id = _apt_id;
-               _apt_id = _save_apt_id;
+               if(_kln89->_dtoReview) {
+                       _kln89->DtoInitiate(_apt_id);
+               } else {
+                       _last_apt_id = _apt_id;
+                       _apt_id = _save_apt_id;
+               }
        } else if(_subPage == 7 && _kln89->_mode == KLN89_MODE_CRSR && _uLinePos > 0) {
                // We are selecting an approach
                if(_iafDialog) {
                        if(_uLinePos > 0) {
                                // Record the IAF that was picked
                                if(_uLinePos == 3) {
-                                       _curIaf = _IAF.size() - 1;
+                                       _curIaf = _approachRoutes.size() - 1;
                                } else {
                                        _curIaf = _uLinePos - 1 + _iafStart;
                                }
@@ -648,9 +663,8 @@ void KLN89AptPage::EntPressed() {
                                // TODO - delete the waypoints inside _approachFP before clearing them!!!!!!!
                                _kln89->_approachFP->waypoints.clear();
                                GPSWaypoint* wp = new GPSWaypoint;
-                               *wp = *_IAF[_curIaf];   // Need to make copies here since we're going to alter ID and type sometimes
+                               *wp = *(_approachRoutes[_curIaf]->waypoints[0]);        // Need to make copies here since we're going to alter ID and type sometimes
                                string iafid = wp->id;
-                               //wp->id += 'i';
                                _kln89->_approachFP->waypoints.push_back(wp);
                                for(unsigned int i=0; i<_IAP.size(); ++i) {
                                        if(_IAP[i]->id != iafid) {      // Don't duplicate waypoints that are part of the initial fix list and the approach procedure list.
@@ -666,11 +680,6 @@ void KLN89AptPage::EntPressed() {
                                                _kln89->_approachFP->waypoints.push_back(wp);
                                        }
                                }
-                               // Only add 1 missed approach procedure waypoint for now.  I think this might be standard always anyway.
-                               wp = new GPSWaypoint;
-                               *wp = *_MAP[0];
-                               //wp->id += 'h';
-                               _kln89->_approachFP->waypoints.push_back(wp);
                                _iafDialog = false;
                                _addDialog = true;
                                _maxULinePos = _kln89->_approachFP->waypoints.size() + 1;
@@ -702,7 +711,7 @@ void KLN89AptPage::EntPressed() {
                         _kln89->_activeFP->waypoints.insert(_kln89->_activeFP->waypoints.end(), _kln89->_approachFP->waypoints.begin(), _kln89->_approachFP->waypoints.end());
                     }
                                        _kln89->_approachID = _apt_id;
-                                       _kln89->_approachAbbrev = _iaps[_curIap]->_abbrev;
+                                       _kln89->_approachAbbrev = _iaps[_curIap]->_ident;
                                        _kln89->_approachRwyStr = _iaps[_curIap]->_rwyStr;
                                        _kln89->_approachLoaded = true;
                                        //_kln89->_messageStack.push_back("*Press ALT To Set Baro");
@@ -717,20 +726,36 @@ void KLN89AptPage::EntPressed() {
                } else if(_replaceDialog) {
                        // TODO - load the approach!
                } else if(_uLinePos > 4) {
-                       _IAF.clear();
+                       _approachRoutes.clear();
                        _IAP.clear();
-                       _MAP.clear();
                        _curIaf = 0;
-                       _IAF = ((FGNPIAP*)(_iaps[_uLinePos-5]))->_IAF;
+                       _approachRoutes = ((FGNPIAP*)(_iaps[_uLinePos-5]))->_approachRoutes;
                        _IAP = ((FGNPIAP*)(_iaps[_uLinePos-5]))->_IAP;
-                       _MAP = ((FGNPIAP*)(_iaps[_uLinePos-5]))->_MAP;
                        _curIap = _uLinePos - 5;        // TODO - handle the start of list ! no. 1, and the end of list not sequential!
                        _uLinePos = 1;
-                       if(_IAF.size() > 1) {
+                       if(_approachRoutes.size() > 1) {
                                // More than 1 IAF - display the selection dialog
                                _iafDialog = true;
-                               _maxULinePos = _IAF.size();
+                               _maxULinePos = _approachRoutes.size();
                        } else {
+                               // There is only 1 IAF, so load the waypoints into the approach flightplan here.
+                               // TODO - there is nasty code duplication loading the approach FP between the case here where we have only one
+                               // IAF and the case where we must choose the IAF from a list.  Try to tidy this after it is all working properly.
+                               _kln89->_approachFP->waypoints.clear();
+                               GPSWaypoint* wp = new GPSWaypoint;
+                               *wp = *(_approachRoutes[0]->waypoints[0]);      // Need to make copies here since we're going to alter ID and type sometimes
+                               string iafid = wp->id;
+                               _kln89->_approachFP->waypoints.push_back(wp);
+                               for(unsigned int i=0; i<_IAP.size(); ++i) {
+                                       if(_IAP[i]->id != iafid) {      // Don't duplicate waypoints that are part of the initial fix list and the approach procedure list.
+                                               // FIXME - allow the same waypoint to be both the IAF and the FAF in some
+                                               // approaches that have a procedure turn eg. KDLL
+                                               // Also allow MAF to be the same as IAF!
+                                               wp = new GPSWaypoint;
+                                               *wp = *_IAP[i];
+                                               _kln89->_approachFP->waypoints.push_back(wp);
+                                       }
+                               }
                                _addDialog = true;
                                _maxULinePos = 1;
                        }
@@ -802,6 +827,15 @@ void KLN89AptPage::Knob2Left1() {
                        } else {
                                _curRwyPage--;
                        }
+               } else if(_subPage == 0) {
+                       _subPage = 7;
+                       // We have to set _uLinePos here even though the cursor isn't pressed, to
+                       // ensure that the list displays properly.
+                       if(_iaps.empty()) {
+                               _uLinePos = 1;
+                       } else {
+                               _uLinePos = 5;
+                       }
                } else {
                        KLN89Page::Knob2Left1();
                }
@@ -845,6 +879,15 @@ void KLN89AptPage::Knob2Right1() {
                        } else {
                                _curFreqPage++;
                        }
+               } else if(_subPage == 6) {
+                       _subPage = 7;
+                       // We have to set _uLinePos here even though the cursor isn't pressed, to
+                       // ensure that the list displays properly.
+                       if(_iaps.empty()) {
+                               _uLinePos = 1;
+                       } else {
+                               _uLinePos = 5;
+                       }
                } else {
                        KLN89Page::Knob2Right1();
                }
index 33dd5603cd37d0cdebe651098c6c5f0c317907d9..993fca550aab4d81170271907ac137a0d49bcaec 100644 (file)
@@ -65,11 +65,11 @@ private:
        
        iap_list_type _iaps;
        unsigned int _curIap;   // The index into _iaps of the IAP we are currently selecting
-       vector<GPSWaypoint*> _IAF;      // The initial approach fix(es)
+       vector<GPSFlightPlan*> _approachRoutes; // The approach route(s) from the IAF(s) to the IF.
        vector<GPSWaypoint*> _IAP;      // The compulsory waypoints of the approach procedure (may duplicate one of the above).
                                                                // _IAP includes the FAF and MAF.
        vector<GPSWaypoint*> _MAP;      // The missed approach procedure (doesn't include the MAF).
-       unsigned int _curIaf;   // The index into _IAF of the IAF we are currently selecting, and then remembered as the one we selected
+       unsigned int _curIaf;   // The index into _approachRoutes of the IAF we are currently selecting, and then remembered as the one we selected
        
        // Position in rwy pages
        unsigned int _curRwyPage;
index de761232a475abf60c64ab871bc1017201459948..a8382b06f9be22298acca1d92e709b1bde2fe5de 100644 (file)
 #endif
 
 #include "kln89_page_dir.hxx"
+#include <Main/fg_props.hxx>
 
 KLN89DirPage::KLN89DirPage(KLN89* parent)
 : KLN89Page(parent) {
        _nSubPages = 1;
        _subPage = 0;
        _name = "DIR";
+       _maxULinePos = 4;
        _DToWpDispMode = 2;
 }
 
@@ -43,16 +45,16 @@ void KLN89DirPage::Update(double dt) {
        _kln89->DrawText("DIRECT TO:", 2, 2, 3);
        
        if(_kln89->_mode == KLN89_MODE_CRSR) {
+               string s = _id;
+               while(s.size() < 5) s += ' ';
                if(_DToWpDispMode == 0) {
-                       string s = _id;
-                       while(s.size() < 5) s += ' ';
                        if(!_kln89->_blink) {
                                _kln89->DrawText(s, 2, 4, 1, false, 99);
                                _kln89->DrawEnt(1, 0, 1);
                        }
                } else if(_DToWpDispMode == 1) {
                        if(!_kln89->_blink) {
-                               // TODO
+                               _kln89->DrawText(s, 2, 4, 1, false, _uLinePos);
                                _kln89->DrawEnt(1, 0, 1);
                        }
                        _kln89->Underline(2, 4, 1, 5);
@@ -67,13 +69,16 @@ void KLN89DirPage::Update(double dt) {
        KLN89Page::Update(dt);
 }
 
+// This can only be called from the KLN89 when DTO is pressed from outside of the DIR page.
+// DO NOT USE IT to set _id internally from the DIR page, since it initialises various state 
+// based on the assumption that the DIR page is being first entered.
 void KLN89DirPage::SetId(const string& s) {
        if(s.size()) {
                _id = s;
-               // TODO - fill in lat, lon, type
-               // or just pass in waypoints (probably better!)
                _DToWpDispMode = 0;
-               // TODO - this (above) should probably be dependent on whether s is a *valid* waypoint!
+               if(!_kln89->_activeFP->IsEmpty()) {
+                       _DToWpDispIndex = (int)_kln89->_activeFP->waypoints.size() - 1;
+               }
        } else {
                _DToWpDispMode = 2;
        }
@@ -81,6 +86,11 @@ void KLN89DirPage::SetId(const string& s) {
        _uLinePos = 1;  // Needed to stop Leg flashing
 }
 
+void KLN89DirPage::CrsrPressed() {
+       // Pressing CRSR clears the ID field (from sim).
+       _DToWpDispMode = 2;
+}
+
 void KLN89DirPage::ClrPressed() {
        if(_kln89->_mode == KLN89_MODE_CRSR) {
                if(_DToWpDispMode <= 1) {
@@ -98,10 +108,203 @@ void KLN89DirPage::ClrPressed() {
 }
 
 void KLN89DirPage::EntPressed() {
-       //cout << "DTO ENT Pressed()\n";
-       if(_id.empty()) {
+       // Trim any RH whitespace from _id
+       while(!_id.empty()) {
+               if(_id[_id.size()-1] == ' ') {
+                       _id = _id.substr(0, _id.size()-1);
+               } else {
+                       // Important to break, since usr waypoint names may contain space.
+                       break;
+               }
+       }
+       if(_DToWpDispMode == 2 || _id.empty()) {
                _kln89->DtoCancel();
        } else {
-               _kln89->DtoInitiate(_id);
+               if(_DToWpDispMode == 0) {
+                       // It's a waypoint from the active flightplan - these get processed without data page review.
+                       _kln89->DtoInitiate(_id);
+               } else {
+                       // Display the appropriate data page for review (USR page if the ident is not currently valid)
+                       _kln89->_dtoReview = true;
+                       GPSWaypoint* wp = _kln89->FindFirstByExactId(_id);
+                       if(wp) {
+                               // Set the current page to be the appropriate data page
+                               _kln89->_curPage = wp->type;
+                               delete wp;
+                       } else {
+                               // Set the current page to be the user page
+                               _kln89->_curPage = 4;
+                       }
+                       // set the page ID and entInvert, and activate the current page.
+                       _kln89->_activePage = _kln89->_pages[_kln89->_curPage];
+                       _kln89->_activePage->SetId(_id);
+                       _kln89->_activePage->SetEntInvert(true);
+               }
+       }
+}
+
+void KLN89DirPage::Knob2Left1() {
+       if(_kln89->_mode == KLN89_MODE_CRSR) {
+               if(fgGetBool("/instrumentation/kln89/scan-pull")) {
+                       if(_DToWpDispMode == 2) {
+                               if(!_kln89->_activeFP->IsEmpty()) {
+                                       // Switch to mode 0, set the position to the end of the active flightplan *and* run the mode 0 case.
+                                       _DToWpDispMode = 0;
+                                       _DToWpDispIndex = (int)_kln89->_activeFP->waypoints.size() - 1;
+                               }
+                       }
+                       if(_DToWpDispMode == 0) {
+                               // If the knob is pulled out, then the unit cycles through the waypoints of the active flight plan
+                               // (This is deduced from the Bendix-King sim, I haven't found it documented in the pilot guide).
+                               // If the active flight plan is empty it clears the field (this is possible, e.g. if a data page was
+                               // active when DTO was pressed).
+                               if(!_kln89->_activeFP->IsEmpty()) {
+                                       if(_DToWpDispIndex == 0) {
+                                               _DToWpDispIndex = (int)_kln89->_activeFP->waypoints.size() - 1;
+                                       } else {
+                                               _DToWpDispIndex--;
+                                       }
+                                       _id = _kln89->_activeFP->waypoints[_DToWpDispIndex]->id;
+                               } else {
+                                       _DToWpDispMode = 2;
+                               }
+                       }
+                       // _DToWpDispMode == 1 is a NO-OP when the knob is out.
+               } else {
+                       if(_DToWpDispMode == 0) {
+                               // If the knob is not pulled out, then turning it transitions the DIR page to the waypoint selection mode
+                               // and sets the waypoint to the first beginning with '9'
+                               _id = "9";
+                               GPSWaypoint* wp = _kln89->FindFirstById(_id);
+                               if(wp) {
+                                       _id = wp->id;
+                                       delete wp;
+                               }
+                               _uLinePos = 0;
+                               _DToWpDispMode = 1;
+                       } else if(_DToWpDispMode == 1) {
+                               while(_id.size() < (_uLinePos + 1)) {
+                                       _id += ' ';
+                               }
+                               char ch = _id[_uLinePos];
+                               if(ch == ' ') {
+                                       ch = '9';
+                               } else if(ch == '0') {
+                                       ch = 'Z';
+                               } else if(ch == 'A') {
+                                       // It seems that blanks are allowed within the name, but not for the first character
+                                       if(_uLinePos == 0) {
+                                               ch = '9';
+                                       } else {
+                                               ch = ' ';
+                                       }
+                               } else {
+                                       ch--;
+                               }
+                               _id[_uLinePos] = ch;
+                               GPSWaypoint* wp = _kln89->FindFirstById(_id.substr(0, _uLinePos+1));
+                               if(wp) {
+                                       _id = wp->id;
+                                       delete wp;
+                               }
+                       } else {
+                               _id = "9";
+                               GPSWaypoint* wp = _kln89->FindFirstById(_id);
+                               if(wp) {
+                                       _id = wp->id;
+                                       delete wp;
+                               }
+                               _uLinePos = 0;
+                               _DToWpDispMode = 1;
+                       }
+               }
+       } else {
+               // If the cursor is not displayed, then we return to the page that was displayed prior to DTO being pressed,
+               // and pass the knob turn to that page, whether pulled out or not.
+               _kln89->_activePage = _kln89->_pages[_kln89->_curPage];
+               _kln89->_activePage->Knob2Left1();
+       }
+}
+
+void KLN89DirPage::Knob2Right1() {
+       if(_kln89->_mode == KLN89_MODE_CRSR) {
+               if(fgGetBool("/instrumentation/kln89/scan-pull")) {
+                       if(_DToWpDispMode == 2) {
+                               if(!_kln89->_activeFP->IsEmpty()) {
+                                       // Switch to mode 0, set the position to the end of the active flightplan *and* run the mode 0 case.
+                                       _DToWpDispMode = 0;
+                                       _DToWpDispIndex = (int)_kln89->_activeFP->waypoints.size() - 1;
+                               }
+                       }
+                       if(_DToWpDispMode == 0) {
+                               // If the knob is pulled out, then the unit cycles through the waypoints of the active flight plan
+                               // (This is deduced from the Bendix-King sim, I haven't found it documented in the pilot guide).
+                               // If the active flight plan is empty it clears the field (this is possible, e.g. if a data page was
+                               // active when DTO was pressed).
+                               if(!_kln89->_activeFP->IsEmpty()) {
+                                       if(_DToWpDispIndex == (int)_kln89->_activeFP->waypoints.size() - 1) {
+                                               _DToWpDispIndex = 0;
+                                       } else {
+                                               _DToWpDispIndex++;
+                                       }
+                                       _id = _kln89->_activeFP->waypoints[_DToWpDispIndex]->id;
+                               } else {
+                                       _DToWpDispMode = 2;
+                               }
+                       }
+                       // _DToWpDispMode == 1 is a NO-OP when the knob is out.
+               } else {
+                       if(_DToWpDispMode == 0) {
+                               // If the knob is not pulled out, then turning it transitions the DIR page to the waypoint selection mode
+                               // and sets the waypoint to the first beginning with 'A'
+                               _id = "A";
+                               GPSWaypoint* wp = _kln89->FindFirstById(_id);
+                               if(wp) {
+                                       _id = wp->id;
+                                       delete wp;
+                               }
+                               _uLinePos = 0;
+                               _DToWpDispMode = 1;
+                       } else if(_DToWpDispMode == 1) {
+                               while(_id.size() < (_uLinePos + 1)) {
+                                       _id += ' ';
+                               }
+                               char ch = _id[_uLinePos];
+                               if(ch == ' ') {
+                                       ch = 'A';
+                               } else if(ch == 'Z') {
+                                       ch = '0';
+                               } else if(ch == '9') {
+                                       // It seems that blanks are allowed within the name, but not for the first character
+                                       if(_uLinePos == 0) {
+                                               ch = 'A';
+                                       } else {
+                                               ch = ' ';
+                                       }
+                               } else {
+                                       ch++;
+                               }
+                               _id[_uLinePos] = ch;
+                               GPSWaypoint* wp = _kln89->FindFirstById(_id.substr(0, _uLinePos+1));
+                               if(wp) {
+                                       _id = wp->id;
+                                       delete wp;
+                               }
+                       } else {
+                               _id = "A";
+                               GPSWaypoint* wp = _kln89->FindFirstById(_id);
+                               if(wp) {
+                                       _id = wp->id;
+                                       delete wp;
+                               }
+                               _uLinePos = 0;
+                               _DToWpDispMode = 1;
+                       }
+               }
+       } else {
+               // If the cursor is not displayed, then we return to the page that was displayed prior to DTO being pressed,
+               // and pass the knob turn to that page, whether pulled out or not.
+               _kln89->_activePage = _kln89->_pages[_kln89->_curPage];
+               _kln89->_activePage->Knob2Right1();
        }
 }
index d9f66b6912964c647b0b9aed9a5da10df7deaaba..ac5899327bcb0511b903e3ebb4968e82c938d011 100644 (file)
@@ -36,8 +36,11 @@ public:
        
        void SetId(const string& s);
        
+       void CrsrPressed();
        void ClrPressed();
        void EntPressed();
+       void Knob2Left1();
+       void Knob2Right1();
        
 private:
        // Waypoint display mode.
@@ -47,6 +50,10 @@ private:
        // 2 => Blanks.  These can be displayed flashing when the cursor is active (eg. when CLR is pressed) and are always displayed if the cursor is turned off.
        int _DToWpDispMode;
        
+       // Position of the list in the mode that scans through the active flight plan.
+       // This should be initialised to point at the final waypoint of the active flight plan when we enter mode zero above.
+       int _DToWpDispIndex;
+       
        // We need to save the mode when DTO gets pressed, since potentially this class handles page exit via. the CLR event handler
        KLN89Mode _saveMasterMode;
 };
index 2b4c350cc5f5adc44b4719be5eedd7b15b3c8d35..86e6178c7343603d04331d6ea567769c7ad13386 100644 (file)
@@ -144,7 +144,7 @@ void KLN89FplPage::Update(double dt) {
                //----------------------------------------- end active FP copy ------------------------------------------------
                
                // Recalculate which waypoint is displayed at the top of the list if required (generally if this page has lost focus).
-               int idx = _parent->GetActiveWaypointIndex();
+               int idx = _kln89->GetActiveWaypointIndex();
                if(_resetFplPos0) {
                        if(waylist.size() <= 1) {
                                _fplPos = 0;
@@ -679,7 +679,7 @@ void KLN89FplPage::LooseFocus() {
 
 void KLN89FplPage::EntPressed() {
        if(_delFP) {
-               _parent->ClearFlightPlan(_subPage);
+               _kln89->ClearFlightPlan(_subPage);
                CrsrPressed();
        } else if(_delWp) {
                int pos = _uLinePos - 4 + _fplPos;
@@ -750,7 +750,7 @@ void KLN89FplPage::EntPressed() {
                        }
                } else {
                        // Use
-                       _parent->ClearFlightPlan(0);
+                       _kln89->ClearFlightPlan(0);
                        for(unsigned int i=0; i<_kln89->_flightPlans[_subPage]->waypoints.size(); ++i) {
                                GPSWaypoint* wp = new GPSWaypoint;
                                *wp = *(_kln89->_flightPlans[_subPage]->waypoints[i]);
@@ -759,13 +759,13 @@ void KLN89FplPage::EntPressed() {
                        _kln89->OrientateToActiveFlightPlan();
                        _subPage = 0;
                }
-               _parent->CrsrPressed();
+               _kln89->CrsrPressed();
        } else if(_uLinePos == 2) {
                if(_kln89->_flightPlans[_subPage]->IsEmpty()) {
                        // ERROR !!!
                } else {
                        // Use Invert
-                       _parent->ClearFlightPlan(0);
+                       _kln89->ClearFlightPlan(0);
                        for(unsigned int i=0; i<_kln89->_flightPlans[_subPage]->waypoints.size(); ++i) {
                                GPSWaypoint* wp = new GPSWaypoint;
                                *wp = *(_kln89->_flightPlans[_subPage]->waypoints[i]);
@@ -774,7 +774,7 @@ void KLN89FplPage::EntPressed() {
                        }
                        _kln89->OrientateToActiveFlightPlan();
                }
-               _parent->CrsrPressed();
+               _kln89->CrsrPressed();
                _subPage = 0;
        }
 }
index 694e06ce6cccd8f7630429e35f63490939493f7b..1edb2428d943b998a0d2a7b650e849c57cb8fec0 100644 (file)
@@ -195,8 +195,13 @@ void KLN89IntPage::ClrPressed() {
 void KLN89IntPage::EntPressed() {
        if(_entInvert) {
                _entInvert = false;
-               _last_int_id = _int_id;
-               _int_id = _save_int_id;
+               _entInvert = false;
+               if(_kln89->_dtoReview) {
+                       _kln89->DtoInitiate(_int_id);
+               } else {
+                       _last_int_id = _int_id;
+                       _int_id = _save_int_id;
+               }
        }
 }
 
index 1a53659bcd7f8981e55de04408e9f6b199b8fa69..0081d70a9ba85f38d7ebe0f7b3a05f441d71502f 100644 (file)
@@ -41,15 +41,15 @@ KLN89NavPage::KLN89NavPage(KLN89* parent)
        _menuPos = 0;
        _suspendAVS = false;
        _scanWpSet = false;
-        _scanWpIndex = -1;
+       _scanWpIndex = -1;
 }
 
 KLN89NavPage::~KLN89NavPage() {
 }
 
 void KLN89NavPage::Update(double dt) {
-       GPSFlightPlan* fp = ((KLN89*)_parent)->_activeFP;
-       GPSWaypoint* awp = _parent->GetActiveWaypoint();
+       GPSFlightPlan* fp = _kln89->_activeFP;
+       GPSWaypoint* awp = _kln89->GetActiveWaypoint();
        // Scan-pull out on nav4 page switches off the cursor
        if(3 == _subPage && fgGetBool("/instrumentation/kln89/scan-pull")) { _kln89->_mode = KLN89_MODE_DISP; }
        bool crsr = (_kln89->_mode == KLN89_MODE_CRSR);
index 0a70f1d633d7260dd2f67777085a22ee1a2f9181..b6b90bebdafc7673e3a26aa02442b6c1f616945e 100644 (file)
@@ -158,8 +158,12 @@ void KLN89NDBPage::ClrPressed() {
 void KLN89NDBPage::EntPressed() {
        if(_entInvert) {
                _entInvert = false;
-               _last_ndb_id = _ndb_id;
-               _ndb_id = _save_ndb_id;
+               if(_kln89->_dtoReview) {
+                       _kln89->DtoInitiate(_ndb_id);
+               } else {
+                       _last_ndb_id = _ndb_id;
+                       _ndb_id = _save_ndb_id;
+               }
        }
 }
 
index a7719f495ebacc5629ab5ccc374628b5abff3d1c..414a8c487d208ff3c3b01efab105a4a7bc5c46a4 100644 (file)
@@ -170,8 +170,13 @@ void KLN89VorPage::ClrPressed() {
 void KLN89VorPage::EntPressed() {
        if(_entInvert) {
                _entInvert = false;
-               _last_vor_id = _vor_id;
-               _vor_id = _save_vor_id;
+               _entInvert = false;
+               if(_kln89->_dtoReview) {
+                       _kln89->DtoInitiate(_vor_id);
+               } else {
+                       _last_vor_id = _vor_id;
+                       _vor_id = _save_vor_id;
+               }
        }
 }
 
index a20189cd973a54f05e4a41ab3ab34cb3accabcab..d3da8e828e5902107f6400b70898a05bd31ad366 100644 (file)
@@ -26,7 +26,6 @@
 #include "dclgps.hxx"
 
 #include <simgear/sg_inlines.h>
-#include <simgear/structure/commands.hxx>
 #include <simgear/timing/sg_time.hxx>
 #include <simgear/magvar/magvar.hxx>
 
 #include <Navaids/fix.hxx>
 #include <Navaids/navrecord.hxx>
 #include <Airports/simple.hxx>
+#include <Airports/runways.hxx>
 
 #include <iostream>
 
 using namespace std;
 
-// Command callbacks for FlightGear
-
-static bool do_kln89_msg_pressed(const SGPropertyNode* arg) {
-       //cout << "do_kln89_msg_pressed called!\n";
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->MsgPressed();
-       return(true);
-}
-
-static bool do_kln89_obs_pressed(const SGPropertyNode* arg) {
-       //cout << "do_kln89_obs_pressed called!\n";
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->OBSPressed();
-       return(true);
-}
-
-static bool do_kln89_alt_pressed(const SGPropertyNode* arg) {
-       //cout << "do_kln89_alt_pressed called!\n";
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->AltPressed();
-       return(true);
-}
-
-static bool do_kln89_nrst_pressed(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->NrstPressed();
-       return(true);
-}
-
-static bool do_kln89_dto_pressed(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->DtoPressed();
-       return(true);
-}
-
-static bool do_kln89_clr_pressed(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->ClrPressed();
-       return(true);
-}
-
-static bool do_kln89_ent_pressed(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->EntPressed();
-       return(true);
-}
-
-static bool do_kln89_crsr_pressed(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->CrsrPressed();
-       return(true);
-}
-
-static bool do_kln89_knob1left1(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->Knob1Left1();
-       return(true);
-}
-
-static bool do_kln89_knob1right1(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->Knob1Right1();
-       return(true);
-}
-
-static bool do_kln89_knob2left1(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->Knob2Left1();
-       return(true);
-}
-
-static bool do_kln89_knob2right1(const SGPropertyNode* arg) {
-       DCLGPS* gps = (DCLGPS*)globals->get_subsystem("kln89");
-       gps->Knob2Right1();
-       return(true);
-}
-
-// End command callbacks
-
 GPSWaypoint::GPSWaypoint() {
     appType = GPS_APP_NONE;
 }
@@ -222,58 +143,12 @@ ClockTime::ClockTime(int hr, int min) {
 ClockTime::~ClockTime() {
 }
 
-GPSPage::GPSPage(DCLGPS* parent) {
-       _parent = parent;
-       _subPage = 0;
-}
-
-GPSPage::~GPSPage() {
-}
-
-void GPSPage::Update(double dt) {}
-
-void GPSPage::Knob1Left1() {}
-void GPSPage::Knob1Right1() {}
-
-void GPSPage::Knob2Left1() {
-       _parent->_activePage->LooseFocus();
-       _subPage--;
-       if(_subPage < 0) _subPage = _nSubPages - 1;
-}
-
-void GPSPage::Knob2Right1() {
-       _parent->_activePage->LooseFocus();
-       _subPage++;
-       if(_subPage >= _nSubPages) _subPage = 0;
-}
-
-void GPSPage::CrsrPressed() {}
-void GPSPage::EntPressed() {}
-void GPSPage::ClrPressed() {}
-void GPSPage::DtoPressed() {}
-void GPSPage::NrstPressed() {}
-void GPSPage::AltPressed() {}
-void GPSPage::OBSPressed() {}
-void GPSPage::MsgPressed() {}
-
-string GPSPage::GPSitoa(int n) {
-       char buf[6];
-       snprintf(buf, 6, "%i", n);
-       string s = buf;
-       return(s);
-}
-
-void GPSPage::CleanUp() {}
-void GPSPage::LooseFocus() {}
-void GPSPage::SetId(const string& s) {}
-
 // ------------------------------------------------------------------------------------- //
 
 DCLGPS::DCLGPS(RenderArea2D* instrument) {
        _instrument = instrument;
        _nFields = 1;
        _maxFields = 2;
-       _pages.clear();
        
        // Units - lets default to US units - FG can set them to other units from config during startup if desired.
        _altUnits = GPS_ALT_UNITS_FT;
@@ -361,21 +236,99 @@ void DCLGPS::draw(osg::State& state) {
 }
 
 void DCLGPS::init() {
-       globals->get_commands()->addCommand("kln89_msg_pressed", do_kln89_msg_pressed);
-       globals->get_commands()->addCommand("kln89_obs_pressed", do_kln89_obs_pressed);
-       globals->get_commands()->addCommand("kln89_alt_pressed", do_kln89_alt_pressed);
-       globals->get_commands()->addCommand("kln89_nrst_pressed", do_kln89_nrst_pressed);
-       globals->get_commands()->addCommand("kln89_dto_pressed", do_kln89_dto_pressed);
-       globals->get_commands()->addCommand("kln89_clr_pressed", do_kln89_clr_pressed);
-       globals->get_commands()->addCommand("kln89_ent_pressed", do_kln89_ent_pressed);
-       globals->get_commands()->addCommand("kln89_crsr_pressed", do_kln89_crsr_pressed);
-       globals->get_commands()->addCommand("kln89_knob1left1", do_kln89_knob1left1);
-       globals->get_commands()->addCommand("kln89_knob1right1", do_kln89_knob1right1);
-       globals->get_commands()->addCommand("kln89_knob2left1", do_kln89_knob2left1);
-       globals->get_commands()->addCommand("kln89_knob2right1", do_kln89_knob2right1);
                
        // Not sure if this should be here, but OK for now.
        CreateDefaultFlightPlans();
+
+       // Hack - hardwire some instrument approaches for development.
+       // These will shortly be replaced by a routine to read ARINC data from file instead.
+       FGNPIAP* iap;
+       GPSWaypoint* wp;
+       GPSFlightPlan* fp;
+       const GPSWaypoint* cwp;
+       
+       iap = new FGNPIAP;
+       iap->_aptIdent = "KHAF";
+       iap->_ident = "R12-Y";
+       iap->_name = ExpandSIAPIdent(iap->_ident);
+       iap->_rwyStr = "12";
+       iap->_approachRoutes.clear();
+       iap->_IAP.clear();
+       // -------
+       wp = new GPSWaypoint;
+       wp->id = "GOBBS";
+       // Nasty using the find any function here, but it saves converting data from FGFix etc. 
+       cwp = FindFirstByExactId(wp->id);
+       if(cwp) {
+               *wp = *cwp;
+               wp->appType = GPS_IAF;
+               fp = new GPSFlightPlan;
+               fp->waypoints.push_back(wp);
+       } else {
+               //cout << "Unable to find waypoint " << wp->id << '\n';
+       }
+       // -------
+       wp = new GPSWaypoint;
+       wp->id = "FUJCE";
+       cwp = FindFirstByExactId(wp->id);
+       if(cwp) {
+               *wp = *cwp;
+               wp->appType = GPS_IAP;
+               fp->waypoints.push_back(wp);
+               iap->_approachRoutes.push_back(fp);
+               iap->_IAP.push_back(wp);
+       } else {
+               //cout << "Unable to find waypoint " << wp->id << '\n';
+       }
+       // -------
+       wp = new GPSWaypoint;
+       wp->id = "JEVXY";
+       cwp = FindFirstByExactId(wp->id);
+       if(cwp) {
+               *wp = *cwp;
+               wp->appType = GPS_FAF;
+               iap->_IAP.push_back(wp);
+       } else {
+               //cout << "Unable to find waypoint " << wp->id << '\n';
+       }
+       // -------
+       wp = new GPSWaypoint;
+       wp->id = "RW12";
+       wp->appType = GPS_MAP;
+       if(wp->id.substr(0, 2) == "RW" && wp->appType == GPS_MAP) {
+               // Assume that this is a missed-approach point based on the runway number, which appears to be standard for most approaches.
+               const FGAirport* apt = fgFindAirportID(iap->_aptIdent);
+               if(apt) {
+                       // TODO - sanity check the waypoint ID to ensure we have a double digit number
+                       FGRunway* rwy = apt->getRunwayByIdent(wp->id.substr(2, 2));
+                       if(rwy) {
+                               wp->lat = rwy->begin().getLatitudeRad();
+                               wp->lon = rwy->begin().getLongitudeRad();
+                       }
+               }
+       } else {
+               cwp = FindFirstByExactId(wp->id);
+               if(cwp) {
+                       *wp = *cwp;
+                       wp->appType = GPS_MAP;
+               } else {
+                       //cout << "Unable to find waypoint " << wp->id << '\n';
+               }
+       }
+       iap->_IAP.push_back(wp);
+       // -------
+       wp = new GPSWaypoint;
+       wp->id = "SEEMS";
+       cwp = FindFirstByExactId(wp->id);
+       if(cwp) {
+               *wp = *cwp;
+               wp->appType = GPS_MAHP;
+               iap->_IAP.push_back(wp);
+       } else {
+               //cout << "Unable to find waypoint " << wp->id << '\n';
+       }
+       // -------
+       _np_iap[iap->_aptIdent].push_back(iap);
 }
 
 void DCLGPS::bind() {
@@ -659,6 +612,88 @@ void DCLGPS::update(double dt) {
        }
 }
 
+/* 
+       Expand a SIAP ident to the full procedure name (as shown on the approach chart).
+       NOTE: Some of this is inferred from data, some is from documentation.
+       
+       Example expansions from ARINC 424-18 [and the airport they're taken from]:
+       "R10LY" <--> "RNAV (GPS) Y RWY 10 L"    [KBOI]
+       "R10-Z" <--> "RNAV (GPS) Z RWY 10"              [KHTO]
+       "S25"   <--> "VOR or GPS RWY 25"                [KHHR]
+       "P20"   <--> "GPS RWY 20"                               [KDAN]
+       "NDB-B" <--> "NDB or GPS-B"                             [KDAW]
+       "NDBC"  <--> "NDB or GPS-C"                             [KEMT]
+       "VDMA"  <--> "VOR/DME or GPS-A"                 [KDAW]
+       "VDM-A" <--> "VOR/DME or GPS-A"                 [KEAG]
+       "VDMB"  <--> "VOR/DME or GPS-B"                 [KDKX]
+       "VORA"  <--> "VOR or GPS-A"                             [KEMT]
+       
+       It seems that there are 2 basic types of expansions; those that include
+       the runway and those that don't.  Of those that don't, it seems that 2
+       different positions within the string to encode the identifying letter
+       are used, i.e. with a dash and without.
+*/
+string DCLGPS::ExpandSIAPIdent(const string& ident) {
+       string name;
+       bool has_rwy;
+       
+       switch(ident[0]) {
+       case 'N': name = "NDB or GPS"; has_rwy = false; break;
+       case 'P': name = "GPS"; has_rwy = true; break;
+       case 'R': name = "RNAV (GPS)"; has_rwy = true; break;
+       case 'S': name = "VOR or GPS"; has_rwy = true; break;
+       case 'V':
+               if(ident[1] == 'D') name = "VOR/DME or GPS";
+               else name = "VOR or GPS";
+               has_rwy = false;
+               break;
+       default: // TODO output a log message
+               break;
+       }
+       
+       if(has_rwy) {
+               // Add the identifying letter if present
+               if(ident.size() == 5) {
+                       name += ' ';
+                       name += ident[4];
+               }
+               
+               // Add the runway
+               name += " RWY ";
+               name += ident.substr(1, 2);
+               
+               // Add a left/right/centre indication if present.
+               if(ident.size() > 3) {
+                       if((ident[3] != '-') && (ident[3] != ' ')) {    // Early versions of the spec allowed a blank instead of a dash so check for both
+                               name += ' ';
+                               name += ident[3];
+                       }
+               }
+       } else {
+               // Add the identifying letter, which I *think* should always be present, but seems to be inconsistent as to whether a dash is used.
+               if(ident.size() == 5) {
+                       name += '-';
+                       name += ident[4];
+               } else if(ident.size() == 4) {
+                       name += '-';
+                       name += ident[3];
+               } else {
+                       // No suffix letter
+               }
+       }
+       
+       return(name);
+}
+
+GPSWaypoint* DCLGPS::GetActiveWaypoint() { 
+       return &_activeWaypoint; 
+}
+       
+// Returns meters
+float DCLGPS::GetDistToActiveWaypoint() { 
+       return _dist2Act;
+}
+
 // I don't yet fully understand all the gotchas about where to source time from.
 // This function sets the initial timer before the clock exports properties
 // and the one below uses the clock to be consistent with the rest of the code.
@@ -682,21 +717,25 @@ double DCLGPS::GetCDIDeflection() const {
 }
 
 void DCLGPS::DtoInitiate(const string& s) {
-       //cout << "DtoInitiate, s = " << s << '\n';
        const GPSWaypoint* wp = FindFirstByExactId(s);
        if(wp) {
-               //cout << "Waypoint found, starting dto operation!\n";
+               // TODO - Currently we start DTO operation unconditionally, regardless of which mode we are in.
+               // In fact, the following rules apply:
+               // In LEG mode, start DTO as we currently do.
+               // In OBS mode, set the active waypoint to the requested waypoint, and then:
+               // If the KLN89 is not connected to an external HSI or CDI, set the OBS course to go direct to the waypoint.
+               // If the KLN89 *is* connected to an external HSI or CDI, it cannot set the course itself, and will display
+               // a scratchpad message with the course to set manually on the HSI/CDI.
+               // In both OBS cases, leave _dto false, since we don't need the virtual waypoint created.
                _dto = true;
                _activeWaypoint = *wp;
                _fromWaypoint.lat = _gpsLat;
                _fromWaypoint.lon = _gpsLon;
                _fromWaypoint.type = GPS_WP_VIRT;
                _fromWaypoint.id = "DTOWP";
-    delete wp;
+               delete wp;
        } else {
-               //cout << "Waypoint not found, ignoring dto request\n";
-               // Should bring up the user waypoint page, but we're not implementing that yet.
-               _dto = false;   // TODO - implement this some day.
+               _dto = false;
        }
 }
 
@@ -709,18 +748,7 @@ void DCLGPS::DtoCancel() {
        _dto = false;
 }
 
-void DCLGPS::Knob1Left1() {}
-void DCLGPS::Knob1Right1() {}
-void DCLGPS::Knob2Left1() {}
-void DCLGPS::Knob2Right1() {}
-void DCLGPS::CrsrPressed() { _activePage->CrsrPressed(); }
-void DCLGPS::EntPressed() { _activePage->EntPressed(); }
-void DCLGPS::ClrPressed() { _activePage->ClrPressed(); }
-void DCLGPS::DtoPressed() {}
-void DCLGPS::NrstPressed() {}
-void DCLGPS::AltPressed() {}
-
-void DCLGPS::OBSPressed() { 
+void DCLGPS::ToggleOBSMode() {
        _obsMode = !_obsMode;
        if(_obsMode) {
                if(!_activeWaypoint.id.empty()) {
@@ -742,8 +770,6 @@ void DCLGPS::SetOBSFromWaypoint() {
        _fromWaypoint.id = "OBSWP";
 }
 
-void DCLGPS::MsgPressed() {}
-
 void DCLGPS::CDIFSDIncrease() {
        if(_currentCdiScaleIndex == 0) {
                _currentCdiScaleIndex = _cdiScales.size() - 1;
index a7b6e05688983b6f305af621eebb45553ce1853c..295a7ad6436d8402db30461a5e09592e9b430b52 100644 (file)
@@ -126,9 +126,9 @@ public:
        virtual ~FGIAP() = 0;
 //protected:
 
-       string _id;             // The ID of the airport this approach is for
-       string _name;   // The approach name, eg "VOR/DME OR GPS-B"
-       string _abbrev; // The abbreviation the GPS unit uses - eg "VOR/D" in this instance.  Possibly GPS model specific.
+       string _aptIdent;       // The ident of the airport this approach is for
+       string _ident;  // The approach ident.
+       string _name;   // The full approach name.
        string _rwyStr; // The string used to specify the rwy - eg "B" in this instance.
        bool _precision;        // True for precision approach, false for non-precision.
 };
@@ -140,10 +140,10 @@ public:
        ~FGNPIAP();
 //private:
 public:
-       vector<GPSWaypoint*> _IAF;      // The initial approach fix(es)
+       vector<GPSFlightPlan*> _approachRoutes; // The approach route(s) from the IAF(s) to the IF.
+                                                                                       // NOTE: It is an assumption in the code that uses this that there is a unique IAF per approach route.
        vector<GPSWaypoint*> _IAP;      // The compulsory waypoints of the approach procedure (may duplicate one of the above).
-                                                               // _IAP includes the FAF and MAF.
-       vector<GPSWaypoint*> _MAP;      // The missed approach procedure (doesn't include the MAF).
+                                                               // _IAP includes the FAF and MAF, and the missed approach waypoints.
 };
 
 typedef vector < FGIAP* > iap_list_type;
@@ -186,67 +186,9 @@ private:
 
 // ------------------------------------------------------------------------------
 
-class DCLGPS;
-
-class GPSPage {
-       
-public:
-       GPSPage(DCLGPS* parent);
-       virtual ~GPSPage() = 0;
-       virtual void Update(double dt);
-       virtual void Knob1Left1();
-       virtual void Knob1Right1();     
-       virtual void Knob2Left1();
-       virtual void Knob2Right1();     
-       virtual void CrsrPressed();
-       virtual void EntPressed();
-       virtual void ClrPressed();
-       virtual void DtoPressed();
-       virtual void NrstPressed();
-       virtual void AltPressed();
-       virtual void OBSPressed();
-       virtual void MsgPressed();
-       
-       // Sometimes a page needs to maintain state for some return paths,
-       // but change it for others.  The CleanUp function can be used for
-       // changing state for non-ENT return  paths in conjunction with
-       // GPS::_cleanUpPage
-       virtual void CleanUp();
-       
-       // The LooseFocus function is called when a page or subpage looses focus
-       // and allows pages to clean up state that is maintained whilst focus is
-       // retained, but lost on return.
-       virtual void LooseFocus();
-       
-       // Allows pages that display info for a given ID to have it set/get if they implement these functions.
-       virtual void SetId(const string& s);
-       virtual const string& GetId()=0;
-       
-       inline int GetSubPage() { return(_subPage); }
-       
-       inline int GetNSubPages() { return(_nSubPages); }
-       
-       inline const string& GetName() { return(_name); }
-       
-protected:
-       DCLGPS* _parent;
-       string _name;   // eg. "APT", "NAV" etc
-       int _nSubPages;
-       // _subpage is zero based
-       int _subPage;   // The subpage gets remembered when other pages are displayed
-       string GPSitoa(int n);
-};
-
-/*-----------------------------------------------------------------------*/
-
-typedef vector<GPSPage*> gps_page_list_type;
-typedef gps_page_list_type::iterator gps_page_list_itr;
-
 // TODO - merge generic GPS functions instead and split out KLN specific stuff.
 class DCLGPS : public SGSubsystem {
        
-       friend class GPSPage;
-       
 public:
        DCLGPS(RenderArea2D* instrument);
        virtual ~DCLGPS() = 0;
@@ -257,6 +199,9 @@ public:
        virtual void bind();
        virtual void unbind();
        virtual void update(double dt);
+       
+       // Expand a SIAP ident to the full procedure name.
+       string ExpandSIAPIdent(const string& ident);
 
        // Render string s in display field field at position x, y
        // WHERE POSITION IS IN CHARACTER UNITS!
@@ -266,18 +211,7 @@ public:
        // Render a char at a given position as above
        virtual void DrawChar(char c, int field, int px, int py, bool bold = false);
        
-       virtual void Knob1Right1();
-       virtual void Knob1Left1();
-       virtual void Knob2Right1();
-       virtual void Knob2Left1();
-       virtual void CrsrPressed();
-       virtual void EntPressed();
-       virtual void ClrPressed();
-       virtual void DtoPressed();
-       virtual void NrstPressed();
-       virtual void AltPressed();
-       virtual void OBSPressed();
-       virtual void MsgPressed();
+       virtual void ToggleOBSMode();
        
        // Set the number of fields
        inline void SetNumFields(int n) { _nFields = (n > _maxFields ? _maxFields : (n < 1 ? 1 : n)); }
@@ -309,7 +243,7 @@ public:
        
        void SetOBSFromWaypoint();
        
-       inline GPSWaypoint* GetActiveWaypoint() { return &_activeWaypoint; }
+       GPSWaypoint* GetActiveWaypoint();
        // Get the (zero-based) position of the active waypoint in the active flightplan
        // Returns -1 if no active waypoint.
        int GetActiveWaypointIndex();
@@ -317,7 +251,7 @@ public:
        int GetWaypointIndex(const string& id);
        
        // Returns meters
-       inline float GetDistToActiveWaypoint() { return _dist2Act; }
+       float GetDistToActiveWaypoint();
        // Returns degrees (magnetic)
        float GetHeadingToActiveWaypoint();
        // Returns degrees (magnetic)
@@ -353,7 +287,7 @@ public:
        inline bool GetToFlag() const { return(_headingBugTo); }
        
        // Initiate Direct To operation to the supplied ID.
-       void DtoInitiate(const string& id);
+       virtual void DtoInitiate(const string& id);
        // Cancel Direct To operation
        void DtoCancel();
        
@@ -383,14 +317,6 @@ protected:
        // 2D rendering area
        RenderArea2D* _instrument;
        
-       // The actual pages
-       gps_page_list_type _pages;
-       
-       // The currently active page
-       GPSPage* _activePage;
-       // And a facility to save the immediately preceeding active page
-       GPSPage* _lastActivePage;
-       
        // Units
        GPSSpeedUnits _velUnits;
        GPSDistanceUnits _distUnits;
@@ -417,8 +343,8 @@ protected:
 
 protected:
        // Find first of any type of waypoint by id.  (TODO - Possibly we should return multiple waypoints here).
-  GPSWaypoint* FindFirstById(const string& id) const;
-  GPSWaypoint* FindFirstByExactId(const string& id) const;
+       GPSWaypoint* FindFirstById(const string& id) const;
+       GPSWaypoint* FindFirstByExactId(const string& id) const;
    
        FGNavRecord* FindFirstVorById(const string& id, bool &multi, bool exact = false);
        FGNavRecord* FindFirstNDBById(const string& id, bool &multi, bool exact = false);
@@ -427,8 +353,8 @@ protected:
        // Find the closest VOR to a position in RADIANS.
        FGNavRecord* FindClosestVor(double lat_rad, double lon_rad);
 
-  // helper to implement the above FindFirstXXX methods
-  FGPositioned* FindTypedFirstById(const std::string& id, FGPositioned::Type ty, bool &multi, bool exact);
+       // helper to implement the above FindFirstXXX methods
+       FGPositioned* FindTypedFirstById(const std::string& id, FGPositioned::Type ty, bool &multi, bool exact);
 
        // Position, orientation and velocity.
        // These should be read from FG's built-in GPS logic if possible.
index e2b451467c03d6061d83e542711880f8f93dddf6..3303b669c4882fe0130df2f49420bda02a87a710 100644 (file)
@@ -9,19 +9,28 @@
 
 #include "gps.hxx"
 
-#include <simgear/compiler.h>
-#include <Aircraft/aircraft.hxx>
-#include <Main/fg_props.hxx>
-#include <Main/util.hxx> // for fgLowPass
-#include <Navaids/positioned.hxx>
+#include <memory>
+#include <set>
+
+#include "Main/fg_props.hxx"
+#include "Main/globals.hxx" // for get_subsystem
+#include "Main/util.hxx" // for fgLowPass
+#include "Navaids/positioned.hxx"
+#include "Navaids/navrecord.hxx"
+#include "Airports/simple.hxx"
+#include "Airports/runways.hxx"
+#include "Autopilot/route_mgr.hxx"
 
 #include <simgear/math/sg_random.h>
 #include <simgear/sg_inlines.h>
 #include <simgear/math/sg_geodesy.hxx>
+#include <simgear/structure/exception.hxx>
 
+using std::auto_ptr;
 using std::string;
 
+///////////////////////////////////////////////////////////////////
+
 void SGGeodProperty::init(SGPropertyNode* base, const char* lonStr, const char* latStr, const char* altStr)
 {
     _lon = base->getChild(lonStr, 0, true);
@@ -65,15 +74,205 @@ SGGeod SGGeodProperty::get() const
     }
 }
 
+static const char* makeTTWString(double TTW)
+{
+  if ((TTW <= 0.0) || (TTW >= 356400.5)) { // 99 hours
+    return "--:--:--";
+  }
+      
+  unsigned int TTW_seconds = (int) (TTW + 0.5);
+  unsigned int TTW_minutes = 0;
+  unsigned int TTW_hours   = 0;
+  static char TTW_str[9];
+  TTW_hours   = TTW_seconds / 3600;
+  TTW_minutes = (TTW_seconds / 60) % 60;
+  TTW_seconds = TTW_seconds % 60;
+  snprintf(TTW_str, 9, "%02d:%02d:%02d",
+    TTW_hours, TTW_minutes, TTW_seconds);
+  return TTW_str;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+class GPSListener : public SGPropertyChangeListener
+{
+public:
+  GPSListener(GPS *m) : 
+    _gps(m),
+    _guard(false) {}
+    
+  virtual void valueChanged (SGPropertyNode * prop)
+  {
+    if (_guard) {
+      return;
+    }
+    
+    _guard = true;
+    if (prop == _gps->_route_current_wp_node) {
+      _gps->routeManagerSequenced();
+    } else if (prop == _gps->_route_active_node) {
+      _gps->routeActivated();
+    } else if (prop == _gps->_ref_navaid_id_node) {
+      _gps->referenceNavaidSet(prop->getStringValue(""));
+    } else if (prop == _gps->_routeEditedSignal) {
+      _gps->routeEdited();
+    } else if (prop == _gps->_routeFinishedSignal) {
+      _gps->routeFinished();
+    }
+        
+    _guard = false;
+  }
+  
+  void setGuard(bool g) {
+    _guard = g;
+  }
+private:
+  GPS* _gps;
+  bool _guard; // re-entrancy guard
+};
+
+////////////////////////////////////////////////////////////////////////////
+/**
+ * Helper to monitor for Nasal or other code accessing properties we haven't
+ * defined. For the moment we complain about all such activites, since various
+ * users assume all kinds of weird, wonderful and non-existent interfaces.
+ */
+class DeprecatedPropListener : public SGPropertyChangeListener
+{
+public:
+  DeprecatedPropListener(SGPropertyNode* gps)
+  {
+    _parents.insert(gps);
+    SGPropertyNode* wp = gps->getChild("wp"); 
+    _parents.insert(wp);
+    _parents.insert(wp->getChild("wp", 0));
+    _parents.insert(wp->getChild("wp", 1));
+    
+    std::set<SGPropertyNode*>::iterator it;
+    for (it = _parents.begin(); it != _parents.end(); ++it) {
+      (*it)->addChangeListener(this);
+    }
+  }
+  
+  virtual void valueChanged (SGPropertyNode * prop)
+  {
+  }
+  
+  virtual void childAdded (SGPropertyNode * parent, SGPropertyNode * child)
+  {
+    if (isDeprecated(parent, child)) {
+      SG_LOG(SG_INSTR, SG_WARN, "GPS: someone accessed a deprecated property:"
+        << child->getPath(true));
+    }
+  }
+private:
+  bool isDeprecated(SGPropertyNode * parent, SGPropertyNode * child) const 
+  {
+    if (_parents.count(parent) < 1) {
+      return false;
+    }
+    
+    // no child exclusions yet
+    return true;
+  }
+  
+  std::set<SGPropertyNode*> _parents;
+};
+
+////////////////////////////////////////////////////////////////////////////
+// configuration helper object
+
+GPS::Config::Config() :
+  _enableTurnAnticipation(true),
+  _turnRate(3.0), // degrees-per-second, so 180 degree turn takes 60 seconds
+  _overflightArmDistance(0.5),
+  _waypointAlertTime(30.0),
+  _tuneRadio1ToRefVor(false),
+  _minRunwayLengthFt(0.0),
+  _requireHardSurface(true),
+  _cdiMaxDeflectionNm(-1), // default to angular mode
+  _driveAutopilot(true)
+{
+  _enableTurnAnticipation = false;
+  _extCourseSource = fgGetNode("/instrumentation/nav[0]/radials/selected-deg", true);
+}
+
+void GPS::Config::bind(GPS* aOwner, SGPropertyNode* aCfg)
+{
+  aOwner->tie(aCfg, "turn-rate-deg-sec", SGRawValuePointer<double>(&_turnRate));
+  
+  aOwner->tie(aCfg, "turn-anticipation", SGRawValuePointer<bool>(&_enableTurnAnticipation));
+  aOwner->tie(aCfg, "wpt-alert-time", SGRawValuePointer<double>(&_waypointAlertTime));
+  aOwner->tie(aCfg, "tune-nav-radio-to-ref-vor", SGRawValuePointer<bool>(&_tuneRadio1ToRefVor));
+  aOwner->tie(aCfg, "min-runway-length-ft", SGRawValuePointer<double>(&_minRunwayLengthFt));
+  aOwner->tie(aCfg, "hard-surface-runways-only", SGRawValuePointer<bool>(&_requireHardSurface));
+  
+  aOwner->tie(aCfg, "course-source", SGRawValueMethods<GPS::Config, const char*>
+    (*this, &GPS::Config::getCourseSource, &GPS::Config::setCourseSource));
+    
+  aOwner->tie(aCfg, "cdi-max-deflection-nm", SGRawValuePointer<double>(&_cdiMaxDeflectionNm));
+  aOwner->tie(aCfg, "drive-autopilot", SGRawValuePointer<bool>(&_driveAutopilot));
+}
+
+const char* 
+GPS::Config::getCourseSource() const
+{
+  if (!_extCourseSource) {
+    return "";
+  }
+  
+  return _extCourseSource->getPath(true);
+}
 
-GPS::GPS ( SGPropertyNode *node)
-    : _last_valid(false),
-      _alt_dist_ratio(0),
-      _distance_m(0),
-      _course_deg(0),
-      _name(node->getStringValue("name", "gps")),
-      _num(node->getIntValue("number", 0))
+void
+GPS::Config::setCourseSource(const char* aPath)
 {
+  SGPropertyNode* nd = fgGetNode(aPath, false);
+  if (!nd) {
+    SG_LOG(SG_INSTR, SG_WARN, "couldn't find course source at:" << aPath);
+    _extCourseSource = NULL;
+  }
+  
+  _extCourseSource = nd;
+}
+
+double 
+GPS::Config::getExternalCourse() const
+{
+  if (!_extCourseSource) {
+    return 0.0;
+  }
+  
+  return _extCourseSource->getDoubleValue();
+}
+      
+void
+GPS::Config::setExternalCourse(double aCourseDeg)
+{
+  if (!_extCourseSource) {
+    return;
+  }
+
+  _extCourseSource->setDoubleValue(aCourseDeg);
+}      
+      
+////////////////////////////////////////////////////////////////////////////
+
+GPS::GPS ( SGPropertyNode *node) : 
+  _selectedCourse(0.0),
+  _dataValid(false),
+  _lastPosValid(false),
+  _mode("init"),
+  _name(node->getStringValue("name", "gps")),
+  _num(node->getIntValue("number", 0)),
+  _computeTurnData(false),
+  _anticipateTurn(false),
+  _inTurn(false)
+{
+  string branch = "/instrumentation/" + _name;
+  _gpsNode = fgGetNode(branch.c_str(), _num, true );
+  _scratchNode = _gpsNode->getChild("scratch", 0, true);
 }
 
 GPS::~GPS ()
@@ -83,137 +282,216 @@ GPS::~GPS ()
 void
 GPS::init ()
 {
-    string branch;
-    branch = "/instrumentation/" + _name;
-
-    SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
-    _position.init("/position/longitude-deg", "/position/latitude-deg", "/position/altitude-ft");
-    _magvar_node = fgGetNode("/environment/magnetic-variation-deg", true);
-    _serviceable_node = node->getChild("serviceable", 0, true);
-    _electrical_node = fgGetNode("/systems/electrical/outputs/gps", true);
-
-    SGPropertyNode *wp_node = node->getChild("wp", 0, true);
-    SGPropertyNode *wp0_node = wp_node->getChild("wp", 0, true);
-    SGPropertyNode *wp1_node = wp_node->getChild("wp", 1, true);
-
-    _wp0_position.init(wp0_node, "longitude-deg", "latitude-deg", "altitude-ft");
-    _wp0_ID_node = wp0_node->getChild("ID", 0, true);
-    _wp0_name_node = wp0_node->getChild("name", 0, true);
-    _wp0_course_node = wp0_node->getChild("desired-course-deg", 0, true);
-    _wp0_distance_node = wp0_node->getChild("distance-nm", 0, true);
-    _wp0_ttw_node = wp0_node->getChild("TTW", 0, true);
-    _wp0_bearing_node = wp0_node->getChild("bearing-true-deg", 0, true);
-    _wp0_mag_bearing_node = wp0_node->getChild("bearing-mag-deg", 0, true);
-    _wp0_course_deviation_node =
-        wp0_node->getChild("course-deviation-deg", 0, true);
-    _wp0_course_error_nm_node = wp0_node->getChild("course-error-nm", 0, true);
-    _wp0_to_flag_node = wp0_node->getChild("to-flag", 0, true);
-    _true_wp0_bearing_error_node =
-        wp0_node->getChild("true-bearing-error-deg", 0, true);
-    _magnetic_wp0_bearing_error_node =
-        wp0_node->getChild("magnetic-bearing-error-deg", 0, true);
-
-    _wp1_position.init(wp1_node, "longitude-deg", "latitude-deg", "altitude-ft");
-    _wp1_ID_node = wp1_node->getChild("ID", 0, true);
-    _wp1_name_node = wp1_node->getChild("name", 0, true);
-    _wp1_course_node = wp1_node->getChild("desired-course-deg", 0, true);
-    _wp1_distance_node = wp1_node->getChild("distance-nm", 0, true);
-    _wp1_ttw_node = wp1_node->getChild("TTW", 0, true);
-    _wp1_bearing_node = wp1_node->getChild("bearing-true-deg", 0, true);
-    _wp1_mag_bearing_node = wp1_node->getChild("bearing-mag-deg", 0, true);
-    _wp1_course_deviation_node =
-        wp1_node->getChild("course-deviation-deg", 0, true);
-    _wp1_course_error_nm_node = wp1_node->getChild("course-error-nm", 0, true);
-    _wp1_to_flag_node = wp1_node->getChild("to-flag", 0, true);
-    _true_wp1_bearing_error_node =
-        wp1_node->getChild("true-bearing-error-deg", 0, true);
-    _magnetic_wp1_bearing_error_node =
-        wp1_node->getChild("magnetic-bearing-error-deg", 0, true);
-    _get_nearest_airport_node = 
-        wp1_node->getChild("get-nearest-airport", 0, true);
-
-    _tracking_bug_node = node->getChild("tracking-bug", 0, true);
-    _raim_node = node->getChild("raim", 0, true);
-
-    _indicated_pos.init(node, "indicated-longitude-deg", 
+  _routeMgr = (FGRouteMgr*) globals->get_subsystem("route-manager");
+  assert(_routeMgr);
+  
+  _position.init("/position/longitude-deg", "/position/latitude-deg", "/position/altitude-ft");
+  _magvar_node = fgGetNode("/environment/magnetic-variation-deg", true);
+  _serviceable_node = _gpsNode->getChild("serviceable", 0, true);
+  _serviceable_node->setBoolValue(true);
+  _electrical_node = fgGetNode("/systems/electrical/outputs/gps", true);
+
+// basic GPS outputs
+  _raim_node = _gpsNode->getChild("raim", 0, true);
+  _odometer_node = _gpsNode->getChild("odometer", 0, true);
+  _trip_odometer_node = _gpsNode->getChild("trip-odometer", 0, true);
+  _true_bug_error_node = _gpsNode->getChild("true-bug-error-deg", 0, true);
+  _magnetic_bug_error_node = _gpsNode->getChild("magnetic-bug-error-deg", 0, true);
+  
+// waypoints
+  SGPropertyNode *wp_node = _gpsNode->getChild("wp", 0, true);
+  SGPropertyNode *wp1_node = wp_node->getChild("wp", 1, true);
+
+  // for compatability, alias selected course down to wp/wp[1]/desired-course-deg
+  SGPropertyNode* wp1Crs = wp1_node->getChild("desired-course-deg", 0, true);
+  wp1Crs->alias(_gpsNode->getChild("selected-course-deg"));
+    
+//    _true_wp1_bearing_error_node =
+//        wp1_node->getChild("true-bearing-error-deg", 0, true);
+//    _magnetic_wp1_bearing_error_node =
+  //      wp1_node->getChild("magnetic-bearing-error-deg", 0, true);
+
+  _tracking_bug_node = _gpsNode->getChild("tracking-bug", 0, true);
+         
+// reference navid
+  SGPropertyNode_ptr ref_navaid = _gpsNode->getChild("ref-navaid", 0, true);
+  _ref_navaid_id_node = ref_navaid->getChild("id", 0, true);
+  _ref_navaid_name_node = ref_navaid->getChild("name", 0, true);
+  _ref_navaid_bearing_node = ref_navaid->getChild("bearing-deg", 0, true);
+  _ref_navaid_frequency_node = ref_navaid->getChild("frequency-mhz", 0, true);
+  _ref_navaid_distance_node = ref_navaid->getChild("distance-nm", 0, true);
+  _ref_navaid_mag_bearing_node = ref_navaid->getChild("mag-bearing-deg", 0, true);
+  _ref_navaid_elapsed = 0.0;
+  _ref_navaid_set = false;
+    
+// route properties    
+  // should these move to the route manager?
+  _routeDistanceNm = _gpsNode->getChild("route-distance-nm", 0, true);
+  _routeETE = _gpsNode->getChild("ETE", 0, true);
+  _routeEditedSignal = fgGetNode("/autopilot/route-manager/signals/edited", true);
+  _routeFinishedSignal = fgGetNode("/autopilot/route-manager/signals/finished", true);
+  
+// add listener to various things
+  _listener = new GPSListener(this);
+  _route_current_wp_node = fgGetNode("/autopilot/route-manager/current-wp", true);
+  _route_current_wp_node->addChangeListener(_listener);
+  _route_active_node = fgGetNode("/autopilot/route-manager/active", true);
+  _route_active_node->addChangeListener(_listener);
+  _ref_navaid_id_node->addChangeListener(_listener);
+  _routeEditedSignal->addChangeListener(_listener);
+  _routeFinishedSignal->addChangeListener(_listener);
+  
+// navradio slaving properties  
+  SGPropertyNode* toFlag = _gpsNode->getChild("to-flag", 0, true);
+  toFlag->alias(wp1_node->getChild("to-flag"));
+  
+  SGPropertyNode* fromFlag = _gpsNode->getChild("from-flag", 0, true);
+  fromFlag->alias(wp1_node->getChild("from-flag"));
+    
+// autopilot drive properties
+  _apTrueHeading = fgGetNode("/autopilot/settings/true-heading-deg",true);
+  _apTargetAltitudeFt = fgGetNode("/autopilot/settings/target-altitude-ft", true);
+  _apAltitudeLock = fgGetNode("/autopilot/locks/altitude", true);
+  
+// realism prop[s]
+  _realismSimpleGps = fgGetNode("/sim/realism/simple-gps", true);
+  if (!_realismSimpleGps->hasValue()) {
+    _realismSimpleGps->setBoolValue(true);
+  }
+  
+  // last thing, add the deprecated prop watcher
+  new DeprecatedPropListener(_gpsNode);
+  
+  clearOutput();
+}
+
+void
+GPS::bind()
+{
+  _config.bind(this, _gpsNode->getChild("config", 0, true));
+// basic GPS outputs
+  tie(_gpsNode, "selected-course-deg", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getSelectedCourse, NULL));
+  
+  
+  tieSGGeodReadOnly(_gpsNode, _indicated_pos, "indicated-longitude-deg", 
         "indicated-latitude-deg", "indicated-altitude-ft");
-        
-    _indicated_vertical_speed_node =
-        node->getChild("indicated-vertical-speed", 0, true);
-    _true_track_node =
-        node->getChild("indicated-track-true-deg", 0, true);
-    _magnetic_track_node =
-        node->getChild("indicated-track-magnetic-deg", 0, true);
-    _speed_node =
-        node->getChild("indicated-ground-speed-kt", 0, true);
-    _odometer_node =
-        node->getChild("odometer", 0, true);
-    _trip_odometer_node =
-        node->getChild("trip-odometer", 0, true);
-    _true_bug_error_node =
-        node->getChild("true-bug-error-deg", 0, true);
-    _magnetic_bug_error_node =
-        node->getChild("magnetic-bug-error-deg", 0, true);
-
-    _leg_distance_node =
-        wp_node->getChild("leg-distance-nm", 0, true);
-    _leg_course_node =
-        wp_node->getChild("leg-true-course-deg", 0, true);
-    _leg_magnetic_course_node =
-        wp_node->getChild("leg-mag-course-deg", 0, true);
-    _alt_dist_ratio_node =
-        wp_node->getChild("alt-dist-ratio", 0, true);
-    _leg_course_deviation_node =
-        wp_node->getChild("leg-course-deviation-deg", 0, true);
-    _leg_course_error_nm_node =
-        wp_node->getChild("leg-course-error-nm", 0, true);
-    _leg_to_flag_node =
-        wp_node->getChild("leg-to-flag", 0, true);
-    _alt_deviation_node =
-        wp_node->getChild("alt-deviation-ft", 0, true);
-        
-    _serviceable_node->setBoolValue(true);
+
+  tie(_gpsNode, "indicated-vertical-speed", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getVerticalSpeed, NULL));
+  tie(_gpsNode, "indicated-track-true-deg", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getTrueTrack, NULL));
+  tie(_gpsNode, "indicated-track-magnetic-deg", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getMagTrack, NULL));
+  tie(_gpsNode, "indicated-ground-speed-kt", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getGroundspeedKts, NULL));
+  
+// command system    
+  tie(_gpsNode, "mode", SGRawValueMethods<GPS, const char*>(*this, &GPS::getMode, NULL));
+  tie(_gpsNode, "command", SGRawValueMethods<GPS, const char*>(*this, &GPS::getCommand, &GPS::setCommand));
+    
+  tieSGGeod(_scratchNode, _scratchPos, "longitude-deg", "latitude-deg", "altitude-ft");
+  tie(_scratchNode, "valid", SGRawValueMethods<GPS, bool>(*this, &GPS::getScratchValid, NULL));
+  tie(_scratchNode, "distance-nm", SGRawValueMethods<GPS, double>(*this, &GPS::getScratchDistance, NULL));
+  tie(_scratchNode, "true-bearing-deg", SGRawValueMethods<GPS, double>(*this, &GPS::getScratchTrueBearing, NULL));
+  tie(_scratchNode, "mag-bearing-deg", SGRawValueMethods<GPS, double>(*this, &GPS::getScratchMagBearing, NULL));
+  tie(_scratchNode, "has-next", SGRawValueMethods<GPS, bool>(*this, &GPS::getScratchHasNext, NULL));
+  _scratchValid = false;
+  
+// waypoint data (including various historical things)
+  SGPropertyNode *wp_node = _gpsNode->getChild("wp", 0, true);
+  SGPropertyNode *wp0_node = wp_node->getChild("wp", 0, true);
+  SGPropertyNode *wp1_node = wp_node->getChild("wp", 1, true);
+
+  tieSGGeodReadOnly(wp0_node, _wp0_position, "longitude-deg", "latitude-deg", "altitude-ft");
+  tie(wp0_node, "ID", SGRawValueMethods<GPS, const char*>
+    (*this, &GPS::getWP0Ident, NULL));
+  tie(wp0_node, "name", SGRawValueMethods<GPS, const char*>
+    (*this, &GPS::getWP0Name, NULL));
+    
+  tieSGGeodReadOnly(wp1_node, _wp1_position, "longitude-deg", "latitude-deg", "altitude-ft");
+  tie(wp1_node, "ID", SGRawValueMethods<GPS, const char*>
+    (*this, &GPS::getWP1Ident, NULL));
+  tie(wp1_node, "name", SGRawValueMethods<GPS, const char*>
+    (*this, &GPS::getWP1Name, NULL));
+  
+  tie(wp1_node, "distance-nm", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getWP1Distance, NULL));
+  tie(wp1_node, "bearing-true-deg", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getWP1Bearing, NULL));
+  tie(wp1_node, "bearing-mag-deg", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getWP1MagBearing, NULL));
+  tie(wp1_node, "TTW-sec", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getWP1TTW, NULL));
+  tie(wp1_node, "TTW", SGRawValueMethods<GPS, const char*>
+    (*this, &GPS::getWP1TTWString, NULL));
+  
+  tie(wp1_node, "course-deviation-deg", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getWP1CourseDeviation, NULL));
+  tie(wp1_node, "course-error-nm", SGRawValueMethods<GPS, double>
+    (*this, &GPS::getWP1CourseErrorNm, NULL));
+  tie(wp1_node, "to-flag", SGRawValueMethods<GPS, bool>
+    (*this, &GPS::getWP1ToFlag, NULL));
+  tie(wp1_node, "from-flag", SGRawValueMethods<GPS, bool>
+    (*this, &GPS::getWP1FromFlag, NULL));
+
+// leg properties (only valid in DTO/LEG modes, not OBS)
+  tie(wp_node, "leg-distance-nm", SGRawValueMethods<GPS, double>(*this, &GPS::getLegDistance, NULL));
+  tie(wp_node, "leg-true-course-deg", SGRawValueMethods<GPS, double>(*this, &GPS::getLegCourse, NULL));
+  tie(wp_node, "leg-mag-course-deg", SGRawValueMethods<GPS, double>(*this, &GPS::getLegMagCourse, NULL));
+  tie(wp_node, "alt-dist-ratio", SGRawValueMethods<GPS, double>(*this, &GPS::getAltDistanceRatio, NULL));
+
+// navradio slaving properties  
+  tie(_gpsNode, "cdi-deflection", SGRawValueMethods<GPS,double>
+    (*this, &GPS::getCDIDeflection));
+}
+
+void
+GPS::unbind()
+{
+  for (unsigned int t=0; t<_tiedNodes.size(); ++t) {
+    _tiedNodes[t]->untie();
+  }
+  _tiedNodes.clear();
 }
 
 void
 GPS::clearOutput()
 {
-    _last_valid = false;
-    _last_speed_kts = 0;
-    _last_pos = SGGeod();
-    _raim_node->setDoubleValue(false);
-    _indicated_pos = SGGeod();
-         _indicated_vertical_speed_node->setDoubleValue(0);
-    _true_track_node->setDoubleValue(0);
-    _magnetic_track_node->setDoubleValue(0);
-    _speed_node->setDoubleValue(0);
-    _wp1_distance_node->setDoubleValue(0);
-    _wp1_bearing_node->setDoubleValue(0);
-    _wp1_position = SGGeod();
-    _wp1_course_node->setDoubleValue(0);
-    _odometer_node->setDoubleValue(0);
-    _trip_odometer_node->setDoubleValue(0);
-    _tracking_bug_node->setDoubleValue(0);
-    _true_bug_error_node->setDoubleValue(0);
-    _magnetic_bug_error_node->setDoubleValue(0);
-         _true_wp1_bearing_error_node->setDoubleValue(0);
-         _magnetic_wp1_bearing_error_node->setDoubleValue(0);
+  _dataValid = false;
+  _last_speed_kts = 0.0;
+  _last_pos = SGGeod();
+  _lastPosValid = false;
+  _indicated_pos = SGGeod();
+  _last_vertical_speed = 0.0;
+  _last_true_track = 0.0;
+  
+  _raim_node->setDoubleValue(0.0);
+  _indicated_pos = SGGeod();
+  _wp1DistanceM = 0.0;
+  _wp1TrueBearing = 0.0;
+  _wp1_position = SGGeod();
+  _odometer_node->setDoubleValue(0);
+  _trip_odometer_node->setDoubleValue(0);
+  _tracking_bug_node->setDoubleValue(0);
+  _true_bug_error_node->setDoubleValue(0);
+  _magnetic_bug_error_node->setDoubleValue(0);
 }
 
 void
 GPS::update (double delta_time_sec)
 {
-   // If it's off, don't bother.
+  if (!_realismSimpleGps->getBoolValue()) {
+    // If it's off, don't bother.
     if (!_serviceable_node->getBoolValue() || !_electrical_node->getBoolValue()) {
-        clearOutput();
-        return;
+      clearOutput();
+      return;
     }
-
-    UpdateContext ctx;
-    ctx.dt = delta_time_sec;
-    ctx.waypoint_changed = false;
-    ctx.pos = _position.get();
-    
+  }
+  
+  if (delta_time_sec <= 0.0) {
+    return; // paused, don't bother
+  }    
     // TODO: Add noise and other errors.
 /*
 
@@ -256,343 +534,1259 @@ GPS::update (double delta_time_sec)
     printf("%f %f \n", error_length, error_angle);
 
 */
-    _raim_node->setBoolValue(true);
-    _indicated_pos = ctx.pos;
+  _raim_node->setDoubleValue(1.0);
+  _indicated_pos = _position.get();
+  updateBasicData(delta_time_sec);
 
-    if (_last_valid) {
-        updateWithValid(ctx);
+  if (_dataValid) {
+    if (_mode == "obs") {
+      _selectedCourse = _config.getExternalCourse();
     } else {
-        _true_track_node->setDoubleValue(0.0);
-        _magnetic_track_node->setDoubleValue(0.0);
-        _speed_node->setDoubleValue(0.0);
-        _last_valid = true;
+      updateTurn();
     }
+      
+    updateWaypoints();
+    updateTrackingBug();
+    updateReferenceNavaid(delta_time_sec);
+    updateRouteData();
+    driveAutopilot();
+  }
+  
+  if (_dataValid && (_mode == "init")) {
+    // allow a realistic delay in the future, here
+    SG_LOG(SG_INSTR, SG_INFO, "GPS initialisation complete");
+    
+    _selectedCourse = _config.getExternalCourse();
+    
+    if (_route_active_node->getBoolValue()) {
+      // GPS init with active route
+      SG_LOG(SG_INSTR, SG_INFO, "GPS init with active route");
+      selectLegMode();
+    } else {
+      // initialise in OBS mode, with waypt set to the nearest airport.
+      // keep in mind at this point, _dataValid is not set
+    
+      auto_ptr<FGPositioned::Filter> f(createFilter(FGPositioned::AIRPORT));
+      FGPositionedRef apt = FGPositioned::findClosest(_position.get(), 20.0, f.get());
+      if (apt) {
+        setScratchFromPositioned(apt, 0);
+        selectOBSMode();
+      }
+    }
+  } // of init mode check
+  
+  _last_pos = _indicated_pos;
+  _lastPosValid = true;
+}
 
-    _last_pos = ctx.pos;
+void
+GPS::updateBasicData(double dt)
+{
+  if (!_lastPosValid) {
+    return;
+  }
+  
+  double distance_m;
+  double track2_deg;
+  SGGeodesy::inverse(_last_pos, _indicated_pos, _last_true_track, track2_deg, distance_m );
+    
+  double speed_kt = ((distance_m * SG_METER_TO_NM) * ((1 / dt) * 3600.0));
+  double vertical_speed_mpm = ((_indicated_pos.getElevationM() - _last_pos.getElevationM()) * 60 / dt);
+  _last_vertical_speed = vertical_speed_mpm * SG_METER_TO_FEET;
+  
+  speed_kt = fgGetLowPass(_last_speed_kts, speed_kt, dt/20.0);
+  _last_speed_kts = speed_kt;
+  
+  double odometer = _odometer_node->getDoubleValue();
+  _odometer_node->setDoubleValue(odometer + distance_m * SG_METER_TO_NM);
+  odometer = _trip_odometer_node->getDoubleValue();
+  _trip_odometer_node->setDoubleValue(odometer + distance_m * SG_METER_TO_NM);
+  
+  if (!_dataValid) {
+    SG_LOG(SG_INSTR, SG_INFO, "GPS setting data valid");
+    _dataValid = true;
+  }
 }
 
 void
-GPS::updateNearestAirport(UpdateContext& ctx)
+GPS::updateTrackingBug()
 {
-    if (!_get_nearest_airport_node->getBoolValue()) {
-        return;
+  double tracking_bug = _tracking_bug_node->getDoubleValue();
+  double true_bug_error = tracking_bug - getTrueTrack();
+  double magnetic_bug_error = tracking_bug - getMagTrack();
+
+  // Get the errors into the (-180,180) range.
+  SG_NORMALIZE_RANGE(true_bug_error, -180.0, 180.0);
+  SG_NORMALIZE_RANGE(magnetic_bug_error, -180.0, 180.0);
+
+  _true_bug_error_node->setDoubleValue(true_bug_error);
+  _magnetic_bug_error_node->setDoubleValue(magnetic_bug_error);
+}
+
+void
+GPS::updateWaypoints()
+{  
+  double az2;
+  SGGeodesy::inverse(_indicated_pos, _wp1_position, _wp1TrueBearing, az2,_wp1DistanceM);
+}
+
+void GPS::updateReferenceNavaid(double dt)
+{
+  if (!_ref_navaid_set) {
+    _ref_navaid_elapsed += dt;
+    if (_ref_navaid_elapsed > 5.0) {
+      _ref_navaid_elapsed = 0.0;
+
+      FGPositioned::TypeFilter vorFilter(FGPositioned::VOR);
+      FGPositionedRef nav = FGPositioned::findClosest(_indicated_pos, 400.0, &vorFilter);
+      if (!nav) {
+        SG_LOG(SG_INSTR, SG_INFO, "GPS couldn't find a reference navid");
+        _ref_navaid_id_node->setStringValue("");
+        _ref_navaid_name_node->setStringValue("");
+        _ref_navaid_bearing_node->setDoubleValue(0.0);
+        _ref_navaid_mag_bearing_node->setDoubleValue(0.0);
+        _ref_navaid_distance_node->setDoubleValue(0.0);
+        _ref_navaid_frequency_node->setStringValue("");
+      } else if (nav != _ref_navaid) {
+        SG_LOG(SG_INSTR, SG_INFO, "GPS code selected new ref-navaid:" << nav->ident());
+        _listener->setGuard(true);
+        _ref_navaid_id_node->setStringValue(nav->ident().c_str());
+        _ref_navaid_name_node->setStringValue(nav->name().c_str());
+        FGNavRecord* vor = (FGNavRecord*) nav.ptr();
+        _ref_navaid_frequency_node->setDoubleValue(vor->get_freq() / 100.0);
+        _listener->setGuard(false);
+        tuneNavRadios();
+      } else {
+        // SG_LOG(SG_INSTR, SG_ALERT, "matched existing");
+      }
+      
+      _ref_navaid = nav;
     }
+  }
+  
+  if (_ref_navaid) {
+    double trueCourse, distanceM, az2;
+    SGGeodesy::inverse(_indicated_pos, _ref_navaid->geod(), trueCourse, az2, distanceM);
+    _ref_navaid_distance_node->setDoubleValue(distanceM * SG_METER_TO_NM);
+    _ref_navaid_bearing_node->setDoubleValue(trueCourse);
+    _ref_navaid_mag_bearing_node->setDoubleValue(trueCourse - _magvar_node->getDoubleValue());
+  }
+}
+
+void GPS::referenceNavaidSet(const std::string& aNavaid)
+{
+  _ref_navaid = NULL;
+  // allow setting an empty string to restore normal nearest-vor selection
+  if (aNavaid.size() > 0) {
+    FGPositioned::TypeFilter vorFilter(FGPositioned::VOR);
+    _ref_navaid = FGPositioned::findClosestWithIdent(aNavaid, 
+      _position.get(), &vorFilter);
     
-    // If the get-nearest-airport-node is true.
-    // Get the nearest airport, and set it as waypoint 1.
-    
-    FGPositioned::TypeFilter aptFilter(FGPositioned::AIRPORT);
-    FGPositionedRef a = FGPositioned::findClosest(ctx.pos, 360.0, &aptFilter);
-    if (!a) {
-        return;
+    if (!_ref_navaid) {
+      SG_LOG(SG_INSTR, SG_ALERT, "GPS: unknown ref navaid:" << aNavaid);
     }
+  }
 
-    _wp1_position = a->geod();
-    _wp1_ID_node->setStringValue(a->ident().c_str());
-    _wp1_name_node->setStringValue(a->name().c_str());
-    _get_nearest_airport_node->setBoolValue(false);
-    _last_wp1_ID = a->ident(); // don't trigger updateWaypoint1();
-    ctx.waypoint_changed = true;
+  if (_ref_navaid) {
+    _ref_navaid_set = true;
+    SG_LOG(SG_INSTR, SG_INFO, "GPS code set explict ref-navaid:" << _ref_navaid->ident());
+    _ref_navaid_id_node->setStringValue(_ref_navaid->ident().c_str());
+    _ref_navaid_name_node->setStringValue(_ref_navaid->name().c_str());
+    FGNavRecord* vor = (FGNavRecord*) _ref_navaid.ptr();
+    _ref_navaid_frequency_node->setDoubleValue(vor->get_freq() / 100.0);
+    tuneNavRadios();
+  } else {
+    _ref_navaid_set = false;
+    _ref_navaid_elapsed = 9999.0; // update next tick
+  }
 }
 
-void
-GPS::updateWithValid(UpdateContext& ctx)
+void GPS::tuneNavRadios()
 {
-    assert(_last_valid);
-    double distance_m;
-    SGGeodesy::inverse(_last_pos, ctx.pos, ctx.track1_deg, ctx.track2_deg, distance_m );
-    
-    ctx.speed_kt = ((distance_m * SG_METER_TO_NM) * ((1 / ctx.dt) * 3600.0));
-    
-    double vertical_speed_mpm = ((ctx.pos.getElevationM() - _last_pos.getElevationM()) * 60 /
-                             ctx.dt);
-         _indicated_vertical_speed_node->setDoubleValue(vertical_speed_mpm * SG_METER_TO_FEET);
-    _true_track_node->setDoubleValue(ctx.track1_deg);
+  if (!_ref_navaid || !_config.tuneNavRadioToRefVor()) {
+    return;
+  }
+  
+  SGPropertyNode_ptr navRadio1 = fgGetNode("/instrumentation/nav", false);
+  if (!navRadio1) {
+    return;
+  }
+  
+  FGNavRecord* vor = (FGNavRecord*) _ref_navaid.ptr();
+  SGPropertyNode_ptr freqs = navRadio1->getChild("frequencies");
+  freqs->setDoubleValue("selected-mhz", vor->get_freq() / 100.0);
+}
+
+void GPS::routeActivated()
+{
+  if (_route_active_node->getBoolValue()) {
+    SG_LOG(SG_INSTR, SG_INFO, "GPS::route activated, switching to LEG mode");
+    selectLegMode();
     
-    ctx.magvar_deg = _magvar_node->getDoubleValue();
-    double mag_track_bearing = ctx.track1_deg - ctx.magvar_deg;
-    SG_NORMALIZE_RANGE(mag_track_bearing, 0.0, 360.0);
-    _magnetic_track_node->setDoubleValue(mag_track_bearing);
-    ctx.speed_kt = fgGetLowPass(_last_speed_kts, ctx.speed_kt, ctx.dt/20.0);
-    _last_speed_kts = ctx.speed_kt;
-    _speed_node->setDoubleValue(ctx.speed_kt);
-
-    double odometer = _odometer_node->getDoubleValue();
-    _odometer_node->setDoubleValue(odometer + distance_m * SG_METER_TO_NM);
-    odometer = _trip_odometer_node->getDoubleValue();
-    _trip_odometer_node->setDoubleValue(odometer + distance_m * SG_METER_TO_NM);
-  
-    updateNearestAirport(ctx);
-    updateWaypoint0(ctx);
-    updateWaypoint1(ctx);
-
-    ctx.wp0_pos = _wp0_position.get();
-    ctx.wp1_pos = _wp1_position.get();
-    // if this flag is set, we need to recompute leg data, because either
-    // WP0 or WP1 has been updated
-    if (ctx.waypoint_changed) {
-      waypointChanged(ctx);
+    // if we've already passed the current waypoint, sequence.
+    if (_dataValid && getWP1FromFlag()) {
+      SG_LOG(SG_INSTR, SG_INFO, "GPS::route activated, FROM wp1, sequencing");
+      _routeMgr->sequence();
     }
+  } else if (_mode == "leg") {
+    SG_LOG(SG_INSTR, SG_INFO, "GPS::route deactivated, switching to OBS mode");
+    selectOBSMode();
+  }
+}
 
-    ctx.wp0_course_deg = _wp0_course_node->getDoubleValue();
-    ctx.wp1_course_deg = _wp1_course_node->getDoubleValue();
-    
-    updateWaypoint0Course(ctx);
-    updateWaypoint1Course(ctx);
-    updateLegCourse(ctx);
-  
-    // Altitude deviation
-    //double desired_altitude_m = wp1_altitude_m
-    //        + wp1_distance * _alt_dist_ratio;
-    //double altitude_deviation_m = altitude_m - desired_altitude_m;
-    //    _alt_deviation_node->setDoubleValue(altitude_deviation_m * SG_METER_TO_FEET);
-    
-    updateTrackingBug(ctx);
+void GPS::routeManagerSequenced()
+{
+  if (_mode != "leg") {
+    SG_LOG(SG_INSTR, SG_INFO, "GPS ignoring route sequencing, not in LEG mode");
+    return;
+  }
+  
+  int index = _routeMgr->currentWaypoint(),
+    count = _routeMgr->size();
+  if ((index < 0) || (index >= count)) {
+    SG_LOG(SG_INSTR, SG_ALERT, "GPS: malformed route, index=" << index);
+    return;
+  }
+  
+  SG_LOG(SG_INSTR, SG_INFO, "GPS waypoint index is now " << index);
+  
+  if (index > 0) {
+    SGWayPoint wp0(_routeMgr->get_waypoint(index - 1));
+    _wp0Ident = wp0.get_id();
+    _wp0Name = wp0.get_name();
+    _wp0_position = wp0.get_target();
+
+  }
+  
+  SGWayPoint wp1(_routeMgr->get_waypoint(index));
+  _wp1Ident = wp1.get_id();
+  _wp1Name = wp1.get_name();
+  _wp1_position = wp1.get_target();
+
+  _selectedCourse = getLegMagCourse();
+  wp1Changed();
 }
 
-void
-GPS::updateLegCourse(UpdateContext& ctx)
+void GPS::routeEdited()
 {
-     // Leg course deviation is the diffenrence between the bearing
-    // and the course.
-    double course_deviation_deg = ctx.wp1_bearing_deg - _course_deg;
-    SG_NORMALIZE_RANGE(course_deviation_deg, -180.0, 180.0);
-        
-    // If the course deviation is less than 90 degrees to either side,
-    // our desired course is towards the waypoint.
-    // It does not matter if we are actually moving 
-    // towards or from the waypoint.
-    if (fabs(course_deviation_deg) < 90.0) {
-        _leg_to_flag_node->setBoolValue(true); 
-    }
-    // If it's more than 90 degrees the desired
-    // course is from the waypoint.
-    else if (fabs(course_deviation_deg) > 90.0) {
-        _leg_to_flag_node->setBoolValue(false);
-        // When the course is away from the waypoint, 
-        // it makes sense to change the sign of the deviation.
-        course_deviation_deg *= -1.0;
-        SG_NORMALIZE_RANGE(course_deviation_deg, -90.0, 90.0);
+  if (_mode != "leg") {
+    return;
+  }
+  
+  SG_LOG(SG_INSTR, SG_INFO, "GPS route edited while in LEG mode, updating waypoints");
+  routeManagerSequenced();
+}
+
+void GPS::routeFinished()
+{
+  if (_mode != "leg") {
+    return;
+  }
+  
+  SG_LOG(SG_INSTR, SG_INFO, "GPS route finished, reverting to OBS");
+  _mode = "obs";
+  _wp0_position = _indicated_pos;
+  wp1Changed();
+}
+
+void GPS::updateTurn()
+{
+  bool printProgress = false;
+  
+  if (_computeTurnData) {
+    if (_last_speed_kts < 60) {
+      // need valid leg course and sensible ground speed to compute the turn
+      return;
     }
     
-    _leg_course_deviation_node->setDoubleValue(course_deviation_deg);
-        
-    // Cross track error.
-    double course_error_m = sin(course_deviation_deg * SG_PI / 180.0)
-            * (_distance_m);
-    _leg_course_error_nm_node->setDoubleValue(course_error_m * SG_METER_TO_NM);
+    computeTurnData();
+    printProgress = true;
+  }
+  
+  if (!_anticipateTurn) {
+    updateOverflight();
+    return;
+  }
 
+  updateTurnData();
+  // find bearing to turn centre
+  double bearing, az2, distanceM;
+  SGGeodesy::inverse(_indicated_pos, _turnCentre, bearing, az2, distanceM);
+  double progress = computeTurnProgress(bearing);
+  
+  if (printProgress) {
+    SG_LOG(SG_INSTR, SG_INFO,"turn progress=" << progress);
+  }
+  
+  if (!_inTurn && (progress > 0.0)) {
+    beginTurn();
+  }
+  
+  if (_inTurn && !_turnSequenced && (progress > 0.5)) {
+    _turnSequenced = true;
+     SG_LOG(SG_INSTR, SG_INFO, "turn passed midpoint, sequencing");
+     _routeMgr->sequence();
+  }
+  
+  if (_inTurn && (progress >= 1.0)) {
+    endTurn();
+  }
+  
+  if (_inTurn) {
+    // drive deviation and desired course
+    double desiredCourse = bearing - copysign(90, _turnAngle);
+    SG_NORMALIZE_RANGE(desiredCourse, 0.0, 360.0);
+    double deviationNm = (distanceM * SG_METER_TO_NM) - _turnRadius;
+    double deviationDeg = desiredCourse - getMagTrack();
+    deviationNm = copysign(deviationNm, deviationDeg);
+    // FXIME
+    //_wp1_course_deviation_node->setDoubleValue(deviationDeg);
+    //_wp1_course_error_nm_node->setDoubleValue(deviationNm);
+    //_cdiDeflectionNode->setDoubleValue(deviationDeg);
+  }
 }
 
-void
-GPS::updateTrackingBug(UpdateContext& ctx)
+void GPS::updateOverflight()
 {
-    double tracking_bug = _tracking_bug_node->getDoubleValue();
-    double true_bug_error = tracking_bug - ctx.track1_deg;
-    double magnetic_bug_error = tracking_bug - _magnetic_track_node->getDoubleValue();
+  if ((_wp1DistanceM * SG_METER_TO_NM) > _config.overflightArmDistanceNm()) {
+    return;
+  }
+  
+  if (getWP1ToFlag()) {
+    return; // still heading towards the WP
+  }
+  
+  if (_mode == "dto") {
+    SG_LOG(SG_INSTR, SG_INFO, "GPS DTO reached destination point");
+    
+    // check for wp1 being on active route - resume leg mode
+    if (_routeMgr->isRouteActive()) {
+      int index = _routeMgr->findWaypoint(_wp1_position);
+      if (index >= 0) {
+        SG_LOG(SG_INSTR, SG_INFO, "GPS DTO, resuming LEG mode at wp:" << index);
+        _mode = "leg";
+        _routeMgr->jumpToIndex(index);
+      }
+    }
+  } else if (_mode == "leg") {
+    SG_LOG(SG_INSTR, SG_INFO, "GPS doing overflight sequencing");
+    _routeMgr->sequence();
+  } else if (_mode == "obs") {
+    // nothing to do here, TO/FROM will update but that's fine
+  }
+  
+  _computeTurnData = true;
+}
 
-    // Get the errors into the (-180,180) range.
-    SG_NORMALIZE_RANGE(true_bug_error, -180.0, 180.0);
-    SG_NORMALIZE_RANGE(magnetic_bug_error, -180.0, 180.0);
+void GPS::beginTurn()
+{
+  _inTurn = true;
+  _turnSequenced = false;
+  SG_LOG(SG_INSTR, SG_INFO, "begining turn");
+}
 
-    _true_bug_error_node->setDoubleValue(true_bug_error);
-    _magnetic_bug_error_node->setDoubleValue(magnetic_bug_error);
+void GPS::endTurn()
+{
+  _inTurn = false;
+  SG_LOG(SG_INSTR, SG_INFO, "ending turn");
+  _computeTurnData = true;
 }
 
-void
-GPS::waypointChanged(UpdateContext& ctx)
+double GPS::computeTurnProgress(double aBearing) const
 {
-    // If any of the two waypoints have changed
-    // we need to calculate a new course between them,
-    // and values for vertical navigation.
-    assert(ctx.waypoint_changed);
+  double startBearing = _turnStartBearing + copysign(90, _turnAngle);
+  return (aBearing - startBearing) / _turnAngle;
+}
 
-    double track2;
-    SGGeodesy::inverse(ctx.wp0_pos, ctx.wp1_pos, _course_deg, track2, _distance_m);
-    
-    double leg_mag_course = _course_deg - _magvar_node->getDoubleValue();
-    SG_NORMALIZE_RANGE(leg_mag_course, 0.0, 360.0);
+void GPS::computeTurnData()
+{
+  _computeTurnData = false;
+  if (_mode != "leg") { // and approach modes in the future
+    _anticipateTurn = false;
+    return;
+  }
+  
+  int curIndex = _routeMgr->currentWaypoint();
+  if ((curIndex + 1) >= _routeMgr->size()) {
+    _anticipateTurn = false;
+    return;
+  }
+  
+  if (!_config.turnAnticipationEnabled()) {
+    _anticipateTurn = false;
+    return;
+  }
+  
+  _turnStartBearing = _selectedCourse;
+// compute next leg course
+  SGWayPoint wp1(_routeMgr->get_waypoint(curIndex)),
+    wp2(_routeMgr->get_waypoint(curIndex + 1));
+  double crs, dist;
+  wp2.CourseAndDistance(wp1, &crs, &dist);
+  
 
-    // Get the altitude / distance ratio
-    if ( _distance_m > 0.0 ) {
-        double alt_difference_m = ctx.wp0_pos.getElevationM() - ctx.wp1_pos.getElevationM();
-        _alt_dist_ratio = alt_difference_m / _distance_m;
-    }
+// compute offset bearing
+  _turnAngle = crs - _turnStartBearing;
+  SG_NORMALIZE_RANGE(_turnAngle, -180.0, 180.0);
+  double median = _turnStartBearing + (_turnAngle * 0.5);
+  double offsetBearing = median + copysign(90, _turnAngle);
+  SG_NORMALIZE_RANGE(offsetBearing, 0.0, 360.0);
+  
+  SG_LOG(SG_INSTR, SG_INFO, "GPS computeTurnData: in=" << _turnStartBearing <<
+    ", out=" << crs << "; turnAngle=" << _turnAngle << ", median=" << median 
+    << ", offset=" << offsetBearing);
+
+  SG_LOG(SG_INSTR, SG_INFO, "next leg is now:" << wp1.get_id() << "->" << wp2.get_id());
 
-    _leg_distance_node->setDoubleValue(_distance_m * SG_METER_TO_NM);
-    _leg_course_node->setDoubleValue(_course_deg);
-    _leg_magnetic_course_node->setDoubleValue(leg_mag_course);
-    _alt_dist_ratio_node->setDoubleValue(_alt_dist_ratio);
+  _turnPt = _wp1_position;
+  _anticipateTurn = true;
 }
 
-void
-GPS::updateWaypoint0(UpdateContext& ctx)
+void GPS::updateTurnData()
 {
-    string id(_wp0_ID_node->getStringValue());
-    if (_last_wp0_ID == id) {
-        return; // easy, nothing to do
+  // depends on ground speed, so needs to be updated per-frame
+  _turnRadius = computeTurnRadiusNm(_last_speed_kts);
+  
+  // compute the turn centre, based on the turn radius.
+  // key thing is to understand that we're working a right-angle triangle,
+  // where the right-angle is the point we start the turn. From that point,
+  // one side is the inbound course to the turn pt, and the other is the
+  // perpendicular line, of length 'r', to the turn centre.
+  // the triangle's hypotenuse, which we need to find, is the distance from the
+  // turn pt to the turn center (in the direction of the offset bearing)
+  // note that d - _turnRadius tell us how much we're 'cutting' the corner.
+  
+  double halfTurnAngle = fabs(_turnAngle * 0.5) * SG_DEGREES_TO_RADIANS;
+  double d = _turnRadius / cos(halfTurnAngle);
+  
+ // SG_LOG(SG_INSTR, SG_INFO, "turnRadius=" << _turnRadius << ", d=" << d
+ //   << " (cut distance=" << d - _turnRadius << ")");
+  
+  double median = _turnStartBearing + (_turnAngle * 0.5);
+  double offsetBearing = median + copysign(90, _turnAngle);
+  SG_NORMALIZE_RANGE(offsetBearing, 0.0, 360.0);
+  
+  double az2;
+  SGGeodesy::direct(_turnPt, offsetBearing, d * SG_NM_TO_METER, _turnCentre, az2); 
+}
+
+double GPS::computeTurnRadiusNm(double aGroundSpeedKts) const
+{
+       // turn time is seconds to execute a 360 turn. 
+  double turnTime = 360.0 / _config.turnRateDegSec();
+  
+  // c is ground distance covered in that time (circumference of the circle)
+       double c = turnTime * (aGroundSpeedKts / 3600.0); // convert knts to nm/sec
+  
+  // divide by 2PI to go from circumference -> radius
+       return c / (2 * M_PI);
+}
+
+void GPS::updateRouteData()
+{
+  double totalDistance = _wp1DistanceM * SG_METER_TO_NM;
+  // walk all waypoints from wp2 to route end, and sum
+  for (int i=_routeMgr->currentWaypoint()+1; i<_routeMgr->size(); ++i) {
+    totalDistance += _routeMgr->get_waypoint(i).get_distance();
+  }
+  
+  _routeDistanceNm->setDoubleValue(totalDistance * SG_METER_TO_NM);
+  if (_last_speed_kts > 1.0) {
+    double TTW = ((totalDistance * SG_METER_TO_NM) / _last_speed_kts) * 3600.0;
+    _routeETE->setStringValue(makeTTWString(TTW));    
+  }
+}
+
+void GPS::driveAutopilot()
+{
+  if (!_config.driveAutopilot() || !_realismSimpleGps->getBoolValue()) {
+    return;
+  }
+  // compatability feature - allow the route-manager / GPS to drive the
+  // generic autopilot heading hold *in leg mode only* 
+  if (_mode == "leg") {
+    // FIXME: we want to set desired track, not heading, here
+    _apTrueHeading->setDoubleValue(getWP1Bearing());
+  }
+}
+
+void GPS::wp1Changed()
+{
+  // update external HSI/CDI/NavDisplay/PFD/etc
+  _config.setExternalCourse(getLegMagCourse());
+
+  if (!_config.driveAutopilot()) {
+    return;
+  }
+  
+  double altFt = _wp1_position.getElevationFt();
+  if (altFt < -9990.0) {
+    _apTargetAltitudeFt->setDoubleValue(0.0);
+  } else {
+    _apTargetAltitudeFt->setDoubleValue(altFt);
+  }
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// property getter/setters
+
+double GPS::getLegDistance() const
+{
+  if (!_dataValid || (_mode == "obs")) {
+    return -1;
+  }
+  
+  return SGGeodesy::distanceNm(_wp0_position, _wp1_position);
+}
+
+double GPS::getLegCourse() const
+{
+  if (!_dataValid) {
+    return -9999.0;
+  }
+  
+  return SGGeodesy::courseDeg(_wp0_position, _wp1_position);
+}
+
+double GPS::getLegMagCourse() const
+{
+  if (!_dataValid) {
+    return 0.0;
+  }
+  
+  double m = getLegCourse() - _magvar_node->getDoubleValue();
+  SG_NORMALIZE_RANGE(m, 0.0, 360.0);
+  return m;
+}
+
+double GPS::getAltDistanceRatio() const
+{
+  if (!_dataValid || (_mode == "obs")) {
+    return 0.0;
+  }
+  
+  double dist = SGGeodesy::distanceM(_wp0_position, _wp1_position);
+  if ( dist <= 0.0 ) {
+    return 0.0;
+  }
+  
+  double alt_difference_m = _wp0_position.getElevationM() - _wp1_position.getElevationM();
+  return alt_difference_m / dist;
+}
+
+double GPS::getMagTrack() const
+{
+  if (!_dataValid) {
+    return 0.0;
+  }
+  
+  double m = getTrueTrack() - _magvar_node->getDoubleValue();
+  SG_NORMALIZE_RANGE(m, 0.0, 360.0);
+  return m;
+}
+
+double GPS::getCDIDeflection() const
+{
+  if (!_dataValid) {
+    return 0.0;
+  }
+  
+  double defl;
+  if (_config.cdiDeflectionIsAngular()) {
+    defl = getWP1CourseDeviation();
+    SG_CLAMP_RANGE(defl, -10.0, 10.0); // as in navradio.cxx
+  } else {
+    double fullScale = _config.cdiDeflectionLinearPeg();
+    double normError = getWP1CourseErrorNm() / fullScale;
+    SG_CLAMP_RANGE(normError, -1.0, 1.0);
+    defl = normError * 10.0; // re-scale to navradio limits, i.e [-10.0 .. 10.0]
+  }
+  
+  return defl;
+}
+
+const char* GPS::getWP0Ident() const
+{
+  if (!_dataValid || (_mode != "leg")) {
+    return "";
+  }
+  
+  return _wp0Ident.c_str();
+}
+
+const char* GPS::getWP0Name() const
+{
+  if (!_dataValid || (_mode != "leg")) {
+    return "";
+  }
+  
+  return _wp0Name.c_str();
+}
+
+const char* GPS::getWP1Ident() const
+{
+  if (!_dataValid) {
+    return "";
+  }
+  
+  return _wp1Ident.c_str();
+}
+
+const char* GPS::getWP1Name() const
+{
+  if (!_dataValid) {
+    return "";
+  }
+
+  return _wp1Name.c_str();
+}
+
+double GPS::getWP1Distance() const
+{
+  if (!_dataValid) {
+    return -1.0;
+  }
+  
+  return _wp1DistanceM * SG_METER_TO_NM;
+}
+
+double GPS::getWP1TTW() const
+{
+  if (!_dataValid) {
+    return -1.0;
+  }
+  
+  if (_last_speed_kts < 1.0) {
+    return -1.0;
+  }
+  
+  return (getWP1Distance() / _last_speed_kts) * 3600.0;
+}
+
+const char* GPS::getWP1TTWString() const
+{
+  if (!_dataValid) {
+    return "";
+  }
+  
+  return makeTTWString(getWP1TTW());
+}
+
+double GPS::getWP1Bearing() const
+{
+  if (!_dataValid) {
+    return -9999.0;
+  }
+  
+  return _wp1TrueBearing;
+}
+
+double GPS::getWP1MagBearing() const
+{
+  if (!_dataValid) {
+    return -9999.0;
+  }
+
+  return _wp1TrueBearing - _magvar_node->getDoubleValue();
+}
+
+double GPS::getWP1CourseDeviation() const
+{
+  if (!_dataValid) {
+    return 0.0;
+  }
+  
+  double dev = getWP1MagBearing() - _selectedCourse;
+  SG_NORMALIZE_RANGE(dev, -180.0, 180.0);
+  
+  if (fabs(dev) > 90.0) {
+    // When the course is away from the waypoint, 
+    // it makes sense to change the sign of the deviation.
+    dev *= -1.0;
+    SG_NORMALIZE_RANGE(dev, -90.0, 90.0);
+  }
+  
+  return dev;
+}
+
+double GPS::getWP1CourseErrorNm() const
+{
+  if (!_dataValid) {
+    return 0.0;
+  }
+  
+  double radDev = getWP1CourseDeviation() * SG_DEGREES_TO_RADIANS;
+  double course_error_m = sin(radDev) * _wp1DistanceM;
+  return course_error_m * SG_METER_TO_NM;
+}
+
+bool GPS::getWP1ToFlag() const
+{
+  if (!_dataValid) {
+    return false;
+  }
+  
+  double dev = getWP1MagBearing() - _selectedCourse;
+  SG_NORMALIZE_RANGE(dev, -180.0, 180.0);
+
+  return (fabs(dev) < 90.0);
+}
+
+bool GPS::getWP1FromFlag() const
+{
+  if (!_dataValid) {
+    return false;
+  }
+  
+  return !getWP1ToFlag();
+}
+
+double GPS::getScratchDistance() const
+{
+  if (!_scratchValid) {
+    return 0.0;
+  }
+  
+  return SGGeodesy::distanceNm(_indicated_pos, _scratchPos);
+}
+
+double GPS::getScratchTrueBearing() const
+{
+  if (!_scratchValid) {
+    return 0.0;
+  }
+
+  return SGGeodesy::courseDeg(_indicated_pos, _scratchPos);
+}
+
+double GPS::getScratchMagBearing() const
+{
+  if (!_scratchValid) {
+    return 0.0;
+  }
+  
+  double crs = getScratchTrueBearing() - _magvar_node->getDoubleValue();
+  SG_NORMALIZE_RANGE(crs, 0.0, 360.0);
+  return crs;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// command / scratch / search system
+
+void GPS::setCommand(const char* aCmd)
+{
+  SG_LOG(SG_INSTR, SG_INFO, "GPS command:" << aCmd);
+  
+  if (!strcmp(aCmd, "direct")) {
+    directTo();
+  } else if (!strcmp(aCmd, "obs")) {
+    selectOBSMode();
+  } else if (!strcmp(aCmd, "leg")) {
+    selectLegMode();
+  } else if (!strcmp(aCmd, "load-route-wpt")) {
+    loadRouteWaypoint();
+  } else if (!strcmp(aCmd, "nearest")) {
+    loadNearest();
+  } else if (!strcmp(aCmd, "search")) {
+    _searchNames = false;
+    search();
+  } else if (!strcmp(aCmd, "search-names")) {
+    _searchNames = true;
+    search();
+  } else if (!strcmp(aCmd, "next")) {
+    nextResult();
+  } else if (!strcmp(aCmd, "previous")) {
+    previousResult();
+  } else if (!strcmp(aCmd, "define-user-wpt")) {
+    defineWaypoint();
+  } else if (!strcmp(aCmd, "route-insert-before")) {
+    int index = _scratchNode->getIntValue("index");
+    if (index < 0 || (_routeMgr->size() == 0)) {
+      index = _routeMgr->size();
+    } else if (index >= _routeMgr->size()) {
+      SG_LOG(SG_INSTR, SG_WARN, "GPS:route-insert-before, bad index:" << index);
+      return;
     }
     
-    FGPositionedRef result = FGPositioned::findClosestWithIdent(id, ctx.pos);
-    if (!result) {
-        // not found, hmm
-        _last_wp0_ID = id;
-        return;
+    insertWaypointAtIndex(index);
+  } else if (!strcmp(aCmd, "route-insert-after")) {
+    int index = _scratchNode->getIntValue("index");
+    if (index < 0 || (_routeMgr->size() == 0)) {
+      index = _routeMgr->size();
+    } else if (index >= _routeMgr->size()) {
+      SG_LOG(SG_INSTR, SG_WARN, "GPS:route-insert-after, bad index:" << index);
+      return;
+    } else {
+      ++index; 
+    }
+  
+    insertWaypointAtIndex(index);
+  } else if (!strcmp(aCmd, "route-delete")) {
+    int index = _scratchNode->getIntValue("index");
+    if (index < 0) {
+      index = _routeMgr->size();
+    } else if (index >= _routeMgr->size()) {
+      SG_LOG(SG_INSTR, SG_WARN, "GPS:route-delete, bad index:" << index);
+      return;
     }
     
-    _wp0_position = result->geod();
-    _wp0_name_node->setStringValue(result->name().c_str());
-    _last_wp0_ID = id;
-    ctx.waypoint_changed = true;
+    removeWaypointAtIndex(index);
+  } else {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:unrecognized command:" << aCmd);
+  }
 }
 
-void
-GPS::updateWaypoint1(UpdateContext& ctx)
+void GPS::clearScratch()
+{
+  _scratchPos = SGGeod::fromDegFt(-9999.0, -9999.0, -9999.0);
+  _scratchValid = false;  
+  _scratchNode->setStringValue("type", "");
+  _scratchNode->setStringValue("query", "");
+}
+
+bool GPS::isScratchPositionValid() const
+{
+  if ((_scratchPos.getLongitudeDeg() < -9990.0) ||
+      (_scratchPos.getLatitudeDeg() < -9990.0)) {
+   return false;   
+  }
+  
+  return true;
+}
+
+void GPS::directTo()
+{
+  if (!isScratchPositionValid()) {
+    SG_LOG(SG_INSTR, SG_WARN, "invalid DTO lat/lon");
+    return;
+  }
+  
+  _wp0_position = _indicated_pos;
+  _wp1Ident = _scratchNode->getStringValue("ident");
+  _wp1Name = _scratchNode->getStringValue("name");
+  _wp1_position = _scratchPos;
+
+  _mode = "dto";
+  _selectedCourse = getLegMagCourse();
+  clearScratch();
+  
+  wp1Changed();
+}
+
+void GPS::loadRouteWaypoint()
+{
+  _scratchValid = false;
+//  if (!_routeMgr->isRouteActive()) {
+//    SG_LOG(SG_INSTR, SG_WARN, "GPS:loadWaypoint: no active route");
+//    return;
+//  }
+  
+  int index = _scratchNode->getIntValue("index", -9999);
+  clearScratch();
+  
+  if ((index < 0) || (index >= _routeMgr->size())) { // no index supplied, use current wp
+    index = _routeMgr->currentWaypoint();
+  }
+  
+  _searchIsRoute = true;
+  setScratchFromRouteWaypoint(index);
+}
+
+void GPS::setScratchFromRouteWaypoint(int aIndex)
+{
+  assert(_searchIsRoute);
+  if ((aIndex < 0) || (aIndex >= _routeMgr->size())) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:setScratchFromRouteWaypoint: route-index out of bounds");
+    return;
+  }
+  
+  _searchResultIndex = aIndex;
+  SGWayPoint wp(_routeMgr->get_waypoint(aIndex));
+  _scratchNode->setStringValue("name", wp.get_name());
+  _scratchNode->setStringValue("ident", wp.get_id());
+  _scratchPos = wp.get_target();
+  _scratchValid = true;
+  _scratchNode->setDoubleValue("course", wp.get_track());
+  _scratchNode->setIntValue("index", aIndex);
+  
+  int lastResult = _routeMgr->size() - 1;
+  _searchHasNext = (_searchResultIndex < lastResult);
+}
+
+void GPS::loadNearest()
+{
+  string sty(_scratchNode->getStringValue("type"));
+  FGPositioned::Type ty = FGPositioned::typeFromName(sty);
+  if (ty == FGPositioned::INVALID) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:loadNearest: request type is invalid:" << sty);
+    return;
+  }
+  
+  auto_ptr<FGPositioned::Filter> f(createFilter(ty));
+  int limitCount = _scratchNode->getIntValue("max-results", 1);
+  double cutoffDistance = _scratchNode->getDoubleValue("cutoff-nm", 400.0);
+  
+  SGGeod searchPos = _indicated_pos;
+  if (isScratchPositionValid()) {
+    searchPos = _scratchPos;
+  }
+  
+  clearScratch(); // clear now, regardless of whether we find a match or not
+    
+  _searchResults = 
+    FGPositioned::findClosestN(searchPos, limitCount, cutoffDistance, f.get());
+  _searchResultsCached = true;
+  _searchResultIndex = 0;
+  _searchIsRoute = false;
+  _searchHasNext = false;
+  
+  if (_searchResults.empty()) {
+    SG_LOG(SG_INSTR, SG_INFO, "GPS:loadNearest: no matches at all");
+    return;
+  }
+  
+  _searchHasNext = (_searchResults.size() > 1);
+  setScratchFromCachedSearchResult();
+}
+
+bool GPS::SearchFilter::pass(FGPositioned* aPos) const
+{
+  switch (aPos->type()) {
+  case FGPositioned::AIRPORT:
+  // heliport and seaport too?
+  case FGPositioned::VOR:
+  case FGPositioned::NDB:
+  case FGPositioned::FIX:
+  case FGPositioned::TACAN:
+  case FGPositioned::WAYPOINT:
+    return true;
+  default:
+    return false;
+  }
+}
+
+FGPositioned::Type GPS::SearchFilter::minType() const
+{
+  return FGPositioned::AIRPORT;
+}
+
+FGPositioned::Type GPS::SearchFilter::maxType() const
+{
+  return FGPositioned::WAYPOINT;
+}
+
+FGPositioned::Filter* GPS::createFilter(FGPositioned::Type aTy)
+{
+  if (aTy == FGPositioned::AIRPORT) {
+    return new FGAirport::HardSurfaceFilter(_config.minRunwayLengthFt());
+  }
+  
+  // if we were passed INVALID, assume it means 'all types interesting to a GPS'
+  if (aTy == FGPositioned::INVALID) {
+    return new SearchFilter;
+  }
+  
+  return new FGPositioned::TypeFilter(aTy);
+}
+
+void GPS::search()
 {
-    string id(_wp1_ID_node->getStringValue());
-    if (_last_wp1_ID == id) {
-        return; // easy, nothing to do
+  // parse search terms into local members, and exec the first search
+  string sty(_scratchNode->getStringValue("type"));
+  _searchType = FGPositioned::typeFromName(sty);
+  _searchQuery = _scratchNode->getStringValue("query");
+  if (_searchQuery.empty()) {
+    SG_LOG(SG_INSTR, SG_WARN, "empty GPS search query");
+    clearScratch();
+    return;
+  }
+  
+  _searchExact = _scratchNode->getBoolValue("exact", true);
+  _searchOrderByRange = _scratchNode->getBoolValue("order-by-distance", true);
+  _searchResultIndex = 0;
+  _searchIsRoute = false;
+  _searchHasNext = false;
+  
+  if (_searchExact && _searchOrderByRange) {
+    // immediate mode search, get all the results now and cache them
+    auto_ptr<FGPositioned::Filter> f(createFilter(_searchType));
+    if (_searchNames) {
+      _searchResults = FGPositioned::findAllWithNameSortedByRange(_searchQuery, _indicated_pos, f.get());
+    } else {
+      _searchResults = FGPositioned::findAllWithIdentSortedByRange(_searchQuery, _indicated_pos, f.get());
     }
     
-    FGPositionedRef result = FGPositioned::findClosestWithIdent(id, ctx.pos);
-    if (!result) {
-        // not found, hmm
-        _last_wp1_ID = id;
-        return;
+    _searchResultsCached = true;
+    
+    if (_searchResults.empty()) {
+      clearScratch();
+      return;
     }
     
-    _wp1_position = result->geod();
-    _wp1_name_node->setStringValue(result->name().c_str());
-    _last_wp1_ID = id;
-    ctx.waypoint_changed = true;
+    _searchHasNext = (_searchResults.size() > 1);
+    setScratchFromCachedSearchResult();
+  } else {
+    // iterative search, look up result zero
+    _searchResultsCached = false;
+    performSearch();
+  }
 }
 
-void
-GPS::updateTTWNode(UpdateContext& ctx, double distance_m, SGPropertyNode_ptr node)
-{
-    // Estimate time to waypoint.
-    // The estimation does not take track into consideration,
-    // so if you are going away from the waypoint the TTW will
-    // increase. Makes most sense when travelling directly towards
-    // the waypoint.
-    double TTW = 0.0;
-    double speed_nm_per_second = ctx.speed_kt / 3600;
-    if (speed_nm_per_second > SGLimitsd::min() && distance_m > 0.0) {
-        TTW = (distance_m * SG_METER_TO_NM) / speed_nm_per_second;
+void GPS::performSearch()
+{
+  auto_ptr<FGPositioned::Filter> f(createFilter(_searchType));
+  clearScratch();
+  
+  FGPositionedRef r;
+  if (_searchNames) {
+    if (_searchOrderByRange) {
+      r = FGPositioned::findClosestWithPartialName(_indicated_pos, _searchQuery, f.get(), _searchResultIndex, _searchHasNext);
+    } else {
+      r = FGPositioned::findWithPartialName(_searchQuery, f.get(), _searchResultIndex, _searchHasNext);
     }
-    if (TTW < 356400.5) { // That's 99 hours
-      unsigned int TTW_seconds = (int) (TTW + 0.5);
-      unsigned int TTW_minutes = 0;
-      unsigned int TTW_hours   = 0;
-      char TTW_str[9];
-      TTW_hours   = TTW_seconds / 3600;
-      TTW_minutes = (TTW_seconds / 60) % 60;
-      TTW_seconds = TTW_seconds % 60;
-      snprintf(TTW_str, 9, "%02d:%02d:%02d",
-        TTW_hours, TTW_minutes, TTW_seconds);
-      node->setStringValue(TTW_str);
+  } else {
+    if (_searchOrderByRange) {
+      r = FGPositioned::findClosestWithPartialId(_indicated_pos, _searchQuery, f.get(), _searchResultIndex, _searchHasNext);
     } else {
-      node->setStringValue("--:--:--");
+      r = FGPositioned::findWithPartialId(_searchQuery, f.get(), _searchResultIndex, _searchHasNext);
     }
+  }
+  
+  if (!r) {
+    return;
+  }
+  
+  setScratchFromPositioned(r.get(), _searchResultIndex);
 }
 
-void
-GPS::updateWaypoint0Course(UpdateContext& ctx)
+void GPS::setScratchFromCachedSearchResult()
 {
-    // Find the bearing and distance to waypoint 0.
-    double az2;
-    SGGeodesy::inverse(ctx.pos, ctx.wp0_pos, ctx.wp0_bearing_deg, az2,ctx.wp0_distance);
-    _wp0_distance_node->setDoubleValue(ctx.wp0_distance * SG_METER_TO_NM);
-    _wp0_bearing_node->setDoubleValue(ctx.wp0_bearing_deg);
-        
-    double mag_bearing_deg = ctx.wp0_bearing_deg - ctx.magvar_deg;
-    SG_NORMALIZE_RANGE(mag_bearing_deg, 0.0, 360.0);
-    _wp0_mag_bearing_node->setDoubleValue(mag_bearing_deg);
-    double bearing_error_deg = ctx.track1_deg - ctx.wp0_bearing_deg;
-    SG_NORMALIZE_RANGE(bearing_error_deg, -180.0, 180.0);
-    _true_wp0_bearing_error_node->setDoubleValue(bearing_error_deg);
+  assert(_searchResultsCached);
+  int index = _searchResultIndex;
+  
+  if ((index < 0) || (index >= (int) _searchResults.size())) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:setScratchFromCachedSearchResult: index out of bounds:" << index);
+    return;
+  }
+  
+  setScratchFromPositioned(_searchResults[index], index);
+  
+  int lastResult = (int) _searchResults.size() - 1;
+  _searchHasNext = (_searchResultIndex < lastResult);
+}
+
+void GPS::setScratchFromPositioned(FGPositioned* aPos, int aIndex)
+{
+  clearScratch();
+  assert(aPos);
+
+  _scratchPos = aPos->geod();
+  _scratchNode->setStringValue("name", aPos->name());
+  _scratchNode->setStringValue("ident", aPos->ident());
+  _scratchNode->setStringValue("type", FGPositioned::nameForType(aPos->type()));
     
-    updateTTWNode(ctx, ctx.wp0_distance, _wp0_ttw_node);
-        
-    // Course deviation is the diffenrence between the bearing
-    // and the course.
-    double course_deviation_deg = ctx.wp0_bearing_deg -
-        ctx.wp0_course_deg;
-    SG_NORMALIZE_RANGE(course_deviation_deg, -180.0, 180.0);
-
-    // If the course deviation is less than 90 degrees to either side,
-    // our desired course is towards the waypoint.
-    // It does not matter if we are actually moving 
-    // towards or from the waypoint.
-    if (fabs(course_deviation_deg) < 90.0) {
-        _wp0_to_flag_node->setBoolValue(true); 
-    }
-    // If it's more than 90 degrees the desired
-    // course is from the waypoint.
-    else if (fabs(course_deviation_deg) > 90.0) {
-      _wp0_to_flag_node->setBoolValue(false);
-      // When the course is away from the waypoint, 
-      // it makes sense to change the sign of the deviation.
-      course_deviation_deg *= -1.0;
-      SG_NORMALIZE_RANGE(course_deviation_deg, -90.0, 90.0);
+  if (aIndex >= 0) {
+    _scratchNode->setIntValue("index", aIndex);
+  }
+  
+  _scratchValid = true;
+  if (_searchResultsCached) {
+    _scratchNode->setIntValue("result-count", _searchResults.size());
+  }
+  
+  switch (aPos->type()) {
+  case FGPositioned::VOR:
+    _scratchNode->setDoubleValue("frequency-mhz", static_cast<FGNavRecord*>(aPos)->get_freq() / 100.0);
+    break;
+  
+  case FGPositioned::NDB:
+    _scratchNode->setDoubleValue("frequency-khz", static_cast<FGNavRecord*>(aPos)->get_freq() / 100.0);
+    break;
+  
+  case FGPositioned::AIRPORT:
+    addAirportToScratch((FGAirport*)aPos);
+    break;
+  
+  default:
+      // no-op
+      break;
+  }
+  
+  // look for being on the route and set?
+}
+
+void GPS::addAirportToScratch(FGAirport* aAirport)
+{
+  for (unsigned int r=0; r<aAirport->numRunways(); ++r) {
+    SGPropertyNode* rwyNd = _scratchNode->getChild("runways", r, true);
+    FGRunway* rwy = aAirport->getRunwayByIndex(r);
+    // TODO - filter out unsuitable runways in the future
+    // based on config again
+    
+    rwyNd->setStringValue("id", rwy->ident().c_str());
+    rwyNd->setIntValue("length-ft", rwy->lengthFt());
+    rwyNd->setIntValue("width-ft", rwy->widthFt());
+    rwyNd->setIntValue("heading-deg", rwy->headingDeg());
+    // map surface code to a string
+    // TODO - lighting information
+    
+    if (rwy->ILS()) {
+      rwyNd->setDoubleValue("ils-frequency-mhz", rwy->ILS()->get_freq() / 100.0);
     }
+  } // of runways iteration
+}
 
-    _wp0_course_deviation_node->setDoubleValue(course_deviation_deg);
 
-    // Cross track error.
-    double course_error_m = sin(course_deviation_deg * SG_PI / 180.0)
-          * (ctx.wp0_distance);
-    _wp0_course_error_nm_node->setDoubleValue(course_error_m * SG_METER_TO_NM);
+void GPS::selectOBSMode()
+{
+  if (!isScratchPositionValid()) {
+    SG_LOG(SG_INSTR, SG_WARN, "invalid OBS lat/lon");
+    return;
+  }
+  
+  SG_LOG(SG_INSTR, SG_INFO, "GPS switching to OBS mode");
+  _mode = "obs";
+  
+  _wp1Ident = _scratchNode->getStringValue("ident");
+  _wp1Name = _scratchNode->getStringValue("name");
+  _wp1_position = _scratchPos;
+  _wp0_position = _indicated_pos;
+  wp1Changed();
 }
 
-void
-GPS::updateWaypoint1Course(UpdateContext& ctx)
+void GPS::selectLegMode()
 {
-    // Find the bearing and distance to waypoint 0.
-    double az2;
-    SGGeodesy::inverse(ctx.pos, ctx.wp1_pos, ctx.wp1_bearing_deg, az2,ctx.wp1_distance);
-    _wp1_distance_node->setDoubleValue(ctx.wp1_distance * SG_METER_TO_NM);
-    _wp1_bearing_node->setDoubleValue(ctx.wp1_bearing_deg);
-        
-    double mag_bearing_deg = ctx.wp1_bearing_deg - ctx.magvar_deg;
-    SG_NORMALIZE_RANGE(mag_bearing_deg, 0.0, 360.0);
-    _wp1_mag_bearing_node->setDoubleValue(mag_bearing_deg);
-    double bearing_error_deg = ctx.track1_deg - ctx.wp1_bearing_deg;
-    SG_NORMALIZE_RANGE(bearing_error_deg, -180.0, 180.0);
-    _true_wp1_bearing_error_node->setDoubleValue(bearing_error_deg);
+  if (_mode == "leg") {
+    return;
+  }
+  
+  if (!_routeMgr->isRouteActive()) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:selectLegMode: no active route");
+    return;
+  }
+
+  SG_LOG(SG_INSTR, SG_INFO, "GPS switching to LEG mode");
+  _mode = "leg";
+  
+  // depending on the situation, this will either get over-written 
+  // in routeManagerSequenced or not; either way it does no harm to
+  // set it here.
+  _wp0_position = _indicated_pos;
+
+  // not really sequenced, but does all the work of updating wp0/1
+  routeManagerSequenced();
+}
+
+void GPS::nextResult()
+{
+  if (!_searchHasNext) {
+    return;
+  }
+  
+  clearScratch();
+  if (_searchIsRoute) {
+    setScratchFromRouteWaypoint(++_searchResultIndex);
+  } else if (_searchResultsCached) {
+    ++_searchResultIndex;
+    setScratchFromCachedSearchResult();
+  } else {
+    ++_searchResultIndex;
+    performSearch();
+  } // of iterative search case
+}
+
+void GPS::previousResult()
+{
+  if (_searchResultIndex <= 0) {
+    return;
+  }
+  
+  clearScratch();
+  --_searchResultIndex;
+  
+  if (_searchIsRoute) {
+    setScratchFromRouteWaypoint(_searchResultIndex);
+  } else if (_searchResultsCached) {
+    setScratchFromCachedSearchResult();
+  } else {
+    performSearch();
+  }
+}
+
+void GPS::defineWaypoint()
+{
+  if (!isScratchPositionValid()) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:defineWaypoint: invalid lat/lon");
+    return;
+  }
+  
+  string ident = _scratchNode->getStringValue("ident");
+  if (ident.size() < 2) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:defineWaypoint: waypoint identifier must be at least two characters");
+    return;
+  }
     
-    updateTTWNode(ctx, ctx.wp1_distance, _wp1_ttw_node);
-        
-    // Course deviation is the diffenrence between the bearing
-    // and the course.
-    double course_deviation_deg = ctx.wp1_bearing_deg -
-        ctx.wp1_course_deg;
-    SG_NORMALIZE_RANGE(course_deviation_deg, -180.0, 180.0);
-
-    // If the course deviation is less than 90 degrees to either side,
-    // our desired course is towards the waypoint.
-    // It does not matter if we are actually moving 
-    // towards or from the waypoint.
-    if (fabs(course_deviation_deg) < 90.0) {
-        _wp1_to_flag_node->setBoolValue(true); 
-    }
-    // If it's more than 90 degrees the desired
-    // course is from the waypoint.
-    else if (fabs(course_deviation_deg) > 90.0) {
-      _wp1_to_flag_node->setBoolValue(false);
-      // When the course is away from the waypoint, 
-      // it makes sense to change the sign of the deviation.
-      course_deviation_deg *= -1.0;
-      SG_NORMALIZE_RANGE(course_deviation_deg, -90.0, 90.0);
-    }
+// check for duplicate idents
+  FGPositioned::TypeFilter f(FGPositioned::WAYPOINT);
+  FGPositioned::List dups = FGPositioned::findAllWithIdentSortedByRange(ident, _indicated_pos, &f);
+  if (!dups.empty()) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:defineWaypoint: non-unique waypoint identifier, ho-hum");
+  }
+  
+  SG_LOG(SG_INSTR, SG_INFO, "GPS:defineWaypoint: creating waypoint:" << ident);
+  FGPositionedRef wpt = FGPositioned::createUserWaypoint(ident, _scratchPos);
+  _searchResultsCached = false;
+  setScratchFromPositioned(wpt.get(), -1);
+}
+
+void GPS::insertWaypointAtIndex(int aIndex)
+{
+  // note we do allow index = routeMgr->size(), that's an append
+  if ((aIndex < 0) || (aIndex > _routeMgr->size())) {
+    throw sg_range_exception("GPS::insertWaypointAtIndex: index out of bounds");
+  }
+  
+  if (!isScratchPositionValid()) {
+    SG_LOG(SG_INSTR, SG_WARN, "GPS:insertWaypointAtIndex: invalid lat/lon");
+    return;
+  }
+  
+  string ident = _scratchNode->getStringValue("ident");
+  string name = _scratchNode->getStringValue("name");
+  
+  _routeMgr->add_waypoint(SGWayPoint(_scratchPos, ident, name), aIndex);
+}
 
-    _wp1_course_deviation_node->setDoubleValue(course_deviation_deg);
+void GPS::removeWaypointAtIndex(int aIndex)
+{
+  if ((aIndex < 0) || (aIndex >= _routeMgr->size())) {
+    throw sg_range_exception("GPS::removeWaypointAtIndex: index out of bounds");
+  }
+  
+  _routeMgr->pop_waypoint(aIndex);
+}
 
-    // Cross track error.
-    double course_error_m = sin(course_deviation_deg * SG_PI / 180.0)
-          * (ctx.wp1_distance);
-    _wp1_course_error_nm_node->setDoubleValue(course_error_m * SG_METER_TO_NM);
+void GPS::tieSGGeod(SGPropertyNode* aNode, SGGeod& aRef, 
+  const char* lonStr, const char* latStr, const char* altStr)
+{
+  tie(aNode, lonStr, SGRawValueMethods<SGGeod, double>(aRef, &SGGeod::getLongitudeDeg, &SGGeod::setLongitudeDeg));
+  tie(aNode, latStr, SGRawValueMethods<SGGeod, double>(aRef, &SGGeod::getLatitudeDeg, &SGGeod::setLatitudeDeg));
+  
+  if (altStr) {
+    tie(aNode, altStr, SGRawValueMethods<SGGeod, double>(aRef, &SGGeod::getElevationFt, &SGGeod::setElevationFt));
+  }
+}
 
+void GPS::tieSGGeodReadOnly(SGPropertyNode* aNode, SGGeod& aRef, 
+  const char* lonStr, const char* latStr, const char* altStr)
+{
+  tie(aNode, lonStr, SGRawValueMethods<SGGeod, double>(aRef, &SGGeod::getLongitudeDeg, NULL));
+  tie(aNode, latStr, SGRawValueMethods<SGGeod, double>(aRef, &SGGeod::getLatitudeDeg, NULL));
+  
+  if (altStr) {
+    tie(aNode, altStr, SGRawValueMethods<SGGeod, double>(aRef, &SGGeod::getElevationFt, NULL));
+  }
 }
 
 // end of gps.cxx
index 24c98239cf79c499ab3f423c88867943c53e8f56..76596773a7a5eb4e769e75c24c9be6d8f8da617d 100644 (file)
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/SGMath.hxx>
 
+#include "Navaids/positioned.hxx"
+
 // forward decls
 class SGRoute;
+class FGRouteMgr;
+class FGAirport;
+class GPSListener;
 
 class SGGeodProperty
 {
@@ -42,15 +47,6 @@ private:
  * /systems/electrical/outputs/gps
  * /instrumentation/gps/serviceable
  * 
- * /instrumentation/gps/wp-longitude-deg
- * /instrumentation/gps/wp-latitude-deg
- * /instrumentation/gps/wp-altitude-ft
- * /instrumentation/gps/wp-ID
- * /instrumentation/gps/wp-name
- * /instrumentation/gps/desired-course-deg
- * /instrumentation/gps/get-nearest-airport
- * /instrumentation/gps/waypoint-type
- * /instrumentation/gps/tracking-bug
  *
  * Output properties:
  *
@@ -73,8 +69,7 @@ private:
  * /instrumentation/gps/trip-odometer
  * /instrumentation/gps/true-bug-error-deg
  * /instrumentation/gps/magnetic-bug-error-deg
- * /instrumentation/gps/true-bearing-error-deg
- * /instrumentation/gps/magnetic-bearing-error-deg
+
  */
 class GPS : public SGSubsystem
 {
@@ -87,119 +82,344 @@ public:
 
     virtual void init ();
     virtual void update (double delta_time_sec);
-
+    
+    virtual void bind();
+    virtual void unbind();
 private:
-    typedef struct {
-        double dt;
-        SGGeod pos;
-        SGGeod wp0_pos;
-        SGGeod wp1_pos;
-        bool waypoint_changed;
-        double speed_kt;
-        double track1_deg;
-        double track2_deg;
-        double magvar_deg;
-        double wp0_distance;
-        double wp0_course_deg;
-        double wp0_bearing_deg;
-        double wp1_distance;
-        double wp1_course_deg;
-        double wp1_bearing_deg;
-    } UpdateContext;
+    friend class GPSListener;
+    friend class SearchFilter;
+    
+    /**
+     * Configuration manager, track data relating to aircraft installation
+     */
+    class Config
+    {
+    public:
+      Config();
+            
+      void bind(GPS* aOwner, SGPropertyNode* aCfg);
+      
+      bool turnAnticipationEnabled() const
+      { return _enableTurnAnticipation; }
+      
+      /**
+       * Desired turn rate in degrees/second. From this we derive the turn
+       * radius and hence how early we need to anticipate it.
+       */
+      double turnRateDegSec() const
+      { return _turnRate; }
+      
+      /**
+       * Distance at which we arm overflight sequencing. Once inside this
+       * distance, a change of the wp1 'TO' flag to false will be considered
+       * overlight of the wp.
+       */
+      double overflightArmDistanceNm() const
+      { return _overflightArmDistance; }
+      
+      /**
+       * Time before the next WP to activate an external annunciator
+       */
+      double waypointAlertTime() const
+      { return _waypointAlertTime; }
+            
+      bool tuneNavRadioToRefVor() const
+      { return _tuneRadio1ToRefVor; }
+      
+      bool requireHardSurface() const
+      { return _requireHardSurface; }
+      
+      double minRunwayLengthFt() const
+      { return _minRunwayLengthFt; }
+      
+      double getExternalCourse() const;
+      
+      void setExternalCourse(double aCourseDeg);
+      
+      bool cdiDeflectionIsAngular() const
+      { return (_cdiMaxDeflectionNm <= 0.0); }
+      
+      double cdiDeflectionLinearPeg() const
+      {
+        assert(_cdiMaxDeflectionNm > 0.0);
+        return _cdiMaxDeflectionNm;
+      }
+      
+      bool driveAutopilot() const
+      { return _driveAutopilot; }
+    private:
+      bool _enableTurnAnticipation;
+      
+      // desired turn rate in degrees per second
+      double _turnRate;
+      
+      // distance from waypoint to arm overflight sequencing (in nm)
+      double _overflightArmDistance;
+      
+      // time before reaching a waypoint to trigger annunicator light/sound 
+      // (in seconds)
+      double _waypointAlertTime;
+      
+      // should GPS automatically tune NAV1 to the reference VOR?
+      bool _tuneRadio1ToRefVor;
+      
+      // minimum runway length to require when filtering
+      double _minRunwayLengthFt;
+      
+      // should we require a hard-surfaced runway when filtering?
+      bool _requireHardSurface;
+      
+      // helpers to tie course-source property
+      const char* getCourseSource() const;
+      void setCourseSource(const char* aPropPath);
+      
+      // property to retrieve the external course from
+      SGPropertyNode_ptr _extCourseSource;
+      
+      double _cdiMaxDeflectionNm;
+      
+      bool _driveAutopilot;
+    };
+    
+    class SearchFilter : public FGPositioned::Filter
+    {
+    public:      
+      virtual bool pass(FGPositioned* aPos) const;
+          
+      virtual FGPositioned::Type minType() const;
+      virtual FGPositioned::Type maxType() const;
+    };
     
-    void search (double frequency, const SGGeod& pos);
-
     /**
      * reset all output properties to default / non-service values
      */
     void clearOutput();
 
-    void updateWithValid(UpdateContext& ctx);
+    void updateBasicData(double dt);
+    void updateWaypoints();
+
+    void updateTrackingBug();
+    void updateReferenceNavaid(double dt);
+    void referenceNavaidSet(const std::string& aNavaid);
+    void tuneNavRadios();
+    void updateRouteData();
+    void driveAutopilot();
     
-    void updateNearestAirport(UpdateContext& ctx);
-    void updateWaypoint0(UpdateContext& ctx);
-    void updateWaypoint1(UpdateContext& ctx);
+    void routeActivated();
+    void routeManagerSequenced();
+    void routeEdited();
+    void routeFinished();
+    
+    void updateTurn();  
+    void updateOverflight();    
+    void beginTurn();
+    void endTurn();
+    
+    double computeTurnProgress(double aBearing) const;
+    void computeTurnData();
+    void updateTurnData();
+    double computeTurnRadiusNm(double aGroundSpeedKts) const;
+  
+  /**
+   * Update one-shot things when WP1 / leg data change
+   */
+  void wp1Changed();
+  
+// scratch maintenence utilities
+  void setScratchFromPositioned(FGPositioned* aPos, int aIndex);
+  void setScratchFromCachedSearchResult();
+  void setScratchFromRouteWaypoint(int aIndex);
+  
+  /**
+   * Add airport-specific information to a scratch result
+   */
+  void addAirportToScratch(FGAirport* aAirport);
+  
+  void clearScratch();
+  
+  /**
+   * Predicate, determine if the lon/lat position in the scratch is 
+   * valid or not.
+   */
+  bool isScratchPositionValid() const;
+  
+  FGPositioned::Filter* createFilter(FGPositioned::Type aTy);
+  
+  /**
+   * Search kernel - called each time we step through a result
+   */
+  void performSearch();
+  
+// command handlers
+  void selectLegMode();
+  void selectOBSMode();
+  void directTo();
+  void loadRouteWaypoint();
+  void loadNearest();
+  void search();
+  void nextResult();
+  void previousResult();
+  void defineWaypoint();
+  void insertWaypointAtIndex(int aIndex);
+  void removeWaypointAtIndex(int aIndex);
+  
+// tied-property getter/setters
+  void setCommand(const char* aCmd);
+  const char* getCommand() const { return ""; }
+  
+  const char* getMode() const { return _mode.c_str(); }
+  
+  bool getScratchValid() const { return _scratchValid; }
+  double getScratchDistance() const;
+  double getScratchMagBearing() const;
+  double getScratchTrueBearing() const;
+  bool getScratchHasNext() const { return _searchHasNext; }
+  
+  double getSelectedCourse() const { return _selectedCourse; }
+  double getCDIDeflection() const;
+  
+  double getLegDistance() const;
+  double getLegCourse() const;
+  double getLegMagCourse() const;
+  double getAltDistanceRatio() const;
+  
+  double getTrueTrack() const { return _last_true_track; }
+  double getMagTrack() const;
+  double getGroundspeedKts() const { return _last_speed_kts; }
+  double getVerticalSpeed() const { return _last_vertical_speed; }
+  
+  //bool getLegMode() const { return _mode == "leg"; }
+  //bool getObsMode() const { return _mode == "obs"; }
+  
+  const char* getWP0Ident() const;
+  const char* getWP0Name() const;
+  
+  const char* getWP1Ident() const;
+  const char* getWP1Name() const;
+  
+  double getWP1Distance() const;
+  double getWP1TTW() const;
+  const char* getWP1TTWString() const;
+  double getWP1Bearing() const;
+  double getWP1MagBearing() const;
+  double getWP1CourseDeviation() const;
+  double getWP1CourseErrorNm() const;
+  bool getWP1ToFlag() const;
+  bool getWP1FromFlag() const;
+  
+  // true-bearing-error and mag-bearing-error
+  
 
-    void updateLegCourse(UpdateContext& ctx);
-    void updateWaypoint0Course(UpdateContext& ctx);
-    void updateWaypoint1Course(UpdateContext& ctx);
+  /**
+   * Tied-properties helper, record nodes which are tied for easy un-tie-ing
+   */
+  template <typename T>
+  void tie(SGPropertyNode* aNode, const char* aRelPath, const SGRawValue<T>& aRawValue)
+  {
+    SGPropertyNode* nd = aNode->getNode(aRelPath, true);
+    _tiedNodes.push_back(nd);
+    nd->tie(aRawValue);
+  }
 
-    void waypointChanged(UpdateContext& ctx);
-    void updateTTWNode(UpdateContext& ctx, double distance_m, SGPropertyNode_ptr node);
-    void updateTrackingBug(UpdateContext& ctx);
-    
-    SGPropertyNode_ptr _magvar_node;
-    SGPropertyNode_ptr _serviceable_node;
-    SGPropertyNode_ptr _electrical_node;
-    SGPropertyNode_ptr _wp0_ID_node;
-    SGPropertyNode_ptr _wp0_name_node;
-    SGPropertyNode_ptr _wp0_course_node;
-    SGPropertyNode_ptr _get_nearest_airport_node;
-    SGPropertyNode_ptr _wp1_ID_node;
-    SGPropertyNode_ptr _wp1_name_node;
-    SGPropertyNode_ptr _wp1_course_node;
-    SGPropertyNode_ptr _tracking_bug_node;
-
-    SGPropertyNode_ptr _raim_node;
-    SGPropertyNode_ptr _indicated_vertical_speed_node;
-    SGPropertyNode_ptr _true_track_node;
-    SGPropertyNode_ptr _magnetic_track_node;
-    SGPropertyNode_ptr _speed_node;
-    SGPropertyNode_ptr _wp0_distance_node;
-    SGPropertyNode_ptr _wp0_ttw_node;
-    SGPropertyNode_ptr _wp0_bearing_node;
-    SGPropertyNode_ptr _wp0_mag_bearing_node;
-    SGPropertyNode_ptr _wp0_course_deviation_node;
-    SGPropertyNode_ptr _wp0_course_error_nm_node;
-    SGPropertyNode_ptr _wp0_to_flag_node;
-    SGPropertyNode_ptr _wp1_distance_node;
-    SGPropertyNode_ptr _wp1_ttw_node;
-    SGPropertyNode_ptr _wp1_bearing_node;
-    SGPropertyNode_ptr _wp1_mag_bearing_node;
-    SGPropertyNode_ptr _wp1_course_deviation_node;
-    SGPropertyNode_ptr _wp1_course_error_nm_node;
-    SGPropertyNode_ptr _wp1_to_flag_node;
-    SGPropertyNode_ptr _odometer_node;
+  /// helper, tie the lat/lon/elev of a SGGeod to the named children of aNode
+  void tieSGGeod(SGPropertyNode* aNode, SGGeod& aRef, 
+    const char* lonStr, const char* latStr, const char* altStr);
+  
+  /// helper, tie a SGGeod to proeprties, but read-only
+  void tieSGGeodReadOnly(SGPropertyNode* aNode, SGGeod& aRef, 
+    const char* lonStr, const char* latStr, const char* altStr);
+
+// members
+  SGPropertyNode_ptr _gpsNode;
+  SGPropertyNode_ptr _magvar_node;
+  SGPropertyNode_ptr _serviceable_node;
+  SGPropertyNode_ptr _electrical_node;
+  SGPropertyNode_ptr _tracking_bug_node;
+  SGPropertyNode_ptr _raim_node;
+
+      SGPropertyNode_ptr _odometer_node;
     SGPropertyNode_ptr _trip_odometer_node;
     SGPropertyNode_ptr _true_bug_error_node;
     SGPropertyNode_ptr _magnetic_bug_error_node;
-    SGPropertyNode_ptr _true_wp0_bearing_error_node;
-    SGPropertyNode_ptr _magnetic_wp0_bearing_error_node;
-    SGPropertyNode_ptr _true_wp1_bearing_error_node;
-    SGPropertyNode_ptr _magnetic_wp1_bearing_error_node;
-    SGPropertyNode_ptr _leg_distance_node;
-    SGPropertyNode_ptr _leg_course_node;
-    SGPropertyNode_ptr _leg_magnetic_course_node;
-    SGPropertyNode_ptr _alt_dist_ratio_node;
-    SGPropertyNode_ptr _leg_course_deviation_node;
-    SGPropertyNode_ptr _leg_course_error_nm_node;
-    SGPropertyNode_ptr _leg_to_flag_node;
-    SGPropertyNode_ptr _alt_deviation_node;
-
-    bool _last_valid;
+    
+    SGPropertyNode_ptr _ref_navaid_id_node;
+    SGPropertyNode_ptr _ref_navaid_bearing_node;
+    SGPropertyNode_ptr _ref_navaid_distance_node;
+    SGPropertyNode_ptr _ref_navaid_mag_bearing_node;
+    SGPropertyNode_ptr _ref_navaid_frequency_node;
+    SGPropertyNode_ptr _ref_navaid_name_node;
+    
+    SGPropertyNode_ptr _route_active_node;
+    SGPropertyNode_ptr _route_current_wp_node;
+    SGPropertyNode_ptr _routeDistanceNm;
+    SGPropertyNode_ptr _routeETE;
+  SGPropertyNode_ptr _routeEditedSignal;
+  SGPropertyNode_ptr _routeFinishedSignal;
+
+    double _selectedCourse;
+    
+    bool _dataValid;
     SGGeod _last_pos;
+    bool _lastPosValid;
     double _last_speed_kts;
-
-    std::string _last_wp0_ID;
-    std::string _last_wp1_ID;
-
-    double _alt_dist_ratio;
-    double _distance_m;
-    double _course_deg;
-
-    double _bias_length;
-    double _bias_angle;
-    double _azimuth_error;
-    double _range_error;
-    double _elapsed_time;
-
+    double _last_true_track;
+    double _last_vertical_speed;
+    
+    std::string _mode;
+    GPSListener* _listener;
+    Config _config;
+    FGRouteMgr* _routeMgr;
+    
+    bool _ref_navaid_set;
+    double _ref_navaid_elapsed;
+    FGPositionedRef _ref_navaid;
+    
     std::string _name;
     int _num;
-
-    SGGeodProperty _position;
-    SGGeodProperty _wp0_position;
-    SGGeodProperty _wp1_position;
-    SGGeodProperty _indicated_pos;
+  
+  SGGeodProperty _position;
+  SGGeod _wp0_position;
+  SGGeod _wp1_position;
+  SGGeod _indicated_pos;
+  std::string _wp0Ident, _wp0Name, _wp1Ident, _wp1Name;
+  double _wp1DistanceM, _wp1TrueBearing;
+  
+// scratch data
+  SGGeod _scratchPos;
+  SGPropertyNode_ptr _scratchNode;
+  bool _scratchValid;
+  
+// search data
+  int _searchResultIndex;
+  std::string _searchQuery;
+  FGPositioned::Type _searchType;
+  bool _searchExact;
+  bool _searchOrderByRange;
+  bool _searchResultsCached;
+  FGPositioned::List _searchResults;
+  bool _searchIsRoute; ///< set if 'search' is actually the current route
+  bool _searchHasNext; ///< is there a result after this one?
+  bool _searchNames; ///< set if we're searching names instead of idents
+  
+  // turn data
+    bool _computeTurnData; ///< do we need to update the turn data?
+    bool _anticipateTurn; ///< are we anticipating the next turn or not?
+    bool _inTurn; // is a turn in progress?
+    bool _turnSequenced; // have we sequenced the new leg?
+    double _turnAngle; // angle to turn through, in degrees
+    double _turnStartBearing; // bearing of inbound leg
+    double _turnRadius; // radius of turn in nm
+    SGGeod _turnPt;
+    SGGeod _turnCentre;
+  
+  SGPropertyNode_ptr _realismSimpleGps; ///< should the GPS be simple or realistic?
+  
+// autopilot drive properties
+  SGPropertyNode_ptr _apTrueHeading;
+  SGPropertyNode_ptr _apTargetAltitudeFt;
+  SGPropertyNode_ptr _apAltitudeLock;
+  
+  std::vector<SGPropertyNode*> _tiedNodes;
 };
 
 
index 937fa2614b4858758c068307b31055a4185c5d81..56c7d0902ac372679a24fe218991046ab06976d4 100644 (file)
@@ -197,7 +197,7 @@ osg::Geometry *GroundRadar::addPavementGeometry(const FGPavement* aPavement, dou
   geo_inverse_wgs_84(aTowerLat, aTowerLon, (*loopBegin)->mPos.getLatitudeDeg(), (*loopBegin)->mPos.getLongitudeDeg(), &az1, &az2, &dist_m);
   osg::Vec3 p1 = fromPolar(az1, dist_m * aScale) + osg::Vec3(TextureHalfSize, TextureHalfSize, 0);
   pts->push_back( p1 );
-  polygon->setVertexArray( pts );
+  polygon->setVertexArray( pts.get() );
 
   polygon->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::POLYGON, 0, pts->size() ) );
 
index 23d49da7446b598ea00fba18260e15d94db0cea9..960bd98ab55570157b1b706c308a25dba3615f17 100644 (file)
@@ -117,7 +117,7 @@ HeadingIndicatorFG::update (double dt)
 
                                 // Next, calculate the indicated heading,
                                 // introducing errors.
-    double factor = 0.1 / (spin * spin * spin * spin * spin * spin);
+    double factor = 100 * (spin * spin * spin * spin * spin * spin);
     double heading = _heading_in_node->getDoubleValue();
 
                                 // Now, we have to get the current
@@ -128,7 +128,7 @@ HeadingIndicatorFG::update (double dt)
     if ((heading - _last_heading_deg) < -180)
         _last_heading_deg -= 360;
 
-    heading = fgGetLowPass(_last_heading_deg, heading, dt / factor);
+    heading = fgGetLowPass(_last_heading_deg, heading, dt * factor);
     _last_heading_deg = heading;
 
        heading += offset;
index 21b2a47e770972120ce3152e3f3c989681d0c147..380ccd2ee8bae6dbae57b02ace3ebc969a2e675b 100644 (file)
@@ -51,7 +51,8 @@
 #include "agradar.hxx"
 #include "rad_alt.hxx"
 
-FGInstrumentMgr::FGInstrumentMgr ()
+FGInstrumentMgr::FGInstrumentMgr () :
+  _explicitGps(false)
 {
     set_subsystem("od_gauge", new FGODGauge);
     set_subsystem("hud", new HUD);
@@ -85,6 +86,14 @@ FGInstrumentMgr::FGInstrumentMgr ()
     }
 
     delete config_props;
+    
+    if (!_explicitGps) {
+      SG_LOG(SG_INSTR, SG_INFO, "creating default GPS instrument");
+      SGPropertyNode_ptr nd(new SGPropertyNode);
+      nd->setStringValue("name", "gps");
+      nd->setIntValue("number", 0);
+      set_subsystem("gps[0]", new GPS(nd));
+    }
 }
 
 FGInstrumentMgr::~FGInstrumentMgr ()
@@ -128,8 +137,8 @@ bool FGInstrumentMgr::build ()
             set_subsystem( id, new Altimeter( node ) );
 
         } else if ( name == "gps" ) {
-            set_subsystem( id, new GPS( node ), 0.45 );
-
+            set_subsystem( id, new GPS( node ) );
+            _explicitGps = true;
         } else if ( name == "gsdi" ) {
             set_subsystem( id, new GSDI( node ) );
 
index 0d0069733b7bb1bd00e91080b8799b46bd9afe99..00b6ddfd1add5d5c3e09c0865c558fe05a1a412b 100644 (file)
@@ -35,6 +35,7 @@ public:
 
 private:
     SGPropertyNode *config_props;
+    bool _explicitGps;
 };
 
 #endif // __INSTRUMENT_MGR_HXX
index 7dd77f9fe7185357e7ea9a7baeaceee28eaab0df..99787b71fde2674f9362ec1ebf13e9e3da301fad 100644 (file)
@@ -231,13 +231,15 @@ void FGKT_70::update( double dt ) {
 
         if ( func_knob == 1 ) {
             sby_ann = true;
-        } else if ( func_knob == 2 ) {
+        } else if ( func_knob == 2 ) { // selftest
             fl_ann = true;
             alt_ann = true;
             gnd_ann = true;
             on_ann = true;
             sby_ann = true;
             reply_ann = true;
+            id_code = 8888;
+            flight_level = 888;
         } else if ( func_knob == 3 ) {
             fl_ann = true;
             gnd_ann = true;
index 3e48ea2b4807eb1f66fed8db93d6f9f20e7c9b99..7d33b1ca8358c43f31f973a792d289759c13223b 100755 (executable)
@@ -1583,10 +1583,6 @@ private:
         : mk(device) {}
         
       virtual bool passAirport(FGAirport *a) const;
-      
-      virtual FGPositioned::Type maxType() const {
-        return FGPositioned::AIRPORT;
-      }
     private:
       MK_VIII* mk;
     };
index 31eb2f461bce9e7a2447564861844d8221c55893..7a8215f3eb9dc53fae787a46dd29b1941421189a 100644 (file)
@@ -94,55 +94,6 @@ FGNavRadio::FGNavRadio(SGPropertyNode *node) :
     lon_node(fgGetNode("/position/longitude-deg", true)),
     lat_node(fgGetNode("/position/latitude-deg", true)),
     alt_node(fgGetNode("/position/altitude-ft", true)),
-    is_valid_node(NULL),
-    power_btn_node(NULL),
-    freq_node(NULL),
-    alt_freq_node(NULL),
-    sel_radial_node(NULL),
-    vol_btn_node(NULL),
-    ident_btn_node(NULL),
-    audio_btn_node(NULL),
-    backcourse_node(NULL),
-    nav_serviceable_node(NULL),
-    cdi_serviceable_node(NULL),
-    gs_serviceable_node(NULL),
-    tofrom_serviceable_node(NULL),
-    dme_serviceable_node(NULL),
-    fmt_freq_node(NULL),
-    fmt_alt_freq_node(NULL),
-    heading_node(NULL),
-    radial_node(NULL),
-    recip_radial_node(NULL),
-    target_radial_true_node(NULL),
-    target_auto_hdg_node(NULL),
-    time_to_intercept(NULL),
-    to_flag_node(NULL),
-    from_flag_node(NULL),
-    inrange_node(NULL),
-    signal_quality_norm_node(NULL),
-    cdi_deflection_node(NULL),
-    cdi_deflection_norm_node(NULL),
-    cdi_xtrack_error_node(NULL),
-    cdi_xtrack_hdg_err_node(NULL),
-    has_gs_node(NULL),
-    loc_node(NULL),
-    loc_dist_node(NULL),
-    gs_deflection_node(NULL),
-    gs_deflection_deg_node(NULL),
-    gs_deflection_norm_node(NULL),
-    gs_rate_of_climb_node(NULL),
-    gs_dist_node(NULL),
-    gs_inrange_node(NULL),
-    nav_id_node(NULL),
-    id_c1_node(NULL),
-    id_c2_node(NULL),
-    id_c3_node(NULL),
-    id_c4_node(NULL),
-    nav_slaved_to_gps_node(NULL),
-    gps_cdi_deflection_node(NULL),
-    gps_to_flag_node(NULL),
-    gps_from_flag_node(NULL),
-    gps_has_gs_node(NULL),
     play_count(0),
     last_time(0),
     target_radial(0.0),
@@ -150,11 +101,11 @@ FGNavRadio::FGNavRadio(SGPropertyNode *node) :
     last_x(0.0),
     last_loc_dist(0.0),
     last_xtrack_error(0.0),
+    xrate_ms(0.0),
     _localizerWidth(5.0),
     _name(node->getStringValue("name", "nav")),
     _num(node->getIntValue("number", 0)),
     _time_before_search_sec(-1.0),
-    _falseCoursesEnabled(true),
     _sgr(NULL)
 {
     SGPath path( globals->get_fg_root() );
@@ -168,6 +119,10 @@ FGNavRadio::FGNavRadio(SGPropertyNode *node) :
     term_tbl = new SGInterpTable( term.str() );
     low_tbl = new SGInterpTable( low.str() );
     high_tbl = new SGInterpTable( high.str() );
+    
+    
+    string branch("/instrumentation/" + _name);
+    _radio_node = fgGetNode(branch.c_str(), _num, true);
 }
 
 
@@ -189,11 +144,7 @@ FGNavRadio::init ()
 
     morse.init();
 
-    string branch;
-    branch = "/instrumentation/" + _name;
-
-    SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
-
+    SGPropertyNode* node = _radio_node.get();
     bus_power_node = 
        fgGetNode(("/systems/electrical/outputs/" + _name).c_str(), true);
 
@@ -215,9 +166,14 @@ FGNavRadio::init ()
     tofrom_serviceable_node = createServiceableProp(node, "to-from");
     dme_serviceable_node = createServiceableProp(node, "dme");
     
-    globals->get_props()->tie("sim/realism/false-radio-courses-enabled", 
-      SGRawValuePointer<bool>(&_falseCoursesEnabled));
-    
+    falseCoursesEnabledNode = 
+      fgGetNode("/sim/realism/false-radio-courses-enabled");
+    if (!falseCoursesEnabledNode) {
+      falseCoursesEnabledNode = 
+        fgGetNode("/sim/realism/false-radio-courses-enabled", true);
+      falseCoursesEnabledNode->setBoolValue(true);
+    }
+
     // frequencies
     SGPropertyNode *subnode = node->getChild("frequencies", 0, true);
     freq_node = subnode->getChild("selected-mhz", 0, true);
@@ -261,14 +217,15 @@ FGNavRadio::init ()
     id_c3_node = node->getChild("nav-id_asc3", 0, true);
     id_c4_node = node->getChild("nav-id_asc4", 0, true);
 
-    node->tie("dme-in-range", SGRawValuePointer<bool>(&_dmeInRange));
-        
     // gps slaving support
     nav_slaved_to_gps_node = node->getChild("slaved-to-gps", 0, true);
     gps_cdi_deflection_node = fgGetNode("/instrumentation/gps/cdi-deflection", true);
     gps_to_flag_node = fgGetNode("/instrumentation/gps/to-flag", true);
     gps_from_flag_node = fgGetNode("/instrumentation/gps/from-flag", true);
     gps_has_gs_node = fgGetNode("/instrumentation/gps/has-gs", true);
+    gps_course_node = fgGetNode("/instrumentation/gps/selected-course-deg", true);
+    gps_xtrack_error_nm_node = fgGetNode("/instrumentation/gps/wp/wp[1]/course-error-nm", true);
+    _magvarNode = fgGetNode("/environment/magnetic-variation-deg", true);
     
     std::ostringstream temp;
     temp << _name << "nav-ident" << _num;
@@ -280,13 +237,18 @@ FGNavRadio::init ()
 void
 FGNavRadio::bind ()
 {
-  
+  tie("dme-in-range", SGRawValuePointer<bool>(&_dmeInRange));
+  tie("operable", SGRawValueMethods<FGNavRadio, bool>(*this, &FGNavRadio::isOperable, NULL));
 }
 
 
 void
 FGNavRadio::unbind ()
 {
+  for (unsigned int t=0; t<_tiedNodes.size(); ++t) {
+    _tiedNodes[t]->untie();
+  }
+  _tiedNodes.clear();
 }
 
 
@@ -378,7 +340,8 @@ FGNavRadio::update(double dt)
   if (power_btn_node->getBoolValue() 
       && (bus_power_node->getDoubleValue() > 1.0)
       && nav_serviceable_node->getBoolValue() )
-  {   
+  {
+    _operable = true;
     if (nav_slaved_to_gps_node->getBoolValue()) {
       updateGPSSlaved();
     } else {
@@ -410,6 +373,7 @@ void FGNavRadio::clearOutputs()
   from_flag_node->setBoolValue( false );
   
   _dmeInRange = false;
+  _operable = false;
 }
 
 void FGNavRadio::updateReceiver(double dt)
@@ -527,7 +491,7 @@ void FGNavRadio::updateReceiver(double dt)
   SG_NORMALIZE_RANGE(r, -180.0, 180.0);
   
   if ( is_loc ) {
-    if (_falseCoursesEnabled) {
+    if (falseCoursesEnabledNode->getBoolValue()) {
       // The factor of 30.0 gives a period of 120 which gives us 3 cycles and six 
       // zeros i.e. six courses: one front course, one back course, and four 
       // false courses. Three of the six are reverse sensing.
@@ -599,7 +563,7 @@ void FGNavRadio::updateGlideSlope(double dt, const SGVec3d& aircraft, double sig
   double angle = atan2(dot_v, dot_h) * SGD_RADIANS_TO_DEGREES;
   double deflectionAngle = target_gs - angle;
   
-  if (_falseCoursesEnabled) {
+  if (falseCoursesEnabledNode->getBoolValue()) {
     // Construct false glideslopes.  The scale factor of 1.5 
     // in the sawtooth gives a period of 6 degrees.
     // There will be zeros at 3, 6r, 9, 12r et cetera
@@ -660,14 +624,30 @@ void FGNavRadio::updateGPSSlaved()
   _toFlag = gps_to_flag_node->getBoolValue();
   _fromFlag = gps_from_flag_node->getBoolValue();
 
-  inrange_node->setBoolValue(_toFlag | _fromFlag);
+  bool gpsValid = (_toFlag | _fromFlag);
+  inrange_node->setBoolValue(gpsValid);
+  if (!gpsValid) {
+    signal_quality_norm_node->setDoubleValue(0.0);
+    _cdiDeflection = 0.0;
+    _cdiCrossTrackErrorM = 0.0;
+    _gsNeedleDeflection = 0.0;
+    return;
+  }
+  
+  // this is unfortunate, but panel instruments use this value to decide
+  // if the navradio output is valid.
+  signal_quality_norm_node->setDoubleValue(1.0);
   
   _cdiDeflection =  gps_cdi_deflection_node->getDoubleValue();
   // clmap to some range (+/- 10 degrees) as the regular deflection
   SG_CLAMP_RANGE(_cdiDeflection, -10.0, 10.0 );
   
-  _cdiCrossTrackErrorM = 0.0; // FIXME, supply this
+  _cdiCrossTrackErrorM = gps_xtrack_error_nm_node->getDoubleValue() * SG_NM_TO_METER;
   _gsNeedleDeflection = 0.0; // FIXME, supply this
+  
+  double trtrue = gps_course_node->getDoubleValue() + _magvarNode->getDoubleValue();
+  SG_NORMALIZE_RANGE(trtrue, 0.0, 360.0);
+  target_radial_true_node->setDoubleValue( trtrue );
 }
 
 void FGNavRadio::updateCDI(double dt)
@@ -749,7 +729,8 @@ void FGNavRadio::updateCDI(double dt)
   //////////////////////////////////////////////////////////
   double t = 0.0;
   if ( inrange && cdi_serviceable ) {
-    double xrate_ms = (last_xtrack_error - _cdiCrossTrackErrorM) / dt;
+    double cur_rate = (last_xtrack_error - _cdiCrossTrackErrorM) / dt;
+    xrate_ms = 0.99 * xrate_ms + 0.01 * cur_rate;
     if ( fabs(xrate_ms) > 0.00001 ) {
         t = _cdiCrossTrackErrorM / xrate_ms;
     } else {
index 6dbe3b78e1775afaf91516ef316f96d276dfb9bc..fe724a3bd4c1abd784286d678310db93b305094e 100644 (file)
@@ -47,6 +47,7 @@ class FGNavRadio : public SGSubsystem
     SGInterpTable *low_tbl;
     SGInterpTable *high_tbl;
 
+    SGPropertyNode_ptr _radio_node;
     SGPropertyNode_ptr lon_node;
     SGPropertyNode_ptr lat_node;
     SGPropertyNode_ptr alt_node;
@@ -116,9 +117,16 @@ class FGNavRadio : public SGSubsystem
     SGPropertyNode_ptr gps_to_flag_node;
     SGPropertyNode_ptr gps_from_flag_node;
     SGPropertyNode_ptr gps_has_gs_node;
+    SGPropertyNode_ptr gps_course_node;
+    SGPropertyNode_ptr gps_xtrack_error_nm_node;
+    SGPropertyNode_ptr _magvarNode;
+    
+    // realism setting, are false courses and GS lobes enabled?
+    SGPropertyNode_ptr falseCoursesEnabledNode;
 
     // internal (private) values
 
+    bool _operable; ///< is the unit serviceable, on, powered, etc
     int play_count;
     time_t last_time;
     FGNavRecordPtr _navaid;
@@ -137,6 +145,7 @@ class FGNavRadio : public SGSubsystem
     double last_x;
     double last_loc_dist;
     double last_xtrack_error;
+    double xrate_ms;
     double _localizerWidth; // cached localizer width in degrees
     
     string _name;
@@ -157,10 +166,8 @@ class FGNavRadio : public SGSubsystem
     double _gsNeedleDeflection;
     double _gsNeedleDeflectionNorm;
     
-    // realism setting, are false courses and GS lobes enabled?
-    bool _falseCoursesEnabled;
-
     SGSharedPtr<SGSampleGroup> _sgr;
+    std::vector<SGPropertyNode*> _tiedNodes;
     
     bool updateWithPower(double aDt);
 
@@ -189,6 +196,21 @@ class FGNavRadio : public SGSubsystem
      */
     double localizerWidth(FGNavRecord* aLOC);
     FGNavRecord* findPrimaryNavaid(const SGGeod& aPos, double aFreqMHz);
+    
+    /// accessor for tied, read-only 'operable' property
+    bool isOperable() const
+      { return _operable; }
+      
+    /**
+     * Tied-properties helper, record nodes which are tied for easy un-tie-ing
+     */
+    template <typename T>
+    void tie(const char* aRelPath, const SGRawValue<T>& aRawValue)
+    {
+      SGPropertyNode* nd = _radio_node->getNode(aRelPath, true);
+      _tiedNodes.push_back(nd);
+      nd->tie(aRawValue);
+    }
 public:
 
     FGNavRadio(SGPropertyNode *node);
index e00ac4f1a98ae8158f1d525e9fd2fc6041f80c4e..b17c8bb346386e06a01cc995085621808b966d48 100755 (executable)
@@ -127,6 +127,9 @@ TACAN::init ()
 void
 TACAN::update (double delta_time_sec)
 {
+    // don't do anything when paused
+    if (delta_time_sec == 0) return;
+
     if (!_serviceable_node->getBoolValue() || !_electrical_node->getBoolValue()) {
         _last_distance_nm = 0;
         _in_range_node->setBoolValue(false);
@@ -237,7 +240,7 @@ TACAN::update (double delta_time_sec)
         }
         _distance_node->setDoubleValue( tmp_dist );
         _speed_node->setDoubleValue(speed_kt);
-        _time_node->setDoubleValue(distance_nm/speed_kt*60.0);
+        _time_node->setDoubleValue(speed_kt > 0 ? (distance_nm/speed_kt*60.0) : 0);
         _bearing_node->setDoubleValue(bearing);
         _x_shift_node->setDoubleValue(x_shift);
         _y_shift_node->setDoubleValue(y_shift);
diff --git a/src/Instrumentation/testgps.cxx b/src/Instrumentation/testgps.cxx
new file mode 100644 (file)
index 0000000..cc73bde
--- /dev/null
@@ -0,0 +1,227 @@
+
+#include <Main/fg_init.hxx>
+#include <Main/globals.hxx>
+#include <Main/fg_props.hxx>
+
+#include <Instrumentation/gps.hxx>
+#include <Autopilot/route_mgr.hxx>
+#include <Environment/environment_mgr.hxx>
+
+using std::string;
+
+char *homedir = ::getenv( "HOME" );
+char *hostname = ::getenv( "HOSTNAME" );
+bool free_hostname = false;
+
+void testSetPosition(const SGGeod& aPos)
+{
+  fgSetDouble("/position/longitude-deg", aPos.getLongitudeDeg());
+  fgSetDouble("/position/latitude-deg", aPos.getLatitudeDeg());
+  fgSetDouble("/position/altitude-ft", aPos.getElevationFt());
+}
+
+void printScratch(SGPropertyNode* scratch)
+{
+  if (!scratch->getBoolValue("valid", false)) {
+    SG_LOG(SG_GENERAL, SG_ALERT, "Scratch is invalid."); 
+    return;
+  }
+
+  SG_LOG(SG_GENERAL, SG_ALERT, "Scratch:" <<
+    scratch->getStringValue("ident") << "/" << scratch->getStringValue("name"));
+  
+  SG_LOG(SG_GENERAL, SG_ALERT, "\t" << scratch->getDoubleValue("longitude-deg")
+    << " " << scratch->getDoubleValue("latitude-deg") << " @ " << scratch->getDoubleValue("altitude-ft"));
+    
+  SG_LOG(SG_GENERAL, SG_ALERT, "\t" << scratch->getDoubleValue("true-bearing-deg") <<
+    " (" << scratch->getDoubleValue("mag-bearing-deg") << " magnetic) " << scratch->getDoubleValue("distance-nm"));
+  
+  if (scratch->hasChild("result-index")) {
+    SG_LOG(SG_GENERAL, SG_ALERT, "\tresult-index:" << scratch->getIntValue("result-index"));
+  } 
+  
+  if (scratch->hasChild("route-index")) {
+    SG_LOG(SG_GENERAL, SG_ALERT, "\troute-index:" << scratch->getIntValue("route-index"));
+  }
+}
+
+void createDummyRoute(FGRouteMgr* rm)
+{
+  SGPropertyNode* rmInput = fgGetNode("/autopilot/route-manager/input", true);
+  rmInput->setStringValue("UW");
+  rmInput->setStringValue("TLA/347/13");
+  rmInput->setStringValue("TLA");
+  rmInput->setStringValue("HAVEN");
+  rmInput->setStringValue("NEW/305/29");
+  rmInput->setStringValue("NEW");
+  rmInput->setStringValue("OTR");
+}
+
+int main(int argc, char* argv[])
+{
+  globals = new FGGlobals;
+    
+  fgInitFGRoot(argc, argv);
+  if (!fgInitConfig(argc, argv) ) {
+    SG_LOG( SG_GENERAL, SG_ALERT, "Config option parsing failed" );
+    exit(-1);
+  }
+  
+  
+  fgInitNav();
+  
+  SG_LOG(SG_GENERAL, SG_ALERT, "hello world!");
+  
+  const FGAirport* egph = fgFindAirportID("EGPH");
+  SG_LOG(SG_GENERAL, SG_ALERT, "egph: cart location:" << egph->cart());
+  
+  FGAirport::AirportFilter af;
+  FGPositioned::List l = FGPositioned::findClosestN(egph->geod(), 20, 2000.0, &af);
+  for (unsigned int i=0; i<l.size(); ++i) {
+    SG_LOG(SG_GENERAL, SG_ALERT, "\t" << l[i]->ident() << "/" << l[i]->name());
+  }
+  
+  //l = FGPositioned::findWithinRange(egph->geod(), 500.0, &af);
+  //for (unsigned int i=0; i<l.size(); ++i) {
+  //  SG_LOG(SG_GENERAL, SG_ALERT, "\t" << l[i]->ident() << "/" << l[i]->name());
+  //}
+  
+
+  FGRouteMgr* rm = new FGRouteMgr;
+  globals->add_subsystem( "route-manager", rm );
+  
+ // FGEnvironmentMgr* envMgr = new FGEnvironmentMgr;
+ // globals->add_subsystem("environment", envMgr);
+ // envMgr->init();
+  
+  
+  SGPropertyNode* nd = fgGetNode("/instrumentation/gps", true);
+  GPS* gps = new GPS(nd);
+  globals->add_subsystem("gps", gps);
+  
+  
+  testSetPosition(egph->geod());
+  
+  // startup the route manager
+  rm->init();
+  
+  nd->setBoolValue("serviceable", true);
+  fgSetBool("/systems/electrical/outputs/gps", true);
+  
+  gps->init();
+  SGPropertyNode* scratch  = nd->getChild("scratch", 0, true);
+  SGPropertyNode* wp = nd->getChild("wp", 0, true);
+  SGPropertyNode* wp1 = wp->getChild("wp", 1, true);
+  
+  // update a few times
+  gps->update(0.05);
+  gps->update(0.05);
+  
+  scratch->setStringValue("query", "TL");
+  scratch->setStringValue("type", "Vor");
+  scratch->setBoolValue("exact", false);
+  nd->setStringValue("command", "search");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+// alphanumeric sort, partial matching
+  nd->setDoubleValue("config/min-runway-length-ft", 5000.0);
+  scratch->setBoolValue("exact", false);
+  scratch->setBoolValue("order-by-distance", false);
+  scratch->setStringValue("query", "KS");
+  scratch->setStringValue("type", "apt");
+  
+  nd->setStringValue("command", "search");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+// alphanumeric sort, explicit matching
+  scratch->setBoolValue("exact", true);
+  scratch->setBoolValue("order-by-distance", true);
+  scratch->setStringValue("type", "vor");
+  scratch->setStringValue("query", "DCS");
+  
+  nd->setStringValue("command", "search");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+// search on totally missing
+  scratch->setBoolValue("exact", true);
+  scratch->setBoolValue("order-by-distance", true);
+  scratch->setStringValue("query", "FOFOFOFOF");
+  nd->setStringValue("command", "search");
+  printScratch(scratch);
+  
+// nearest
+  scratch->setStringValue("type", "apt");
+  scratch->setIntValue("max-results", 10);
+  nd->setStringValue("command", "nearest");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+// direct to
+  nd->setStringValue("command", "direct");
+  SG_LOG(SG_GENERAL, SG_ALERT, "mode:" << nd->getStringValue("mode") << "\n\t"
+    << wp1->getStringValue("ID") << " " << wp1->getDoubleValue("longitude-deg") 
+    << " " << wp1->getDoubleValue("latitude-deg"));
+
+// OBS mode
+  scratch->setStringValue("query", "UW");
+  scratch->setBoolValue("order-by-distance", true);
+  nd->setStringValue("command", "search");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "obs");
+  SG_LOG(SG_GENERAL, SG_ALERT, "mode:" << nd->getStringValue("mode") << "\n\t"
+    << wp1->getStringValue("ID") << " " << wp1->getDoubleValue("longitude-deg") 
+    << " " << wp1->getDoubleValue("latitude-deg"));
+  
+// load route waypoints
+  createDummyRoute(rm);
+
+  scratch->setIntValue("route-index", 5);
+  nd->setStringValue("command", "load-route-wpt");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+  nd->setStringValue("command", "next");
+  printScratch(scratch);
+  
+  scratch->setIntValue("route-index", 2);
+  nd->setStringValue("command", "load-route-wpt");
+  nd->setStringValue("command", "direct");
+  SG_LOG(SG_GENERAL, SG_ALERT, "mode:" << nd->getStringValue("mode") << "\n\t"
+    << wp1->getStringValue("ID") << " " << wp1->getDoubleValue("longitude-deg") 
+    << " " << wp1->getDoubleValue("latitude-deg"));
+  
+// route editing
+  SGGeod pos = egph->geod();
+  scratch->setStringValue("ident", "FOOBAR");
+  scratch->setDoubleValue("longitude-deg", pos.getLongitudeDeg());
+  scratch->setDoubleValue("latitude-deg", pos.getLatitudeDeg());
+  nd->setStringValue("command", "define-user-wpt");
+  printScratch(scratch);
+  
+  
+  
+  return EXIT_SUCCESS;
+}
index 9ba93143df6374b22c8743940fd123e4441fa75a..57371b1d87bb4feb49fa2eb5457643282409fa9f 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include "CameraGroup.hxx"
 
 #include "globals.hxx"
@@ -317,7 +321,11 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode)
                            | CullSettings::VIEW_FRUSTUM_CULLING);
     camera->setInheritanceMask(CullSettings::ALL_VARIABLES
                                & ~(CullSettings::CULL_MASK
-                                   | CullSettings::CULLING_MODE));
+                                   | CullSettings::CULLING_MODE
+#if defined(HAVE_CULLSETTINGS_CLEAR_MASK)
+                                   | CullSettings::CLEAR_MASK
+#endif
+                                   ));
 
     osg::Matrix pOff;
     osg::Matrix vOff;
@@ -418,7 +426,11 @@ CameraInfo* CameraGroup::buildGUICamera(SGPropertyNode* cameraNode,
         camera->setClearMask(0);
     camera->setInheritanceMask(CullSettings::ALL_VARIABLES
                                & ~(CullSettings::COMPUTE_NEAR_FAR_MODE
-                                   | CullSettings::CULLING_MODE));
+                                   | CullSettings::CULLING_MODE
+#if defined(HAVE_CULLSETTINGS_CLEAR_MASK)
+                                   | CullSettings::CLEAR_MASK
+#endif
+                                   ));
     camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
     camera->setCullingMode(osg::CullSettings::NO_CULLING);
     camera->setProjectionResizePolicy(Camera::FIXED);
index f4c24345dba3ee70367dddb7fda15b9cf80a329d..6b4f08569a7a70f6d3f0c346c972b11113c7e29d 100644 (file)
@@ -51,6 +51,7 @@ using std::endl;
 
 #include "main.hxx"
 #include "globals.hxx"
+#include "fg_props.hxx"
 #include "fgviewer.hxx"
 
 
index a78759c42f1a0c2384951f1b1293081f0d987c46..dc64bc9c3b452b0bfc7312760adff91bdef1c0b3 100644 (file)
@@ -37,6 +37,7 @@
 #  define getcwd _getcwd
 #  include <io.h>               // isatty()
 #  define isatty _isatty
+#  include "Winsock2.h"                // for gethostname()
 #endif
 
 // work around a stdc++ lib bug in some versions of linux, but doesn't
@@ -48,6 +49,8 @@
 #include <simgear/compiler.h>
 
 #include <string>
+#include <boost/algorithm/string/compare.hpp>
+#include <boost/algorithm/string/predicate.hpp>
 
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
@@ -74,6 +77,8 @@
 #include <ATCDCL/AIMgr.hxx>
 #include <Autopilot/route_mgr.hxx>
 #include <Autopilot/xmlauto.hxx>
+#include <Autopilot/autobrake.hxx>
+
 #include <Cockpit/cockpit.hxx>
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
 #endif
 
 using std::string;
+using namespace boost::algorithm;
 
 extern const char *default_root;
 
@@ -550,7 +556,7 @@ static string fgFindAircraftPath( const SGPath &path, const string &aircraft,
             n->setStringValue(path.str().c_str());
             n->setAttribute(SGPropertyNode::USERARCHIVE, true);
 
-            if ( !strcmp(dire->d_name, aircraft.c_str()) ) {
+            if ( boost::equals(dire->d_name, aircraft.c_str(), is_iequal()) ) {
                 result = path.str();
                 break;
             }
@@ -633,7 +639,7 @@ bool fgInitConfig ( int argc, char **argv ) {
             vector<SGPropertyNode_ptr> cache = cache_root->getChildren("aircraft");
             for (unsigned int i = 0; i < cache.size(); i++) {
                 const char *name = cache[i]->getStringValue("file", "");
-                if (aircraft_set == name) {
+                if (boost::equals(aircraft_set, name, is_iequal())) {
                     const char *path = cache[i]->getStringValue("path", "");
                     SGPath xml(path);
                     xml.append(name);
@@ -1438,6 +1444,7 @@ bool fgInitSubsystems() {
     //     = fgGetNode("/sim/presets/latitude-deg");
     // static const SGPropertyNode *altitude
     //     = fgGetNode("/sim/presets/altitude-ft");
+
     SG_LOG( SG_GENERAL, SG_INFO, "Initialize Subsystems");
     SG_LOG( SG_GENERAL, SG_INFO, "========== ==========");
 
@@ -1530,7 +1537,8 @@ bool fgInitSubsystems() {
 
     globals->add_subsystem( "xml-autopilot", new FGXMLAutopilot );
     globals->add_subsystem( "route-manager", new FGRouteMgr );
-
+    globals->add_subsystem( "autobrake", new FGAutoBrake );
+    
     ////////////////////////////////////////////////////////////////////
     // Initialize the view manager subsystem.
     ////////////////////////////////////////////////////////////////////
index 066f0262b0e56d85f14bc3df5ed308221a9f7d9d..31f4ae0dac7f5403c1d706349c7ba24d51ff7293 100644 (file)
@@ -85,20 +85,26 @@ LogClassMapping log_class_mappings [] = {
 /**
  * Get the logging classes.
  */
+// XXX Making the result buffer be global is a band-aid that hopefully
+// delays its destruction 'til after its last use.
+namespace
+{
+string loggingResult;
+}
+
 static const char *
 getLoggingClasses ()
 {
   sgDebugClass classes = logbuf::get_log_classes();
-  static string result;
-  result = "";
+  loggingResult.clear();
   for (int i = 0; log_class_mappings[i].c != SG_UNDEFD; i++) {
     if ((classes&log_class_mappings[i].c) > 0) {
-      if (!result.empty())
-       result += '|';
-      result += log_class_mappings[i].name;
+      if (!loggingResult.empty())
+       loggingResult += '|';
+      loggingResult += log_class_mappings[i].name;
     }
   }
-  return result.c_str();
+  return loggingResult.c_str();
 }
 
 
index 5df7d9116ae78ab86c15983c386471fcc992bb36..fdf0bfd38fb4a8b145d8dc6340d7c293a197e2d7 100644 (file)
@@ -47,6 +47,7 @@
 #include <simgear/scene/model/animation.hxx>
 #include <simgear/scene/sky/sky.hxx>
 #include <simgear/structure/event_mgr.hxx>
+#include <simgear/props/AtomicChangeListener.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/timing/sg_time.hxx>
 #include <simgear/math/sg_random.h>
@@ -167,7 +168,7 @@ void fgUpdateTimeDepCalcs() {
                 // normal playback
                 replay_time->setDoubleValue( replay_time->getDoubleValue()
                                              + ( delta_time_sec
-                                               * fgGetInt("/sim/speed-up") ) );
+                                                 * fgGetInt("/sim/speed-up") ) );
             } else if ( replay_state->getIntValue() == 2 ) {
                 // paused playback (don't advance replay time)
             }
@@ -344,14 +345,14 @@ static void fgMainLoop( void ) {
     // probably move eventually
 
     /* printf("Before - ground = %.2f  runway = %.2f  alt = %.2f\n",
-           scenery.get_cur_elev(),
-           cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
-           cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
+       scenery.get_cur_elev(),
+       cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
+       cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
 
     /* printf("Adjustment - ground = %.2f  runway = %.2f  alt = %.2f\n",
-           scenery.get_cur_elev(),
-           cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
-           cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
+       scenery.get_cur_elev(),
+       cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
+       cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
 
     // cout << "Warp = " << globals->get_warp() << endl;
 
@@ -423,7 +424,7 @@ static void fgMainLoop( void ) {
         general.set_frame_rate( frames );
         fgSetInt("/sim/frame-rate", frames);
         SG_LOG( SG_ALL, SG_DEBUG,
-            "--> Frame rate is = " << general.get_frame_rate() );
+                "--> Frame rate is = " << general.get_frame_rate() );
         frames = 0;
     }
     last_time = t->get_cur_time();
@@ -452,7 +453,7 @@ static void fgMainLoop( void ) {
         fgUpdateTimeDepCalcs();
     } else {
         SG_LOG( SG_ALL, SG_DEBUG,
-            "Elapsed time is zero ... we're zinging" );
+                "Elapsed time is zero ... we're zinging" );
     }
 
     globals->get_subsystem_mgr()->update(delta_time_sec);
@@ -524,7 +525,7 @@ static void fgMainLoop( void ) {
         globals->get_props()->tie("/sim/sound/devices/name",
               SGRawValueFunctions<const char *>(0, fgSetNewSoundDevice), false);
     }
-
+    simgear::AtomicChangeListener::fireChangeListeners();
     fgRequestRedraw();
 
     SG_LOG( SG_ALL, SG_DEBUG, "" );
@@ -817,7 +818,9 @@ static void fgIdleFunction ( void ) {
                                          fgGetInt("/sim/startup/ysize") );
 
         fgSplashProgress("loading scenery objects");
-
+        int session = fgGetInt("/sim/session",0);
+        session++;
+        fgSetInt("/sim/session",session);
     }
 
     if ( idle_state == 1000 ) {
index 9b51185110068b2f28f71677f417a3da35f87385..bededfb71e43ed8cbbfe535954bb60a1f5d57440 100644 (file)
@@ -62,6 +62,7 @@
 #include "util.hxx"
 #include "viewmgr.hxx"
 #include <Main/viewer.hxx>
+#include <simgear/version.h>
 
 using std::string;
 using std::sort;
@@ -1197,9 +1198,22 @@ fgOptParking( const char *arg )
 static int
 fgOptVersion( const char *arg )
 {
-    cerr << VERSION << endl;
+    cerr << "FlightGear version: " << VERSION << endl;
     cerr << "FG_ROOT=" << globals->get_fg_root() << endl;
     cerr << "FG_HOME=" << fgGetString("/sim/fg-home") << endl;
+    cerr << "FG_SCENERY=";
+
+    int didsome = 0;
+    string_list scn = globals->get_fg_scenery();
+    for (string_list::const_iterator it = scn.begin(); it != scn.end(); it++)
+    {
+        if (didsome) cerr << ":";
+        didsome++;
+        cerr << *it;
+    }
+    cerr << endl;
+    cerr << "SimGear version: " << SG_STRINGIZE(SIMGEAR_VERSION) << endl;
+    cerr << "PLIB version: " << PLIB_VERSION << endl;
     return FG_OPTIONS_EXIT;
 }
 
index ef3fe6e104ae7cdd587ec547498dc2cdf6cbac4f..32d7953380b417271fbedd5aead6ba626d1ae3df 100644 (file)
@@ -47,6 +47,7 @@
 #include <osg/Notify>
 #include <osg/PolygonMode>
 #include <osg/PolygonOffset>
+#include <osg/Program>
 #include <osg/Version>
 #include <osg/TexEnv>
 
@@ -66,6 +67,7 @@
 #include <simgear/scene/util/SGSceneUserData.hxx>
 #include <simgear/scene/tgdb/GroundLightManager.hxx>
 #include <simgear/scene/tgdb/pt_lights.hxx>
+#include <simgear/structure/OSGUtils.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/timing/sg_time.hxx>
 #include <simgear/ephemeris/ephemeris.hxx>
@@ -137,6 +139,7 @@ public:
   {
     // Dynamic stuff, do not store geometry
     setUseDisplayList(false);
+    setDataVariance(Object::DYNAMIC);
 
     osg::StateSet* stateSet = getOrCreateStateSet();
     stateSet->setRenderBinDetails(1001, "RenderBin");
@@ -182,6 +185,7 @@ public:
   {
     // Dynamic stuff, do not store geometry
     setUseDisplayList(false);
+    setDataVariance(Object::DYNAMIC);
 
     osg::StateSet* stateSet = getOrCreateStateSet();
     stateSet->setRenderBinDetails(1000, "RenderBin");
@@ -232,6 +236,18 @@ private:
 
 class FGLightSourceUpdateCallback : public osg::NodeCallback {
 public:
+  
+  /**
+   * @param isSun true if the light is the actual sun i.e., for
+   * illuminating the moon.
+   */
+  FGLightSourceUpdateCallback(bool isSun = false) : _isSun(isSun) {}
+  FGLightSourceUpdateCallback(const FGLightSourceUpdateCallback& nc,
+                              const CopyOp& op)
+    : NodeCallback(nc, op), _isSun(nc._isSun)
+  {}
+  META_Object(flightgear,FGLightSourceUpdateCallback);
+  
   virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
   {
     assert(dynamic_cast<osg::LightSource*>(node));
@@ -239,21 +255,22 @@ public:
     osg::Light* light = lightSource->getLight();
     
     FGLight *l = static_cast<FGLight*>(globals->get_subsystem("lighting"));
-    light->setAmbient(toOsg(l->scene_ambient()));
-    light->setDiffuse(toOsg(l->scene_diffuse()));
-    light->setSpecular(toOsg(l->scene_specular()));
+    if (_isSun) {
+      light->setAmbient(Vec4(0.0f, 0.0f, 0.0f, 0.0f));
+      light->setDiffuse(Vec4(1.0f, 1.0f, 1.0f, 1.0f));
+      light->setSpecular(Vec4(0.0f, 0.0f, 0.0f, 0.0f));
+    } else {
+      light->setAmbient(toOsg(l->scene_ambient()));
+      light->setDiffuse(toOsg(l->scene_diffuse()));
+      light->setSpecular(toOsg(l->scene_specular()));
+    }
     osg::Vec4f position(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2], 0);
     light->setPosition(position);
-    osg::Vec3f direction(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2]);
-    light->setDirection(direction);
-    light->setSpotExponent(0);
-    light->setSpotCutoff(180);
-    light->setConstantAttenuation(1);
-    light->setLinearAttenuation(0);
-    light->setQuadraticAttenuation(0);
 
     traverse(node, nv);
   }
+private:
+  const bool _isSun;
 };
 
 class FGWireFrameModeUpdateCallback : public osg::StateAttribute::Callback {
@@ -466,16 +483,39 @@ FGRenderer::init( void )
     stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON);
 
     // need to update the light on every frame
-    osg::LightSource* lightSource = new osg::LightSource;
-    lightSource->setUpdateCallback(new FGLightSourceUpdateCallback);
+    // OSG LightSource objects are rather confusing. OSG only supports
+    // the 10 lights specified by OpenGL itself; if more than one
+    // LightSource in the scene graph have the same light number, it's
+    // indeterminate which values will be used to render geometry that
+    // has that light number enabled. Also, adding children to a
+    // LightSource is just a shortcut for setting up a state set that
+    // has the corresponding OpenGL light enabled: a LightSource will
+    // affect geometry anywhere in the scene graph that has its light
+    // number enabled in a state set. 
+    LightSource* lightSource = new LightSource;
+    lightSource->getLight()->setDataVariance(Object::DYNAMIC);
     // relative because of CameraView being just a clever transform node
     lightSource->setReferenceFrame(osg::LightSource::RELATIVE_RF);
     lightSource->setLocalStateSetModes(osg::StateAttribute::ON);
-    
-    lightSource->addChild(sceneGroup);
-    lightSource->addChild(thesky->getPreRoot());
-    mRoot->addChild(lightSource);
-
+    lightSource->setUpdateCallback(new FGLightSourceUpdateCallback);
+    mRealRoot->addChild(lightSource);
+    // we need a white diffuse light for the phase of the moon
+    osg::LightSource* sunLight = new osg::LightSource;
+    sunLight->getLight()->setDataVariance(Object::DYNAMIC);
+    sunLight->getLight()->setLightNum(1);
+    sunLight->setUpdateCallback(new FGLightSourceUpdateCallback(true));
+    sunLight->setReferenceFrame(osg::LightSource::RELATIVE_RF);
+    sunLight->setLocalStateSetModes(osg::StateAttribute::ON);
+    // Hang a StateSet above the sky subgraph in order to turn off
+    // light 0
+    Group* skyGroup = new Group;
+    StateSet* skySS = skyGroup->getOrCreateStateSet();
+    skySS->setMode(GL_LIGHT0, StateAttribute::OFF);
+    skyGroup->addChild(thesky->getPreRoot());
+    sunLight->addChild(skyGroup);
+    mRoot->addChild(sceneGroup);
+    mRoot->addChild(sunLight);
+    // Clouds are added to the scene graph later
     stateSet = globals->get_scenery()->get_scene_graph()->getOrCreateStateSet();
     stateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
     stateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON);
@@ -510,8 +550,15 @@ FGRenderer::init( void )
     sw->setUpdateCallback(new FGScenerySwitchCallback);
     sw->addChild(mRoot.get());
     mRealRoot->addChild(sw);
+    // The clouds are attached directly to the scene graph root
+    // because, in theory, they don't want the same default state set
+    // as the rest of the scene. This may not be true in practice.
     mRealRoot->addChild(thesky->getCloudRoot());
     mRealRoot->addChild(FGCreateRedoutNode());
+    // Attach empty program to the scene root so that shader programs
+    // don't leak into state sets (effects) that shouldn't have one.
+    stateSet = mRealRoot->getOrCreateStateSet();
+    stateSet->setAttributeAndModes(new osg::Program, osg::StateAttribute::ON);
 }
 
 
@@ -611,42 +658,16 @@ FGRenderer::update( bool refresh_camera_settings ) {
         }
 
         SGSkyState sstate;
-
-        SGVec3d viewPos = current__view->getViewPosition();
-        sstate.view_pos  = toVec3f(viewPos);
-        SGGeod geodViewPos = SGGeod::fromCart(viewPos);
-        SGGeod geodZeroViewPos = SGGeod::fromGeodM(geodViewPos, 0);
-        sstate.zero_elev = toVec3f(SGVec3d::fromGeod(geodZeroViewPos));
-        SGQuatd hlOr = SGQuatd::fromLonLat(geodViewPos);
-        sstate.view_up   = toVec3f(hlOr.backTransform(-SGVec3d::e3()));
-        sstate.lon       = geodViewPos.getLongitudeRad();
-        sstate.lat       = geodViewPos.getLatitudeRad();
-        sstate.alt       = geodViewPos.getElevationM();
+        sstate.pos       = current__view->getViewPosition();
+        sstate.pos_geod  = current__view->getPosition();
+        sstate.ori       = current__view->getViewOrientation();
         sstate.spin      = l->get_sun_rotation();
         sstate.gst       = globals->get_time_params()->getGst();
         sstate.sun_dist  = 50000.0 * sun_horiz_eff;
         sstate.moon_dist = 40000.0 * moon_horiz_eff;
         sstate.sun_angle = l->get_sun_angle();
 
-
-        /*
-         SG_LOG( SG_GENERAL, SG_BULK, "thesky->repaint() sky_color = "
-         << l->sky_color()[0] << " "
-         << l->sky_color()[1] << " "
-         << l->sky_color()[2] << " "
-         << l->sky_color()[3] );
-        SG_LOG( SG_GENERAL, SG_BULK, "    fog = "
-         << l->fog_color()[0] << " "
-         << l->fog_color()[1] << " "
-         << l->fog_color()[2] << " "
-         << l->fog_color()[3] );
-        SG_LOG( SG_GENERAL, SG_BULK,
-                "    sun_angle = " << l->sun_angle
-         << "    moon_angle = " << l->moon_angle );
-        */
-
         SGSkyColor scolor;
-
         scolor.sky_color   = SGVec3f(l->sky_color().data());
         scolor.adj_sky_color = SGVec3f(l->adj_sky_color().data());
         scolor.fog_color   = SGVec3f(l->adj_fog_color().data());
index 9dca91cc47d2250335e6b19d160dcb3f72e2d392..403617891f2027276978b7110de7146a8bcfc845 100644 (file)
@@ -109,6 +109,7 @@ private:
 };
 
 
+
 class FGSplashContentProjectionCalback : public osg::NodeCallback {
 public:
   virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
@@ -143,11 +144,49 @@ public:
   }
 };
 
+char *genNameString()
+{
+    string website = "http://www.flightgear.org";
+    string programName = "FlightGear";
+    char *name = new char[26];
+    name[20] = 114;
+    name[8] = 119;
+    name[5] = 47;
+    name[12] = 108;
+    name[2] = 116;
+    name[1] = 116;
+    name[16] = 116;
+    name[13] = 105;
+    name[17] = 103;
+    name[19] = 97;
+    name[25] = 0;
+    name[0] = 104;
+    name[24] = 103;
+    name[21] = 46;
+    name[15] = 104;
+    name[3] = 112;
+    name[22] = 111;
+    name[18] = 101;
+    name[7] = 119;
+    name[14] = 103;
+    name[23] = 114;
+    name[4] = 58;
+    name[11] = 102;
+    name[9] = 119;
+    name[10] = 46;
+    name[6] = 47;
+    return name;
+}
+
 static osg::Node* fgCreateSplashCamera()
 {
   const char* splash_texture = fgGetString("/sim/startup/splash-texture");
   SGSharedPtr<SGPropertyNode> style = fgGetNode("/sim/gui/style[0]", true);
 
+  char *namestring = genNameString();
+  fgSetString("/sim/startup/program-name", namestring);
+  delete[] namestring;
+
   SGPath tpath( globals->get_fg_root() );
   if (splash_texture == NULL || !strcmp(splash_texture, "")) {
     // load in the texture data
@@ -260,10 +299,21 @@ static osg::Node* fgCreateSplashCamera()
 
   text = new osgText::Text;
   text->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str());
-  text->setCharacterSize(0.06);
+  text->setCharacterSize(0.08);
   text->setColor(osg::Vec4(1, 1, 1, 1));
   text->setPosition(osg::Vec3(0, 0.92, 0));
   text->setAlignment(osgText::Text::CENTER_CENTER);
+  prop = fgGetNode("/sim/startup/program-name", "FlightGear");
+  text->setUpdateCallback(new FGSplashTextUpdateCallback(prop));
+  geode->addDrawable(text);
+
+
+  text = new osgText::Text;
+  text->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str());
+  text->setCharacterSize(0.06);
+  text->setColor(osg::Vec4(1, 1, 1, 1));
+  text->setPosition(osg::Vec3(0, 0.82, 0));
+  text->setAlignment(osgText::Text::CENTER_CENTER);
   prop = fgGetNode("/sim/startup/splash-title", true);
   text->setUpdateCallback(new FGSplashTextUpdateCallback(prop));
   geode->addDrawable(text);
index 6ac60caaaeb7b41b16b3b70d2526ecd4c6a78e4f..be6889fda55d048d80e0a63044be888fcfbb5d82 100644 (file)
@@ -102,6 +102,11 @@ FGPanelNode::FGPanelNode(SGPropertyNode* props)
         m(1,i) *= 1.0/_ymax;
     }
 
+    _lastViewport[0] = 0;
+    _lastViewport[1] = 0;
+    _lastViewport[2] = 0;
+    _lastViewport[3] = 0;
+
     dirtyBound();
 
     // All done.  Add us to the list
@@ -152,6 +157,11 @@ FGPanelNode::computeBound() const
 
 bool FGPanelNode::doMouseAction(int button, int updown, int x, int y)
 {
+    if (_lastViewport[2] == 0 || _lastViewport[3] == 0) {
+        // we haven't been drawn yet, presumably
+        return false;
+    }
+
     // Covert the screen coordinates to viewport coordinates in the
     // range [0:1], then transform to OpenGL "post projection" coords
     // in [-1:1].  Remember the difference in Y direction!
index 32e08ac03cf30ea02f497ae548d7c3b51c43b7f5..ab8ec1177b5c2a01602f4a16ab5eed9ac379d53b 100755 (executable)
@@ -32,6 +32,7 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sgstream.hxx>
 #include <simgear/route/waypoint.hxx>
+#include <simgear/misc/sg_path.hxx>
 
 #include "awynet.hxx"
 
@@ -47,18 +48,19 @@ FGNode::FGNode()
 {
 }
 
-FGNode::FGNode(double lt, double ln, int idx, std::string id) :
+FGNode::FGNode(const SGGeod& aPos, int idx, std::string id) :
   ident(id),
-  geod(SGGeod::fromDeg(ln, lt)),
+  geod(aPos),
   index(idx)
 {
+  cart = SGVec3d::fromGeod(geod);
 }
 
-bool FGNode::matches(string id, double lt, double ln)
+bool FGNode::matches(std::string id, const SGGeod& aPos)
 {
   if ((ident == id) &&
-      (fabs(lt - geod.getLatitudeDeg()) < 1.0) &&
-      (fabs(ln - geod.getLongitudeDeg()) < 1.0))
+      (fabs(aPos.getLatitudeDeg() - geod.getLatitudeDeg()) < 1.0) &&
+      (fabs(aPos.getLongitudeDeg() - geod.getLongitudeDeg()) < 1.0))
     return true;
   else
     return false;
@@ -195,9 +197,9 @@ void FGAirwayNetwork::init()
 }
 
 
-void FGAirwayNetwork::load(SGPath path)
+void FGAirwayNetwork::load(const SGPath& path)
 {
-  string identStart, identEnd, token, name;
+  std::string identStart, identEnd, token, name;
   double latStart, lonStart, latEnd, lonEnd;
   int type, base, top;
   int airwayIndex = 0;
@@ -272,7 +274,8 @@ void FGAirwayNetwork::load(SGPath path)
       node_map_iterator itr = nodesMap.find(string(buffer));
       if (itr == nodesMap.end()) {
        startIndex = nodes.size();
-       n = new FGNode(latStart, lonStart, startIndex, identStart);
+  SGGeod startPos(SGGeod::fromDeg(lonStart, latStart));
+       n = new FGNode(startPos, startIndex, identStart);
        nodesMap[string(buffer)] = n;
        nodes.push_back(n);
        //cout << "Adding node: " << identStart << endl;
@@ -287,7 +290,8 @@ void FGAirwayNetwork::load(SGPath path)
       itr = nodesMap.find(string(buffer));
       if (itr == nodesMap.end()) {
        endIndex = nodes.size();
-       n = new FGNode(latEnd, lonEnd, endIndex, identEnd);
+  SGGeod endPos(SGGeod::fromDeg(lonEnd, latEnd));
+       n = new FGNode(endPos, endIndex, identEnd);
        nodesMap[string(buffer)] = n;
        nodes.push_back(n);
        //cout << "Adding node: " << identEnd << endl;
@@ -310,32 +314,23 @@ void FGAirwayNetwork::load(SGPath path)
     }
   }
 
-  int FGAirwayNetwork::findNearestNode(double lat, double lon)
+int FGAirwayNetwork::findNearestNode(const SGGeod& aPos)
 {
   double minDist = HUGE_VAL;
-  double distsqrt, lat2, lon2;
   int index;
+  SGVec3d cart = SGVec3d::fromGeod(aPos);
+  
   //cerr << "Lat " << lat << " lon " << lon << endl;
   for (FGNodeVectorIterator
         itr = nodes.begin();
        itr != nodes.end(); itr++)
     {
-      lat2 = (*itr)->getLatitude();
-      lon2 = (*itr)->getLongitude();
-      // Note: This equation should adjust for decreasing distance per longitude
-      // with increasing lat.
-      distsqrt =
-       (lat-lat2)*(lat-lat2) +
-       (lon-lon2)*(lon-lon2);
-
-      if (distsqrt < minDist)
-       {
-         minDist = distsqrt;
-         //cerr << "Test" << endl;
-         index = (*itr)->getIndex();
-         //cerr << "Minimum distance of " << minDist << " for index " << index << endl;
-         //cerr << (*itr)->getLatitude() << " " << (*itr)->getLongitude() << endl;
-       }
+      double d2 = distSqr(cart, (*itr)->getCart());
+      if (d2 < minDist)
+      {
+        minDist = d2;
+                 index = (*itr)->getIndex();
+      }
       //cerr << (*itr)->getIndex() << endl;
     }
   //cerr << " returning  " << index << endl;
index 81bc073a9a9c08c22290f6fcbeb1e05bd5a619f2..9ac508204928218661b83d49ebabef903731c45b 100755 (executable)
 #include <map>
 #include <vector>
 
-#include <simgear/misc/sg_path.hxx>
 #include <simgear/misc/sgstream.hxx>
 
 
 //#include "parking.hxx"
 
 class FGAirway; // forward reference
+class SGPath;
+class SGGeod;
 
 typedef std::vector<FGAirway>  FGAirwayVector;
 typedef std::vector<FGAirway *> FGAirwayPointerVector;
@@ -51,28 +52,26 @@ class FGNode
 private:
   std::string ident;
   SGGeod geod;
+  SGVec3d cart; // cached cartesian position
   int index;
   FGAirwayPointerVector next; // a vector to all the segments leaving from this node
 
 public:
   FGNode();
-  FGNode(double lt, double ln, int idx, std::string id);
+  FGNode(const SGGeod& aPos, int idx, std::string id);
 
   void setIndex(int idx)                  { index = idx;};
   void addAirway(FGAirway *segment) { next.push_back(segment); };
 
-  double getLatitude() { return geod.getLatitudeDeg();};
-  double getLongitude(){ return geod.getLongitudeDeg();};
-
   const SGGeod& getPosition() {return geod;}
-
+  const SGVec3d& getCart() { return cart; }
   int getIndex() { return index; };
   std::string getIdent() { return ident; };
   FGNode *getAddress() { return this;};
   FGAirwayPointerVectorIterator getBeginRoute() { return next.begin(); };
   FGAirwayPointerVectorIterator getEndRoute()   { return next.end();   };
 
-  bool matches(std::string ident, double lat, double lon);
+  bool matches(std::string ident, const SGGeod& aPos);
 };
 
 typedef std::vector<FGNode *> FGNodeVector;
@@ -191,12 +190,12 @@ public:
 
   void init();
   bool exists() { return hasNetwork; };
-  int findNearestNode(double lat, double lon);
+  int findNearestNode(const SGGeod& aPos);
   FGNode *findNode(int idx);
   FGAirRoute findShortestRoute(int start, int end);
   void trace(FGNode *, int, int, double dist);
 
-  void load(SGPath path);
+  void load(const SGPath& path);
 };
 
 #endif
index f7c0cd8e1733f5502486c699ee0c08ff2ea4a3b9..4f7c10e7f8e89241e3d67d532ee6d7cfac6e0856 100644 (file)
@@ -240,11 +240,10 @@ FGRunway* getRunwayFromName(const std::string& aName)
     return NULL;
   }
   
-  FGRunway* runway = apt->getRunwayByIdent(parts[1]);
-  if (!runway) {
+  if (!apt->hasRunwayWithIdent(parts[1])) {
     SG_LOG(SG_GENERAL, SG_WARN, "navaid " << aName << " associated with bogus runway ID:" << parts[1]);
     return NULL;
   }
 
-  return runway;
+  return apt->getRunwayByIdent(parts[1]);
 }
index 6bb71a54c9d2e40e3506b4e17e451b910e80fd94..e75339804036ea7fbb73b929a1b64fe15d3184e6 100644 (file)
@@ -91,6 +91,9 @@ void FGNavRecord::initAirportRelation()
   }
   
   mRunway = getRunwayFromName(_name);  
+  if (!mRunway) {
+    return;
+  }
   
   if (type() != GS) {
     readAirportSceneryData();
index f43e4b82f2eb9ced5192bf31837cbac1a3633f54..bbd0443063330acacd69b9d72c22a3cc7088f3cb 100644 (file)
 #include <map>
 #include <set>
 #include <algorithm> // for sort
-#include <locale> // for char-traits toupper
+#include <queue>
 
-#include <iostream>
+#include <boost/algorithm/string/case_conv.hpp>
+#include <boost/algorithm/string/predicate.hpp>
 
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/timestamp.hxx>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/structure/exception.hxx>
+#include <simgear/math/SGBox.hxx>
 
 #include "positioned.hxx"
 
@@ -40,72 +44,371 @@ typedef std::pair<NamedPositionedIndex::const_iterator, NamedPositionedIndex::co
 using std::lower_bound;
 using std::upper_bound;
 
+static NamedPositionedIndex global_identIndex;
+static NamedPositionedIndex global_nameIndex;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace Octree
+{
+
+const double LEAF_SIZE = SG_NM_TO_METER * 8.0;
+const double LEAF_SIZE_SQR = LEAF_SIZE * LEAF_SIZE;
+
+typedef SGBox<double> SGBoxd;
+
+template<typename T1, typename T2>
+inline bool
+intersects(const SGVec3<T1>& v, const SGBox<T2>& box)
+{
+  if (v[0] < box.getMin()[0])
+    return false;
+  if (box.getMax()[0] < v[0])
+    return false;
+  if (v[1] < box.getMin()[1])
+    return false;
+  if (box.getMax()[1] < v[1])
+    return false;
+  if (v[2] < box.getMin()[2])
+    return false;
+  if (box.getMax()[2] < v[2])
+    return false;
+  return true;
+}
+
 /**
- * Order positioned elements by type, then pointer address. This allows us to
- * use range searches (lower_ and upper_bound) to grab items of a particular
- * type out of bucket efficently.
+ * Decorate an object with a double value, and use that value to order 
+ * items, for the purpoises of the STL algorithms
  */
-class OrderByType
+template <class T>
+class Ordered
 {
 public:
-  bool operator()(const FGPositioned* a, const FGPositioned* b) const
-  {
-    if (a->type() == b->type()) return a < b;
-    return a->type() < b->type();
-  }
+    Ordered(const T& v, double x) :
+        _order(x),
+        _inner(v)
+    {
+    }
+    
+    Ordered(const Ordered<T>& a) :
+        _order(a._order),
+        _inner(a._inner)
+    {
+    }
+    
+    Ordered<T>& operator=(const Ordered<T>& a)
+    {
+        _order = a._order;
+        _inner = a._inner;
+        return *this;
+    }
+    
+    bool operator<(const Ordered<T>& other) const
+    {
+        return _order < other._order;
+    }
+    
+    bool operator>(const Ordered<T>& other) const
+    {
+        return _order > other._order;
+    }
+    
+    const T& get() const
+        { return _inner; }
+    
+    double order() const
+        { return _order; }
+    
+private:    
+    double _order;
+    T _inner;
 };
 
-class LowerLimitOfType
+class Node;
+typedef Ordered<Node*> OrderedNode;
+typedef std::greater<OrderedNode> FNPQCompare; 
+
+/**
+ * the priority queue is fundamental to our search algorithm. When searching,
+ * we know the front of the queue is the nearest unexpanded node (to the search
+ * location). The default STL pqueue returns the 'largest' item from top(), so
+ * to get the smallest, we need to replace the default Compare functor (less<>)
+ * with greater<>.
+ */
+typedef std::priority_queue<OrderedNode, std::vector<OrderedNode>, FNPQCompare> FindNearestPQueue;
+
+typedef Ordered<FGPositioned*> OrderedPositioned;
+typedef std::vector<OrderedPositioned> FindNearestResults;
+
+Node* global_spatialOctree = NULL;
+
+/**
+ * Octree node base class, tracks its bounding box and provides various
+ * queries relating to it
+ */
+class Node
 {
 public:
-  bool operator()(const FGPositioned* a, const FGPositioned::Type b) const
-  {
-    return a->type() < b;
-  }
-
-  bool operator()(const FGPositioned::Type a, const FGPositioned* b) const
-  {
-    return a < b->type();
-  }
+    bool contains(const SGVec3d& aPos) const
+    {
+        return intersects(aPos, _box);
+    }
 
-  // The operator below is required by VS2005 in debug mode
-  bool operator()(const FGPositioned* a, const FGPositioned* b) const
-  {
-    return a->type() < b->type();
-  }
+    double distSqrToNearest(const SGVec3d& aPos) const
+    {
+        return distSqr(aPos, getClosestPoint(aPos));
+    }
+    
+    virtual void insert(FGPositioned* aP) = 0;
+    
+    SGVec3d getClosestPoint(const SGVec3d& aPos) const
+    {
+      SGVec3d r;
+      
+      for (unsigned int i=0;i<3; ++i) {
+        if (aPos[i] < _box.getMin()[i]) {
+          r[i] = _box.getMin()[i];
+        } else if (aPos[i] > _box.getMax()[i]) {
+          r[i] = _box.getMax()[i];
+        } else {
+          r[i] = aPos[i];
+        }
+      } // of axis iteration
+      
+      return r;
+    }
+    
+    virtual void visit(const SGVec3d& aPos, double aCutoff, 
+      FGPositioned::Filter* aFilter, 
+      FindNearestResults& aResults, FindNearestPQueue&) = 0;
+protected:
+    Node(const SGBoxd &aBox) :
+        _box(aBox)
+    {
+    }
+    
+    const SGBoxd _box;
 };
 
+class Leaf : public Node
+{
+public:
+    Leaf(const SGBoxd& aBox) :
+        Node(aBox)
+    {
+    }
+    
+    const FGPositioned::List& members() const
+    { return _members; }
+    
+    virtual void insert(FGPositioned* aP)
+    {
+        _members.push_back(aP);
+    }
+    
+    virtual void visit(const SGVec3d& aPos, double aCutoff, 
+      FGPositioned::Filter* aFilter, 
+      FindNearestResults& aResults, FindNearestPQueue&)
+    {
+        int previousResultsSize = aResults.size();
+        int addedCount = 0;
+        
+        for (unsigned int i=0; i<_members.size(); ++i) {
+            FGPositioned* p = _members[i];
+            double d2 = distSqr(aPos, p->cart());
+            if (d2 > aCutoff) {
+                continue;
+            }
+            
+            if (aFilter) {
+              if (aFilter->hasTypeRange() && !aFilter->passType(p->type())) {
+                continue;
+              }
+      
+              if (!aFilter->pass(p)) {
+                continue;
+              }
+            } // of have a filter
 
-typedef std::set<FGPositioned*, OrderByType> BucketEntry;
-typedef std::map<long int, BucketEntry> SpatialPositionedIndex;
+            ++addedCount;
+            aResults.push_back(OrderedPositioned(p, d2));
+        }
+        
+        if (addedCount == 0) {
+          return;
+        }
+        
+      // keep aResults sorted
+        // sort the new items, usually just one or two items
+        std::sort(aResults.begin() + previousResultsSize, aResults.end());
+        
+        // merge the two sorted ranges together - in linear time
+        std::inplace_merge(aResults.begin(), 
+          aResults.begin() + previousResultsSize, aResults.end());
+      }
+private:
+    FGPositioned::List _members;
+};
 
-static NamedPositionedIndex global_namedIndex;
-static SpatialPositionedIndex global_spatialIndex;
+class Branch : public Node
+{
+public:
+    Branch(const SGBoxd& aBox) :
+        Node(aBox)
+    {
+        memset(children, 0, sizeof(Node*) * 8);
+    }
+    
+    virtual void insert(FGPositioned* aP)
+    {
+        SGVec3d cart(aP->cart());
+        assert(contains(cart));
+        int childIndex = 0;
+        
+        SGVec3d center(_box.getCenter());
+    // tests must match indices in SGbox::getCorner
+        if (cart.x() < center.x()) {
+            childIndex += 1;
+        }
+        
+        if (cart.y() < center.y()) {
+            childIndex += 2;
+        }
+        
+        if (cart.z() < center.z()) {
+            childIndex += 4;
+        }
+        
+        Node* child = children[childIndex];
+        if (!child) { // lazy building of children
+            SGBoxd cb(boxForChild(childIndex));            
+            double d2 = dot(cb.getSize(), cb.getSize());
+            if (d2 < LEAF_SIZE_SQR) {
+                child = new Leaf(cb);
+            } else {
+                child = new Branch(cb);
+            }
+            
+            children[childIndex] = child; 
+        }
+        
+        child->insert(aP);
+    }
+    
+    virtual void visit(const SGVec3d& aPos, double aCutoff, 
+      FGPositioned::Filter*, 
+      FindNearestResults&, FindNearestPQueue& aQ)
+    {    
+        for (unsigned int i=0; i<8; ++i) {
+            if (!children[i]) {
+                continue;
+            }
+            
+            double d2 = children[i]->distSqrToNearest(aPos);
+            if (d2 > aCutoff) {
+                continue; // exceeded cutoff
+            }
+            
+            aQ.push(Ordered<Node*>(children[i], d2));
+        } // of child iteration
+    }
+    
+    
+private:
+    /**
+     * Return the box for a child touching the specified corner
+     */
+    SGBoxd boxForChild(unsigned int aCorner) const
+    {
+        SGBoxd r(_box.getCenter());
+        r.expandBy(_box.getCorner(aCorner));
+        return r;
+    }
+    
+    Node* children[8];
+};
 
-SpatialPositionedIndex::iterator
-bucketEntryForPositioned(FGPositioned* aPos)
+void findNearestN(const SGVec3d& aPos, unsigned int aN, double aCutoffM, FGPositioned::Filter* aFilter, FGPositioned::List& aResults)
 {
-  int bucketIndex = aPos->bucket().gen_index();
-  SpatialPositionedIndex::iterator it = global_spatialIndex.find(bucketIndex);
-  if (it != global_spatialIndex.end()) {
-    return it;
-  }
-  
-  // create a new BucketEntry
-  return global_spatialIndex.insert(it, std::make_pair(bucketIndex, BucketEntry()));
+    aResults.clear();
+    FindNearestPQueue pq;
+    FindNearestResults results;
+    pq.push(Ordered<Node*>(global_spatialOctree, 0));
+    double cut = aCutoffM * aCutoffM;
+    
+    while (!pq.empty()) {
+        if (!results.empty()) {
+          // terminate the search if we have sufficent results, and we are
+          // sure no node still on the queue contains a closer match
+          double furthestResultOrder = results.back().order();
+          if ((results.size() >= aN) && (furthestResultOrder < pq.top().order())) {
+            break;
+          }
+        }
+        
+        Node* nd = pq.top().get();
+        pq.pop();
+        
+        nd->visit(aPos, cut, aFilter, results, pq);
+    } // of queue iteration
+    
+    // depending on leaf population, we may have (slighty) more results
+    // than requested
+    unsigned int numResults = std::min((unsigned int) results.size(), aN);
+  // copy results out
+    aResults.resize(numResults);
+    for (unsigned int r=0; r<numResults; ++r) {
+      aResults[r] = results[r].get();
+    }
 }
 
+void findAllWithinRange(const SGVec3d& aPos, double aRangeM, FGPositioned::Filter* aFilter, FGPositioned::List& aResults)
+{
+    aResults.clear();
+    FindNearestPQueue pq;
+    FindNearestResults results;
+    pq.push(Ordered<Node*>(global_spatialOctree, 0));
+    double rng = aRangeM * aRangeM;
+    
+    while (!pq.empty()) {
+        Node* nd = pq.top().get();
+        pq.pop();
+        
+        nd->visit(aPos, rng, aFilter, results, pq);
+    } // of queue iteration
+    
+    unsigned int numResults = results.size();
+  // copy results out
+    aResults.resize(numResults);
+    for (unsigned int r=0; r<numResults; ++r) {
+      aResults[r] = results[r].get();
+    }
+}
+
+} // of namespace Octree
+
+//////////////////////////////////////////////////////////////////////////////
+
 static void
 addToIndices(FGPositioned* aPos)
 {
   assert(aPos);
   if (!aPos->ident().empty()) {
-    global_namedIndex.insert(global_namedIndex.begin(), 
+    global_identIndex.insert(global_identIndex.begin(), 
       std::make_pair(aPos->ident(), aPos));
   }
-    
-  SpatialPositionedIndex::iterator it = bucketEntryForPositioned(aPos);
-  it->second.insert(aPos);
+  
+  if (!aPos->name().empty()) {
+    global_nameIndex.insert(global_nameIndex.begin(), 
+                             std::make_pair(aPos->name(), aPos));
+  }
+
+  if (!Octree::global_spatialOctree) {
+    double RADIUS_EARTH_M = 7000 * 1000.0; // 7000km is plenty
+    SGVec3d earthExtent(RADIUS_EARTH_M, RADIUS_EARTH_M, RADIUS_EARTH_M);
+    Octree::global_spatialOctree = new Octree::Branch(SGBox<double>(-earthExtent, earthExtent));
+  }
+  Octree::global_spatialOctree->insert(aPos);
 }
 
 static void
@@ -114,10 +417,10 @@ removeFromIndices(FGPositioned* aPos)
   assert(aPos);
   
   if (!aPos->ident().empty()) {
-    NamedPositionedIndex::iterator it = global_namedIndex.find(aPos->ident());
-    while (it != global_namedIndex.end() && (it->first == aPos->ident())) {
+    NamedPositionedIndex::iterator it = global_identIndex.find(aPos->ident());
+    while (it != global_identIndex.end() && (it->first == aPos->ident())) {
       if (it->second == aPos) {
-        global_namedIndex.erase(it);
+        global_identIndex.erase(it);
         break;
       }
       
@@ -125,87 +428,17 @@ removeFromIndices(FGPositioned* aPos)
     } // of multimap walk
   }
   
-  SpatialPositionedIndex::iterator sit = bucketEntryForPositioned(aPos);
-  sit->second.erase(aPos);
-}
-
-static void
-spatialFilterInBucket(const SGBucket& aBucket, FGPositioned::Filter* aFilter, FGPositioned::List& aResult)
-{
-  SpatialPositionedIndex::const_iterator it;
-  it = global_spatialIndex.find(aBucket.gen_index());
-  if (it == global_spatialIndex.end()) {
-    return;
-  }
-  
-  BucketEntry::const_iterator l = it->second.begin();
-  BucketEntry::const_iterator u = it->second.end();
-
-  if (!aFilter) { // pass everything
-    aResult.insert(aResult.end(), l, u);
-    return;
-  }
-
-  if (aFilter->hasTypeRange()) {
-    // avoid many calls to the filter hook
-    l = lower_bound(it->second.begin(), it->second.end(), aFilter->minType(), LowerLimitOfType());
-    u = upper_bound(l, it->second.end(), aFilter->maxType(), LowerLimitOfType());
-  }
-
-  for ( ; l != u; ++l) {
-    if ((*aFilter)(*l)) {
-      aResult.push_back(*l);
-    }
-  }
-}
-
-static void
-spatialFind(const SGGeod& aPos, double aRange, 
-  FGPositioned::Filter* aFilter, FGPositioned::List& aResult)
-{
-  SGBucket buck(aPos);
-  double lat = aPos.getLatitudeDeg(),
-    lon = aPos.getLongitudeDeg();
-  
-  int bx = (int)( aRange*SG_NM_TO_METER / buck.get_width_m() / 2);
-  int by = (int)( aRange*SG_NM_TO_METER / buck.get_height_m() / 2 );
-    
-  // loop over bucket range 
-  for ( int i=-bx; i<=bx; i++) {
-    for ( int j=-by; j<=by; j++) {
-      spatialFilterInBucket(sgBucketOffset(lon, lat, i, j), aFilter, aResult);
-    } // of j-iteration
-  } // of i-iteration  
-}
-
-/**
- */
-class RangePredictate
-{
-public:
-  RangePredictate(const SGGeod& aOrigin, double aRange) :
-    mOrigin(SGVec3d::fromGeod(aOrigin)),
-    mRangeSqr(aRange * aRange)
-  { ; }
-  
-  bool operator()(const FGPositionedRef& aPos)
-  {
-    double dSqr = distSqr(aPos->cart(), mOrigin);
-    return (dSqr > mRangeSqr);
+  if (!aPos->name().empty()) {
+    NamedPositionedIndex::iterator it = global_nameIndex.find(aPos->name());
+    while (it != global_nameIndex.end() && (it->first == aPos->name())) {
+      if (it->second == aPos) {
+        global_nameIndex.erase(it);
+        break;
+      }
+      
+      ++it;
+    } // of multimap walk
   }
-  
-private:
-  SGVec3d mOrigin;
-  double mRangeSqr;
-};
-
-static void
-filterListByRange(const SGGeod& aPos, double aRange, FGPositioned::List& aResult)
-{
-  RangePredictate pred(aPos, aRange * SG_NM_TO_METER);
-  FGPositioned::List::iterator newEnd; 
-  newEnd = std::remove_if(aResult.begin(), aResult.end(), pred);
-  aResult.erase(newEnd, aResult.end());
 }
 
 class DistanceOrdering
@@ -217,6 +450,10 @@ public:
   
   bool operator()(const FGPositionedRef& a, const FGPositionedRef& b) const
   {
+    if (!a || !b) {
+      throw sg_exception("empty reference passed to DistanceOrdering");
+    }
+  
     double dA = distSqr(a->cart(), mPos),
       dB = distSqr(b->cart(), mPos);
     return dA < dB;
@@ -233,9 +470,10 @@ sortByDistance(const SGGeod& aPos, FGPositioned::List& aResult)
 }
 
 static FGPositionedRef
-namedFindClosest(const std::string& aIdent, const SGGeod& aOrigin, FGPositioned::Filter* aFilter)
+namedFindClosest(const NamedPositionedIndex& aIndex, const std::string& aName, 
+                 const SGGeod& aOrigin, FGPositioned::Filter* aFilter)
 {
-  NamedIndexRange range = global_namedIndex.equal_range(aIdent);
+  NamedIndexRange range = aIndex.equal_range(aName);
   if (range.first == range.second) {
     return NULL;
   }
@@ -288,51 +526,6 @@ namedFindClosest(const std::string& aIdent, const SGGeod& aOrigin, FGPositioned:
   return result;
 }
 
-static FGPositioned::List
-spatialGetClosest(const SGGeod& aPos, unsigned int aN, double aCutoffNm, FGPositioned::Filter* aFilter)
-{
-  FGPositioned::List result;
-  int radius = 1; // start at 1, radius 0 is handled explicitly
-  SGBucket buck;
-  double lat = aPos.getLatitudeDeg(),
-    lon = aPos.getLongitudeDeg();
-  // final cutoff is in metres, and scaled to account for testing the corners
-  // of the 'box' instead of the centre of each edge
-  double cutoffM = aCutoffNm * SG_NM_TO_METER * 1.5;
-  
-  // base case, simplifes loop to do it seperately here
-  spatialFilterInBucket(sgBucketOffset(lon, lat, 0, 0), aFilter, result);
-
-  for (;result.size() < aN; ++radius) {
-    // cutoff check
-    double az1, az2, d1, d2;
-    SGGeodesy::inverse(aPos, sgBucketOffset(lon, lat, -radius, -radius).get_center(), az1, az2, d1);
-    SGGeodesy::inverse(aPos, sgBucketOffset(lon, lat, radius, radius).get_center(), az1, az2, d2);  
-      
-    if ((d1 > cutoffM) && (d2 > cutoffM)) {
-      //std::cerr << "spatialGetClosest terminating due to range cutoff" << std::endl;
-      break;
-    }
-    
-    FGPositioned::List hits;
-    for ( int i=-radius; i<=radius; i++) {
-      spatialFilterInBucket(sgBucketOffset(lon, lat, i, -radius), aFilter, hits);
-      spatialFilterInBucket(sgBucketOffset(lon, lat, -radius, i), aFilter, hits);
-      spatialFilterInBucket(sgBucketOffset(lon, lat, i, radius), aFilter, hits);
-      spatialFilterInBucket(sgBucketOffset(lon, lat, radius, i), aFilter, hits);
-    }
-
-    result.insert(result.end(), hits.begin(), hits.end()); // append
-  } // of outer loop
-  
-  sortByDistance(aPos, result);
-  if (result.size() > aN) {
-    result.resize(aN); // truncate at requested number of matches
-  }
-  
-  return result;
-}
-
 //////////////////////////////////////////////////////////////////////////////
 
 class OrderByName
@@ -358,8 +551,8 @@ char** searchAirportNamesAndIdents(const std::string& aFilter)
     ct.toupper((char *)filter.data(), (char *)filter.data() + filter.size());
   }
   
-  NamedPositionedIndex::const_iterator it = global_namedIndex.begin();
-  NamedPositionedIndex::const_iterator end = global_namedIndex.end();
+  NamedPositionedIndex::const_iterator it = global_identIndex.begin();
+  NamedPositionedIndex::const_iterator end = global_identIndex.end();
   
   // note this is a vector of raw pointers, not smart pointers, because it
   // may get very large and smart-pointer-atomicity-locking then becomes a
@@ -437,6 +630,77 @@ FGPositioned::Filter::passType(Type aTy) const
   return (minType() <= aTy) && (maxType() >= aTy);
 }
 
+static FGPositioned::List
+findAllSortedByRange(const NamedPositionedIndex& aIndex, 
+                             const std::string& aName, const SGGeod& aPos, FGPositioned::Filter* aFilter)
+{
+  FGPositioned::List result;
+  NamedIndexRange range = aIndex.equal_range(aName);
+  for (; range.first != range.second; ++range.first) {
+    FGPositioned* candidate = range.first->second;
+    if (aFilter) {
+      if (aFilter->hasTypeRange() && !aFilter->passType(candidate->type())) {
+        continue;
+      }
+      
+      if (!aFilter->pass(candidate)) {
+        continue;
+      }
+    }
+    
+    result.push_back(range.first->second);
+  }
+  
+  sortByDistance(aPos, result);
+  return result;
+}
+
+static FGPositionedRef
+findWithPartial(const NamedPositionedIndex& aIndex, const std::string& aName, 
+                    FGPositioned::Filter* aFilter, int aOffset, bool& aNext)
+{
+  // see comment in findNextWithPartialId concerning upperBoundId
+  std::string upperBoundId = aName;
+  upperBoundId[upperBoundId.size()-1]++;
+  NamedPositionedIndex::const_iterator upperBound = aIndex.lower_bound(upperBoundId);
+  
+  NamedIndexRange range = aIndex.equal_range(aName);
+  FGPositionedRef result;
+  
+  while (range.first != upperBound) {
+    for (; range.first != range.second; ++range.first) {
+      FGPositionedRef candidate = range.first->second;
+      if (aFilter) {
+        if (aFilter->hasTypeRange() && !aFilter->passType(candidate->type())) {
+          continue;
+        }
+        
+        if (!aFilter->pass(candidate)) {
+          continue;
+        }
+      }
+      
+      if (result) {
+        aNext = true;
+        return result;
+      } else if (aOffset == 0) {
+        // okay, found our result. we need to go around once more to set aNext
+        result = candidate;
+      } else {
+        --aOffset; // seen one more valid result, decrement the count
+      }
+    }
+    
+    // Unable to match the filter with this range - try the next range.
+    range = aIndex.equal_range(range.second->first);
+  }
+  
+  // if we fell out, we reached the end of the valid range. We might have a
+  // valid result, but we definitiely don't have a next result.
+  aNext = false;
+  return result;  
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 
 FGPositioned::FGPositioned(Type ty, const std::string& aIdent, const SGGeod& aPos, bool aIndexed) :
@@ -458,6 +722,12 @@ FGPositioned::~FGPositioned()
   removeFromIndices(this);
 }
 
+FGPositioned*
+FGPositioned::createUserWaypoint(const std::string& aIdent, const SGGeod& aPos)
+{
+  return new FGPositioned(WAYPOINT, aIdent, aPos, true);
+}
+
 SGBucket
 FGPositioned::bucket() const
 {
@@ -470,6 +740,47 @@ FGPositioned::cart() const
   return SGVec3d::fromGeod(mPosition);
 }
 
+FGPositioned::Type FGPositioned::typeFromName(const std::string& aName)
+{
+  if (aName.empty() || (aName == "")) {
+    return INVALID;
+  }
+
+  typedef struct {
+    const char* _name;
+    Type _ty;
+  } NameTypeEntry;
+  
+  const NameTypeEntry names[] = {
+    {"airport", AIRPORT},
+    {"vor", VOR},
+    {"ndb", NDB},
+    {"wpt", WAYPOINT},
+    {"fix", FIX},
+    {"tacan", TACAN},
+    {"dme", DME},
+  // aliases
+    {"waypoint", WAYPOINT},
+    {"apt", AIRPORT},
+    {"arpt", AIRPORT},
+    {"any", INVALID},
+    {"all", INVALID},
+    
+    {NULL, INVALID}
+  };
+  
+  std::string lowerName(boost::to_lower_copy(aName));
+  
+  for (const NameTypeEntry* n = names; (n->_name != NULL); ++n) {
+    if (::strcmp(n->_name, lowerName.c_str()) == 0) {
+      return n->_ty;
+    }
+  }
+  
+  SG_LOG(SG_GENERAL, SG_WARN, "FGPositioned::typeFromName: couldn't match:" << aName);
+  return INVALID;
+}
+
 const char* FGPositioned::nameForType(Type aTy)
 {
  switch (aTy) {
@@ -503,39 +814,34 @@ const char* FGPositioned::nameForType(Type aTy)
 FGPositionedRef
 FGPositioned::findClosestWithIdent(const std::string& aIdent, const SGGeod& aPos, Filter* aFilter)
 {
-  return namedFindClosest(aIdent, aPos, aFilter);
+  return namedFindClosest(global_identIndex, aIdent, aPos, aFilter);
 }
 
 FGPositioned::List
 FGPositioned::findWithinRange(const SGGeod& aPos, double aRangeNm, Filter* aFilter)
 {
   List result;
-  spatialFind(aPos, aRangeNm, aFilter, result);
-  filterListByRange(aPos, aRangeNm, result);
+  Octree::findAllWithinRange(SGVec3d::fromGeod(aPos), 
+    aRangeNm * SG_NM_TO_METER, aFilter, result);
   return result;
 }
 
 FGPositioned::List
 FGPositioned::findAllWithIdentSortedByRange(const std::string& aIdent, const SGGeod& aPos, Filter* aFilter)
 {
-  List result;
-  NamedIndexRange range = global_namedIndex.equal_range(aIdent);
-  for (; range.first != range.second; ++range.first) {
-    if (aFilter && !aFilter->pass(range.first->second)) {
-      continue;
-    }
-    
-    result.push_back(range.first->second);
-  }
-  
-  sortByDistance(aPos, result);
-  return result;
+  return findAllSortedByRange(global_identIndex, aIdent, aPos, aFilter);
+}
+
+FGPositioned::List
+FGPositioned::findAllWithNameSortedByRange(const std::string& aName, const SGGeod& aPos, Filter* aFilter)
+{
+  return findAllSortedByRange(global_nameIndex, aName, aPos, aFilter);
 }
 
 FGPositionedRef
 FGPositioned::findClosest(const SGGeod& aPos, double aCutoffNm, Filter* aFilter)
 {
-   FGPositioned::List l(spatialGetClosest(aPos, 1, aCutoffNm, aFilter));
+   List l(findClosestN(aPos, 1, aCutoffNm, aFilter));
    if (l.empty()) {
       return NULL;
    }
@@ -547,50 +853,28 @@ FGPositioned::findClosest(const SGGeod& aPos, double aCutoffNm, Filter* aFilter)
 FGPositioned::List
 FGPositioned::findClosestN(const SGGeod& aPos, unsigned int aN, double aCutoffNm, Filter* aFilter)
 {
-  return spatialGetClosest(aPos, aN, aCutoffNm, aFilter);
+  List result;
+  Octree::findNearestN(SGVec3d::fromGeod(aPos), aN, aCutoffNm * SG_NM_TO_METER, aFilter, result);
+  return result;
 }
 
-/*
 FGPositionedRef
 FGPositioned::findNextWithPartialId(FGPositionedRef aCur, const std::string& aId, Filter* aFilter)
 {
-  NamedIndexRange range = global_namedIndex.equal_range(aId);
-  for (; range.first != range.second; ++range.first) {
-    FGPositionedRef candidate = range.first->second;
-    if (aCur == candidate) {
-      aCur = NULL; // found our start point, next match will pass
-      continue;
-    }
-    
-    if (aFilter) {
-      if (aFilter->hasTypeRange() && !aFilter->passType(candidate->type())) {
-        continue;
-      }
-
-      if(!aFilter->pass(candidate)) {
-        continue;
-      }
-    }
-  
-    if (!aCur) {
-      return candidate;
-    }
+  if (aId.empty()) {
+    return NULL;
   }
   
-  return NULL; // fell out, no match in range
-}*/
+  std::string id(boost::to_upper_copy(aId));
 
-FGPositionedRef
-FGPositioned::findNextWithPartialId(FGPositionedRef aCur, const std::string& aId, Filter* aFilter)
-{
   // It is essential to bound our search, to avoid iterating all the way to the end of the database.
   // Do this by generating a second ID with the final character incremented by 1.
   // e.g., if the partial ID is "KI", we wish to search "KIxxx" but not "KJ".
-  std::string upperBoundId = aId;
+  std::string upperBoundId = id;
   upperBoundId[upperBoundId.size()-1]++;
-  NamedPositionedIndex::const_iterator upperBound = global_namedIndex.lower_bound(upperBoundId);
+  NamedPositionedIndex::const_iterator upperBound = global_identIndex.lower_bound(upperBoundId);
 
-  NamedIndexRange range = global_namedIndex.equal_range(aId);
+  NamedIndexRange range = global_identIndex.equal_range(id);
   while (range.first != upperBound) {
     for (; range.first != range.second; ++range.first) {
       FGPositionedRef candidate = range.first->second;
@@ -615,10 +899,121 @@ FGPositioned::findNextWithPartialId(FGPositionedRef aCur, const std::string& aId
     }
 
     // Unable to match the filter with this range - try the next range.
-    range = global_namedIndex.equal_range(range.second->first);
+    range = global_identIndex.equal_range(range.second->first);
   }
 
   return NULL; // Reached the end of the valid sequence with no match.  
 }
   
+FGPositionedRef
+FGPositioned::findWithPartialId(const std::string& aId, Filter* aFilter, int aOffset, bool& aNext)
+{
+  return findWithPartial(global_identIndex, aId, aFilter, aOffset, aNext);
+}
+
+
+FGPositionedRef
+FGPositioned::findWithPartialName(const std::string& aName, Filter* aFilter, int aOffset, bool& aNext)
+{
+  return findWithPartial(global_nameIndex, aName, aFilter, aOffset, aNext);
+}
+
+/**
+ * Wrapper filter which proxies to an inner filter, but also ensures the
+ * ident starts with supplied partial ident.
+ */
+class PartialIdentFilter : public FGPositioned::Filter
+{
+public:
+  PartialIdentFilter(const std::string& ident, FGPositioned::Filter* filter) :
+    _inner(filter)
+  {
+    _ident = boost::to_upper_copy(ident);
+  }
+  
+  virtual bool pass(FGPositioned* aPos) const
+  {
+    if (!_inner->pass(aPos)) {
+      return false;
+    }
+    
+    return (boost::algorithm::starts_with(aPos->ident(), _ident));
+  }
+    
+  virtual FGPositioned::Type minType() const
+  { return _inner->minType(); }
+    
+  virtual FGPositioned::Type maxType() const
+  { return _inner->maxType(); }
+    
+private:
+  std::string _ident;
+  FGPositioned::Filter* _inner;
+};
+
+static FGPositionedRef
+findClosestWithPartial(const SGGeod& aPos, FGPositioned::Filter* aFilter, int aOffset, bool& aNext)
+{
+  // why aOffset +2 ? at offset=3, we want the fourth search result, but also
+  // to know if the fifth result exists (to set aNext flag for iterative APIs)
+  FGPositioned::List matches;
+  Octree::findNearestN(SGVec3d::fromGeod(aPos), aOffset + 2, 1000 * SG_NM_TO_METER, aFilter, matches);
+  
+  if ((int) matches.size() <= aOffset) {
+    SG_LOG(SG_GENERAL, SG_INFO, "findClosestWithPartial, couldn't match enough with prefix");
+    aNext = false;
+    return NULL; // couldn't find a match within the cutoff distance
+  }
+  
+  aNext = ((int) matches.size() >= (aOffset + 2));
+  return matches[aOffset];
+
+}
+
+FGPositionedRef
+FGPositioned::findClosestWithPartialId(const SGGeod& aPos, const std::string& aId, Filter* aFilter, int aOffset, bool& aNext)
+{
+  PartialIdentFilter pf(aId, aFilter);
+  return findClosestWithPartial(aPos, &pf, aOffset, aNext);
+}
+
+/**
+ * Wrapper filter which proxies to an inner filter, but also ensures the
+ * name starts with supplied partial name.
+ */
+class PartialNameFilter : public FGPositioned::Filter
+{
+public:
+  PartialNameFilter(const std::string& nm, FGPositioned::Filter* filter) :
+  _inner(filter)
+  {
+    _name = nm;
+  }
+  
+  virtual bool pass(FGPositioned* aPos) const
+  {
+    if (!_inner->pass(aPos)) {
+      return false;
+    }
+    
+    return (boost::algorithm::istarts_with(aPos->name(), _name));
+  }
+  
+  virtual FGPositioned::Type minType() const
+  { return _inner->minType(); }
+  
+  virtual FGPositioned::Type maxType() const
+  { return _inner->maxType(); }
+  
+private:
+  std::string _name;
+  FGPositioned::Filter* _inner;
+};
+
+FGPositionedRef
+FGPositioned::findClosestWithPartialName(const SGGeod& aPos, const std::string& aName, Filter* aFilter, int aOffset, bool& aNext)
+{
+  PartialNameFilter pf(aName, aFilter);
+  return findClosestWithPartial(aPos, &pf, aOffset, aNext);
+}
 
index 93e4f6bbfee60ddf4da6ad03c54377bd1cb9e016..37f8910c1bd616a09221ef81e08ba9dafc684c8b 100644 (file)
@@ -158,6 +158,16 @@ public:
    */
   static FGPositionedRef findNextWithPartialId(FGPositionedRef aCur, const std::string& aId, Filter* aFilter = NULL);
   
+  /**
+   * As above, but searches using an offset index
+   */
+  static FGPositionedRef findWithPartialId(const std::string& aId, Filter* aFilter, int aOffset, bool& aNext);
+
+  /**
+   * As above, but search names instead of idents
+   */
+  static FGPositionedRef findWithPartialName(const std::string& aName, Filter* aFilter, int aOffset, bool& aNext);
+  
   /**
    * Find all items with the specified ident, and return then sorted by
    * distance from a position
@@ -166,6 +176,11 @@ public:
    */
   static List findAllWithIdentSortedByRange(const std::string& aIdent, const SGGeod& aPos, Filter* aFilter = NULL);
   
+  /**
+   * As above, but searches names instead of idents
+   */
+  static List findAllWithNameSortedByRange(const std::string& aName, const SGGeod& aPos, Filter* aFilter = NULL);
+  
   /**
    * Find the closest item to a position, which pass the specified filter
    * A cutoff range in NM must be specified, to constrain the search acceptably.
@@ -182,18 +197,36 @@ public:
    * Very large cutoff values will make this slow.
    * 
    * @result The matches (possibly less than N, depending on the filter and cutoff),
-  *    sorted by distance from the search pos
+   *    sorted by distance from the search pos
    * @param aN - number of matches to find
    * @param aCutoffNm - maximum distance to search within, in nautical miles
    */
   static List findClosestN(const SGGeod& aPos, unsigned int aN, double aCutoffNm, Filter* aFilter = NULL);
   
+  /**
+   * Find the closest match based on partial id (with an offset to allow selecting the n-th closest).
+   * Cutoff distance is limited internally, to avoid making this very slow.
+   */
+  static FGPositionedRef findClosestWithPartialId(const SGGeod& aPos, const std::string& aId, Filter* aFilter, int aOffset, bool& aNext);
+
+  /**
+   * As above, but matches on name
+   */
+  static FGPositionedRef findClosestWithPartialName(const SGGeod& aPos, const std::string& aName, Filter* aFilter, int aOffset, bool& aNext);
   
   
   /**
-   * Debug helper, map a type to a human-readable string
+   * Map a candidate type string to a real type. Returns INVALID if the string
+   * does not correspond to a defined type.
+   */
+  static Type typeFromName(const std::string& aName);
+  
+  /**
+   * Map a type to a human-readable string
    */
   static const char* nameForType(Type aTy);
+  
+  static FGPositioned* createUserWaypoint(const std::string& aIdent, const SGGeod& aPos);
 protected:
   
   FGPositioned(Type ty, const std::string& aIdent, const SGGeod& aPos, bool aIndex = true);
index 73c53733aa7f07ea1a36707e164104059d660115..cfa0eb72a2d388b46f63b24a1b68a380ca371d9d 100644 (file)
@@ -33,9 +33,6 @@
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/tgdb/userdata.hxx>
-#include <simgear/scene/material/Effect.hxx>
-#include <simgear/scene/material/EffectGeode.hxx>
-#include <simgear/scene/material/Technique.hxx>
 #include <simgear/scene/material/matlib.hxx>
 #include <simgear/scene/util/SGNodeMasks.hxx>
 #include <simgear/scene/util/SGSceneUserData.hxx>
@@ -253,47 +250,3 @@ SceneryPager* FGScenery::getPagerSingleton()
     return pager.get();
 }
 
-// Effect initialization stuff
-
-class PropertyExpression : public SGExpression<bool>
-{
-public:
-    PropertyExpression(SGPropertyNode* pnode) : _pnode(pnode) {}
-    
-    void eval(bool& value, const expression::Binding*) const
-    {
-        value = _pnode->getValue<bool>();
-    }
-protected:
-    SGPropertyNode_ptr _pnode;
-};
-
-class EffectPropertyListener : public SGPropertyChangeListener
-{
-public:
-    EffectPropertyListener(Technique* tniq) : _tniq(tniq) {}
-    
-    void valueChanged(SGPropertyNode* node)
-    {
-        _tniq->refreshValidity();
-    }
-protected:
-    osg::ref_ptr<Technique> _tniq;
-};
-
-Expression* propertyExpressionParser(const SGPropertyNode* exp,
-                                     expression::Parser* parser)
-{
-    SGPropertyNode_ptr pnode = fgGetNode(exp->getStringValue(), true);
-    PropertyExpression* pexp = new PropertyExpression(pnode);
-    TechniquePredParser* predParser
-        = dynamic_cast<TechniquePredParser*>(parser);
-    if (predParser)
-        pnode->addChangeListener(new EffectPropertyListener(predParser
-                                                            ->getTechnique()));
-    return pexp;
-}
-
-expression::ExpParserRegistrar propertyRegistrar("property",
-                                                 propertyExpressionParser);
-
index 4b97c385c0b5476515cc7988373f9d438e01477d..89fc0d9320dc6b63d55380012c554934003126ed 100644 (file)
@@ -2,10 +2,14 @@
 
 #include <deque>
 #include <map>
-#include <pair.h>
-#include <stdio.h>
+#include <iostream>
 #include <string>
 
+using std::deque;
+using std::map;
+using std::string;
+using std::less;
+using std::cout;
 
 main() {
     deque < int > mylist;
@@ -46,16 +50,18 @@ main() {
     mymap["dan"] = 24;
 
     printf("curt age = %d\n", mymap["curt"]);
-    printf("doug age = %d\n", mymap["doug"]);
+    printf("dan age = %d\n", mymap["dan"]);
 
 
-    map < string, int, less<string> > :: iterator test = mymap.find("dan");
+    map < string, int, less<string> > :: iterator test = mymap.find("doug");
     if ( test == mymap.end() ) {
-       printf("dan age = not found\n");
+       printf("doug age = not found\n");
     } else {
-       printf("dan age = %d\n",  (*test).second);
+       printf("doug age = %d\n",  (*test).second);
+        mymap.erase( "doug" );
     }
 
+    printf("\n");
     map < string, int, less<string> > :: iterator mapcurrent = mymap.begin();
     map < string, int, less<string> > :: iterator maplast = mymap.end();
     while ( mapcurrent != maplast ) {
index f44fb8b7c6ac950fb29e845ab4f5bef7d30f9090..a7bbb388bf7bf32802caec5364b072d409b56bd3 100644 (file)
@@ -236,13 +236,27 @@ void FGTileMgr::initialize_queue()
 osg::Node*
 FGTileMgr::loadTileModel(const string& modelPath, bool cacheModel)
 {
+    SGPath fullPath;
+    if (fgGetBool("/sim/paths/use-custom-scenery-data") == true) {
+        string_list sc = globals->get_fg_scenery();
+
+        for (string_list_iterator it = sc.begin(); it != sc.end(); ++it) {
+            SGPath tmpPath(*it);
+            tmpPath.append(modelPath);
+            if (tmpPath.exists()) {
+                fullPath = tmpPath;
+                break;
+            } 
+        }
+    } else {
+         fullPath.append(modelPath);
+    }
     osg::Node* result = 0;
     try {
         if(cacheModel)
             result =
-                SGModelLib::loadModel(modelPath, globals->get_props(),
+                SGModelLib::loadModel(fullPath.str(), globals->get_props(),
                                       new FGNasalModelData);
-
         else
             result=
                 SGModelLib::loadPagedModel(modelPath, globals->get_props(),
index c893d05103df161c33675f3e1ace2bdd57650597..3b1d995293ff896eef9ef91bcbf74065617fdd54 100644 (file)
@@ -32,6 +32,7 @@
 #include <Main/fg_props.hxx>
 #include <Main/util.hxx>
 #include <Scenery/scenery.hxx>
+#include <Navaids/navrecord.hxx>
 
 #include "NasalSys.hxx"
 
@@ -555,7 +556,9 @@ static naRef f_airportinfo(naContext c, naRef me, int argc, naRef* args)
             // user provided an <id>, hopefully
             apt = FGAirport::findByIdent(s);
             if (!apt) {
-                naRuntimeError(c, "airportinfo() couldn't find airport: %s", s);
+                // return nil here, but don't raise a runtime error; this is a
+                // legitamate way to validate an ICAO code, for example in a
+                // dialog box or similar.
                 return naNil();
             }
         }
@@ -591,6 +594,11 @@ static naRef f_airportinfo(naContext c, naRef me, int argc, naRef* args)
         HASHSET("width", 5, naNum(rwy->widthM()));
         HASHSET("threshold", 9, naNum(rwy->displacedThresholdM()));
         HASHSET("stopway", 7, naNum(rwy->stopwayM()));
+        
+        if (rwy->ILS()) {
+          HASHSET("ils_frequency_mhz", 17, naNum(rwy->ILS()->get_freq() / 100.0));
+        }
+        
 #undef HASHSET
         naHash_set(rwys, rwyid, rwydata);
     }
index 4ffc4d6016a4536298d2c8fec2ee86848280d354..9f309903a11b7401a2b7992a49926bd53da9ab89 100644 (file)
@@ -3,6 +3,9 @@
 #  include "config.h"
 #endif
 
+#include <cstring>
+
+#include <simgear/math/SGMath.hxx>
 #include <simgear/nasal/nasal.h>
 #include <simgear/props/props.hxx>
 
@@ -10,6 +13,8 @@
 
 #include "NasalSys.hxx"
 
+using namespace std;
+
 // Implementation of a Nasal wrapper for the SGPropertyNode class,
 // using the Nasal "ghost" (er... Garbage collection Handle for
 // OutSide Thingy) facility.
index c1d204ac339b4e289a040150951caf5379bc5274..cb5469a7fc5d66311df35a44aa5fb64f43dad356 100644 (file)
@@ -57,8 +57,6 @@ FGLight::FGLight ()
       _sun_lat(0),
       _moon_lon(0),
       _moon_gc_lat(0),
-      _sunpos(0, 0, 0),
-      _moonpos(0, 0, 0),
       _sun_vec(0, 0, 0, 0),
       _moon_vec(0, 0, 0, 0),
       _sun_vec_inv(0, 0, 0, 0),
@@ -71,6 +69,7 @@ FGLight::FGLight ()
       _scene_ambient(0, 0, 0, 0),
       _scene_diffuse(0, 0, 0, 0),
       _scene_specular(0, 0, 0, 0),
+      _scene_chrome(0, 0, 0, 0),
       _sky_color(0, 0, 0, 0),
       _fog_color(0, 0, 0, 0),
       _cloud_color(0, 0, 0, 0),
@@ -153,6 +152,15 @@ void FGLight::bind () {
     prop->tie("/rendering/dome/fog/red",SGRawValuePointer<float>(&_fog_color[0]));
     prop->tie("/rendering/dome/fog/green",SGRawValuePointer<float>(&_fog_color[1]));
     prop->tie("/rendering/dome/fog/blue",SGRawValuePointer<float>(&_fog_color[2]));
+    // Properties used directly by effects
+    _chromeProps[0] = prop->getNode("/rendering/scene/chrome-light/red", true);
+    _chromeProps[1] = prop->getNode("/rendering/scene/chrome-light/green",
+                                    true);
+    _chromeProps[2] = prop->getNode("/rendering/scene/chrome-light/blue", true);
+    _chromeProps[3] = prop->getNode("/rendering/scene/chrome-light/alpha",
+                                    true);
+    for (int i = 0; i < 4; ++i)
+        _chromeProps[i]->setValue(0.0);
 }
 
 void FGLight::unbind () {
@@ -170,10 +178,10 @@ void FGLight::unbind () {
     prop->untie("/rendering/dome/sun/red");
     prop->untie("/rendering/dome/sun/green");
     prop->untie("/rendering/dome/sun/blue");
-    prop->untie("/rendering/dome/skyred");
+    prop->untie("/rendering/dome/sky/red");
     prop->untie("/rendering/dome/sky/green");
     prop->untie("/rendering/dome/sky/blue");
-    prop->untie("/rendering/dome/fogred");
+    prop->untie("/rendering/dome/fog/red");
     prop->untie("/rendering/dome/fog/green");
     prop->untie("/rendering/dome/fog/blue");
 }
@@ -200,7 +208,7 @@ void FGLight::update_sky_color () {
     // if the 4th field is 0.0, this specifies a direction ...
     // const GLfloat white[4]          = { 1.0,  1.0,  1.0,  1.0 };
     const GLfloat base_sky_color[4] = { 0.31, 0.43, 0.69, 1.0 };
-    const GLfloat base_fog_color[4] = { 0.84, 0.87, 1.0,  1.0 };
+    const GLfloat base_fog_color[4] = { 0.60, 0.70, 0.9,  1.0 };
 
     SG_LOG( SG_EVENT, SG_DEBUG, "Updating light parameters." );
 
@@ -267,6 +275,14 @@ void FGLight::update_sky_color () {
     _scene_diffuse[3] = 1.0;
     gamma_correct_rgb( _scene_diffuse.data() );
 
+    SGVec4f chrome = _scene_ambient * .4f + _scene_diffuse;
+    chrome[3] = 1.0f;
+    if (chrome != _scene_chrome) {
+        _scene_chrome = chrome;
+        for (int i = 0; i < 4; ++i)
+            _chromeProps[i]->setValue(static_cast<double>(_scene_chrome[i]));
+    }
+
     color = thesky->get_sun_color();
     _scene_specular[0] = color[0] * specular;
     _scene_specular[1] = color[1] * specular;
@@ -330,9 +346,9 @@ void FGLight::update_adj_fog_color () {
     // Calculate the fog color in the direction of the sun for
     // sunrise/sunset effects.
     //
-    float s_red =   color[0]*color[0];
-    float s_green = color[1]*color[1];
-    float s_blue =  color[2];
+    float s_red =   color[0]*color[0]*color[0];
+    float s_green = color[1]*color[1]*color[1];
+    float s_blue =  color[2]*color[2];
 
     // interpolate beween the sunrise/sunset color and the color
     // at the opposite direction of this effect. Take in account
index ffffa5ab28c51c779c22b227ba0f5a9a0e1ed7cd..f3ecb32e16bf5f8f8c30c23ca2435ca6c36e38f3 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <simgear/compiler.h>
 
+#include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
 
@@ -60,9 +61,6 @@ private:
     double _sun_lon, _sun_lat;
     double _moon_lon, _moon_gc_lat;
 
-    // in cartesian coordiantes
-    SGVec3d _sunpos, _moonpos;
-
     // (in view coordinates)
     SGVec4f _sun_vec, _moon_vec;
 
@@ -88,6 +86,7 @@ private:
     SGVec4f _scene_ambient;
     SGVec4f _scene_diffuse;
     SGVec4f _scene_specular;
+    SGVec4f _scene_chrome;
 
     // clear sky, fog and cloud color
     SGVec4f _sky_color;
@@ -103,6 +102,9 @@ private:
     void update_sky_color ();
     void update_adj_fog_color ();
 
+    // properties for chrome light; not a tie because I want to fire
+    // property listeners when the values change.
+    SGPropertyNode_ptr _chromeProps[4];
 public:
 
     FGLight ();
@@ -120,6 +122,7 @@ public:
     inline const SGVec4f& scene_ambient () const { return _scene_ambient; }
     inline const SGVec4f& scene_diffuse () const { return _scene_diffuse; }
     inline const SGVec4f& scene_specular () const { return _scene_specular; }
+    inline const SGVec4f& scene_chrome () const { return _scene_chrome; }
 
     inline const SGVec4f& sky_color () const { return _sky_color; }
     inline const SGVec4f& cloud_color () const { return _cloud_color; }
@@ -141,9 +144,6 @@ public:
     inline double get_sun_lat () const { return _sun_lat; }
     inline void set_sun_lat (double l) { _sun_lat = l; }
 
-    inline const SGVec3d& get_sunpos () const { return _sunpos; }
-    inline void set_sunpos (const SGVec3d& p) { _sunpos = p; }
-
     inline SGVec4f& sun_vec () { return _sun_vec; }
     inline SGVec4f& sun_vec_inv () { return _sun_vec_inv; }
 
@@ -162,9 +162,6 @@ public:
     inline double get_moon_gc_lat () const { return _moon_gc_lat; }
     inline void set_moon_gc_lat (double l) { _moon_gc_lat = l; }
 
-    inline const SGVec3d& get_moonpos () const { return _moonpos; }
-    inline void set_moonpos (const SGVec3d& p) { _moonpos = p; }
-
     inline const SGVec4f& moon_vec () const { return _moon_vec; }
     inline const SGVec4f& moon_vec_inv () const { return _moon_vec_inv; }
 };
index 70cac6f823c14c167ded46db0ae339cf7534f15a..0e04d5b24f4d7919ea8b5abd8d68215c5908915b 100644 (file)
@@ -65,6 +65,49 @@ void fgUpdateLocalTime() {
 
 // update the cur_time_params structure with the current sun position
 void fgUpdateSunPos( void ) {
+#if 0
+    // This only works at lat,lon = 0,0
+    // need to find a way to get it working at other locations
+
+    FGLight *light = (FGLight *)(globals->get_subsystem("lighting"));
+    FGViewer *viewer = globals->get_current_view();
+    SGTime *time_now = globals->get_time_params();
+
+    SG_LOG( SG_EVENT, SG_DEBUG, "  Updating Sun position" );
+    SG_LOG( SG_EVENT, SG_DEBUG, "  Gst = " << time_now->getGst() );
+
+    double sun_lon, sun_lat;
+    fgSunPositionGST(time_now->getGst(), &sun_lon, &sun_lat);
+    light->set_sun_lon(sun_lon);
+    light->set_sun_lat(sun_lat);
+
+    // update the sun light vector
+    // calculations are in the horizontal normal plane: x-north, y-east, z-down
+    static SGQuatd q = SGQuatd::fromLonLat(SGGeod::fromRad(0,0));
+
+    // sun orientation
+    SGGeod geodSunPos = SGGeod::fromRad(sun_lon, sun_lat);
+    SGQuatd sunOr = SGQuatd::fromLonLat(geodSunPos);
+
+    // scenery orientation
+    SGGeod geodViewPos = SGGeod::fromCart(viewer->getViewPosition());
+    SGQuatd hlOr = SGQuatd::fromLonLat(geodViewPos);
+    SGVec3d localAt = hlOr.backTransform(SGVec3d::e3());
+
+    // transpose the sun direction from (lat,lon) to (0,0)
+    SGVec3d transSunDir = (q*sunOr).transform(-localAt);
+    SGQuatd sunDirOr = SGQuatd::fromRealImag(0, transSunDir);
+
+    // transpose the calculated sun vector back to (lat,lon)
+    SGVec3d sunDirection = sunDirOr.transform(localAt);
+    light->set_sun_rotation( acos(sunDirection[1])-SGD_PI_2 );
+    light->set_sun_angle( acos(-sunDirection[2]) );
+
+    SGVec3d sunPos = SGVec3d::fromGeod(geodSunPos);
+    light->sun_vec() = SGVec4f(toVec3f(normalize(sunPos)), 0);
+    light->sun_vec_inv() = -light->sun_vec();
+
+#else
     FGLight *l = (FGLight *)(globals->get_subsystem("lighting"));
     SGTime *t = globals->get_time_params();
     FGViewer *v = globals->get_current_view();
@@ -77,34 +120,33 @@ void fgUpdateSunPos( void ) {
     fgSunPositionGST(t->getGst(), &sun_l, &sun_gd_lat);
     l->set_sun_lon(sun_l);
     l->set_sun_lat(sun_gd_lat);
-    l->set_sunpos(SGVec3d::fromGeod(SGGeod::fromRad(sun_l, sun_gd_lat)));
+    SGVec3d sunpos(SGVec3d::fromGeod(SGGeod::fromRad(sun_l, sun_gd_lat)));
 
     SG_LOG( SG_EVENT, SG_DEBUG, "    t->cur_time = " << t->get_cur_time() );
     SG_LOG( SG_EVENT, SG_DEBUG,
-           "    Sun Geodetic lat = " << sun_gd_lat
-           << " Geodetic lat = " << sun_gd_lat );
+            "    Sun Geodetic lat = " << sun_gd_lat
+            << " Geodetic lat = " << sun_gd_lat );
 
     // update the sun light vector
-    l->sun_vec() = SGVec4f(toVec3f(normalize(l->get_sunpos())), 0);
+    l->sun_vec() = SGVec4f(toVec3f(normalize(sunpos)), 0);
     l->sun_vec_inv() = - l->sun_vec();
 
     // calculate the sun's relative angle to local up
     SGVec3d viewPos = v->get_view_pos();
     SGQuatd hlOr = SGQuatd::fromLonLat(SGGeod::fromCart(viewPos));
-    SGVec3f nup(toVec3f(hlOr.backTransform(-SGVec3d::e3())));
-
-    SGVec3f nsun(toVec3f(normalize(l->get_sunpos())));
-    // cout << "nup = " << nup[0] << "," << nup[1] << "," 
+    SGVec3f world_up = toVec3f(hlOr.backTransform(-SGVec3d::e3()));
+    SGVec3f nsun = toVec3f(normalize(sunpos));
+    // cout << "nup = " << nup[0] << "," << nup[1] << ","
     //      << nup[2] << endl;
-    // cout << "nsun = " << nsun[0] << "," << nsun[1] << "," 
+    // cout << "nsun = " << nsun[0] << "," << nsun[1] << ","
     //      << nsun[2] << endl;
 
-    l->set_sun_angle( acos( dot ( nup, nsun ) ) );
+    l->set_sun_angle( acos( dot ( world_up, nsun ) ) );
     SG_LOG( SG_EVENT, SG_DEBUG, "sun angle relative to current location = "
-           << l->get_sun_angle() );
-    
+            << l->get_sun_angle() );
+
     // calculate vector to sun's position on the earth's surface
-    SGVec3d rel_sunpos = l->get_sunpos() - v->get_view_pos();
+    SGVec3d rel_sunpos = sunpos - v->get_view_pos();
     // vector in cartesian coordinates from current position to the
     // postion on the earth's surface the sun is directly over
     SGVec3f to_sun = toVec3f(rel_sunpos);
@@ -115,18 +157,17 @@ void fgUpdateSunPos( void ) {
     // earth's surface the sun is directly over, map into onto the
     // local plane representing "horizontal".
 
-    SGVec3f world_up = toVec3f(hlOr.backTransform(-SGVec3d::e3()));
-    SGVec3f view_pos = toVec3f(v->get_view_pos());
     // surface direction to go to head towards sun
     SGVec3f surface_to_sun;
+    SGVec3f view_pos = toVec3f(v->get_view_pos());
     sgmap_vec_onto_cur_surface_plane( world_up.data(), view_pos.data(),
-                                     to_sun.data(), surface_to_sun.data() );
+                                      to_sun.data(), surface_to_sun.data() );
     surface_to_sun = normalize(surface_to_sun);
     // cout << "(sg) Surface direction to sun is "
-    //   << surface_to_sun[0] << "," 
+    //   << surface_to_sun[0] << ","
     //   << surface_to_sun[1] << ","
     //   << surface_to_sun[2] << endl;
-    // cout << "Should be close to zero = " 
+    // cout << "Should be close to zero = "
     //   << sgScalarProductVec3(nup, surface_to_sun) << endl;
 
     // calculate the angle between surface_to_sun and
@@ -156,11 +197,13 @@ void fgUpdateSunPos( void ) {
      }
 
     if ( east_dot >= 0 ) {
-       l->set_sun_rotation( acos(dot_) );
+        l->set_sun_rotation( acos(dot_) );
     } else {
-       l->set_sun_rotation( -acos(dot_) );
+        l->set_sun_rotation( -acos(dot_) );
     }
     // cout << "  Sky needs to rotate = " << angle << " rads = "
     //      << angle * SGD_RADIANS_TO_DEGREES << " degrees." << endl;
+
+#endif
 }
 
index b5297301a1470ae71fefc783b5079a8f28ab294a..309d9340b1b0b9694d494a401b00424070942766 100644 (file)
@@ -205,6 +205,9 @@ bool FGAISchedule::update(time_t now)
     userLatitude,
     userLongitude;
 
+  SGVec3d newPos(0, 0, 0);
+
+
   if (fgGetBool("/sim/traffic-manager/enabled") == false)
     return true;
   
@@ -302,68 +305,60 @@ bool FGAISchedule::update(time_t now)
          if (!(dep && arr))
            return false;
          
-          SGVec3d a = SGVec3d::fromGeoc(SGGeoc::fromDegM(dep->getLongitude(),
-                                                dep->getLatitude(), 1));
-          SGVec3d b = SGVec3d::fromGeoc(SGGeoc::fromDegM(arr->getLongitude(),
-                                                arr->getLatitude(), 1));
-          SGVec3d _cross = cross(b, a);
+          if (dep != arr) {
+               SGVec3d a = SGVec3d::fromGeoc(SGGeoc::fromDegM(dep->getLongitude(),
+                                                     dep->getLatitude(), 1));
+               SGVec3d b = SGVec3d::fromGeoc(SGGeoc::fromDegM(arr->getLongitude(),
+                                                     arr->getLatitude(), 1));
+               SGVec3d _cross = cross(b, a);
          
-         angle = sgACos(dot(a, b));
+              angle = sgACos(dot(a, b));
          
-         // Okay, at this point we have the angle between departure and 
-         // arrival airport, in degrees. From here we can interpolate the
-         // position of the aircraft by calculating the ratio between 
-         // total time enroute and elapsed time enroute. 
+              // Okay, at this point we have the angle between departure and 
+              // arrival airport, in degrees. From here we can interpolate the
+              // position of the aircraft by calculating the ratio between 
+              // total time enroute and elapsed time enroute. 
  
-         totalTimeEnroute     = (*i)->getArrivalTime() - (*i)->getDepartureTime();
-         if (now > (*i)->getDepartureTime())
-           {
-             //err << "Lat = " << lat << ", lon = " << lon << endl;
-             //cerr << "Time diff: " << now-i->getDepartureTime() << endl;
-             elapsedTimeEnroute   = now - (*i)->getDepartureTime();
-             remainingTimeEnroute = (*i)->getArrivalTime()   - now;  
-              SG_LOG (SG_GENERAL, SG_DEBUG, "Traffic Manager:      Flight is in progress.");
-           }
-         else
-           {
-             lat = dep->getLatitude();
-             lon = dep->getLongitude();
-             elapsedTimeEnroute = 0;
-             remainingTimeEnroute = totalTimeEnroute;
-              SG_LOG (SG_GENERAL, SG_DEBUG, "Traffic Manager:      Flight is pending.");
-           }
-                 
-         angle *= ( (double) elapsedTimeEnroute/ (double) totalTimeEnroute);
-         
-         
-         //cout << "a = " << a[0] << " " << a[1] << " " << a[2] 
-         //     << "b = " << b[0] << " " << b[1] << " " << b[2] << endl;  
-          sgdMat4 matrix;
-         sgdMakeRotMat4(matrix, angle, _cross.data()); 
-          SGVec3d newPos(0, 0, 0);
-         for(int j = 0; j < 3; j++)
-           {
-             for (int k = 0; k<3; k++)
-               {
-                 newPos[j] += matrix[j][k]*a[k];
-               }
-           }
-         
-    SGGeod current;
-         if (now > (*i)->getDepartureTime())
-           {
-        current = SGGeod::fromCart(newPos);
-           }
-         else
-           {
-             current = dep->geod();
-      }
-         
-    SGGeod user = SGGeod::fromDegM(userLongitude, userLatitude, (*i)->getCruiseAlt());
-    speed = SGGeodesy::distanceNm(current, arr->geod()) / 
-           ((double) remainingTimeEnroute/3600.0);
-    
-    distanceToUser = SGGeodesy::distanceNm(current, user);
+              totalTimeEnroute     = (*i)->getArrivalTime() - (*i)->getDepartureTime();
+              if (now > (*i)->getDepartureTime())
+              {
+                  //err << "Lat = " << lat << ", lon = " << lon << endl;
+                  //cerr << "Time diff: " << now-i->getDepartureTime() << endl;
+                  elapsedTimeEnroute   = now - (*i)->getDepartureTime();
+                  remainingTimeEnroute = (*i)->getArrivalTime()   - now;  
+                   SG_LOG (SG_GENERAL, SG_DEBUG, "Traffic Manager:      Flight is in progress.");
+              }
+              else
+              {
+                  lat = dep->getLatitude();
+                  lon = dep->getLongitude();
+                  elapsedTimeEnroute = 0;
+                  remainingTimeEnroute = totalTimeEnroute;
+                   SG_LOG (SG_GENERAL, SG_DEBUG, "Traffic Manager:      Flight is pending.");
+               }
+               angle *= ( (double) elapsedTimeEnroute/ (double) totalTimeEnroute);
+               //cout << "a = " << a[0] << " " << a[1] << " " << a[2] 
+               //     << "b = " << b[0] << " " << b[1] << " " << b[2] << endl;  
+                sgdMat4 matrix;
+               sgdMakeRotMat4(matrix, angle, _cross.data()); 
+               for(int j = 0; j < 3; j++) {
+                   for (int k = 0; k<3; k++) {
+                       newPos[j] += matrix[j][k]*a[k];
+                   }
+               }
+           }
+           SGGeod current;
+          if ((now > (*i)->getDepartureTime() && (dep != arr))) {
+                current = SGGeod::fromCart(newPos);
+                speed = SGGeodesy::distanceNm(current, arr->geod()) / 
+                                  ((double) remainingTimeEnroute/3600.0);
+          } else {
+               current = dep->geod();
+               speed = 450;
+           }
+           SGGeod user = SGGeod::fromDegM(userLongitude, userLatitude, (*i)->getCruiseAlt());
+           
+           distanceToUser = SGGeodesy::distanceNm(current, user);
 
          // If distance between user and simulated aircaft is less
          // then 500nm, create this flight. At jet speeds 500 nm is roughly
index 13bf1cc1bf324d232e44955a5216858d49a64c19..899685e938fc96124f807ec1436f0aad7d7b891c 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <stdlib.h>
 #include <time.h>
+#include <cstring>
 #include <iostream>
 #include <fstream>
 
@@ -70,6 +71,7 @@
 #include "TrafficMgr.hxx"
 
 using std::sort;
+using std::strcmp;
  
 /******************************************************************************
  * TrafficManager
@@ -376,62 +378,60 @@ void  FGTrafficManager::startElement (const char * name, const XMLAttributes &at
 
 void  FGTrafficManager::endElement (const char * name) {
   //cout << "End element " << name << endl;
-  string element(name);
-  string value = elementValueStack.back();
-  elementValueStack.pop_back();
+  const string& value = elementValueStack.back();
 
-  if (element == string("model"))
+  if (!strcmp(name, "model"))
     mdl = value;
-  else if (element == string("livery"))
+  else if (!strcmp(name, "livery"))
     livery = value;
-  else if (element == string("home-port"))
+  else if (!strcmp(name, "home-port"))
     homePort = value;
-  else if (element == string("registration"))
+  else if (!strcmp(name, "registration"))
     registration = value;
-  else if (element == string("airline"))
+  else if (!strcmp(name, "airline"))
     airline = value;
-  else if (element == string("actype"))
+  else if (!strcmp(name, "actype"))
     acType = value;
-  else if (element == string("required-aircraft"))
+  else if (!strcmp(name, "required-aircraft"))
     requiredAircraft = value;
-  else if (element == string("flighttype"))
+  else if (!strcmp(name, "flighttype"))
     flighttype = value;
-  else if (element == string("radius"))
+  else if (!strcmp(name, "radius"))
     radius = atoi(value.c_str());
-  else if (element == string("offset"))
+  else if (!strcmp(name, "offset"))
     offset = atoi(value.c_str());
-  else if (element == string("performance-class"))
+  else if (!strcmp(name, "performance-class"))
     m_class = value;
-  else if (element == string("heavy"))
+  else if (!strcmp(name, "heavy"))
     {
       if(value == string("true"))
        heavy = true;
       else
        heavy = false;
     }
-  else if (element == string("callsign"))
+  else if (!strcmp(name, "callsign"))
     callsign = value;
-  else if (element == string("fltrules"))
+  else if (!strcmp(name, "fltrules"))
     fltrules = value;
-  else if (element == string("port"))
+  else if (!strcmp(name, "port"))
     port = value;
-  else if (element == string("time"))
+  else if (!strcmp(name, "time"))
     timeString = value;
-  else if (element == string("departure"))
+  else if (!strcmp(name, "departure"))
     {
       departurePort = port;
       departureTime = timeString;
     }
-  else if (element == string("cruise-alt"))
+  else if (!strcmp(name, "cruise-alt"))
     cruiseAlt = atoi(value.c_str());
-  else if (element == string("arrival"))
+  else if (!strcmp(name, "arrival"))
     {
       arrivalPort = port;
       arrivalTime = timeString;
     }
-  else if (element == string("repeat"))
+  else if (!strcmp(name, "repeat"))
     repeat = value;
-  else if (element == string("flight"))
+  else if (!strcmp(name, "flight"))
     {
       // We have loaded and parsed all the information belonging to this flight
       // so we temporarily store it. 
@@ -477,7 +477,7 @@ void  FGTrafficManager::endElement (const char * name) {
                                                                  requiredAircraft));
       requiredAircraft = "";
   }
-  else if (element == string("aircraft"))
+  else if (!strcmp(name, "aircraft"))
     {
       int proportion = (int) (fgGetDouble("/sim/traffic-manager/proportion") * 100);
       int randval = rand() & 100;
@@ -533,6 +533,7 @@ void  FGTrafficManager::endElement (const char * name) {
              << score);
       score = 0;
     }
+  elementValueStack.pop_back();
 }
 
 void  FGTrafficManager::data (const char * s, int len) {
index 87d87c7ec1f818b135ca856fecaf6191fb12f41d..2062c36ba29a7021bd902d2e9c2577644d3ee310 100644 (file)
@@ -2,10 +2,16 @@ bin_PROGRAMS = est-epsilon gl-info alcinfo
 
 noinst_PROGRAMS = test-gethostname test-mktime test-text test-up test-env-map
 
-est_epsilon_SOURCES = est-epsilon.c
+if HAVE_FRAMEWORK_PLIB
+test_up_LDFLAGS = $(plib_FRAMEWORK)
+else
+test_up_PLIB_LIBS = -lplibsg -lplibul
+endif
+
+est_epsilon_SOURCES = est-epsilon.cxx
 est_epsilon_LDADD =  $(opengl_LIBS)
 
-gl_info_SOURCES = gl-info.c
+gl_info_SOURCES = gl-info.cxx
 gl_info_LDADD = $(opengl_LIBS)
 
 alcinfo_SOURCES = alcinfo.cxx
@@ -21,4 +27,4 @@ test_mktime_SOURCES = test-mktime.cxx
 test_text_SOURCES = test-text.cxx
 
 test_up_SOURCES = test-up.cxx
-test_up_LDADD = -lsgmath -lsgxml -lsgmisc -lsgdebug -lsgstructure -lsgtiming -lplibsg -lplibul -lz $(base_LIBS)
+test_up_LDADD = $(test_up_PLIB_LIBS) -lsgmath -lsgxml -lsgmisc -lsgdebug -lsgstructure -lsgtiming -lz $(base_LIBS)
diff --git a/tests/est-epsilon.c b/tests/est-epsilon.c
deleted file mode 100644 (file)
index 5ff0a8a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <stdio.h>
-
-#include <simgear/compiler.h>
-#if defined( __APPLE__)
-# include <OpenGL/OpenGL.h>
-#else
-# include <GL/gl.h>
-#endif
-
-int main() {
-    GLfloat a, t;
-
-    a = 1.0;
-
-    do {
-       printf("a = %.10f\n", a);
-       a = a / 2.0;
-       t = 1.0 + a;
-    } while ( t > 1.0 );
-
-    a = a + a;
-
-    printf("Estimated GLfloat epsilon = %.10f\n", a);
-
-    return(0);
-}
diff --git a/tests/est-epsilon.cxx b/tests/est-epsilon.cxx
new file mode 100644 (file)
index 0000000..5ff0a8a
--- /dev/null
@@ -0,0 +1,34 @@
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
+#include <stdio.h>
+
+#include <simgear/compiler.h>
+#if defined( __APPLE__)
+# include <OpenGL/OpenGL.h>
+#else
+# include <GL/gl.h>
+#endif
+
+int main() {
+    GLfloat a, t;
+
+    a = 1.0;
+
+    do {
+       printf("a = %.10f\n", a);
+       a = a / 2.0;
+       t = 1.0 + a;
+    } while ( t > 1.0 );
+
+    a = a + a;
+
+    printf("Estimated GLfloat epsilon = %.10f\n", a);
+
+    return(0);
+}
diff --git a/tests/gl-info.c b/tests/gl-info.c
deleted file mode 100644 (file)
index 7d5be7d..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-From: Steve Baker <sbaker@link.com>
-Sender: root@fatcity.com
-To: OPENGL-GAMEDEV-L <OPENGL-GAMEDEV-L@fatcity.com>
-Subject: Re: Win32 OpenGL Resource Page
-Date: Fri, 24 Apr 1998 07:33:51 -0800
-*/
-
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <simgear/compiler.h>
-#if defined( __APPLE__)
-# include <OpenGL/OpenGL.h>
-# include <GLUT/glut.h>
-#else
-# include <GL/gl.h>
-# ifdef HAVE_GLUT_H
-#  include <GL/glut.h>
-# endif
-#endif
-
-
-void getPrints ( GLenum token, char *string )
-{
-  printf ( "%s = \"%s\"\n", string, glGetString ( token ) ) ;
-}
-
-void getPrint2f ( GLenum token, char *string )
-{
-  GLfloat f[2] ;
-  glGetFloatv ( token, f ) ;
-  printf ( "%s = %g,%g\n", string, f[0],f[1] ) ;
-}
-
-void getPrintf ( GLenum token, char *string )
-{
-  GLfloat f ;
-  glGetFloatv ( token, &f ) ;
-  printf ( "%s = %g\n", string, f ) ;
-}
-
-void getPrint2i ( GLenum token, char *string )
-{
-  GLint i[2] ;
-  glGetIntegerv ( token, i ) ;
-  printf ( "%s = %d,%d\n", string, i[0],i[1] ) ;
-}
-
-void getPrinti ( GLenum token, char *string )
-{
-  GLint i ;
-  glGetIntegerv ( token, &i ) ;
-  printf ( "%s = %d\n", string, i ) ;
-}
-
-int main ( int argc, char **argv )
-{
-#ifdef HAVE_GLUT_H
-  glutInit            ( &argc, argv ) ;
-  glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
-  glutCreateWindow    ( "You should never see this window!"  ) ;
-
-  getPrints ( GL_VENDOR      , "GL_VENDOR"     ) ;
-  getPrints ( GL_RENDERER    , "GL_RENDERER"   ) ;
-  getPrints ( GL_VERSION     , "GL_VERSION"    ) ;
-  getPrints ( GL_EXTENSIONS  , "GL_EXTENSIONS" ) ;
-
-  getPrinti ( GL_RED_BITS    , "GL_RED_BITS"   ) ;
-  getPrinti ( GL_GREEN_BITS  , "GL_GREEN_BITS" ) ;
-  getPrinti ( GL_BLUE_BITS   , "GL_BLUE_BITS"  ) ;
-  getPrinti ( GL_ALPHA_BITS  , "GL_ALPHA_BITS" ) ;
-  getPrinti ( GL_DEPTH_BITS  , "GL_DEPTH_BITS" ) ;
-  getPrinti ( GL_INDEX_BITS  , "GL_INDEX_BITS" ) ;
-  getPrinti ( GL_STENCIL_BITS, "GL_STENCIL_BITS" ) ;
-
-  getPrinti ( GL_ACCUM_RED_BITS  , "GL_ACCUM_RED_BITS"   ) ;
-  getPrinti ( GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS" ) ;
-  getPrinti ( GL_ACCUM_BLUE_BITS , "GL_ACCUM_BLUE_BITS"  ) ;
-  getPrinti ( GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS" ) ;
-
-  getPrinti ( GL_AUX_BUFFERS, "GL_AUX_BUFFERS" ) ;
-
-  getPrinti ( GL_MAX_ATTRIB_STACK_DEPTH    , "GL_MAX_ATTRIB_STACK_DEPTH"     ) ;
-  getPrinti ( GL_MAX_NAME_STACK_DEPTH      , "GL_MAX_NAME_STACK_DEPTH"       ) ;
-  getPrinti ( GL_MAX_TEXTURE_STACK_DEPTH   , "GL_MAX_TEXTURE_STACK_DEPTH"    ) ;
-  getPrinti ( GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH" ) ;
-  getPrinti ( GL_MAX_MODELVIEW_STACK_DEPTH , "GL_MAX_MODELVIEW_STACK_DEPTH"  ) ;
-
-  getPrinti ( GL_MAX_CLIP_PLANES    , "GL_MAX_CLIP_PLANES"     ) ;
-  getPrinti ( GL_MAX_EVAL_ORDER     , "GL_MAX_EVAL_ORDER"      ) ;
-  getPrinti ( GL_MAX_LIGHTS         , "GL_MAX_LIGHTS"          ) ;
-  getPrinti ( GL_MAX_LIST_NESTING   , "GL_MAX_LIST_NESTING"    ) ;
-  getPrinti ( GL_MAX_TEXTURE_SIZE   , "GL_MAX_TEXTURE_SIZE"    ) ;
-  getPrint2i( GL_MAX_VIEWPORT_DIMS  , "GL_MAX_VIEWPORT_DIMS"   ) ;
-
-  getPrintf ( GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY" ) ;
-  getPrint2f( GL_POINT_SIZE_RANGE      , "GL_POINT_SIZE_RANGE" ) ;
-
-  printf("Default values:\n\n");
-
-  getPrinti( GL_UNPACK_ALIGNMENT  , "GL_UNPACK_ALIGNMENT"   ) ;
-  getPrinti( GL_UNPACK_ROW_LENGTH  , "GL_UNPACK_ROW_LENGTH"   ) ;
-  getPrinti( GL_UNPACK_SKIP_PIXELS  , "GL_UNPACK_SKIP_PIXELS"   ) ;
-  getPrinti( GL_UNPACK_SKIP_ROWS  , "GL_UNPACK_SKIP_ROWS"   ) ;
-  getPrinti( GL_BLEND_SRC  , "GL_BLEND_SRC"   ) ;
-  getPrinti( GL_BLEND_DST  , "GL_BLEND_DST"   ) ;
-#else
-
-  printf("GL Utility Toolkit (glut) was not found on this system.\n");
-#endif
-
-  return 0 ;
-}
diff --git a/tests/gl-info.cxx b/tests/gl-info.cxx
new file mode 100644 (file)
index 0000000..7d5be7d
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+From: Steve Baker <sbaker@link.com>
+Sender: root@fatcity.com
+To: OPENGL-GAMEDEV-L <OPENGL-GAMEDEV-L@fatcity.com>
+Subject: Re: Win32 OpenGL Resource Page
+Date: Fri, 24 Apr 1998 07:33:51 -0800
+*/
+
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <simgear/compiler.h>
+#if defined( __APPLE__)
+# include <OpenGL/OpenGL.h>
+# include <GLUT/glut.h>
+#else
+# include <GL/gl.h>
+# ifdef HAVE_GLUT_H
+#  include <GL/glut.h>
+# endif
+#endif
+
+
+void getPrints ( GLenum token, char *string )
+{
+  printf ( "%s = \"%s\"\n", string, glGetString ( token ) ) ;
+}
+
+void getPrint2f ( GLenum token, char *string )
+{
+  GLfloat f[2] ;
+  glGetFloatv ( token, f ) ;
+  printf ( "%s = %g,%g\n", string, f[0],f[1] ) ;
+}
+
+void getPrintf ( GLenum token, char *string )
+{
+  GLfloat f ;
+  glGetFloatv ( token, &f ) ;
+  printf ( "%s = %g\n", string, f ) ;
+}
+
+void getPrint2i ( GLenum token, char *string )
+{
+  GLint i[2] ;
+  glGetIntegerv ( token, i ) ;
+  printf ( "%s = %d,%d\n", string, i[0],i[1] ) ;
+}
+
+void getPrinti ( GLenum token, char *string )
+{
+  GLint i ;
+  glGetIntegerv ( token, &i ) ;
+  printf ( "%s = %d\n", string, i ) ;
+}
+
+int main ( int argc, char **argv )
+{
+#ifdef HAVE_GLUT_H
+  glutInit            ( &argc, argv ) ;
+  glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
+  glutCreateWindow    ( "You should never see this window!"  ) ;
+
+  getPrints ( GL_VENDOR      , "GL_VENDOR"     ) ;
+  getPrints ( GL_RENDERER    , "GL_RENDERER"   ) ;
+  getPrints ( GL_VERSION     , "GL_VERSION"    ) ;
+  getPrints ( GL_EXTENSIONS  , "GL_EXTENSIONS" ) ;
+
+  getPrinti ( GL_RED_BITS    , "GL_RED_BITS"   ) ;
+  getPrinti ( GL_GREEN_BITS  , "GL_GREEN_BITS" ) ;
+  getPrinti ( GL_BLUE_BITS   , "GL_BLUE_BITS"  ) ;
+  getPrinti ( GL_ALPHA_BITS  , "GL_ALPHA_BITS" ) ;
+  getPrinti ( GL_DEPTH_BITS  , "GL_DEPTH_BITS" ) ;
+  getPrinti ( GL_INDEX_BITS  , "GL_INDEX_BITS" ) ;
+  getPrinti ( GL_STENCIL_BITS, "GL_STENCIL_BITS" ) ;
+
+  getPrinti ( GL_ACCUM_RED_BITS  , "GL_ACCUM_RED_BITS"   ) ;
+  getPrinti ( GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS" ) ;
+  getPrinti ( GL_ACCUM_BLUE_BITS , "GL_ACCUM_BLUE_BITS"  ) ;
+  getPrinti ( GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS" ) ;
+
+  getPrinti ( GL_AUX_BUFFERS, "GL_AUX_BUFFERS" ) ;
+
+  getPrinti ( GL_MAX_ATTRIB_STACK_DEPTH    , "GL_MAX_ATTRIB_STACK_DEPTH"     ) ;
+  getPrinti ( GL_MAX_NAME_STACK_DEPTH      , "GL_MAX_NAME_STACK_DEPTH"       ) ;
+  getPrinti ( GL_MAX_TEXTURE_STACK_DEPTH   , "GL_MAX_TEXTURE_STACK_DEPTH"    ) ;
+  getPrinti ( GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH" ) ;
+  getPrinti ( GL_MAX_MODELVIEW_STACK_DEPTH , "GL_MAX_MODELVIEW_STACK_DEPTH"  ) ;
+
+  getPrinti ( GL_MAX_CLIP_PLANES    , "GL_MAX_CLIP_PLANES"     ) ;
+  getPrinti ( GL_MAX_EVAL_ORDER     , "GL_MAX_EVAL_ORDER"      ) ;
+  getPrinti ( GL_MAX_LIGHTS         , "GL_MAX_LIGHTS"          ) ;
+  getPrinti ( GL_MAX_LIST_NESTING   , "GL_MAX_LIST_NESTING"    ) ;
+  getPrinti ( GL_MAX_TEXTURE_SIZE   , "GL_MAX_TEXTURE_SIZE"    ) ;
+  getPrint2i( GL_MAX_VIEWPORT_DIMS  , "GL_MAX_VIEWPORT_DIMS"   ) ;
+
+  getPrintf ( GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY" ) ;
+  getPrint2f( GL_POINT_SIZE_RANGE      , "GL_POINT_SIZE_RANGE" ) ;
+
+  printf("Default values:\n\n");
+
+  getPrinti( GL_UNPACK_ALIGNMENT  , "GL_UNPACK_ALIGNMENT"   ) ;
+  getPrinti( GL_UNPACK_ROW_LENGTH  , "GL_UNPACK_ROW_LENGTH"   ) ;
+  getPrinti( GL_UNPACK_SKIP_PIXELS  , "GL_UNPACK_SKIP_PIXELS"   ) ;
+  getPrinti( GL_UNPACK_SKIP_ROWS  , "GL_UNPACK_SKIP_ROWS"   ) ;
+  getPrinti( GL_BLEND_SRC  , "GL_BLEND_SRC"   ) ;
+  getPrinti( GL_BLEND_DST  , "GL_BLEND_DST"   ) ;
+#else
+
+  printf("GL Utility Toolkit (glut) was not found on this system.\n");
+#endif
+
+  return 0 ;
+}
diff --git a/utils/Modeller/yasim_import.py b/utils/Modeller/yasim_import.py
new file mode 100644 (file)
index 0000000..6a862cb
--- /dev/null
@@ -0,0 +1,825 @@
+#!BPY
+
+# """
+# Name: 'YASim (.xml)'
+# Blender: 245
+# Group: 'Import'
+# Tooltip: 'Loads and visualizes a YASim FDM geometry'
+# """
+
+__author__ = "Melchior FRANZ < mfranz # aon : at >"
+__url__ = ["http://www.flightgear.org/", "http://cvs.flightgear.org/viewvc/source/utils/Modeller/yasim_import.py"]
+__version__ = "0.2"
+__bpydoc__ = """\
+yasim_import.py loads and visualizes a YASim FDM geometry
+=========================================================
+
+It is recommended to load the model superimposed over a greyed out and immutable copy of the aircraft model:
+
+  (0) put this script into ~/.blender/scripts/
+  (1) load or import aircraft model (menu -> "File" -> "Import" -> "AC3D (.ac) ...")
+  (2) create new *empty* scene (menu -> arrow button left of "SCE:scene1" combobox -> "ADD NEW" -> "empty")
+  (3) rename scene to yasim (not required)
+  (4) link to scene1 (F10 -> "Output" tab in "Buttons Window" -> arrow button left of text entry "No Set Scene" -> "scene1")
+  (5) now load the YASim config file (menu -> "File" -> "Import" -> "YASim (.xml) ...")
+
+This is good enough for simple checks. But if you are working on the YASim configuration, then you need a
+quick and convenient way to reload the file. In that case continue after (4):
+
+  (5) switch the button area at the bottom of the blender screen to "Scripts Window" mode (green python snake icon)
+  (6) load the YASim config file (menu -> "Scripts" -> "Import" -> "YASim (.xml) ...")
+  (7) make the "Scripts Window" area as small as possible by dragging the area separator down
+  (8) optionally split the "3D View" area and switch the right part to the "Outliner"
+  (9) press the "Reload YASim" button in the script area to reload the file
+
+
+If the 3D model is displaced with respect to the FDM model, then the <offsets> values from the
+model animation XML file should be added as comment to the YASim config file, as a line all by
+itself, with no spaces surrounding the equal signs. Spaces elsewhere are allowed. For example:
+
+  <offsets>
+      <x-m>3.45</x-m>
+      <z-m>-0.4</z-m>
+      <pitch-deg>5</pitch-deg>
+  </offsets>
+
+becomes:
+
+  <!-- offsets: x=3.45 z=-0.4 p=5 -->
+
+Possible variables are:
+
+  x ... <x-m>
+  y ... <y-m>
+  z ... <z-m>
+  h ... <heading-deg>
+  p ... <pitch-deg>
+  r ... <roll-deg>
+
+Of course, absolute FDM coordinates can then no longer directly be read from Blender's 3D view.
+The cursor coordinates display in the script area, however, shows the coordinates in YASim space.
+Note that object names don't contain XML indices but element numbers. YASim_flap0#2 is the third
+flap0 in the whole file, not necessarily in its parent XML group. A floating point part in the
+object name (e.g. YASim_flap0#2.004) only means that the geometry has been reloaded that often.
+It's an unavoidable consequence of how Blender deals with meshes.
+
+
+Elements are displayed as follows:
+
+  cockpit                             -> monkey head
+  fuselage                            -> blue "tube" (with only 12 sides for less clutter); center at "a"
+  vstab                               -> red with yellow control surfaces (flap0, flap1, slat, spoiler)
+  wing/mstab/hstab                    -> green with yellow control surfaces (which are always 20 cm deep);
+                                         symmetric surfaces are only displayed on the left side, unless
+                                         the "Mirror" button is active
+  thrusters (jet/propeller/thruster)  -> dashed line from center to actionpt;
+                                         arrow from actionpt along thrust vector (always 1 m long);
+                                         propeller circle
+  rotor                               -> radius and rel_len_blade_start circle, normal and forward vector,
+                                         one blade at phi0 with direction arrow near blade tip
+  gear                                -> contact point and compression vector (no arrow head)
+  tank                                -> magenta cube (10 cm side length)
+  weight                              -> inverted cyan cone
+  ballast                             -> yellow cylinder
+  hitch                               -> hexagon (10 cm diameter)
+  hook                                -> dashed line for up angle, T-line for down angle
+  launchbar                           -> dashed line for up angles, T-line for down angles
+                                         (launchbar and holdback each)
+
+
+The Mirror button complements symmetrical surfaces (wing/hstab/mstab) and control surfaces
+(flap0/flap1/slat/spoiler). This is useful for asymmetrical aircraft, but has the disadvantage
+that it moves the surfaces' object centers from their usual place, yasim's [x, y, z] value,
+to [0, 0, 0]. Turning mirroring off restores the object center.
+
+
+
+Environment variable BLENDER_YASIM_IMPORT can be set to a space-separated list of options:
+
+  $ BLENDER_YASIM_IMPORT="mirror verbose"  blender
+
+whereby:
+
+  verbose  ... enables verbose logs
+  mirror   ... enables mirroring of symmetric surfaces
+"""
+
+
+#--------------------------------------------------------------------------------
+# Copyright (C) 2009  Melchior FRANZ  < mfranz # aon : at >
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#--------------------------------------------------------------------------------
+
+
+import Blender, BPyMessages, string, math, os
+from Blender.Mathutils import *
+from xml.sax import handler, make_parser
+
+
+CONFIG = string.split(os.getenv("BLENDER_YASIM_IMPORT") or "")
+YASIM_MATRIX = Matrix([-1, 0, 0, 0], [0, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1])
+ORIGIN = Vector(0, 0, 0)
+X = Vector(1, 0, 0)
+Y = Vector(0, 1, 0)
+Z = Vector(0, 0, 1)
+DEG2RAD = math.pi / 180
+RAD2DEG = 180 / math.pi
+
+NO_EVENT = 0
+RELOAD_BUTTON = 1
+CURSOR_BUTTON = 2
+MIRROR_BUTTON = 3
+
+
+
+class Global:
+       verbose = "verbose" in CONFIG
+       path = ""
+       matrix = None
+       data = None
+       cursor = ORIGIN
+       last_cursor = Vector(Blender.Window.GetCursorPos())
+       mirror_button = Blender.Draw.Create("mirror" in CONFIG)
+
+
+
+class Abort(Exception):
+       def __init__(self, msg, term = None):
+               self.msg = msg
+               self.term = term
+
+
+
+def log(msg):
+       if Global.verbose:
+               print(msg)
+
+
+
+def draw_dashed_line(mesh, start, end):
+       w = 0.04
+       step = w * (end - start).normalize()
+       n = len(mesh.verts)
+       for i in range(int(1 + 0.5 * (end - start).length / w)):
+               a = start + 2 * i * step
+               b = a + step
+               if (b - end).length < step.length:
+                       b = end
+               mesh.verts.extend([a, b])
+               mesh.edges.extend([n + 2 * i, n + 2 * i + 1])
+
+
+
+def draw_arrow(mesh, start, end):
+       v = end - start
+       m = v.toTrackQuat('x', 'z').toMatrix().resize4x4() * TranslationMatrix(start)
+       v = v.length * X
+       n = len(mesh.verts)
+       mesh.verts.extend([ORIGIN * m , v * m, (v - 0.05 * X + 0.05 * Y) * m, (v - 0.05 * X - 0.05 * Y) * m]) # head
+       mesh.verts.extend([(ORIGIN + 0.05 * Y) * m, (ORIGIN - 0.05 * Y) * m]) # base
+       mesh.edges.extend([[n, n + 1], [n + 1, n + 2], [n + 1, n + 3], [n + 4, n + 5]])
+
+
+
+def draw_circle(mesh, numpoints, radius, matrix):
+       n = len(mesh.verts)
+       for i in range(numpoints):
+               angle = 2.0 * math.pi * i / numpoints
+               v = Vector(radius * math.cos(angle), radius * math.sin(angle), 0)
+               mesh.verts.extend([v * matrix])
+       for i in range(numpoints):
+               i1 = (i + 1) % numpoints
+               mesh.edges.extend([[n + i, n + i1]])
+
+
+
+class Item:
+       scene = Blender.Scene.GetCurrent()
+
+       def make_twosided(self, mesh):
+               mesh.faceUV = True
+               for f in mesh.faces:
+                       f.mode |= Blender.Mesh.FaceModes.TWOSIDE | Blender.Mesh.FaceModes.OBCOL
+
+       def set_color(self, obj, color):
+               mat = Blender.Material.New()
+               mat.setRGBCol(color[0], color[1], color[2])
+               mat.setAlpha(color[3])
+               mat.mode |= Blender.Material.Modes.ZTRANSP | Blender.Material.Modes.TRANSPSHADOW
+               obj.transp = True
+
+               mesh = obj.getData(mesh = True)
+               mesh.materials += [mat]
+
+               for f in mesh.faces:
+                       f.smooth = True
+               mesh.calcNormals()
+
+
+
+class Cockpit(Item):
+       def __init__(self, center):
+               mesh = Blender.Mesh.Primitives.Monkey()
+               mesh.transform(ScaleMatrix(0.13, 4) * Euler(90, 0, 90).toMatrix().resize4x4() * TranslationMatrix(Vector(-0.1, 0, -0.032)))
+               obj = self.scene.objects.new(mesh, "YASim_cockpit")
+               obj.setMatrix(TranslationMatrix(center) * Global.matrix)
+
+
+
+class Tank(Item):
+       def __init__(self, name, center):
+               mesh = Blender.Mesh.Primitives.Cube()
+               mesh.transform(ScaleMatrix(0.05, 4))
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(TranslationMatrix(center) * Global.matrix)
+               self.set_color(obj, [1, 0, 1, 0.5])
+
+
+
+class Ballast(Item):
+       def __init__(self, name, center):
+               mesh = Blender.Mesh.Primitives.Cylinder()
+               mesh.transform(ScaleMatrix(0.05, 4))
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(TranslationMatrix(center) * Global.matrix)
+               self.set_color(obj, [1, 1, 0, 0.5])
+
+
+
+class Weight(Item):
+       def __init__(self, name, center):
+               mesh = Blender.Mesh.Primitives.Cone()
+               mesh.transform(ScaleMatrix(0.05, 4))
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(TranslationMatrix(center) * Global.matrix)
+               self.set_color(obj, [0, 1, 1, 0.5])
+
+
+
+class Gear(Item):
+       def __init__(self, name, center, compression):
+               mesh = Blender.Mesh.New()
+               mesh.verts.extend([ORIGIN, compression])
+               mesh.edges.extend([0, 1])
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(TranslationMatrix(center) * Global.matrix)
+
+
+
+class Hook(Item):
+       def __init__(self, name, center, length, up_angle, dn_angle):
+               mesh = Blender.Mesh.New()
+               up = ORIGIN - length * math.cos(up_angle * DEG2RAD) * X - length * math.sin(up_angle * DEG2RAD) * Z
+               dn = ORIGIN - length * math.cos(dn_angle * DEG2RAD) * X - length * math.sin(dn_angle * DEG2RAD) * Z
+               mesh.verts.extend([ORIGIN, dn, dn + 0.05 * Y, dn - 0.05 * Y])
+               mesh.edges.extend([[0, 1], [2, 3]])
+               draw_dashed_line(mesh, ORIGIN, up)
+               draw_dashed_line(mesh, ORIGIN, dn)
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(TranslationMatrix(center) * Global.matrix)
+
+
+
+class Launchbar(Item):
+       def __init__(self, name, lb, lb_length, hb, hb_length, up_angle, dn_angle):
+               mesh = Blender.Mesh.New()
+               hb = hb - lb
+               lb_tip = ORIGIN + lb_length * math.cos(dn_angle * DEG2RAD) * X - lb_length * math.sin(dn_angle * DEG2RAD) * Z
+               hb_tip = hb - hb_length * math.cos(dn_angle * DEG2RAD) * X - hb_length * math.sin(dn_angle * DEG2RAD) * Z
+               mesh.verts.extend([lb_tip, ORIGIN, hb, hb_tip, lb_tip + 0.05 * Y, lb_tip - 0.05 * Y, hb_tip + 0.05 * Y, hb_tip - 0.05 * Y])
+               mesh.edges.extend([[0, 1], [1, 2], [2, 3], [4, 5], [6, 7]])
+               draw_dashed_line(mesh, ORIGIN, lb_length * math.cos(up_angle * DEG2RAD) * X - lb_length * math.sin(up_angle * DEG2RAD) * Z)
+               draw_dashed_line(mesh, hb, hb - hb_length * math.cos(up_angle * DEG2RAD) * X - hb_length * math.sin(up_angle * DEG2RAD) * Z)
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(TranslationMatrix(lb) * Global.matrix)
+
+
+
+class Hitch(Item):
+       def __init__(self, name, center):
+               mesh = Blender.Mesh.Primitives.Circle(6, 0.1)
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(RotationMatrix(90, 4, "x") * TranslationMatrix(center) * Global.matrix)
+
+
+
+class Thrust:
+       def set_actionpt(self, p):
+               self.actionpt = p
+
+       def set_dir(self, d):
+               self.thrustvector = d
+
+
+
+class Thruster(Thrust, Item):
+       def __init__(self, name, center, thrustvector):
+               (self.name, self.center, self.actionpt, self.thrustvector) = (name, center, center, thrustvector)
+
+       def __del__(self):
+               a = self.actionpt - self.center
+               mesh = Blender.Mesh.New()
+               draw_dashed_line(mesh, ORIGIN, a)
+               draw_arrow(mesh, a, a + self.thrustvector.normalize())
+               obj = self.scene.objects.new(mesh, self.name)
+               obj.setMatrix(TranslationMatrix(self.center) * Global.matrix)
+
+
+
+class Propeller(Thrust, Item):
+       def __init__(self, name, center, radius):
+               (self.name, self.center, self.radius, self.actionpt, self.thrustvector) = (name, center, radius, center, -X)
+
+       def __del__(self):
+               a = self.actionpt - self.center
+               matrix = self.thrustvector.toTrackQuat('z', 'x').toMatrix().resize4x4() * TranslationMatrix(a)
+
+               mesh = Blender.Mesh.New()
+               mesh.verts.extend([ORIGIN * matrix, (ORIGIN + self.radius * X) * matrix])
+               mesh.edges.extend([[0, 1]])
+               draw_dashed_line(mesh, ORIGIN, a)
+               draw_arrow(mesh, a, a + self.thrustvector.normalize())
+
+               draw_circle(mesh, 128, self.radius, matrix)
+               obj = self.scene.objects.new(mesh, self.name)
+               obj.setMatrix(TranslationMatrix(self.center) * Global.matrix)
+
+
+
+class Jet(Thrust, Item):
+       def __init__(self, name, center, rotate):
+               (self.name, self.center, self.actionpt) = (name, center, center)
+               self.thrustvector = -X * RotationMatrix(rotate, 4, "y")
+
+       def __del__(self):
+               a = self.actionpt - self.center
+               mesh = Blender.Mesh.New()
+               draw_dashed_line(mesh, ORIGIN, a)
+               draw_arrow(mesh, a, a + self.thrustvector.normalize())
+               obj = self.scene.objects.new(mesh, self.name)
+               obj.setMatrix(TranslationMatrix(self.center) * Global.matrix)
+
+
+
+class Fuselage(Item):
+       def __init__(self, name, a, b, width, taper, midpoint):
+               numvert = 12
+               angle = []
+               for i in range(numvert):
+                       alpha = i * 2 * math.pi / float(numvert)
+                       angle.append([math.cos(alpha), math.sin(alpha)])
+
+               axis = b - a
+               length = axis.length
+               mesh = Blender.Mesh.New()
+
+               for i in range(numvert):
+                       mesh.verts.extend([[0, 0.5 * width * taper * angle[i][0], 0.5 * width * taper * angle[i][1]]])
+               for i in range(numvert):
+                       mesh.verts.extend([[midpoint * length, 0.5 * width * angle[i][0], 0.5 * width * angle[i][1]]])
+               for i in range(numvert):
+                       mesh.verts.extend([[length, 0.5 * width * taper * angle[i][0], 0.5 * width * taper * angle[i][1]]])
+               for i in range(numvert):
+                       i1 = (i + 1) % numvert
+                       mesh.faces.extend([[i, i1, i1 + numvert, i + numvert]])
+                       mesh.faces.extend([[i + numvert, i1 + numvert, i1 + 2 * numvert, i + 2 * numvert]])
+
+               mesh.verts.extend([ORIGIN, length * X])
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(axis.toTrackQuat('x', 'y').toMatrix().resize4x4() * TranslationMatrix(a) * Global.matrix)
+               self.set_color(obj, [0, 0, 0.5, 0.4])
+
+
+
+class Rotor(Item):
+       def __init__(self, name, center, up, fwd, numblades, radius, chord, twist, taper, rel_len_blade_start, phi0, ccw):
+               matrix = RotationMatrix(phi0, 4, "z") * up.toTrackQuat('z', 'x').toMatrix().resize4x4()
+               invert = matrix.copy().invert()
+               direction = [-1, 1][ccw]
+               twist *= DEG2RAD
+               a = ORIGIN + rel_len_blade_start * radius * X
+               b = ORIGIN + radius * X
+               tw = 0.5 * chord * taper * math.cos(twist) * Y + 0.5 * direction * chord * taper * math.sin(twist) * Z
+
+               mesh = Blender.Mesh.New()
+               mesh.verts.extend([ORIGIN, a, b, a + 0.5 * chord * Y, a - 0.5 * chord * Y, b + tw, b - tw])
+               mesh.edges.extend([[0, 1], [1, 2], [1, 3], [1, 4], [3, 5], [4, 6], [5, 6]])
+               draw_circle(mesh, 64, rel_len_blade_start * radius, Matrix())
+               draw_circle(mesh, 128, radius, Matrix())
+               draw_arrow(mesh, ORIGIN, up * invert)
+               draw_arrow(mesh, ORIGIN, fwd * invert)
+               b += 0.1 * X + direction * chord * Y
+               draw_arrow(mesh, b, b + min(0.5 * radius, 1) * direction * Y)
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(matrix * TranslationMatrix(center) * Global.matrix)
+
+
+
+class Wing(Item):
+       def __init__(self, name, root, length, chord, incidence, twist, taper, sweep, dihedral):
+               #  <1--0--2
+               #   \  |  /
+               #    4-3-5
+               self.is_symmetric = not name.startswith("YASim_vstab#")
+               mesh = Blender.Mesh.New()
+               mesh.verts.extend([ORIGIN, ORIGIN + 0.5 * chord * X, ORIGIN - 0.5 * chord * X])
+               tip = ORIGIN + math.cos(sweep * DEG2RAD) * length * Y - math.sin(sweep * DEG2RAD) * length * X
+               tipfore = tip + 0.5 * taper * chord * math.cos(twist * DEG2RAD) * X + 0.5 * taper * chord * math.sin(twist * DEG2RAD) * Z
+               tipaft = tip + tip - tipfore
+               mesh.verts.extend([tip, tipfore, tipaft])
+               mesh.faces.extend([[0, 1, 4, 3], [2, 0, 3, 5]])
+
+               self.make_twosided(mesh)
+
+               obj = self.scene.objects.new(mesh, name)
+               mesh.transform(Euler(dihedral, -incidence, 0).toMatrix().resize4x4())
+               self.set_color(obj, [[0.5, 0.0, 0, 0.5], [0.0, 0.5, 0, 0.5]][self.is_symmetric])
+               (self.obj, self.mesh) = (obj, mesh)
+
+               if self.is_symmetric and Global.mirror_button.val:
+                       mod = obj.modifiers.append(Blender.Modifier.Type.MIRROR)
+                       mod[Blender.Modifier.Settings.AXIS_X] = False
+                       mod[Blender.Modifier.Settings.AXIS_Y] = True
+                       mod[Blender.Modifier.Settings.AXIS_Z] = False
+                       mesh.transform(TranslationMatrix(root)) # must move object center to x axis
+                       obj.setMatrix(Global.matrix)
+               else:
+                       obj.setMatrix(TranslationMatrix(root) * Global.matrix)
+
+       def add_flap(self, name, start, end):
+               a = Vector(self.mesh.verts[2].co)
+               b = Vector(self.mesh.verts[5].co)
+               c = 0.2 * (Vector(self.mesh.verts[0].co - a)).normalize()
+               m = self.obj.getMatrix()
+
+               mesh = Blender.Mesh.New()
+               i0 = a + start * (b - a)
+               i1 = a + end * (b - a)
+               mesh.verts.extend([i0, i1, i0 + c, i1 + c])
+               mesh.faces.extend([[0, 1, 3, 2]])
+
+               self.make_twosided(mesh)
+
+               obj = self.scene.objects.new(mesh, name)
+               obj.setMatrix(m)
+               self.set_color(obj, [0.8, 0.8, 0, 0.9])
+
+               if self.is_symmetric and Global.mirror_button.val:
+                       mod = obj.modifiers.append(Blender.Modifier.Type.MIRROR)
+                       mod[Blender.Modifier.Settings.AXIS_X] = False
+                       mod[Blender.Modifier.Settings.AXIS_Y] = True
+                       mod[Blender.Modifier.Settings.AXIS_Z] = False
+
+
+
+class import_yasim(handler.ErrorHandler, handler.ContentHandler):
+       ignored = ["cruise", "approach", "control-input", "control-output", "control-speed", \
+                       "control-setting", "stall", "airplane", "piston-engine", "turbine-engine", \
+                       "rotorgear", "tow", "winch", "solve-weight"]
+
+
+       # err_handler
+       def warning(self, exception):
+               print((self.error_string("Warning", exception)))
+
+       def error(self, exception):
+               print((self.error_string("Error", exception)))
+
+       def fatalError(self, exception):
+               raise Abort(str(exception), self.error_string("Fatal", exception))
+
+       def error_string(self, tag, e):
+               (column, line) = (e.getColumnNumber(), e.getLineNumber())
+               return "%s: %s\n%s%s^"  % (tag, str(e), Global.data[line - 1], column * ' ')
+
+
+       # doc_handler
+       def setDocumentLocator(self, locator):
+               self.locator = locator
+
+       def startDocument(self):
+               self.tags = []
+               self.counter = {}
+               self.items = [None]
+
+       def endDocument(self):
+               for o in Item.scene.objects:
+                       o.sel = True
+
+       def startElement(self, tag, attrs):
+               if len(self.tags) == 0 and tag != "airplane":
+                       raise Abort("this isn't a YASim config file (bad root tag at line %d)" % self.locator.getLineNumber())
+
+               self.tags.append(tag)
+               path = string.join(self.tags, '/')
+               item = Item()
+               parent = self.items[-1]
+
+               if self.counter.has_key(tag):
+                       self.counter[tag] += 1
+               else:
+                       self.counter[tag] = 0
+
+               if tag == "cockpit":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       log("\033[31mcockpit x=%f y=%f z=%f\033[m" % (c[0], c[1], c[2]))
+                       item = Cockpit(c)
+
+               elif tag == "fuselage":
+                       a = Vector(float(attrs["ax"]), float(attrs["ay"]), float(attrs["az"]))
+                       b = Vector(float(attrs["bx"]), float(attrs["by"]), float(attrs["bz"]))
+                       width = float(attrs["width"])
+                       taper = float(attrs.get("taper", 1))
+                       midpoint = float(attrs.get("midpoint", 0.5))
+                       log("\033[32mfuselage ax=%f ay=%f az=%f bx=%f by=%f bz=%f width=%f taper=%f midpoint=%f\033[m" % \
+                                       (a[0], a[1], a[2], b[0], b[1], b[2], width, taper, midpoint))
+                       item = Fuselage("YASim_%s#%d" % (tag, self.counter[tag]), a, b, width, taper, midpoint)
+
+               elif tag == "gear":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       compression = float(attrs.get("compression", 1))
+                       up = Z * compression
+                       if attrs.has_key("upx"):
+                               up = Vector(float(attrs["upx"]), float(attrs["upy"]), float(attrs["upz"])).normalize() * compression
+                       log("\033[35;1mgear x=%f y=%f z=%f compression=%f upx=%f upy=%f upz=%f\033[m" \
+                                       % (c[0], c[1], c[2], compression, up[0], up[1], up[2]))
+                       item = Gear("YASim_gear#%d" % self.counter[tag], c, up)
+
+               elif tag == "jet":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       rotate = float(attrs.get("rotate", 0))
+                       log("\033[36;1mjet x=%f y=%f z=%f rotate=%f\033[m" % (c[0], c[1], c[2], rotate))
+                       item = Jet("YASim_jet#%d" % self.counter[tag], c, rotate)
+
+               elif tag == "propeller":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       radius = float(attrs["radius"])
+                       log("\033[36;1m%s x=%f y=%f z=%f radius=%f\033[m" % (tag, c[0], c[1], c[2], radius))
+                       item = Propeller("YASim_propeller#%d" % self.counter[tag], c, radius)
+
+               elif tag == "thruster":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       v = Vector(float(attrs["vx"]), float(attrs["vy"]), float(attrs["vz"]))
+                       log("\033[36;1m%s x=%f y=%f z=%f vx=%f vy=%f vz=%f\033[m" % (tag, c[0], c[1], c[2], v[0], v[1], v[2]))
+                       item = Thruster("YASim_thruster#%d" % self.counter[tag], c, v)
+
+               elif tag == "actionpt":
+                       if not isinstance(parent, Thrust):
+                               raise Abort("%s is not part of a thruster/propeller/jet at line %d" \
+                                               % (path, self.locator.getLineNumber()))
+
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       log("\t\033[36mactionpt x=%f y=%f z=%f\033[m" % (c[0], c[1], c[2]))
+                       parent.set_actionpt(c)
+
+               elif tag == "dir":
+                       if not isinstance(parent, Thrust):
+                               raise Abort("%s is not part of a thruster/propeller/jet at line %d" \
+                                               % (path, self.locator.getLineNumber()))
+
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       log("\t\033[36mdir x=%f y=%f z=%f\033[m" % (c[0], c[1], c[2]))
+                       parent.set_dir(c)
+
+               elif tag == "tank":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       log("\033[34;1m%s x=%f y=%f z=%f\033[m" % (tag, c[0], c[1], c[2]))
+                       item = Tank("YASim_tank#%d" % self.counter[tag], c)
+
+               elif tag == "ballast":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       log("\033[34m%s x=%f y=%f z=%f\033[m" % (tag, c[0], c[1], c[2]))
+                       item = Ballast("YASim_ballast#%d" % self.counter[tag], c)
+
+               elif tag == "weight":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       log("\033[34m%s x=%f y=%f z=%f\033[m" % (tag, c[0], c[1], c[2]))
+                       item = Weight("YASim_weight#%d" % self.counter[tag], c)
+
+               elif tag == "hook":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       length = float(attrs.get("length", 1))
+                       up_angle = float(attrs.get("up-angle", 0))
+                       down_angle = float(attrs.get("down-angle", 70))
+                       log("\033[35m%s x=%f y=%f z=%f length=%f up-angle=%f down-angle=%f\033[m" \
+                                       % (tag, c[0], c[1], c[2], length, up_angle, down_angle))
+                       item = Hook("YASim_hook#%d" % self.counter[tag], c, length, up_angle, down_angle)
+
+               elif tag == "hitch":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       log("\033[35m%s x=%f y=%f z=%f\033[m" % (tag, c[0], c[1], c[2]))
+                       item = Hitch("YASim_hitch#%d" % self.counter[tag], c)
+
+               elif tag == "launchbar":
+                       c = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       length = float(attrs.get("length", 1))
+                       up_angle = float(attrs.get("up-angle", -45))
+                       down_angle = float(attrs.get("down-angle", 45))
+                       holdback = Vector(float(attrs.get("holdback-x", c[0])), float(attrs.get("holdback-y", c[1])), float(attrs.get("holdback-z", c[2])))
+                       holdback_length = float(attrs.get("holdback-length", 2))
+                       log("\033[35m%s x=%f y=%f z=%f length=%f down-angle=%f up-angle=%f holdback-x=%f holdback-y=%f holdback-z+%f holdback-length=%f\033[m" \
+                                       % (tag, c[0], c[1], c[2], length, down_angle, up_angle, \
+                                       holdback[0], holdback[1], holdback[2], holdback_length))
+                       item = Launchbar("YASim_launchbar#%d" % self.counter[tag], c, length, holdback, holdback_length, up_angle, down_angle)
+
+               elif tag == "wing" or tag == "hstab" or tag == "vstab" or tag == "mstab":
+                       root = Vector(float(attrs["x"]), float(attrs["y"]), float(attrs["z"]))
+                       length = float(attrs["length"])
+                       chord = float(attrs["chord"])
+                       incidence = float(attrs.get("incidence", 0))
+                       twist = float(attrs.get("twist", 0))
+                       taper = float(attrs.get("taper", 1))
+                       sweep = float(attrs.get("sweep", 0))
+                       dihedral = float(attrs.get("dihedral", [0, 90][tag == "vstab"]))
+                       log("\033[33;1m%s x=%f y=%f z=%f length=%f chord=%f incidence=%f twist=%f taper=%f sweep=%f dihedral=%f\033[m" \
+                                       % (tag, root[0], root[1], root[2], length, chord, incidence, twist, taper, sweep, dihedral))
+                       item = Wing("YASim_%s#%d" % (tag, self.counter[tag]), root, length, chord, incidence, twist, taper, sweep, dihedral)
+
+               elif tag == "flap0" or tag == "flap1" or tag == "slat" or tag == "spoiler":
+                       if not isinstance(parent, Wing):
+                               raise Abort("%s is not part of a wing or stab at line %d" \
+                                               % (path, self.locator.getLineNumber()))
+
+                       start = float(attrs["start"])
+                       end = float(attrs["end"])
+                       log("\t\033[33m%s start=%f end=%f\033[m" % (tag, start, end))
+                       parent.add_flap("YASim_%s#%d" % (tag, self.counter[tag]), start, end)
+
+               elif tag == "rotor":
+                       c = Vector(float(attrs.get("x", 0)), float(attrs.get("y", 0)), float(attrs.get("z", 0)))
+                       norm = Vector(float(attrs.get("nx", 0)), float(attrs.get("ny", 0)), float(attrs.get("nz", 1)))
+                       fwd = Vector(float(attrs.get("fx", 1)), float(attrs.get("fy", 0)), float(attrs.get("fz", 0)))
+                       diameter = float(attrs.get("diameter", 10.2))
+                       numblades = int(attrs.get("numblades", 4))
+                       chord = float(attrs.get("chord", 0.3))
+                       twist = float(attrs.get("twist", 0))
+                       taper = float(attrs.get("taper", 1))
+                       rel_len_blade_start = float(attrs.get("rel-len-blade-start", 0))
+                       phi0 = float(attrs.get("phi0", 0))
+                       ccw = not not int(attrs.get("ccw", 0))
+
+                       log(("\033[36;1mrotor x=%f y=%f z=%f nx=%f ny=%f nz=%f fx=%f fy=%f fz=%f numblades=%d diameter=%f " \
+                                       + "chord=%f twist=%f taper=%f rel_len_blade_start=%f phi0=%f ccw=%d\033[m") \
+                                       % (c[0], c[1], c[2], norm[0], norm[1], norm[2], fwd[0], fwd[1], fwd[2], numblades, \
+                                       diameter, chord, twist, taper, rel_len_blade_start, phi0, ccw))
+                       item = Rotor("YASim_rotor#%d" % self.counter[tag], c, norm, fwd, numblades, 0.5 * diameter, chord, \
+                                       twist, taper, rel_len_blade_start, phi0, ccw)
+
+               elif tag not in self.ignored:
+                       log("\033[30;1m%s\033[m" % path)
+
+               self.items.append(item)
+
+       def endElement(self, tag):
+               self.tags.pop()
+               self.items.pop()
+
+
+
+def extract_matrix(filedata, tag):
+       v = { 'x': 0.0, 'y': 0.0, 'z': 0.0, 'h': 0.0, 'p': 0.0, 'r': 0.0 }
+       has_offsets = False
+       for line in filedata:
+               line = string.strip(line)
+               if not line.startswith("<!--") or not line.endswith("-->"):
+                       continue
+               line = string.strip(line[4:-3])
+               if not string.lower(line).startswith("%s:" % tag):
+                       continue
+               line = string.strip(line[len(tag) + 1:])
+               for assignment in string.split(line):
+                       (key, value) = string.split(assignment, '=', 2)
+                       v[string.strip(key)] = float(string.strip(value))
+                       has_offsets = True
+
+       if not has_offsets:
+               return None
+
+       print(("using offsets: x=%f y=%f z=%f h=%f p=%f r=%f" % (v['x'], v['y'], v['z'], v['h'], v['p'], v['r'])))
+       return Euler(v['r'], v['p'], v['h']).toMatrix().resize4x4() * TranslationMatrix(Vector(v['x'], v['y'], v['z']))
+
+
+
+def load_yasim_config(path):
+       if BPyMessages.Error_NoFile(path):
+               return
+
+       Blender.Window.WaitCursor(1)
+       Blender.Window.EditMode(0)
+
+       print(("loading '%s'" % path))
+       try:
+               for o in Item.scene.objects:
+                       if o.name.startswith("YASim_"):
+                               Item.scene.objects.unlink(o)
+
+               f = open(path)
+               Global.data = f.readlines()
+               f.close
+
+               Global.path = path
+               Global.matrix = YASIM_MATRIX
+               matrix = extract_matrix(Global.data, "offsets")
+               if matrix:
+                       Global.matrix *= matrix.invert()
+
+               Global.yasim.parse(path)
+               Blender.Registry.SetKey("FGYASimImportExport", { "path": path }, False)
+               Global.data = None
+
+       except Abort, e:
+               print(("%s\nAborting ..." % (e.term or e.msg)))
+               Blender.Draw.PupMenu("Error%t|" + e.msg)
+
+       Blender.Window.RedrawAll()
+       Blender.Window.WaitCursor(0)
+
+
+
+def gui_draw():
+       from Blender import BGL, Draw
+       (width, height) = Blender.Window.GetAreaSize()
+
+       BGL.glClearColor(0.4, 0.4, 0.45, 1)
+       BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
+
+       BGL.glColor3f(1, 1, 1)
+       BGL.glRasterPos2f(5, 55)
+       Draw.Text("FlightGear YASim Import:   '%s'" % Global.path)
+
+       Draw.PushButton("Reload", RELOAD_BUTTON, 5, 5, 80, 32, "reload YASim config file")
+       Global.mirror_button = Draw.Toggle("Mirror", MIRROR_BUTTON, 100, 5, 50, 16, Global.mirror_button.val, \
+                       "show symmetric surfaces on both sides (reloads config)")
+       Draw.PushButton("Update Cursor", CURSOR_BUTTON, width - 650, 5, 100, 32, "update cursor display (in YASim coordinate system)")
+
+       BGL.glRasterPos2f(width - 530 + Blender.Draw.GetStringWidth("Vector from last") - Blender.Draw.GetStringWidth("Current"), 24)
+       Draw.Text("Current cursor pos:    x = %+.3f    y = %+.3f    z = %+.3f" % tuple(Global.cursor))
+
+       c = Global.cursor - Global.last_cursor
+       BGL.glRasterPos2f(width - 530, 7)
+       Draw.Text("Vector from last cursor pos:    x = %+.3f    y = %+.3f    z = %+.3f    length = %.3f m" % (c[0], c[1], c[2], c.length))
+
+
+
+def gui_event(ev, value):
+       if ev == Blender.Draw.ESCKEY:
+               Blender.Draw.Exit()
+
+
+
+def gui_button(n):
+       if n == NO_EVENT:
+               return
+
+       elif n == RELOAD_BUTTON:
+               load_yasim_config(Global.path)
+
+       elif n == CURSOR_BUTTON:
+               Global.last_cursor = Global.cursor
+               Global.cursor = Vector(Blender.Window.GetCursorPos()) * Global.matrix.invert()
+               d = Global.cursor - Global.last_cursor
+               print(("cursor:   x=\"%f\" y=\"%f\" z=\"%f\"   dx=%f dy=%f dz=%f   length=%f" \
+                               % (Global.cursor[0], Global.cursor[1], Global.cursor[2], d[0], d[1], d[2], d.length)))
+
+       elif n == MIRROR_BUTTON:
+               load_yasim_config(Global.path)
+
+       Blender.Draw.Redraw(1)
+
+
+
+def main():
+       log(6 * "\n")
+       registry = Blender.Registry.GetKey("FGYASimImportExport", False)
+       if registry and "path" in registry and Blender.sys.exists(Blender.sys.expandpath(registry["path"])):
+               path = registry["path"]
+       else:
+               path = ""
+
+       xml_handler = import_yasim()
+       Global.yasim = make_parser()
+       Global.yasim.setContentHandler(xml_handler)
+       Global.yasim.setErrorHandler(xml_handler)
+
+       if Blender.Window.GetScreenInfo(Blender.Window.Types.SCRIPT):
+               Blender.Draw.Register(gui_draw, gui_event, gui_button)
+
+       Blender.Window.FileSelector(load_yasim_config, "Import YASim Configuration File", path)
+
+
+
+main()
+
index 9f4ee7b3fe8444e3d36211a145ed783f58f592cc..4024a3120dfd113dc55a20bdd3f1a60161f54691 100644 (file)
@@ -99,6 +99,7 @@ CompletedTiles completedTiles;
 apr_pool_t *mysvn_pool = NULL;
 svn_client_ctx_t *mysvn_ctx = NULL;
 svn_opt_revision_t *mysvn_rev = NULL;
+svn_opt_revision_t *mysvn_rev_peg = NULL;
 
 static const svn_version_checklist_t mysvn_checklist[] = {
     { "svn_subr",   svn_subr_version },
@@ -162,11 +163,17 @@ int mysvn_setup(void) {
     mysvn_ctx->auth_baton = ab;
     mysvn_ctx->conflict_func = NULL;
     mysvn_ctx->conflict_baton = NULL;
+    // Now our magic revisions
     mysvn_rev = (svn_opt_revision_t*) apr_palloc(pool, 
         sizeof(svn_opt_revision_t));
     if (!mysvn_rev)
         return EXIT_FAILURE;
+    mysvn_rev_peg = (svn_opt_revision_t*) apr_palloc(pool, 
+        sizeof(svn_opt_revision_t));
+    if (!mysvn_rev_peg)
+        return EXIT_FAILURE;
     mysvn_rev->kind = svn_opt_revision_head;
+    mysvn_rev_peg->kind = svn_opt_revision_unspecified;
     // Success if we got this far
     mysvn_pool = pool;
     return EXIT_SUCCESS;
@@ -200,11 +207,14 @@ void sync_tree(const char* dir) {
        if (mysvn_setup() != EXIT_SUCCESS)
            exit(1);
        apr_pool_t *subpool = svn_pool_create(mysvn_pool);
-       err = svn_client_checkout(NULL,
+       err = svn_client_checkout3(NULL,
            command,
            dest_base_dir,
+           mysvn_rev_peg,
            mysvn_rev,
-           1,
+           svn_depth_infinity,
+           0,
+           0,
            mysvn_ctx,
            subpool);
        if (err) {
@@ -428,12 +438,6 @@ int main( int argc, char **argv ) {
            source_base = rsync_base;
     }
     
-    // We just want one grid square, no FGFS communications
-    if (testing) {
-          sync_areas( 37, -123, 0, 0 );
-         exit(0);
-    }
-
     // Must call this before any other net stuff
     netInit( &argc,argv );
 
@@ -458,10 +462,30 @@ int main( int argc, char **argv ) {
     int last_lat = nowhere;
     int last_lon = nowhere;
     bool recv_msg = false;
-    char synced_other = 'J';
+
+    char synced_other;
+    for ( synced_other = 'K'; synced_other <= 'Z'; synced_other++ ) {
+       char dir[512];
+       snprintf( dir, 512, "Airports/%c", synced_other );
+       waitingTiles.push_back( dir );
+    }
+    for ( synced_other = 'A'; synced_other <= 'J'; synced_other++ ) {
+       char dir[512];
+       snprintf( dir, 512, "Airports/%c", synced_other );
+       waitingTiles.push_back( dir );
+    }
+    if ( use_svn ) {
+       waitingTiles.push_back( "Models" );
+    }
 
     while ( true ) {
         recv_msg = false;
+        if ( testing ) {
+            // No FGFS communications
+            lat = 37;
+            lon = -123;
+            recv_msg = (lat != last_lat) || (lon != last_lon);
+        }
         while ( (len = s.recv(msg, maxlen, 0)) >= 0 ) {
             msg[len] = '\0';
             recv_msg = true;
@@ -470,7 +494,8 @@ int main( int argc, char **argv ) {
         }
 
         if ( recv_msg ) {
-            if ( lat != last_lat || lon != last_lon ) {
+             // Ignore messages where the location does not change
+             if ( lat != last_lat || lon != last_lon ) {
                cout << "pos in msg = " << lat << "," << lon << endl;
                std::deque<std::string> oldRequests;
                oldRequests.swap( waitingTiles );
@@ -499,25 +524,24 @@ int main( int argc, char **argv ) {
                    waitingTiles.push_back( oldRequests.front() );
                    oldRequests.pop_front();
                }
-           } else if ( !waitingTiles.empty() ) {
-               getWaitingTile();
-           } else {
-               if ( last_lat == nowhere || last_lon == nowhere ) {
-                   cout << "Waiting for FGFS to finish startup" << endl;
-               }
-               char c;
-               while ( !isdigit( c = ++synced_other ) && !isupper( c ) );
-
-               char dir[512];
-               snprintf( dir, 512, "Airports/%c", c );
-               waitingTiles.push_back( dir );
-           }
+                last_lat = lat;
+                last_lon = lon;
+            }
+       } else
 
-            last_lat = lat;
-            last_lon = lon;
-       } else if ( !waitingTiles.empty() ) {
+        // No messages inbound, so process some pending work
+        if ( !waitingTiles.empty() ) {
            getWaitingTile();
-        } 
+        } else
+
+       if ( testing ) {
+           exit( 0 );
+       } else
+
+       if ( last_lat == nowhere || last_lon == nowhere ) {
+           cout << "FlightGear is not running, exiting." << endl;
+           exit( 1 );
+       } else
 
         ulSleep( 1 );
     } // while true