EXTRA_DIST = \
acinclude.m4 \
autogen.sh \
- FlightGear.dsp \
- FlightGear.dsw \
projects \
README \
README.OpenAL \
Thanks
dist-hook:
- (cd $(top_srcdir); $(HOME)/Projects/FlightGear/admin/am2dsp.pl)
(cd $(top_srcdir); tar --exclude docs-mini/CVS --exclude hints/CVS \
-cf - docs-mini ) | (cd $(distdir); tar xvf -)
rm -rf `find $(distdir)/projects -name CVS`
--exclude='*/Docs/source' \
--exclude='*/Models/MNUAV' \
--exclude='*/Models/Airspace' \
- -cjvf source/FlightGear-data-$(VERSION).tar.bz2 \
+ -cjvf FlightGear-data-$(VERSION).tar.bz2 \
data/AI \
data/Aircraft/Generic \
data/Aircraft/Instruments \
data/preferences.xml \
data/Protocol \
data/README \
+ data/Scenery/Airports \
data/Scenery/Objects \
data/Scenery/Terrain \
data/Shaders \
-Version 1.99.5
-* October 30, 2008 (source code snapshot release)
+Version 2.0.0 - February 25, 2010
+
+ FlightGear 2.0.0. reflects the maturation of the OpenSceneGraph port
+ that started with the previous 1.9.0 release. In addition to many
+ internal code improvements, FlightGear 2.0.0. marks the introduction
+ of many new exciting improvements in the graphics and sound system,
+ as well as improved usability of key features, and improved behavior
+ of exsisting features. Highlights of this new version include:
+ Dramatic new 3D clouds, dramatic lighting conditions, improved
+ support for custom scenery, and many many new and detailed aircraft
+ models.
+
+ Sound
+ * Complete overhaul of the sound code
+ * doppler effects
+ * distance attenuation
+ * 3D positional sound sources
+ * assignment of sound sources to external objects (i.e. AI controlled
+ aircraft)
+ * User selection of the sound device
+
+ Visual Effects
+ * Use of Shaders for dynamic textures
+ * Use of Effects files
+ * Improved 3D clouds
+ * Color changes based on humidity and other weather effects allow for very
+ dramatic lighting conditions
+ * Dynamic water textures
+ * Text animation based on OSGText
+
+ Usability
+ * Allow screenshots in more common file formats
+ * User selectable sound device
+ * More intuitive selection of the weather settings through the GUI and/or
+ commandline
+
+ Infrastructure
+ * Airport geometry data can be read from the scenery, allowing for more
+ flexible regeneration of terrain tiles
+
+ Internals
+ * Improved efficiency of the property tree
+ * A more efficient ground cache
+ * Many improvements to the route management code
+ * Removed many compiler warnings
+ * More realistic atmosphere model
+
+ Behavior
+ * More realistic ILS behavior
+ * Autopilot improvements
+ * A generic autobrake function
+ * Winds over mountainous areas cause up- and downdrafts that can be used
+ for gliding
+ * More realistic behavior of the route manager
+ * Wild fires, which can be extinguished by firefighter aircraft operating
+ across the multplayer server
+ * Navaid frequencies and radials can be transmitted to Atlas
+
+ Utilities
+ * A python script to visualize Yasim configuration files in Blender
+
+ AI
+ * Allow traffic departing and arriving at the same airport
+ * Add Ground Vehicles - including automobiles, trucks, articulated trucks,
+ trains (including high speed trains)
+ * ATC interactions between AI aircraft and ground controllers
+ * Performance characteristics of AI aircraft can be specified in a
+ performance database
+ * Push-back vehicles are available for a selected number of aircraft
+ * Add escorts for AI carrier - frigates, guided missile cruiser, amphibious
+ warfare ships now make up the Vinson Battle Group
+ * Improved radar functionality - now detects AI escorts etc.
+ * AI objects are now solid (i.e. users can collide with them)
+ * Some preliminary support for SID/STAR procedures for AI aircraft
+
+Version 1.9.0
+* December 20, 2008 (source code snapshot release)
New in 0.9.10
You *must* have OpenSceneGraph (OSG) installed to build this version of
FlightGear.
-Notice that FlightGear 1.9.0 requires at least version 2.7.8. Using earlier
-versions of OSG will yield serious rendering bugs.
+Notice that from FlightGear version 1.9.0, OSG version 2.7.8 or later
+is required. Using earlier versions of OSG will yield serious
+rendering bugs. If you are using an 'older' distribution, this may mean
+a suitable version of OSG may not be availble through the usual package
+repositories.
You can get the latest version of OSG from:
make
sudo make install
+Also later release versions of OpenSceneGraph can be obtained by
+svn, or you can use the OSG development svn 'trunk', but be warned,
+OSG is always in heavy development, and at certain moments
+in time, it may not compile completely, so, as usual, it is
+recommended that you stay with released versions.
+
+Installation notes:
+
+In some unix/linux distributions, particularly 64-bit
+systems, OSG may install its shared libraries in other than
+/usr/lib, /usr/local/lib or $prefix/lib!
+
+This does not seem to effect binary installation, which is
+to $prefix/bin, nor header installation, which remains
+$prefix/include. Just the shared libraries, and perhaps
+only for 64-bit systems, or higher as, and when available.
+
+The default is /usr/local/lib64 or $prefix/lib64 in
+64-bit systems. This may cause problems with the auto-conf
+tools when configuring and compiling FlighGear, since
+even using the configure option --with-osg=$prefix
+will not 'fix' the problem.
+
+The are various ways to deal with this, which mainly depend
+on whether you just want one version of OSG 'globally'
+installed, or desire to be able to build, and run, FlightGear
+against 'different' versions of OSG.
+
+There is a parameter, -D LIB_POSTFIX= or -D LIB_POSTFIX=""
+which can be passed to cmake OSG to force the OSG library
+installation into the 'standard' "$prefix/lib".
+
+OSG cmake advises of a post installation step -
+ $ sudo make install_ld_conf
+which, if available, will add an openscenegraph.conf file
+to the /etc/ld.so.conf.d folder, with the line -
+${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}
+and run 'ldconfig' to add this to the 'cache'. But this
+option does not always seem available.
+
+Configuring SimGear and Flightgear notes:
+
+If you install OSG in other than the 'standard' directories,
+you must add --with-osg=$prefix when configuring
+SimGear and FlightGear. This will cause the auto-conf
+tools to look in $prefix/include for headers, and
+$prefix/lib for libraries, but _NOT_ in 'lib64'!
+
+If the OSG is installed to a unique $prefix directory, then
+it is also possible to make a 'link' entry lib -> lib64 to
+get over this, but obviously this is not available if
+$prefix/lib already exists, and contains entries.
+
+Running fgfs, and others, with OSG shared libraries:
+
+You must also deal with the executable loader being
+able to find the OSG shared libraries when running fgfs,
+and others, through perhaps using :-
+ $ export LD_LIBRARY_PATH=/path/to/osg/lib[64][:/other/paths]
+or more permanently using a '.conf' file in the
+/etc/ld.so.conf.d directory, and running
+ $ sudo ldconfig -v to update the 'cache'.
+
fi
])
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+ [AC_MSG_RESULT([no])
+ $4])
+elif test $pkg_failed = untried; then
+ ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+ [$4])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
exit
fi
-AC_MSG_CHECKING([for SimGear 1.9.0 or newer])
+AC_MSG_CHECKING([for SimGear 2.0.0 or newer])
AC_TRY_RUN([
#include <stdio.h>
#define STRINGIFY(X) XSTRINGIFY(X)
#define XSTRINGIFY(X) #X
-#define MIN_MAJOR 1
-#define MIN_MINOR 9
+#define MIN_MAJOR 2
+#define MIN_MINOR 0
#define MIN_MICRO 0
int main() {
AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support])
# Find the OSG libraries. Note special handling for OS X frameworks
-case "${host}" in
-*-apple-darwin*)
- if test "x$with_osg_framework" = "x"; then
- if test "x$enable_osgdebug" = "xyes"; then
- # debug version of osg libs
- AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
- openthreads_LIBS="$LIBS"
- LIBS=""
- AC_CHECK_LIB(osgd,osgGetVersion)
- AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
- AC_CHECK_LIB(osgDBd,osgDBGetVersion)
- AC_CHECK_LIB(osgTextd,osgTextGetVersion)
- AC_CHECK_LIB(osgGAd,osgGAGetVersion)
- AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
- AC_CHECK_LIB(osgSimd,osgSimGetVersion)
- AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
- OSG_LIBS="$LIBS -losgFXd $openthreads_LIBS"
- LIBS=""
- else
- # release version of osg libs
- AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
- openthreads_LIBS="$LIBS"
- LIBS=""
- AC_CHECK_LIB(osg,osgGetVersion)
- AC_CHECK_LIB(osgUtil,osgUtilGetVersion)
- AC_CHECK_LIB(osgDB,osgDBGetVersion)
- AC_CHECK_LIB(osgText,osgTextGetVersion)
- AC_CHECK_LIB(osgGA,osgGAGetVersion)
- AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
- AC_CHECK_LIB(osgSim,osgSimGetVersion)
- AC_CHECK_LIB(osgParticle,osgParticleGetVersion)
- OSG_LIBS="$LIBS -losgFX $openthreads_LIBS"
- LIBS=""
- # echo $LIBS
- fi
- AC_SUBST(openthreads_LIBS)
- AC_SUBST(OSG_LIBS)
- else
- # Checking osg frameworks.
- AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
- AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
- osg_FRAMEWORKS="$FRAMEWORKS"
- FRAMEWORKS=""
- AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
- openthreads_FRAMEWORK="$FRAMEWORKS"
- AC_SUBST(osg_FRAMEWORKS)
- AC_SUBST(openthreads_FRAMEWORK)
- fi
- ;;
-*)
+if test "x$with_osg_framework" = "x"; then
if test "x$enable_osgdebug" = "xyes"; then
- AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
- AC_CHECK_LIB(osgd,osgGetVersion)
- AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
- AC_CHECK_LIB(osgDBd,osgDBGetVersion)
- AC_CHECK_LIB(osgTextd,osgTextGetVersion)
- AC_CHECK_LIB(osgGAd,osgGAGetVersion)
- AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
- AC_CHECK_LIB(osgSimd,osgSimGetVersion)
- AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
- LIBS="$LIBS -losgFXd $opengl_LIBS"
+ AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
+ AC_CHECK_LIB(osgd,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
+ AC_CHECK_LIB(osgUtild,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
+ AC_CHECK_LIB(osgDBd,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
+ AC_CHECK_LIB(osgTextd,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
+ AC_CHECK_LIB(osgGAd,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
+ AC_CHECK_LIB(osgViewerd,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
+ AC_CHECK_LIB(osgSimd,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
+ AC_CHECK_LIB(osgParticled,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
+ AC_CHECK_LIB(osgFXd, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
else
- AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
- AC_CHECK_LIB(osg,osgGetVersion)
- AC_CHECK_LIB(osgUtil,osgUtilGetVersion)
- AC_CHECK_LIB(osgDB,osgDBGetVersion)
- AC_CHECK_LIB(osgText,osgTextGetVersion)
- AC_CHECK_LIB(osgGA,osgGAGetVersion)
- AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
- AC_CHECK_LIB(osgSim,osgSimGetVersion)
- AC_CHECK_LIB(osgParticle,osgParticleGetVersion)
- LIBS="$LIBS -losgFX $opengl_LIBS"
+ AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
+ AC_CHECK_LIB(osg,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
+ AC_CHECK_LIB(osgUtil,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
+ AC_CHECK_LIB(osgDB,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
+ AC_CHECK_LIB(osgText,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
+ AC_CHECK_LIB(osgGA,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
+ AC_CHECK_LIB(osgViewer,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
+ AC_CHECK_LIB(osgSim,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
+ AC_CHECK_LIB(osgParticle,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
+ AC_CHECK_LIB(osgFX, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
fi
- ;;
-esac
+else
+ # Checking osg frameworks.
+ AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
+ AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
+ osg_FRAMEWORKS="$FRAMEWORKS"
+ FRAMEWORKS=""
+ AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
+ openthreads_FRAMEWORK="$FRAMEWORKS"
+ AC_SUBST(osg_FRAMEWORKS)
+ AC_SUBST(openthreads_FRAMEWORK)
+fi
AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
AC_CHECK_HEADER(osg/Version)
-How to compile FlightGear with Microsoft Visual C++ 7.0
-======================================================
+Use FlightGear.sln to compile fgfs executable for Win32 or x64 architectures with Visual Studio 2008.
+Previous versions of Visual Studio are not officially supported anymore.
-I am receiving an increasing number of request for working
-project files for MSVC. While I can't reply specifically
-to everybody, I packed my current, unedited, project files
-here :
-ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/
+Precompiled librairies and headers for compiling x64 executables with VS2008 :
+ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-x64-VS90-3rdParty+OSG-20100501.zip
-They are for MSVC 7. I am not trying to compile with MSVC 6
-anymore because it is an old compiler ( released 5 years ago )
-that has serious bugs and limitations that would make the
-source ugly. For those that want to try, there are already
-.dsp files in plib, SimGear and FlightGear source trees.
+Precompiled librairies and headers for compiling Win32 executables with VS2008 :
+ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty+OSG-20100501.zip
-Support request must be directed to the mailing list.
+The VS2008 / v9.0 project files assume the directory layout below :
+Win32 build :
+ * any_directory_on_any_drive /
+ 3rdParty / ( includes plib, fltk, zlib, libpng, libjpeg, libtiff, freetype, libsvn, gdal, ...
+ bin /
+ include /
+ lib /
+ boost_1_39_0 /
+ boost /
+ source / ( Flightgear CVS directory - It can also be renamed FlightGear or anything else
+ src /
+ projects /
+ VC90 /
+ Win32 / ( generated at build time
+ Debug / ( Debug executable
+ Release / ( Release executable
+ FlightGear.sln ( Main solution
+ utils /
+ install /
+ msvc90 /
+ OpenSceneGraph / ( OSG CMake install
+ bin /
+ include /
+ lib /
+ SimGear / ( SimGear CVS directory
+ simgear /
+ projects /
+ VC90 /
-Pthread support for Windows can be obtained here:
-http://sourceware.org/pthreads-win32/
+3rdParty, boost_1_39_0 and install/msvc90 are included in the Win32 3rdParty archive.
+
+x64 build :
+ * any_directory_on_any_drive /
+ 3rdParty.x64 / ( includes plib, fltk, zlib, libpng, libjpeg, libtiff, freetype, ...
+ bin /
+ include /
+ lib /
+ boost_1_39_0 /
+ boost /
+ source / ( Flightgear CVS directory - It can also be renamed FlightGear or anything else
+ src /
+ projects /
+ VC90 /
+ x64 / ( generated at build time
+ Debug / ( Debug executable
+ Release / ( Release executable
+ FlightGear.sln ( Main solution
+ utils /
+ install /
+ msvc90-64 /
+ OpenSceneGraph / ( OSG CMake install
+ bin /
+ include /
+ lib /
+ SimGear / ( SimGear CVS directory
+ simgear /
+ projects /
+ VC90 /
+
+3rdParty.x64, boost_1_39_0 and install/msvc90-64 are included in the x32 3rdParty archive.
+++ /dev/null
-\r
-How to compile FlightGear with Microsoft Visual C++ 8.0\r
-(Visual Studio .net 2003)\r
-======================================================\r
-\r
-You may need additional information on how to set up compilation\r
-with the project files included in this release.\r
-\r
-http://wiki.flightgear.org/flightgear_wiki/index.php?title=Building_Flightgear\r
-\r
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
+float-property - returns the float value of a property, useful inside equal, less or less-equal nodes
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>
+
+There is also a property set by the user to indicate what is the level
+of quality desired. This level of quality can be checked in the predicate
+like this :
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
- <less-equal>
- <value type="float">1.0</value>
- <shader-language/>
- </less-equal>
+ <less-equal>
+ <value type="float">2.0</value>
+ <float-property>/sim/rendering/quality-level</float-property>
+ </less-equal>
+ <!-- other predicate conditions -->
</and>
</predicate>
-
+
+The range of /sim/rendering/quality-level is [0..5]
+ * 2.0 is the threshold for relief mapping effects,
+ * 4.0 is the threshold for geometry shader usage.
A technique can consist of several passes. A pass is basically an Open
Scene Graph StateSet. Ultimately all OpenGL and OSG modes and state
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>
+ <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 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.
+ 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 0.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
+ 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
+ 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
+ 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
+ Valid values:
+ fill, line, point
program
- vertex-shader
- fragment-shader
+ vertex-shader
+ geometry-shader
+ fragment-shader
+ attribute
+ geometry-vertices-out: integer, max number of vertices emitted by geometry shader
+ geometry-input-type - points, lines, lines-adjacency, triangles, triangles-adjacency
+ geometry-output-type - points, line-strip, triangle-strip
render-bin - (OSG) children: bin-number, bin-name
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
- builtin texture. Currently supported OpenGL types are 1d, 2d,
- 3d which have the following common parameters:
+ type - This is either an OpenGL texture type or the name of a
+ builtin texture. Currently supported OpenGL types are 1d, 2d,
+ 3d which have the following common parameters:
image (file name)
- filter
- mag-filter
- wrap-s
- wrap-t
- wrap-r
- The following builtin types are supported:
- white - 1 pixel white texture
- noise - a 3d noise texture
- environment
- mode
- color
+ filter
+ mag-filter
+ wrap-s
+ wrap-t
+ wrap-r
+ The following built-in types are supported:
+ white - 1 pixel white texture
+ noise - a 3d noise texture
+ environment
+ mode
+ color
uniform
- name
- type - float, float-vec3, float-vec4, sampler-1d, sampler-2d,
- sampler-3d
+ name
+ type - float, float-vec3, float-vec4, sampler-1d, sampler-2d,
+ sampler-3d
vertex-program-two-side - true, false
overrides any default values that might be in the base effect's
parameters section.
+Generate
+--------
+
+Often shader effects need tangent vectors to work properly. These
+tangent vectors, usually called tangent and binormal, are computed
+on the CPU and given to the shader as vertex attributes. These
+vectors are computed on demand on the geometry using the effect if
+the 'generate' clause is present in the effect file. Exemple :
+
+ <generate>
+ <tangent type="int">6</tangent>
+ <binormal type="int">7</binormal>
+ <normal type="int">8</normal>
+ </generate>
+
+Valid subnodes of 'generate' are 'tangent', 'binormal' or 'normal'.
+The integer value of these subnode is the index of the attribute
+that will hold the value of the vec3 vector.
+
+The generate clause is located under PropertyList in the xml file.
+
+In order to be available for the vertex shader, these data should
+be bound to an attribute in the program clause, like this :
+
+ <program>
+ <vertex-shader>my_vertex_shader</vertex-shader>
+ <attribute>
+ <name>my_tangent_attribute</name>
+ <index>6</index>
+ </attribute>
+ <attribute>
+ <name>my_binormal_attribute</name>
+ <index>7</index>
+ </attribute>
+ </program>
+
+attribute names are whatever the shader use. The index is the one
+declared in the 'generate' clause. So because generate/tangent has
+value 6 and my_tangent_attribute has index 6, my_tangent_attribute
+holds the tangent value for the vertex.
+
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
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
+ shininess, color mode
+ * blend active, source, destination
+ * shade-model
+ * cull-face
+ * rendering-hint
+ * texture type, image, filter, wrap-s, wrap-t
Specifying Custom Effects
-------------------------
The Effects directory contains the effects definitions; look there for
examples. Effects/crop.eff is a good example of a complex effect.
+
+Application
+-----------
+
+To apply an effect to a model or part of a model use:
+
+ <effect>
+ <inherits-from>Effects/light-cone</inherits-from>
+ <object-name>Cone</object-name>
+ </effect>
+
+where <inherits-from> </inherits-from> contains the path to the effect you want to apply.
+The effect does not need the file extension.
+
+NOTE:
+
+Chrome, although now implemented as an effect, still retains the old method of application:
+
+ <animation>
+ <type>shader</type>
+ <shader>chrome</shader>
+ <texture>glass_shader.png</texture>
+ <object-name>windscreen</object-name>
+ </animation>
+
+in order to maintain backward compatibility.
+
+++ /dev/null
-bin
-Debug
-Release
-fgadmin_Debug
-fgadmin_Release
-3dconvert_Debug
-3dconvert_Release
-fgjs_Debug
-fgjs_Release
-GPSsmooth_Debug
-GPSsmooth_Release
-MIDGsmooth_Debug
-MIDGsmooth_Release
-UGsmooth_Debug
-UGsmooth_Release
-yasim_Debug
-yasim_Release
-FlightGear.ncb
-FlightGear.suo
-metar_Debug
-metar_Release
-Terrasync_Release
-Terrasync_Debug
-xmlgrep_Release
-xmlgrep_Debug
-fgviewer_Debug
-fgviewer_Release
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="3dconvert"
- ProjectGUID="{D95DBC85-D945-4879-B6CF-5864BF8F5E2E}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="3dconvert_Debug"
- IntermediateDirectory="3dconvert_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="ssg_d.lib sg_d.lib ul_d.lib"
- OutputFile="$(OutDir)/3dconvert.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\plib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/3dconvert.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="3dconvert_Release"
- IntermediateDirectory="3dconvert_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="ssg.lib ul.lib sg.lib"
- OutputFile="$(OutDir)/3dconvert.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\plib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\utils\Modeller\3dconvert.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FlightGear", "FlightGear.vcproj", "{49142EAF-B264-4B9F-B096-F669999EBB2E}"
- ProjectSection(ProjectDependencies) = postProject
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimGear", "..\..\..\SimGear\projects\VC7.1\SimGear.vcproj", "{22540CD3-D3CA-4C86-A773-80AEEE3ACDED}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fgadmin", "fgadmin.vcproj", "{7004E589-7EA0-4AFD-B432-3D5E00B55049}"
- ProjectSection(ProjectDependencies) = postProject
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fgjs", "fgjs.vcproj", "{6749547A-6493-4754-8E0E-49FB3137C4CA}"
- ProjectSection(ProjectDependencies) = postProject
- {49142EAF-B264-4B9F-B096-F669999EBB2E} = {49142EAF-B264-4B9F-B096-F669999EBB2E}
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GPSsmooth", "GPSsmooth.vcproj", "{AE9CE7E4-8F21-4C34-82DD-4D0371C210DA}"
- ProjectSection(ProjectDependencies) = postProject
- {49142EAF-B264-4B9F-B096-F669999EBB2E} = {49142EAF-B264-4B9F-B096-F669999EBB2E}
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MIDGsmooth", "MIDGsmooth.vcproj", "{92010FAB-17A3-4891-AE6D-507214FEA508}"
- ProjectSection(ProjectDependencies) = postProject
- {49142EAF-B264-4B9F-B096-F669999EBB2E} = {49142EAF-B264-4B9F-B096-F669999EBB2E}
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UGsmooth", "UGsmooth.vcproj", "{EEEEB798-BFFD-425F-86F9-03C6FE6B8B99}"
- ProjectSection(ProjectDependencies) = postProject
- {49142EAF-B264-4B9F-B096-F669999EBB2E} = {49142EAF-B264-4B9F-B096-F669999EBB2E}
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasim", "yasim.vcproj", "{800CB1FF-C398-4B81-B3D6-8BBD9E0897D2}"
- ProjectSection(ProjectDependencies) = postProject
- {49142EAF-B264-4B9F-B096-F669999EBB2E} = {49142EAF-B264-4B9F-B096-F669999EBB2E}
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "metar", "metar.vcproj", "{FC424099-5D77-4BC2-A93F-2EE59F816B51}"
- ProjectSection(ProjectDependencies) = postProject
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terrasync", "terrasync.vcproj", "{874D3F55-6048-4068-A7C2-7FA6AF1F30EA}"
- ProjectSection(ProjectDependencies) = postProject
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlgrep", "xmlgrep.vcproj", "{1F40CF41-9836-4488-BAAF-560623665C12}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fgviewer", "fgviewer.vcproj", "{0F13A557-EC52-481D-ADFB-9209C068FCEB}"
- ProjectSection(ProjectDependencies) = postProject
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {49142EAF-B264-4B9F-B096-F669999EBB2E}.Debug.ActiveCfg = Debug|Win32
- {49142EAF-B264-4B9F-B096-F669999EBB2E}.Debug.Build.0 = Debug|Win32
- {49142EAF-B264-4B9F-B096-F669999EBB2E}.Release.ActiveCfg = Release|Win32
- {49142EAF-B264-4B9F-B096-F669999EBB2E}.Release.Build.0 = Release|Win32
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}.Debug.ActiveCfg = Debug|Win32
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}.Debug.Build.0 = Debug|Win32
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}.Release.ActiveCfg = Release|Win32
- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}.Release.Build.0 = Release|Win32
- {7004E589-7EA0-4AFD-B432-3D5E00B55049}.Debug.ActiveCfg = Debug|Win32
- {7004E589-7EA0-4AFD-B432-3D5E00B55049}.Debug.Build.0 = Debug|Win32
- {7004E589-7EA0-4AFD-B432-3D5E00B55049}.Release.ActiveCfg = Release|Win32
- {7004E589-7EA0-4AFD-B432-3D5E00B55049}.Release.Build.0 = Release|Win32
- {6749547A-6493-4754-8E0E-49FB3137C4CA}.Debug.ActiveCfg = Debug|Win32
- {6749547A-6493-4754-8E0E-49FB3137C4CA}.Debug.Build.0 = Debug|Win32
- {6749547A-6493-4754-8E0E-49FB3137C4CA}.Release.ActiveCfg = Release|Win32
- {6749547A-6493-4754-8E0E-49FB3137C4CA}.Release.Build.0 = Release|Win32
- {AE9CE7E4-8F21-4C34-82DD-4D0371C210DA}.Debug.ActiveCfg = Debug|Win32
- {AE9CE7E4-8F21-4C34-82DD-4D0371C210DA}.Debug.Build.0 = Debug|Win32
- {AE9CE7E4-8F21-4C34-82DD-4D0371C210DA}.Release.ActiveCfg = Release|Win32
- {AE9CE7E4-8F21-4C34-82DD-4D0371C210DA}.Release.Build.0 = Release|Win32
- {92010FAB-17A3-4891-AE6D-507214FEA508}.Debug.ActiveCfg = Debug|Win32
- {92010FAB-17A3-4891-AE6D-507214FEA508}.Debug.Build.0 = Debug|Win32
- {92010FAB-17A3-4891-AE6D-507214FEA508}.Release.ActiveCfg = Release|Win32
- {92010FAB-17A3-4891-AE6D-507214FEA508}.Release.Build.0 = Release|Win32
- {EEEEB798-BFFD-425F-86F9-03C6FE6B8B99}.Debug.ActiveCfg = Debug|Win32
- {EEEEB798-BFFD-425F-86F9-03C6FE6B8B99}.Debug.Build.0 = Debug|Win32
- {EEEEB798-BFFD-425F-86F9-03C6FE6B8B99}.Release.ActiveCfg = Release|Win32
- {EEEEB798-BFFD-425F-86F9-03C6FE6B8B99}.Release.Build.0 = Release|Win32
- {800CB1FF-C398-4B81-B3D6-8BBD9E0897D2}.Debug.ActiveCfg = Debug|Win32
- {800CB1FF-C398-4B81-B3D6-8BBD9E0897D2}.Debug.Build.0 = Debug|Win32
- {800CB1FF-C398-4B81-B3D6-8BBD9E0897D2}.Release.ActiveCfg = Release|Win32
- {800CB1FF-C398-4B81-B3D6-8BBD9E0897D2}.Release.Build.0 = Release|Win32
- {FC424099-5D77-4BC2-A93F-2EE59F816B51}.Debug.ActiveCfg = Debug|Win32
- {FC424099-5D77-4BC2-A93F-2EE59F816B51}.Debug.Build.0 = Debug|Win32
- {FC424099-5D77-4BC2-A93F-2EE59F816B51}.Release.ActiveCfg = Release|Win32
- {FC424099-5D77-4BC2-A93F-2EE59F816B51}.Release.Build.0 = Release|Win32
- {874D3F55-6048-4068-A7C2-7FA6AF1F30EA}.Debug.ActiveCfg = Debug|Win32
- {874D3F55-6048-4068-A7C2-7FA6AF1F30EA}.Debug.Build.0 = Debug|Win32
- {874D3F55-6048-4068-A7C2-7FA6AF1F30EA}.Release.ActiveCfg = Release|Win32
- {874D3F55-6048-4068-A7C2-7FA6AF1F30EA}.Release.Build.0 = Release|Win32
- {1F40CF41-9836-4488-BAAF-560623665C12}.Debug.ActiveCfg = Debug|Win32
- {1F40CF41-9836-4488-BAAF-560623665C12}.Debug.Build.0 = Debug|Win32
- {1F40CF41-9836-4488-BAAF-560623665C12}.Release.ActiveCfg = Release|Win32
- {1F40CF41-9836-4488-BAAF-560623665C12}.Release.Build.0 = Release|Win32
- {0F13A557-EC52-481D-ADFB-9209C068FCEB}.Debug.ActiveCfg = Debug|Win32
- {0F13A557-EC52-481D-ADFB-9209C068FCEB}.Debug.Build.0 = Debug|Win32
- {0F13A557-EC52-481D-ADFB-9209C068FCEB}.Release.ActiveCfg = Release|Win32
- {0F13A557-EC52-481D-ADFB-9209C068FCEB}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="FlightGear"
- ProjectGUID="{49142EAF-B264-4B9F-B096-F669999EBB2E}"
- RootNamespace="FlightGear"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\src;..\..\src\include;..\..\..\SimGear;..\..\src\FDM\JSBSim;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include;..\..\..\boost_1_36_0"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;HAVE_CONFIG_H;FGFS;ENABLE_AUDIO_SUPPORT;_FG_NDEBUG;ENABLE_THREADS=1;FG_ENABLE_MULTIPASS_CLOUDS;ENABLE_SP_FMDS;_USE_MATH_DEFINES;FG_JPEG_SERVER;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;PU_USE_NATIVE"
- StringPooling="TRUE"
- BasicRuntimeChecks="0"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- PrecompiledHeaderFile=".\Debug/FlightGear.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="4"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="opengl32.lib glu32.lib winmm.lib wsock32.lib sg_d.lib net_d.lib pui_d.lib puaux_d.lib fnt_d.lib js_d.lib ul_d.lib zlibd.lib OpenAL32.lib ALut.lib osgd.lib osgDBd.lib osgUtild.lib osgViewerd.lib osgGAd.lib osgTextd.lib osgParticled.lib OpenThreadsd.lib libjpegd.lib"
- OutputFile="$(OutDir)/fgfs.exe"
- LinkIncremental="2"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- IgnoreDefaultLibraryNames=""
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Debug/FlightGear.pdb"
- SubSystem="1"/>
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Debug/FlightGear.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="3081"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\src;..\..\src\include;..\..\src\FDM\JSBSim;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\Producer\include;..\..\..\3rdParty\include;..\..\..\boost_1_36_0"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HAVE_CONFIG_H;FGFS;ENABLE_AUDIO_SUPPORT;_FG_NDEBUG;ENABLE_THREADS=1;FG_ENABLE_MULTIPASS_CLOUDS;ENABLE_SP_FMDS;_USE_MATH_DEFINES;FG_JPEG_SERVER;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;PU_USE_NATIVE"
- StringPooling="TRUE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
- RuntimeTypeInfo="TRUE"
- PrecompiledHeaderFile=".\Release/FlightGear.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="opengl32.lib glu32.lib winmm.lib wsock32.lib sg.lib net.lib pui.lib puAux.lib fnt.lib js.lib ul.lib zlib.lib OpenAL32.lib ALut.lib osg.lib osgDB.lib osgUtil.lib osgViewer.lib osgGA.lib osgText.lib osgParticle.lib OpenThreads.lib libjpeg.lib"
- OutputFile="bin/Release/fgfs.exe"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- IgnoreDefaultLibraryNames=""
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Release/FlightGear.pdb"
- SubSystem="1"/>
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Release/FlightGear.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="3081"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Lib_Aircraft"
- Filter="">
- <File
- RelativePath="..\..\src\Aircraft\aircraft.cxx">
- </File>
- <File
- RelativePath="..\..\src\Aircraft\aircraft.hxx">
- </File>
- <File
- RelativePath="..\..\src\Aircraft\controls.cxx">
- </File>
- <File
- RelativePath="..\..\src\Aircraft\controls.hxx">
- </File>
- <File
- RelativePath="..\..\src\Aircraft\replay.cxx">
- </File>
- <File
- RelativePath="..\..\src\Aircraft\replay.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Airports"
- Filter="">
- <File
- RelativePath="..\..\src\Airports\apt_loader.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\apt_loader.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\dynamicloader.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\dynamicloader.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\dynamics.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\dynamics.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\gnnode.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\gnnode.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\groundnetwork.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\groundnetwork.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\parking.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\parking.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\pavement.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\pavement.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runwaybase.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runwaybase.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runwayprefloader.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runwayprefloader.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runwayprefs.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runwayprefs.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runways.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\runways.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\sidstar.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\sidstar.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\simple.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\simple.hxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\xmlloader.cxx">
- </File>
- <File
- RelativePath="..\..\src\Airports\xmlloader.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_ATCDCL"
- Filter="">
- <File
- RelativePath="..\..\src\ATCDCL\AIEntity.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AIEntity.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AIGAVFRTraffic.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AIGAVFRTraffic.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AILocalTraffic.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AILocalTraffic.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AIMgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AIMgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AIPlane.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\AIPlane.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\approach.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\approach.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATC.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATC.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCDialog.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCDialog.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCmgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCmgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCProjection.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCProjection.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCutils.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCutils.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCVoice.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ATCVoice.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\atis.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\atis.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\commlist.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\commlist.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ground.cxx">
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\ground.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\tower.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\tower.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\transmission.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\transmission.hxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\transmissionlist.cxx">
- </File>
- <File
- RelativePath="..\..\src\ATCDCL\transmissionlist.hxx">
- </File>
- </Filter>
- <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>
- <File
- RelativePath="..\..\src\Autopilot\route_mgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Autopilot\xmlauto.cxx">
- </File>
- <File
- RelativePath="..\..\src\Autopilot\xmlauto.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Cockpit"
- Filter="">
- <File
- RelativePath="..\..\src\Cockpit\cockpit.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\cockpit.hxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud.cxx">
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud.hxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_card.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_dnst.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_gaug.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_inst.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_labl.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_ladr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_rwy.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_scal.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\hud_tbi.cxx">
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\Cockpit\panel.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\panel.hxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\panel_io.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\panel_io.hxx">
- </File>
- <Filter
- Name="build_in"
- Filter="">
- <File
- RelativePath="..\..\src\Cockpit\built_in\FGMagRibbon.cxx">
- </File>
- <File
- RelativePath="..\..\src\Cockpit\built_in\FGMagRibbon.hxx">
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Lib_JSBSim"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\JSBSim\FGFDMExec.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\JSBSim\FGFDMExec.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\JSBSim\FGJSBBase.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\JSBSim\FGJSBBase.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\JSBSim\FGState.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\JSBSim\FGState.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\JSBSim\JSBSim.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\JSBSim\JSBSim.hxx">
- </File>
- <Filter
- Name="math"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGColumnVector3.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGColumnVector3.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGCondition.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGCondition.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGFunction.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGFunction.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGLocation.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGLocation.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGMatrix33.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGMatrix33.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGParameter.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGPropertyValue.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGPropertyValue.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGQuaternion.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGQuaternion.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGRealValue.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGRealValue.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGTable.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\math\FGTable.h">
- </File>
- </Filter>
- <Filter
- Name="models"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAerodynamics.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAerodynamics.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAircraft.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAircraft.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAtmosphere.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAtmosphere.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAuxiliary.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGAuxiliary.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGBuoyantForces.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGBuoyantForces.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGExternalForce.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGExternalForce.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGExternalReactions.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGExternalReactions.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGFCS.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGFCS.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGGasCell.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGGasCell.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGGroundReactions.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGGroundReactions.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGInertial.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGInertial.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGInput.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGInput.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGLGear.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGLGear.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGMassBalance.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGMassBalance.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGModel.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGModel.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGOutput.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGOutput.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGPropagate.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGPropagate.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGPropulsion.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\FGPropulsion.h">
- </File>
- <Filter
- Name="atmosphere"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\atmosphere\FGMars.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\atmosphere\FGMars.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\atmosphere\FGMSIS.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\atmosphere\FGMSIS.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\atmosphere\FGMSISData.cpp">
- </File>
- </Filter>
- <Filter
- Name="flight_control"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGAccelerometer.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGAccelerometer.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGActuator.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGActuator.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGDeadBand.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGDeadBand.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGFCSComponent.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGFCSComponent.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGFCSFunction.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGFCSFunction.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGFilter.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGFilter.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGGain.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGGain.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGGradient.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGGradient.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGKinemat.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGKinemat.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGPID.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGPID.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGSensor.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGSensor.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGSummer.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGSummer.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGSwitch.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\flight_control\FGSwitch.h">
- </File>
- </Filter>
- <Filter
- Name="propulsion"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGElectric.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGElectric.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGEngine.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGEngine.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGForce.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGForce.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGNozzle.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGNozzle.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGPiston.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGPiston.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGPropeller.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGPropeller.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGRocket.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGRocket.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGRotor.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGRotor.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGTank.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGTank.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGThruster.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGThruster.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGTurbine.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGTurbine.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGTurboProp.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\models\propulsion\FGTurboProp.h">
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="input_output"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGfdmSocket.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGfdmSocket.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGGroundCallback.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGGroundCallback.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGPropertyManager.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGPropertyManager.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGScript.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGScript.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGXMLElement.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGXMLElement.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGXMLFileRead.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGXMLParse.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\FGXMLParse.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\input_output\net_fdm.hxx">
- </File>
- </Filter>
- <Filter
- Name="initialization"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\JSBSim\initialization\FGInitialCondition.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\initialization\FGInitialCondition.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\initialization\FGTrim.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\initialization\FGTrim.h">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\initialization\FGTrimAxis.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\JSBSim\initialization\FGTrimAxis.h">
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Lib_LaRCsim"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\LaRCsim\atmos_62.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\atmos_62.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\basic_aero.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\basic_aero.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\basic_engine.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\basic_gear.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\basic_init.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\basic_init.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\c172_aero.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\c172_aero.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\c172_engine.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\c172_gear.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\c172_init.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\c172_init.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\cherokee_aero.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\cherokee_engine.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\cherokee_gear.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\cherokee_init.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\default_model_routines.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\default_model_routines.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\IO360.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\IO360.hxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\LaRCsim.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\LaRCsim.hxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\LaRCsimIC.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\LaRCsimIC.hxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_accel.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_accel.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_aux.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_aux.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_cockpit.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_constants.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_generic.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_geodesy.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_geodesy.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_gravity.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_gravity.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_init.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_init.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_interface.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_interface.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_matrix.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_matrix.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_model.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_model.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_sim_control.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_step.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_step.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_sym.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\ls_types.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\navion_aero.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\navion_engine.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\navion_gear.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\navion_init.c">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\navion_init.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\LaRCsim\uiuc_aero.c">
- </File>
- </Filter>
- <Filter
- Name="Lib_UIUCModel"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_1DdataFileReader.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_1DdataFileReader.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_1Dinterpolation.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_1Dinterpolation.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_2DdataFileReader.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_2DdataFileReader.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_2Dinterpolation.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_2Dinterpolation.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_3Dinterpolation.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_3Dinterpolation.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_aerodeflections.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_aerodeflections.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_aircraft.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_aircraftdir.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_alh_ap.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_alh_ap.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_auto_pilot.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_auto_pilot.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_betaprobe.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_betaprobe.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_drag.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_drag.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_lift.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_lift.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_pitch.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_pitch.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_roll.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_roll.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_sideforce.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_sideforce.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_yaw.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coef_yaw.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coefficients.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_coefficients.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_controlInput.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_controlInput.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_convert.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_convert.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_engine.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_engine.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_find_position.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_find_position.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_flapdata.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_flapdata.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_fog.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_fog.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_gear.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_gear.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_get_flapper.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_get_flapper.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_getwind.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_getwind.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_hh_ap.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_hh_ap.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_ice.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_ice.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_iceboot.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_iceboot.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_iced_nonlin.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_iced_nonlin.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_icing_demo.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_icing_demo.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_initializemaps.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_initializemaps.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_CD.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_CD.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_CL.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_CL.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_Cm.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_Cm.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_Cn.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_Cn.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_controlSurface.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_controlSurface.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_Croll.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_Croll.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_CY.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_CY.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_engine.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_engine.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_fog.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_fog.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_gear.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_gear.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_geometry.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_geometry.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_ice.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_ice.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_init.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_init.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_keyword.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_keyword.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_mass.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_mass.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_misc.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_misc.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record1.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record1.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record2.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record2.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record3.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record3.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record4.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record4.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record5.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record5.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record6.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_map_record6.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_CD.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_CD.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_CL.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_CL.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_Cm.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_Cm.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_Cn.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_Cn.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_controlSurface.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_controlSurface.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_Croll.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_Croll.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_CY.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_CY.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_engine.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_engine.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_fog.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_fog.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_functions.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_functions.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_gear.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_gear.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_geometry.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_geometry.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_ice.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_ice.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_init.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_init.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_mass.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_mass.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_misc.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_misc.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_record.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_menu_record.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_pah_ap.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_pah_ap.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_parsefile.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_parsefile.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_rah_ap.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_rah_ap.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_recorder.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_recorder.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_warnings_errors.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_warnings_errors.h">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_wrapper.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\UIUCModel\uiuc_wrapper.h">
- </File>
- </Filter>
- <Filter
- Name="Lib_YASim"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\YASim\Airplane.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Airplane.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Atmosphere.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Atmosphere.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\BodyEnvironment.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\ControlMap.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\ControlMap.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\FGFDM.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\FGFDM.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\FGGround.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\FGGround.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Gear.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Gear.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Glue.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Glue.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Ground.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Ground.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hitch.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hitch.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hook.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hook.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Integrator.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Integrator.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Jet.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Jet.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Launchbar.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Launchbar.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Math.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Math.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Model.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Model.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\PistonEngine.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\PistonEngine.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Propeller.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Propeller.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\PropEngine.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\PropEngine.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\RigidBody.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\RigidBody.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Rotor.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Rotor.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Rotorpart.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Rotorpart.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\SimpleJet.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\SimpleJet.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Surface.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Surface.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Thruster.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Thruster.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\TurbineEngine.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\TurbineEngine.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Turbulence.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Turbulence.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Vector.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Wing.cpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\Wing.hpp">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\YASim.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\YASim\YASim.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Flight"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\flight.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\flight.hxx">
- </File>
- <File
- RelativePath="..\..\src\Fdm\groundcache.cxx">
- </File>
- <File
- RelativePath="..\..\src\Fdm\groundcache.hxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\NullFDM.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\NullFDM.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_GUI"
- Filter="">
- <File
- RelativePath="..\..\src\GUI\AirportList.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\AirportList.hxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\dialog.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\dialog.hxx">
- </File>
- <File
- RelativePath="..\..\src\Gui\fonts.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\gui.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\gui.h">
- </File>
- <File
- RelativePath="..\..\src\GUI\gui_funcs.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\layout-props.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\layout.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\layout.hxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\menubar.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\menubar.hxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\new_gui.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\new_gui.hxx">
- </File>
- <File
- RelativePath="..\..\src\Gui\property_list.cxx">
- </File>
- <File
- RelativePath="..\..\src\Gui\property_list.hxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\SafeTexFont.cxx">
- </File>
- <File
- RelativePath="..\..\src\GUI\SafeTexFont.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Input"
- Filter="">
- <File
- RelativePath="..\..\src\Input\input.cxx">
- </File>
- <File
- RelativePath="..\..\src\Input\input.hxx">
- </File>
- </Filter>
- <Filter
- Name="main"
- Filter="">
- <File
- RelativePath="..\..\src\Main\bootstrap.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\CameraGroup.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\CameraGroup.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_commands.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_commands.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_init.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_init.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_io.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_io.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_os.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_os_common.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_os_osgviewer.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_props.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fg_props.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fgviewer.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\fgviewer.hxx">
- </File>
-
- <File
- RelativePath="..\..\src\Main\FGEventHandler.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\FGEventHandler.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\globals.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\globals.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\logger.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\logger.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\main.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\main.hxx">
- </File>
- <File
- RelativePath="..\..\src\Scripting\nasal-props.cxx">
- </File>
- <File
- RelativePath="..\..\src\Scripting\NasalSys.cxx">
- </File>
- <File
- RelativePath="..\..\src\Scripting\NasalSys.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\options.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\options.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\renderer.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\renderer.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\splash.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\splash.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\util.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\util.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\viewer.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\viewer.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\viewmgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\viewmgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\WindowBuilder.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\WindowBuilder.hxx">
- </File>
- <File
- RelativePath="..\..\src\Main\WindowSystemAdapter.cxx">
- </File>
- <File
- RelativePath="..\..\src\Main\WindowSystemAdapter.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Navaids"
- Filter="">
- <File
- RelativePath="..\..\src\Navaids\awynet.cxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\awynet.hxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\fix.hxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\fixlist.cxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\fixlist.hxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\markerbeacon.cxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\markerbeacon.hxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\nav.hxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\navdb.cxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\navdb.hxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\navlist.cxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\navlist.hxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\navrecord.cxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\positioned.cxx">
- </File>
- <File
- RelativePath="..\..\src\Navaids\positioned.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Network"
- Filter="">
- <File
- RelativePath="..\..\src\Network\ATC-Inputs.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\ATC-Inputs.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\ATC-Main.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\ATC-Main.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\ATC-Outputs.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\ATC-Outputs.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\atlas.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\atlas.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\AV400.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\AV400.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\AV400Sim.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\AV400Sim.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\garmin.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\garmin.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\generic.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\generic.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\httpd.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\httpd.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\joyclient.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\joyclient.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\jpg-httpd.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\jpg-httpd.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\jsclient.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\jsclient.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\multiplay.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\multiplay.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native_ctrls.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native_ctrls.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native_fdm.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native_fdm.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native_gui.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\native_gui.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\net_ctrls.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\net_fdm.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\net_fdm_mini.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\net_gui.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\nmea.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\nmea.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\opengc.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\opengc.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\opengc_data.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\props.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\props.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\protocol.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\protocol.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\pve.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\pve.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\ray.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\ray.hxx">
- </File>
- <File
- RelativePath="..\..\src\Network\rul.cxx">
- </File>
- <File
- RelativePath="..\..\src\Network\rul.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Scenery"
- Filter="">
- <File
- RelativePath="..\..\src\Scenery\redout.cxx">
- </File>
- <File
- RelativePath="..\..\src\Scenery\redout.hxx">
- </File>
- <File
- RelativePath="..\..\src\Scenery\scenery.cxx">
- </File>
- <File
- RelativePath="..\..\src\Scenery\scenery.hxx">
- </File>
- <File
- RelativePath="..\..\src\Scenery\SceneryPager.cxx">
- </File>
- <File
- RelativePath="..\..\src\Scenery\SceneryPager.hxx">
- </File>
- <File
- RelativePath="..\..\src\Scenery\tilemgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Scenery\tilemgr.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Sound"
- Filter="">
- <File
- RelativePath="..\..\src\Sound\beacon.cxx">
- </File>
- <File
- RelativePath="..\..\src\Sound\beacon.hxx">
- </File>
- <File
- RelativePath="..\..\src\Sound\fg_fx.cxx">
- </File>
- <File
- RelativePath="..\..\src\Sound\fg_fx.hxx">
- </File>
- <File
- RelativePath="..\..\src\Sound\morse.cxx">
- </File>
- <File
- RelativePath="..\..\src\Sound\morse.hxx">
- </File>
- <File
- RelativePath="..\..\src\Sound\voice.cxx">
- </File>
- <File
- RelativePath="..\..\src\Sound\voice.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Time"
- Filter="">
- <File
- RelativePath="..\..\src\Time\light.cxx">
- </File>
- <File
- RelativePath="..\..\src\Time\light.hxx">
- </File>
- <File
- RelativePath="..\..\src\Time\sunsolver.cxx">
- </File>
- <File
- RelativePath="..\..\src\Time\sunsolver.hxx">
- </File>
- <File
- RelativePath="..\..\src\Time\tmp.cxx">
- </File>
- <File
- RelativePath="..\..\src\Time\tmp.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Multiplayer"
- Filter="">
- <File
- RelativePath="..\..\src\MultiPlayer\mpmessages.hxx">
- </File>
- <File
- RelativePath="..\..\src\MultiPlayer\multiplaymgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\MultiPlayer\multiplaymgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\MultiPlayer\tiny_xdr.cxx">
- </File>
- <File
- RelativePath="..\..\src\MultiPlayer\tiny_xdr.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Environment"
- Filter="">
- <File
- RelativePath="..\..\src\Environment\atmosphere.cxx">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\Environment\atmosphere.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\environment.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\environment.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\environment_ctrl.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\environment_ctrl.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\environment_mgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\environment_mgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\fgclouds.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\fgclouds.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\fgmetar.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\fgmetar.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\fgwind.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\fgwind.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\precipitation_mgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\precipitation_mgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\ridge_lift.cxx">
- </File>
- <File
- RelativePath="..\..\src\Environment\ridge_lift.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Model"
- Filter="">
- <File
- RelativePath="..\..\src\Model\acmodel.cxx">
- </File>
- <File
- RelativePath="..\..\src\Model\acmodel.hxx">
- </File>
- <File
- RelativePath="..\..\src\Model\model_panel.cxx">
- </File>
- <File
- RelativePath="..\..\src\Model\model_panel.hxx">
- </File>
- <File
- RelativePath="..\..\src\Model\modelmgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Model\modelmgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Model\panelnode.cxx">
- </File>
- <File
- RelativePath="..\..\src\Model\panelnode.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_UFO"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\UFO.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\UFO.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Instrumentation"
- Filter="">
- <File
- RelativePath="..\..\src\Instrumentation\adf.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\adf.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\agradar.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\agradar.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\airspeed_indicator.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\airspeed_indicator.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\altimeter.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\altimeter.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\attitude_indicator.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\attitude_indicator.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\clock.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\clock.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\dclgps.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\dclgps.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\dme.cxx">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\dme.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\gps.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\gps.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\groundradar.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\groundradar.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\gsdi.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\gsdi.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\gyro.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\gyro.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\heading_indicator.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\heading_indicator.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\heading_indicator_dg.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\heading_indicator_dg.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\heading_indicator_fg.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\heading_indicator_fg.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\inst_vertical_speed_indicator.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\inst_vertical_speed_indicator.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\instrument_mgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\instrument_mgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\kr_87.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\kr_87.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\kt_70.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\kt_70.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\mag_compass.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\mag_compass.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\marker_beacon.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\marker_beacon.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\mk_viii.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\mk_viii.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\mrg.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\mrg.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\navradio.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\navradio.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\od_gauge.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\od_gauge.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\rad_alt.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\rad_alt.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\render_area_2d.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\render_area_2d.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\slip_skid_ball.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\slip_skid_ball.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\tacan.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\tacan.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\transponder.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\transponder.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\turn_indicator.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\turn_indicator.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\vertical_speed_indicator.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\vertical_speed_indicator.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\wxradar.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\wxradar.hxx">
- </File>
- <Filter
- Name="Lib_HUD"
- Filter="">
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD.cxx">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_dial.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_gauge.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_instrument.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_label.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_ladder.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_misc.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_runway.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_scale.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_tape.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Hud\HUD_tbi.cxx">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Lib_Systems"
- Filter="">
- <File
- RelativePath="..\..\src\Systems\electrical.cxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\electrical.hxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\pitot.cxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\pitot.hxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\static.cxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\static.hxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\system_mgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\system_mgr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\vacuum.cxx">
- </File>
- <File
- RelativePath="..\..\src\Systems\vacuum.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_ExternalNet"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\ExternalNet\ExternalNet.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\ExternalNet\ExternalNet.hxx">
- </File>
- </Filter>
- <Filter
- Name="ExternalPipe"
- Filter="">
- <File
- RelativePath="..\..\src\FDM\ExternalPipe\ExternalPipe.cxx">
- </File>
- <File
- RelativePath="..\..\src\FDM\ExternalPipe\ExternalPipe.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_AIModel"
- Filter="">
- <File
- RelativePath="..\..\src\AIModel\AIAircraft.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIAircraft.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIBallistic.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIBallistic.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIBase.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIBase.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AICarrier.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AICarrier.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIEscort.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIEscort.hxx">
- </File>
-
- <File
- RelativePath="..\..\src\AIModel\AIFlightPlan.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIFlightPlan.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIFlightPlanCreate.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIFlightPlanCreateCruise.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIFlightPlanCreatePushBack.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIManager.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIManager.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIMultiplayer.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIMultiplayer.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIShip.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIShip.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIStatic.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIStatic.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIStorm.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIStorm.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AITanker.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AITanker.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIThermal.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIThermal.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIWingman.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIWingman.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIGroundVehicle.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\AIGroundVehicle.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\performancedata.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\performancedata.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\performancedb.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\performancedb.hxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\submodel.cxx">
- </File>
- <File
- RelativePath="..\..\src\AIModel\submodel.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_Traffic"
- Filter="">
- <File
- RelativePath="..\..\src\Traffic\SchedFlight.cxx">
- </File>
- <File
- RelativePath="..\..\src\Traffic\SchedFlight.hxx">
- </File>
- <File
- RelativePath="..\..\src\Traffic\Schedule.cxx">
- </File>
- <File
- RelativePath="..\..\src\Traffic\Schedule.hxx">
- </File>
- <File
- RelativePath="..\..\src\Traffic\TrafficMgr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Traffic\TrafficMgr.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_SP"
- Filter="">
- <File
- RelativePath="..\..\src\Fdm\Sp\ACMS.cxx">
- </File>
- <File
- RelativePath="..\..\src\Fdm\Sp\ACMS.hxx">
- </File>
- <File
- RelativePath="..\..\src\Fdm\Sp\ADA.cxx">
- </File>
- <File
- RelativePath="..\..\src\Fdm\Sp\ADA.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_KLN89"
- Filter="">
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_act.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_act.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_apt.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_apt.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_cal.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_cal.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_dir.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_dir.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_fpl.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_fpl.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_int.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_int.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_nav.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_nav.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_ndb.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_ndb.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_nrst.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_nrst.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_oth.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_oth.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_set.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_set.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_usr.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_usr.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_vor.cxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_page_vor.hxx">
- </File>
- <File
- RelativePath="..\..\src\Instrumentation\Kln89\kln89_symbols.hxx">
- </File>
- </Filter>
- <Filter
- Name="Lib_ATC"
- Filter="">
- <File
- RelativePath="..\..\src\Atc\trafficcontrol.cxx">
- </File>
- <File
- RelativePath="..\..\src\Atc\trafficcontrol.hxx">
- </File>
- </Filter>
- <File
- RelativePath="..\..\src\Include\config.h-msvc71">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Generation of config.h"
- CommandLine="copy $(inputPath) $(InputDir)\$(InputName).h
-"
- Outputs="..\..\src\Include\config.h"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Generation of config.h"
- CommandLine="copy $(inputPath) $(InputDir)\$(InputName).h
-"
- Outputs="..\..\src\Include\config.h"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="flightgear.ico">
- </File>
- <File
- RelativePath="flightgear.rc">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="GPSsmooth"
- ProjectGUID="{AE9CE7E4-8F21-4C34-82DD-4D0371C210DA}"
- RootNamespace="GPSsmooth"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectName)_Debug"
- IntermediateDirectory="$(ProjectName)_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg_d.lib net_d.lib ul_d.lib ws2_32.lib winmm.lib zlibd.lib"
- OutputFile="$(OutDir)/GPSsmooth.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/GPSsmooth.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectName)_Release"
- IntermediateDirectory="$(ProjectName)_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg.lib net.lib ul.lib ws2_32.lib winmm.lib zlib.lib"
- OutputFile="bin/Release/GPSsmooth.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\utils\GPSsmooth\gps.cxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\gps_main.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\..\utils\GPSsmooth\gps.hxx">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="MIDGsmooth"
- ProjectGUID="{92010FAB-17A3-4891-AE6D-507214FEA508}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectName)_Debug"
- IntermediateDirectory="$(ProjectName)_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg_d.lib net_d.lib ul_d.lib ws2_32.lib winmm.lib"
- OutputFile="$(OutDir)/MIDGsmooth.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/MIDGsmooth.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectName)_Release"
- IntermediateDirectory="$(ProjectName)_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- RuntimeLibrary="2"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg.lib net.lib ul.lib ws2_32.lib winmm.lib"
- OutputFile="bin/Release/MIDGsmooth.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\utils\GPSsmooth\MIDG-II.cxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\MIDG_main.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\..\utils\GPSsmooth\MIDG-II.hxx">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="UGsmooth"
- ProjectGUID="{EEEEB798-BFFD-425F-86F9-03C6FE6B8B99}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectName)_Debug"
- IntermediateDirectory="$(ProjectName)_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg_d.lib net_d.lib ul_d.lib ws2_32.lib winmm.lib zlibd.lib"
- OutputFile="$(OutDir)/UGsmooth.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/UGsmooth.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectName)_Release"
- IntermediateDirectory="$(ProjectName)_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- RuntimeLibrary="2"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg.lib net.lib ul.lib ws2_32.lib winmm.lib zlib.lib"
- OutputFile="bin/Release/UGsmooth.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear.cxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear_command.cxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear_main.cxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear_telnet.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear.hxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear_command.hxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear_opengc.hxx">
- </File>
- <File
- RelativePath="..\..\utils\GPSsmooth\UGear_telnet.hxx">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-IDI_ICON1 ICON "flightgear.ico"
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="fgadmin"
- ProjectGUID="{7004E589-7EA0-4AFD-B432-3D5E00B55049}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="fgadmin_Debug"
- IntermediateDirectory="fgadmin_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\..\..\OpenThreads\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_ZLIB;NOMINMAX;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="fltkd.lib ul_d.lib comctl32.lib wsock32.lib zlibd.lib sg_d.lib"
- OutputFile="$(OutDir)/fgadmin.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/fgadmin.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="fgadmin_Release"
- IntermediateDirectory="fgadmin_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- OmitFramePointers="TRUE"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_ZLIB;NOMINMAX;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- StringPooling="TRUE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="fltk.lib ul.lib sg.lib comctl32.lib wsock32.lib zlib.lib"
- OutputFile="bin/Release/fgadmin.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""..\..\..\fltk-1.1.7\lib";..\..\..\plib;..\..\..\3rdParty\lib"
- GenerateDebugInformation="FALSE"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
- <File
- RelativePath="..\..\utils\fgadmin\src\fgadmin.cxx">
- </File>
- <File
- RelativePath="..\..\utils\fgadmin\src\fgadmin_funcs.cxx">
- </File>
- <File
- RelativePath="..\..\utils\fgadmin\src\main.cxx">
- </File>
- <File
- RelativePath="..\..\utils\fgadmin\src\untarka.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc">
- <File
- RelativePath="..\..\utils\fgadmin\src\config.h">
- </File>
- <File
- RelativePath="..\..\utils\fgadmin\src\fgadmin.h">
- </File>
- <File
- RelativePath=".\resource.h">
- </File>
- <File
- RelativePath="..\..\utils\fgadmin\src\untarka.h">
- </File>
- </Filter>
- <File
- RelativePath=".\fgadmin.rc">
- </File>
- <File
- RelativePath=".\flightgear.ico">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="fgjs"
- ProjectGUID="{6749547A-6493-4754-8E0E-49FB3137C4CA}"
- RootNamespace="fgjs"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="fgjs_Debug"
- IntermediateDirectory="fgjs_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg_d.lib js_d.lib ul_d.lib zlibd.lib winmm.lib ws2_32.lib OpenThreadsd.lib"
- OutputFile="$(OutDir)/fgjs.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/fgjs.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="fgjs_Release"
- IntermediateDirectory="fgjs_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- RuntimeLibrary="2"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg.lib js.lib ul.lib zlib.lib winmm.lib ws2_32.lib OpenThreads.lib"
- OutputFile="bin/Release/fgjs.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\src\Input\fgjs.cxx">
- </File>
- <File
- RelativePath="..\..\src\Input\jsinput.cxx">
- </File>
- <File
- RelativePath="..\..\src\Input\jssuper.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\..\src\Input\jsinput.h">
- </File>
- <File
- RelativePath="..\..\src\Input\jssuper.h">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="fgviewer"
- ProjectGUID="{0F13A557-EC52-481D-ADFB-9209C068FCEB}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectName)_Debug"
- IntermediateDirectory="$(ProjectName)_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\boost_1_36_0;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="opengl32.lib osgd.lib osgDBd.lib osgViewerd.lib osgGAd.lib openthreadsd.lib osgParticled.lib osgUtild.lib ul_d.lib sg_d.lib zlibd.lib"
- OutputFile="$(OutDir)/fgviewer.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/fgviewer.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectName)_Release"
- IntermediateDirectory="$(ProjectName)_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\boost_1_36_0;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX"
- RuntimeLibrary="2"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="opengl32.lib osg.lib osgDB.lib osgViewer.lib osgGA.lib openthreads.lib osgParticle.lib osgUtil.lib ul.lib sg.lib zlib.lib"
- OutputFile="bin/Release/fgviewer.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\utils\fgviewer\fgviewer.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-FLIGHTGEAR ICON "flightgear.ico"
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="metar"
- ProjectGUID="{FC424099-5D77-4BC2-A93F-2EE59F816B51}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectName)_Debug"
- IntermediateDirectory="$(ProjectName)_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg_d.lib ul_d.lib net_d.lib ws2_32.lib"
- OutputFile="$(OutDir)/metar.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/metar.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectName)_Release"
- IntermediateDirectory="$(ProjectName)_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg.lib ul.lib net.lib ws2_32.lib"
- OutputFile="bin/Release/metar.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\src\Main\metar_main.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="terrasync"
- ProjectGUID="{874D3F55-6048-4068-A7C2-7FA6AF1F30EA}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Terrasync_Debug"
- IntermediateDirectory="Terrasync_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;"..\..\..\svn-win32-1.5.3\include";"..\..\..\svn-win32-1.5.3\include\apr";"..\..\..\svn-win32-1.5.3\include\apr-iconv";"..\..\..\svn-win32-1.5.3\include\apr-util";..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;HAVE_SVN_CLIENT_H;HAVE_LIBSVN_CLIENT_1"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="ul_d.lib sg_d.lib net_d.lib ws2_32.lib libsvn_client-1.lib libsvn_diff-1.lib libsvn_delta-1.lib libsvn_ra-1.lib libsvn_subr-1.lib libsvn_wc-1.lib libapr-1.lib OpenThreadsd.lib"
- OutputFile="$(OutDir)/terrasync.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib;"..\..\..\svn-win32-1.5.3\lib";"..\..\..\svn-win32-1.5.3\lib\apr""
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/terrasync.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Terrasync_Release"
- IntermediateDirectory="Terrasync_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;"..\..\..\svn-win32-1.5.3\include";"..\..\..\svn-win32-1.5.3\include\apr";"..\..\..\svn-win32-1.5.3\include\apr-iconv";"..\..\..\svn-win32-1.5.3\include\apr-util";..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;HAVE_SVN_CLIENT_H;HAVE_LIBSVN_CLIENT_1"
- RuntimeLibrary="2"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="ul.lib sg.lib net.lib ws2_32.lib libsvn_client-1.lib libsvn_diff-1.lib libsvn_delta-1.lib libsvn_ra-1.lib libsvn_subr-1.lib libsvn_wc-1.lib libapr-1.lib OpenThreads.lib"
- OutputFile="bin/Release/terrasync.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib;"..\..\..\svn-win32-1.5.3\lib";"..\..\..\svn-win32-1.5.3\lib\apr""
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\utils\TerraSync\terrasync.cxx">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="xmlgrep"
- ProjectGUID="{1F40CF41-9836-4488-BAAF-560623665C12}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectName)_Debug"
- IntermediateDirectory="$(ProjectName)_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/xmlgrep.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/xmlgrep.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectName)_Release"
- IntermediateDirectory="$(ProjectName)_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="bin/Release/xmlgrep.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\utils\xmlgrep\xml.c">
- </File>
- <File
- RelativePath="..\..\utils\xmlgrep\xml_cache.c">
- </File>
- <File
- RelativePath="..\..\utils\xmlgrep\xmlgrep.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\..\utils\xmlgrep\xml.h">
- </File>
- <File
- RelativePath="..\..\utils\xmlgrep\xml_cache.h">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="yasim"
- ProjectGUID="{800CB1FF-C398-4B81-B3D6-8BBD9E0897D2}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectName)_Debug"
- IntermediateDirectory="$(ProjectName)_Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg_d.lib ul_d.lib OpenThreadsd.lib"
- OutputFile="$(OutDir)/yasim.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/yasim.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectName)_Release"
- IntermediateDirectory="$(ProjectName)_Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\src;..\..\..\SimGear;..\..\..\install\msvc71\OpenSceneGraph\include;..\..\..\3rdParty\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
- RuntimeLibrary="2"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="sg.lib ul.lib OpenThreads.lib"
- OutputFile="bin/Release/yasim.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\..\install\msvc71\OpenSceneGraph\lib;..\..\..\3rdParty\lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\src\Fdm\YASim\Airplane.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Atmosphere.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\ControlMap.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\FGFDM.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Gear.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Glue.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Ground.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hitch.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hook.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Integrator.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Jet.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Launchbar.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Math.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Model.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\PistonEngine.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Propeller.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\PropEngine.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\RigidBody.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Rotor.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Rotorpart.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\SimpleJet.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Surface.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Thruster.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\TurbineEngine.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Turbulence.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Wing.cpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\yasim-test.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\..\src\Fdm\YASim\Airplane.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Atmosphere.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\ControlMap.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\FGFDM.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Gear.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Glue.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Ground.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hitch.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Hook.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Integrator.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Jet.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Launchbar.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Math.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Model.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\PistonEngine.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Propeller.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\PropEngine.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\RigidBody.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Rotor.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Rotorpart.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\SimpleJet.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Surface.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Thruster.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\TurbineEngine.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Turbulence.hpp">
- </File>
- <File
- RelativePath="..\..\src\Fdm\YASim\Wing.hpp">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
RelativePath="..\..\..\src\GUI\SafeTexFont.hxx"
>
</File>
+ <File RelativePath="..\..\..\src\GUI\WaypointList.cxx"></File>
+ <File RelativePath="..\..\..\src\GUI\WaypointList.hxx"></File>
+ <File RelativePath="..\..\..\src\GUI\MapWidget.cxx"></File>
+ <File RelativePath="..\..\..\src\GUI\MapWidget.hxx"></File>
</Filter>
<Filter
Name="Lib_Input"
+++ /dev/null
-Use FlightGear.sln to compile fgfs executable for Win32 or x64 architectures with Visual Studio 2008.
-
-Precompiled librairies and headers for compiling x64 executables with VS2008 :
-ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-x64-VS90-3rdParty+OSG-20090628.zip
-
-Precompiled librairies and headers for compiling Win32 executables with VS2008 :
-ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty+OSG-20090628.zip
static string tempReg;
-class AI_OutOfSight{};
-class FP_Inactive{};
-
FGAIAircraft::FGAIAircraft(FGAISchedule *ref) : FGAIBase(otAircraft) {
trafficRef = ref;
if (trafficRef) {
headingError = 0;
holdPos = false;
+ needsTaxiClearance = false;
_performance = 0; //TODO initialize to JET_TRANSPORT from PerformanceDB
dt = 0;
void FGAIAircraft::Run(double dt) {
FGAIAircraft::dt = dt;
-
- try {
- updatePrimaryTargetValues(); // target hdg, alt, speed
- }
- catch (AI_OutOfSight) {
- return;
+
+ bool outOfSight = false,
+ flightplanActive = true;
+ updatePrimaryTargetValues(flightplanActive, outOfSight); // target hdg, alt, speed
+ if (outOfSight) {
+ return;
}
- catch (FP_Inactive) {
- //return;
- groundTargetSpeed = 0;
+
+ if (!flightplanActive) {
+ groundTargetSpeed = 0;
}
handleATCRequests(); // ATC also has a word to say
//cerr << trafficRef->getCallSign() << " has passed waypoint " << prev->name << " at speed " << speed << endl;
if (prev->name == "PushBackPoint") {
dep->getDynamics()->releaseParking(fp->getGate());
- time_t holdUntil = now + 120;
- fp->setTime(holdUntil);
- //cerr << _getCallsign() << "Holding at pushback point" << endl;
+ AccelTo(0.0);
+ setTaxiClearanceRequest(true);
}
// This is the last taxi waypoint, and marks the the end of the flight plan
/**
* Update target values (heading, alt, speed) depending on flight plan or control properties
*/
-void FGAIAircraft::updatePrimaryTargetValues() {
+void FGAIAircraft::updatePrimaryTargetValues(bool& flightplanActive, bool& aiOutOfSight) {
if (fp) // AI object has a flightplan
{
//TODO make this a function of AIBase
}
if (trafficRef) {
//cerr << trafficRef->getRegistration() << " Setting altitude to " << altitude_ft;
- if (! aiTrafficVisible()) {
+ aiOutOfSight = !aiTrafficVisible();
+ if (aiOutOfSight) {
setDie(true);
//cerr << trafficRef->getRegistration() << " is set to die " << endl;
- throw AI_OutOfSight();
+ aiOutOfSight = true;
+ return;
}
}
timeElapsed = now - fp->getStartTime();
- if (! fp->isActive(now)) {
- throw FP_Inactive();
- }
+ flightplanActive = fp->isActive(now);
} else {
// no flight plan, update target heading, speed, and altitude
// from control properties. These default to the initial
#include <ATC/trafficcontrol.hxx>
#include <string>
-using std::string;
class PerformanceData;
void doGroundAltitude();
bool loadNextLeg ();
- void setAcType(const string& ac) { acType = ac; };
- void setCompany(const string& comp) { company = comp;};
+ void setAcType(const std::string& ac) { acType = ac; };
+ void setCompany(const std::string& comp) { company = comp;};
void announcePositionToController(); //TODO have to be public?
void processATC(FGATCInstruction instruction);
+ void setTaxiClearanceRequest(bool arg) { needsTaxiClearance = arg; };
+ bool getTaxiClearanceRequest() { return needsTaxiClearance; };
FGAISchedule * getTrafficRef() { return trafficRef; };
virtual const char* getTypeString(void) const { return "aircraft"; }
- string GetTransponderCode() { return transponderCode; };
- void SetTransponderCode(string tc) { transponderCode = tc;};
+ std::string GetTransponderCode() { return transponderCode; };
+ void SetTransponderCode(const std::string& tc) { transponderCode = tc;};
// included as performance data needs them, who else?
inline PerformanceData* getPerformance() { return _performance; };
inline double getVerticalSpeed() const { return vs; };
inline double altitudeAGL() const { return props->getFloatValue("position/altitude-agl-ft");};
inline double airspeed() const { return props->getFloatValue("velocities/airspeed-kt");};
- string atGate();
+ std::string atGate();
protected:
void Run(double dt);
void controlHeading(FGAIFlightPlan::waypoint* curr);
void controlSpeed(FGAIFlightPlan::waypoint* curr,
FGAIFlightPlan::waypoint* next);
- void updatePrimaryTargetValues();
+
+ void updatePrimaryTargetValues(bool& flightplanActive, bool& aiOutOfSight);
+
void updateSecondaryTargetValues();
void updatePosition();
void updateHeading();
double sign(double x);
- string acType;
- string company;
- string transponderCode;
+ std::string acType;
+ std::string company;
+ std::string transponderCode;
int spinCounter;
double prevSpeed;
const char * _getTransponderCode() const;
bool reachedWaypoint;
+ bool needsTaxiClearance;
time_t timeElapsed;
PerformanceData* _performance; // the performance data for this aircraft
{
if (model.valid()) {
- fgSetString("/ai/models/model-added", props->getPath());
+ fgSetString("/ai/models/model-added", props->getPath().c_str());
} else if (!model_path.empty()) {
SG_LOG(SG_INPUT, SG_WARN, "AIBase: Could not load model " << model_path);
speed(0),
altitude(0),
radius(0),
+ frequencyId(0),
allowTransmission(true) {
}
alt = 0;
}
+
bool FGATCInstruction::hasInstruction()
{
return (holdPattern || holdPosition || changeSpeed || changeHeading || changeAltitude || resolveCircularWait);
}
+/***************************************************************************
+ * FGATCController
+ *
+ **************************************************************************/
+
+
+
+
+FGATCController::FGATCController()
+{
+ dt_count = 0;
+ available = true;
+ lastTransmission = 0;
+}
+
string FGATCController::getGateName(FGAIAircraft *ref)
{
return ref->atGate();
string sender, receiver;
int stationFreq = 0;
int taxiFreq = 0;
+ int freqId = 0;
string atisInformation;
- //double commFreqD;
- switch (msgDir) {
- case ATC_AIR_TO_GROUND:
- sender = rec->getAircraft()->getTrafficRef()->getCallSign();
- switch (rec->getLeg()) {
- case 2:
- case 3:
- stationFreq =
- rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getGroundFrequency(rec->getLeg());
- taxiFreq =
- rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getGroundFrequency(3);
- receiver = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getName() + "-Ground";
- atisInformation = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getAtisInformation();
- break;
- case 4:
- receiver = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getName() + "-Tower";
- break;
- }
- break;
- case ATC_GROUND_TO_AIR:
- receiver = rec->getAircraft()->getTrafficRef()->getCallSign();
- switch (rec->getLeg()) {
- case 2:
- case 3:
- stationFreq =
- rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getGroundFrequency(rec->getLeg());
- taxiFreq =
- rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getGroundFrequency(3);
- sender = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getName() + "-Ground";
- atisInformation = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getAtisInformation();
- break;
-
- case 4:
- sender = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getName() + "-Tower";
- break;
- }
- break;
- }
string text;
string taxiFreqStr;
double heading = 0;
string transponderCode;
FGAIFlightPlan *fp;
string fltRules;
+
+ //double commFreqD;
+ sender = rec->getAircraft()->getTrafficRef()->getCallSign();
+ //cerr << "transmitting for: " << sender << "Leg = " << rec->getLeg() << endl;
+ switch (rec->getLeg()) {
+ case 2:
+ case 3:
+ freqId = rec->getNextFrequency();
+ stationFreq =
+ rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getGroundFrequency(rec->getLeg()+freqId);
+ taxiFreq =
+ rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getGroundFrequency(3);
+ receiver = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getName() + "-Ground";
+ atisInformation = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getDynamics()->getAtisInformation();
+ break;
+ case 4:
+ receiver = rec->getAircraft()->getTrafficRef()->getDepartureAirport()->getName() + "-Tower";
+ break;
+ }
+ // Swap sender and receiver value in case of a ground to air transmission
+ if (msgDir == ATC_GROUND_TO_AIR) {
+ string tmp = sender;
+ sender = receiver;
+ receiver = tmp;
+ }
switch (msgId) {
case MSG_ANNOUNCE_ENGINE_START:
text = sender + ". Ready to Start up";
activeRunway + ", " + SID + ", squawk " + transponderCode + ". " +
"For push-back and taxi clearance call " + taxiFreqStr + ". " + sender;
break;
+ case MSG_ACKNOWLEDGE_SWITCH_GROUND_FREQUENCY:
+ taxiFreqStr = formatATCFrequency3_2(taxiFreq);
+ text = receiver + ". Switching to " + taxiFreqStr + ". " + sender;
+ break;
+ case MSG_INITIATE_CONTACT:
+ text = receiver + ". With you. " + sender;
+ break;
+ case MSG_ACKNOWLEDGE_INITIATE_CONTACT:
+ text = receiver + ". Roger. " + sender;
+ break;
case MSG_REQUEST_PUSHBACK_CLEARANCE:
text = receiver + ". Request push-back. " + sender;
break;
break;
case MSG_HOLD_PUSHBACK_CLEARANCE:
text = receiver + ". Standby. " + sender;
- break;
- default:
- text = sender + ". Transmitting unknown Message";
+ break;
+ case MSG_REQUEST_TAXI_CLEARANCE:
+ text = receiver + ". Ready to Taxi. " + sender;
+ break;
+ case MSG_ISSUE_TAXI_CLEARANCE:
+ text = receiver + ". Cleared to taxi. " + sender;
+ break;
+ case MSG_ACKNOWLEDGE_TAXI_CLEARANCE:
+ text = receiver + ". Cleared to taxi. " + sender;
+ break;
+ case MSG_HOLD_POSITION:
+ text = receiver + ". Hold Position. " + sender;
+ break;
+ case MSG_ACKNOWLEDGE_HOLD_POSITION:
+ text = receiver + ". Holding Position. " + sender;
+ break;
+ case MSG_RESUME_TAXI:
+ text = receiver + ". Resume Taxiing. " + sender;
+ break;
+ case MSG_ACKNOWLEDGE_RESUME_TAXI:
+ text = receiver + ". Continuing Taxi. " + sender;
+ break;
+ default:
+ text = text + sender + ". Transmitting unknown Message";
break;
}
double onBoardRadioFreq0 = fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
FGStartupController::FGStartupController() :
FGATCController()
{
- available = false;
- lastTransmission = 0;
}
void FGStartupController::announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentPosition,
available = false;
}
}
- // TODO: Switch to APRON control and request pushback Clearance.
- // Get Push back clearance
+ // Note: The next four stages are only necessesary when Startup control is
+ // on a different frequency, compared to ground control
if ((state == 4) && available){
if (now > startTime+130) {
- transmit(&(*i), MSG_REQUEST_PUSHBACK_CLEARANCE, ATC_AIR_TO_GROUND);
+ transmit(&(*i), MSG_ACKNOWLEDGE_SWITCH_GROUND_FREQUENCY, ATC_AIR_TO_GROUND);
i->updateState();
+ i->nextFrequency();
lastTransmission = now;
available = false;
}
}
if ((state == 5) && available){
- if (now > startTime+130) {
+ if (now > startTime+140) {
+ transmit(&(*i), MSG_INITIATE_CONTACT, ATC_AIR_TO_GROUND);
+ i->updateState();
+ lastTransmission = now;
+ available = false;
+ }
+ }
+ if ((state == 6) && available){
+ if (now > startTime+150) {
+ transmit(&(*i), MSG_ACKNOWLEDGE_INITIATE_CONTACT, ATC_GROUND_TO_AIR);
+ i->updateState();
+ lastTransmission = now;
+ available = false;
+ }
+ }
+
+
+ // TODO: Switch to APRON control and request pushback Clearance.
+ // Get Push back clearance
+ if ((state == 7) && available){
+ if (now > startTime+180) {
+ transmit(&(*i), MSG_REQUEST_PUSHBACK_CLEARANCE, ATC_AIR_TO_GROUND);
+ i->updateState();
+ lastTransmission = now;
+ available = false;
+ }
+ }
+ if ((state == 8) && available){
+ if (now > startTime+200) {
if (i->pushBackAllowed()) {
i->allowRepeatedTransmissions();
transmit(&(*i), MSG_PERMIT_PUSHBACK_CLEARANCE, ATC_GROUND_TO_AIR);
available = false;
}
}
- if ((state == 6) && available){
+ if ((state == 9) && available){
i->setHoldPosition(false);
}
}
int id, waitsForId;
int currentPos;
int leg;
+ int frequencyId;
int state;
bool allowTransmission;
time_t timer;
void setLeg(int lg) { leg = lg;};
int getId() { return id;};
int getState() { return state;};
+ void setState(int s) { state = s;}
FGATCInstruction getInstruction() { return instruction;};
bool hasInstruction() { return instruction.hasInstruction(); };
void setPositionAndHeading(double lat, double lon, double hdg, double spd, double alt);
bool allowTransmissions() { return allowTransmission; };
void suppressRepeatedTransmissions () { allowTransmission=false; };
void allowRepeatedTransmissions () { allowTransmission=true; };
+ void nextFrequency() { frequencyId++; };
+ int getNextFrequency() { return frequencyId; };
};
typedef vector<FGTrafficRecord> TrafficVector;
*************************************************************************************/
class FGATCController
{
-private:
+protected:
+ bool available;
+ time_t lastTransmission;
+
double dt_count;
public:
typedef enum {
MSG_ANNOUNCE_ENGINE_START,
- MSG_REQUEST_ENGINE_START,
+ MSG_REQUEST_ENGINE_START,
MSG_PERMIT_ENGINE_START,
MSG_DENY_ENGINE_START,
MSG_ACKNOWLEDGE_ENGINE_START,
MSG_REQUEST_PUSHBACK_CLEARANCE,
- MSG_PERMIT_PUSHBACK_CLEARANCE,
- MSG_HOLD_PUSHBACK_CLEARANCE } AtcMsgId;
+ MSG_PERMIT_PUSHBACK_CLEARANCE,
+ MSG_HOLD_PUSHBACK_CLEARANCE,
+ MSG_ACKNOWLEDGE_SWITCH_GROUND_FREQUENCY,
+ MSG_INITIATE_CONTACT,
+ MSG_ACKNOWLEDGE_INITIATE_CONTACT,
+ MSG_REQUEST_TAXI_CLEARANCE,
+ MSG_ISSUE_TAXI_CLEARANCE,
+ MSG_ACKNOWLEDGE_TAXI_CLEARANCE,
+ MSG_HOLD_POSITION,
+ MSG_ACKNOWLEDGE_HOLD_POSITION,
+ MSG_RESUME_TAXI,
+ MSG_ACKNOWLEDGE_RESUME_TAXI } AtcMsgId;
typedef enum {
ATC_AIR_TO_GROUND,
ATC_GROUND_TO_AIR } AtcMsgDir;
- FGATCController() { dt_count = 0;};
+ FGATCController();
virtual ~FGATCController() {};
virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute,
double lat, double lon,
{
private:
TrafficVector activeTraffic;
- bool available;
- time_t lastTransmission;
//ActiveRunwayVec activeRunways;
public:
{
SGSoundMgr *smgr = globals->get_soundmgr();
_sgr = smgr->find("atc", true);
+ _sgr->tie_to_listener();
_volume = fgGetNode("/sim/sound/atc/volume", true);
_enabled = fgGetNode("/sim/sound/atc/enabled", true);
FGATCMgr::FGATCMgr() :
initDone(false),
atc_list(new atc_list_type),
- last_in_range(false)
+#ifdef ENABLE_AUDIO_SUPPORT
+ voiceOK(false),
+ voice(true),
+#else
+ voice(false),
+#endif
+ last_in_range(false),
+ v1(0)
{
}
// Is this still true after the reorganization of the event managar??
// -EMH-
-#ifdef ENABLE_AUDIO_SUPPORT
- // Load all available voices.
- // For now we'll do one hardwired one
-
- v1 = new FGATCVoice;
- try {
- voiceOK = v1->LoadVoice("default");
- voice = true;
- } catch ( sg_io_exception & e) {
- voiceOK = false;
- SG_LOG(SG_ATC, SG_ALERT, "Unable to load default voice : " << e.getFormattedMessage().c_str());
- voice = false;
- delete v1;
- v1 = 0;
- }
-
- /* I've loaded the voice even if /sim/sound/pause is true
- * since I know no way of forcing load of the voice if the user
- * subsequently switches /sim/sound/audible to true.
- * (which is the right thing to do -- CLO) :-) */
-#else
- voice = false;
-#endif
-
// Initialise the ATC Dialogs
//cout << "Initing Transmissions..." << endl;
SG_LOG(SG_ATC, SG_INFO, " ATC Transmissions");
if(voice) {
switch(type) {
case ATIS: case AWOS:
+#ifdef ENABLE_AUDIO_SUPPORT
+ // Delayed loading fo all available voices, needed because the
+ // soundmanager might not be initialized (at all) at this point.
+ // For now we'll do one hardwired one
+
+ /* I've loaded the voice even if /sim/sound/pause is true
+ * since I know no way of forcing load of the voice if the user
+ * subsequently switches /sim/sound/audible to true.
+ * (which is the right thing to do -- CLO) :-)
+ */
+ if (!voiceOK && fgGetBool("/sim/sound/working")) {
+ v1 = new FGATCVoice;
+ try {
+ voiceOK = v1->LoadVoice("default");
+ voice = voiceOK;
+ } catch ( sg_io_exception & e) {
+ voiceOK = false;
+ SG_LOG(SG_ATC, SG_ALERT, "Unable to load default voice : "
+ << e.getFormattedMessage().c_str());
+ voice = false;
+ delete v1;
+ v1 = 0;
+ }
+ }
+#endif
if(voiceOK) {
return(v1);
}
timingInfo.clear();
stamp("begin");
static SGPropertyNode *replay_master
- = fgGetNode( "/sim/freeze/replay", true );
+ = fgGetNode( "/sim/freeze/replay-state", true );
if( disable_replay->getBoolValue() ) {
- if( sim_time != 0.0 ) {
+ if ( sim_time != 0.0 ) {
// we were recording data
init();
}
return;
}
//stamp("point_01");
- if ( replay_master->getBoolValue() ) {
+ if ( replay_master->getIntValue() > 0 ) {
// don't record the replay session
return;
}
r = new FGReplayData;
stamp("Replay_02");
} else {
- r = recycler.front();
- recycler.pop_front();
- //stamp("point_04be");
+ r = recycler.front();
+ recycler.pop_front();
+ //stamp("point_04be");
}
r->sim_time = sim_time;
//r->ctrls = c;
#include <simgear/misc/sgstream.hxx>
#include <simgear/misc/strutils.hxx>
#include <simgear/structure/exception.hxx>
+#include <simgear/bucket/newbucket.hxx>
#include <string>
SGGeod pos(SGGeod::fromDegFt(lon, lat, last_apt_elev));
FGAirport* apt = new FGAirport(last_apt_id, pos, tower, last_apt_name, false,
fptypeFromRobinType(atoi(last_apt_type.c_str())));
-
apt->setRunwaysAndTaxiways(runways, taxiways, pavements);
}
#include "simple.hxx"
#include "dynamics.hxx"
-FGAirportDynamics::FGAirportDynamics(FGAirport* ap) :
- _ap(ap), rwyPrefs(ap), SIDs(ap) {
- lastUpdate = 0;
+FGAirportDynamics::FGAirportDynamics(FGAirport * ap):
+_ap(ap), rwyPrefs(ap), SIDs(ap)
+{
+ lastUpdate = 0;
- // For testing only. This needs to be refined when we move ATIS functionality over.
- atisInformation = "Sierra";
+ // For testing only. This needs to be refined when we move ATIS functionality over.
+ atisInformation = "Sierra";
}
// Note that the ground network should also be copied
-FGAirportDynamics::FGAirportDynamics(const FGAirportDynamics& other) :
- rwyPrefs(other.rwyPrefs),
- SIDs(other.SIDs)
+FGAirportDynamics::
+FGAirportDynamics(const FGAirportDynamics & other):rwyPrefs(other.
+ rwyPrefs),
+SIDs(other.SIDs)
{
- for (FGParkingVecConstIterator ip= other.parkings.begin(); ip != other.parkings.end(); ip++)
- parkings.push_back(*(ip));
- // rwyPrefs = other.rwyPrefs;
- lastUpdate = other.lastUpdate;
-
- stringVecConstIterator il;
- for (il = other.landing.begin(); il != other.landing.end(); il++)
- landing.push_back(*il);
- for (il = other.takeoff.begin(); il != other.takeoff.end(); il++)
- takeoff.push_back(*il);
- lastUpdate = other.lastUpdate;
- atisInformation = other.atisInformation;
+ for (FGParkingVecConstIterator ip = other.parkings.begin();
+ ip != other.parkings.end(); ip++)
+ parkings.push_back(*(ip));
+ // rwyPrefs = other.rwyPrefs;
+ lastUpdate = other.lastUpdate;
+
+ stringVecConstIterator il;
+ for (il = other.landing.begin(); il != other.landing.end(); il++)
+ landing.push_back(*il);
+ for (il = other.takeoff.begin(); il != other.takeoff.end(); il++)
+ takeoff.push_back(*il);
+ lastUpdate = other.lastUpdate;
+ atisInformation = other.atisInformation;
}
// Destructor
// Initialization required after XMLRead
-void FGAirportDynamics::init()
+void FGAirportDynamics::init()
{
- // This may seem a bit weird to first randomly shuffle the parkings
- // and then sort them again. However, parkings are sorted here by ascending
- // radius. Since many parkings have similar radii, with each radius class they will
- // still be allocated relatively systematically. Randomizing prior to sorting will
- // prevent any initial orderings to be destroyed, leading (hopefully) to a more
- // naturalistic gate assignment.
- random_shuffle(parkings.begin(), parkings.end());
- sort(parkings.begin(), parkings.end());
- // add the gate positions to the ground network.
- groundNetwork.addNodes(&parkings);
- groundNetwork.init();
- groundNetwork.setTowerController(&towerController);
- groundNetwork.setParent(_ap);
+ // This may seem a bit weird to first randomly shuffle the parkings
+ // and then sort them again. However, parkings are sorted here by ascending
+ // radius. Since many parkings have similar radii, with each radius class they will
+ // still be allocated relatively systematically. Randomizing prior to sorting will
+ // prevent any initial orderings to be destroyed, leading (hopefully) to a more
+ // naturalistic gate assignment.
+ random_shuffle(parkings.begin(), parkings.end());
+ sort(parkings.begin(), parkings.end());
+ // add the gate positions to the ground network.
+ groundNetwork.addNodes(&parkings);
+ groundNetwork.init();
+ groundNetwork.setTowerController(&towerController);
+ groundNetwork.setParent(_ap);
}
-bool FGAirportDynamics::getAvailableParking(double *lat, double *lon, double *heading, int *gateId, double rad, const string &flType, const string &acType, const string &airline)
+bool FGAirportDynamics::getAvailableParking(double *lat, double *lon,
+ double *heading, int *gateId,
+ double rad,
+ const string & flType,
+ const string & acType,
+ const string & airline)
{
- bool found = false;
- bool available = false;
- //string gateType;
-
- FGParkingVecIterator i;
-// if (flType == "cargo")
-// {
-// gateType = "RAMP_CARGO";
-// }
-// else if (flType == "ga")
-// {
-// gateType = "RAMP_GA";
-// }
-// else gateType = "GATE";
-
- if (parkings.begin() == parkings.end())
- {
- //cerr << "Could not find parking spot at " << _ap->getId() << endl;
- *lat = _ap->getLatitude();
- *lon = _ap->getLongitude();
- *heading = 0;
- found = true;
+ bool found = false;
+ bool available = false;
+
+
+ FGParkingVecIterator i;
+ if (parkings.begin() == parkings.end()) {
+ //cerr << "Could not find parking spot at " << _ap->getId() << endl;
+ *lat = _ap->getLatitude();
+ *lon = _ap->getLongitude();
+ *heading = 0;
+ found = true;
+ } else {
+ // First try finding a parking with a designated airline code
+ for (i = parkings.begin(); !(i == parkings.end() || found); i++) {
+ available = true;
+ // Taken by another aircraft
+ if (!(i->isAvailable())) {
+ available = false;
+ continue;
+ }
+ // No airline codes, so skip
+ if (i->getCodes().empty()) {
+ available = false;
+ continue;
+ } else { // Airline code doesn't match
+ //cerr << "Code = " << airline << ": Codes " << i->getCodes();
+ if (i->getCodes().find(airline, 0) == string::npos) {
+ available = false;
+ //cerr << "Unavailable" << endl;
+ continue;
+ } else {
+ //cerr << "Available" << endl;
+ }
+ }
+ // Type doesn't match
+ if (i->getType() != flType) {
+ available = false;
+ continue;
+ }
+ // too small
+ if (i->getRadius() < rad) {
+ available = false;
+ continue;
+ }
+
+ if (available) {
+ *lat = i->getLatitude();
+ *lon = i->getLongitude();
+ *heading = i->getHeading();
+ *gateId = i->getIndex();
+ i->setAvailable(false);
+ found = true;
+ }
+ }
+ // then try again for those without codes.
+ for (i = parkings.begin(); !(i == parkings.end() || found); i++) {
+ available = true;
+ if (!(i->isAvailable())) {
+ available = false;
+ continue;
+ }
+ if (!(i->getCodes().empty())) {
+ if ((i->getCodes().find(airline, 0) == string::npos)) {
+ available = false;
+ continue;
+ }
+ }
+ if (i->getType() != flType) {
+ available = false;
+ continue;
+ }
+
+ if (i->getRadius() < rad) {
+ available = false;
+ continue;
+ }
+
+ if (available) {
+ *lat = i->getLatitude();
+ *lon = i->getLongitude();
+ *heading = i->getHeading();
+ *gateId = i->getIndex();
+ i->setAvailable(false);
+ found = true;
+ }
+ }
+ // And finally once more if that didn't work. Now ignore the airline codes, as a last resort
+ for (i = parkings.begin(); !(i == parkings.end() || found); i++) {
+ available = true;
+ if (!(i->isAvailable())) {
+ available = false;
+ continue;
+ }
+ if (i->getType() != flType) {
+ available = false;
+ continue;
+ }
+
+ if (i->getRadius() < rad) {
+ available = false;
+ continue;
+ }
+
+ if (available) {
+ *lat = i->getLatitude();
+ *lon = i->getLongitude();
+ *heading = i->getHeading();
+ *gateId = i->getIndex();
+ i->setAvailable(false);
+ found = true;
+ }
+ }
}
- else
- {
- // First try finding a parking with a designated airline code
- for (i = parkings.begin(); !(i == parkings.end() || found); i++)
- {
- //cerr << "Gate Id: " << i->getIndex()
- // << " Type : " << i->getType()
- // << " Codes : " << i->getCodes()
- // << " Radius: " << i->getRadius()
- // << " Name : " << i->getName()
- // << " Available: " << i->isAvailable() << endl;
- available = true;
- // Taken by another aircraft
- if (!(i->isAvailable()))
- {
- available = false;
- continue;
- }
- // No airline codes, so skip
- if (i->getCodes().empty())
- {
- available = false;
- continue;
- }
- else // Airline code doesn't match
- {
- //cerr << "Code = " << airline << ": Codes " << i->getCodes();
- if (i->getCodes().find(airline, 0) == string::npos)
- {
- available = false;
- //cerr << "Unavailable" << endl;
- continue;
- }
- else
- {
- //cerr << "Available" << endl;
- }
- }
- // Type doesn't match
- if (i->getType() != flType)
- {
- available = false;
- continue;
- }
- // too small
- if (i->getRadius() < rad)
- {
- available = false;
- continue;
- }
-
- if (available)
- {
- *lat = i->getLatitude ();
- *lon = i->getLongitude();
- *heading = i->getHeading ();
- *gateId = i->getIndex ();
- i->setAvailable(false);
- found = true;
- }
- }
- // then try again for those without codes.
- for (i = parkings.begin(); !(i == parkings.end() || found); i++)
- {
- available = true;
- if (!(i->isAvailable()))
- {
- available = false;
- continue;
- }
- if (!(i->getCodes().empty()))
- {
- if ((i->getCodes().find(airline,0) == string::npos))
- {
- available = false;
- continue;
- }
- }
- if (i->getType() != flType)
- {
- available = false;
- continue;
- }
-
- if (i->getRadius() < rad)
- {
- available = false;
- continue;
- }
-
- if (available)
- {
- *lat = i->getLatitude ();
- *lon = i->getLongitude();
- *heading = i->getHeading ();
- *gateId = i->getIndex ();
- i->setAvailable(false);
- found = true;
- }
- }
- // And finally once more if that didn't work. Now ignore the airline codes, as a last resort
- for (i = parkings.begin(); !(i == parkings.end() || found); i++)
- {
- available = true;
- if (!(i->isAvailable()))
- {
- available = false;
- continue;
- }
- if (i->getType() != flType)
- {
- available = false;
- continue;
- }
-
- if (i->getRadius() < rad)
- {
- available = false;
- continue;
- }
-
- if (available)
- {
- *lat = i->getLatitude ();
- *lon = i->getLongitude();
- *heading = i->getHeading ();
- *gateId = i->getIndex ();
- i->setAvailable(false);
- found = true;
- }
- }
+ if (!found) {
+ //cerr << "Traffic overflow at" << _ap->getId()
+ // << ". flType = " << flType
+ // << ". airline = " << airline
+ // << " Radius = " <<rad
+ // << endl;
+ *lat = _ap->getLatitude();
+ *lon = _ap->getLongitude();
+ *heading = 0;
+ *gateId = -1;
+ //exit(1);
}
- if (!found)
- {
- //cerr << "Traffic overflow at" << _ap->getId()
- // << ". flType = " << flType
- // << ". airline = " << airline
- // << " Radius = " <<rad
- // << endl;
- *lat = _ap->getLatitude();
- *lon = _ap->getLongitude();
- *heading = 0;
- *gateId = -1;
- //exit(1);
- }
- return found;
+ return found;
}
-void FGAirportDynamics::getParking (int id, double *lat, double* lon, double *heading)
+void FGAirportDynamics::getParking(int id, double *lat, double *lon,
+ double *heading)
{
- if (id < 0)
- {
- *lat = _ap->getLatitude();
- *lon = _ap->getLongitude();
- *heading = 0;
- }
- else
- {
- FGParkingVecIterator i = parkings.begin();
- for (i = parkings.begin(); i != parkings.end(); i++)
- {
- if (id == i->getIndex())
- {
- *lat = i->getLatitude();
- *lon = i->getLongitude();
- *heading = i->getHeading();
- }
- }
+ if (id < 0) {
+ *lat = _ap->getLatitude();
+ *lon = _ap->getLongitude();
+ *heading = 0;
+ } else {
+ FGParkingVecIterator i = parkings.begin();
+ for (i = parkings.begin(); i != parkings.end(); i++) {
+ if (id == i->getIndex()) {
+ *lat = i->getLatitude();
+ *lon = i->getLongitude();
+ *heading = i->getHeading();
+ }
+ }
}
-}
+}
-FGParking *FGAirportDynamics::getParking(int id)
-{
+FGParking *FGAirportDynamics::getParking(int id)
+{
FGParkingVecIterator i = parkings.begin();
- for (i = parkings.begin(); i != parkings.end(); i++)
- {
- if (id == i->getIndex()) {
- return &(*i);
- }
+ for (i = parkings.begin(); i != parkings.end(); i++) {
+ if (id == i->getIndex()) {
+ return &(*i);
}
+ }
return 0;
}
-string FGAirportDynamics::getParkingName(int id)
-{
+
+string FGAirportDynamics::getParkingName(int id)
+{
FGParkingVecIterator i = parkings.begin();
- for (i = parkings.begin(); i != parkings.end(); i++)
- {
- if (id == i->getIndex()) {
- return i->getName();
- }
+ for (i = parkings.begin(); i != parkings.end(); i++) {
+ if (id == i->getIndex()) {
+ return i->getName();
}
+ }
return string("overflow");
}
+
void FGAirportDynamics::releaseParking(int id)
{
- if (id >= 0)
- {
-
- FGParkingVecIterator i = parkings.begin();
- for (i = parkings.begin(); i != parkings.end(); i++)
- {
- if (id == i->getIndex())
- {
- i -> setAvailable(true);
- }
- }
+ if (id >= 0) {
+
+ FGParkingVecIterator i = parkings.begin();
+ for (i = parkings.begin(); i != parkings.end(); i++) {
+ if (id == i->getIndex()) {
+ i->setAvailable(true);
+ }
+ }
}
}
-
-void FGAirportDynamics::setRwyUse(const FGRunwayPreference& ref)
+
+void FGAirportDynamics::setRwyUse(const FGRunwayPreference & ref)
{
- rwyPrefs = ref;
- //cerr << "Exiting due to not implemented yet" << endl;
- //exit(1);
+ rwyPrefs = ref;
+ //cerr << "Exiting due to not implemented yet" << endl;
+ //exit(1);
}
-bool FGAirportDynamics::innerGetActiveRunway(const string &trafficType, int action, string &runway, double heading)
+bool FGAirportDynamics::innerGetActiveRunway(const string & trafficType,
+ int action, string & runway,
+ double heading)
{
-double windSpeed;
- double windHeading;
- double maxTail;
- double maxCross;
- string name;
- string type;
-
- if (!rwyPrefs.available()) {
- return false;
- }
-
- RunwayGroup *currRunwayGroup = 0;
- int nrActiveRunways = 0;
- time_t dayStart = fgGetLong("/sim/time/utc/day-seconds");
- if ((abs((long)(dayStart - lastUpdate)) > 600) || trafficType != prevTrafficType)
- {
- landing.clear();
- takeoff.clear();
- lastUpdate = dayStart;
- prevTrafficType = trafficType;
-
- FGEnvironment
- stationweather = ((FGEnvironmentMgr *) globals->get_subsystem("environment"))
- ->getEnvironment(getLatitude(),
- getLongitude(),
- getElevation());
-
- windSpeed = stationweather.get_wind_speed_kt();
- windHeading = stationweather.get_wind_from_heading_deg();
- string scheduleName;
- //cerr << "finding active Runway for" << _ap->getId() << endl;
- //cerr << "Nr of seconds since day start << " << dayStart << endl;
-
- ScheduleTime *currSched;
- //cerr << "A"<< endl;
- currSched = rwyPrefs.getSchedule(trafficType.c_str());
- if (!(currSched))
- return false;
- //cerr << "B"<< endl;
- scheduleName = currSched->getName(dayStart);
- maxTail = currSched->getTailWind ();
- maxCross = currSched->getCrossWind ();
- //cerr << "SChedule anme = " << scheduleName << endl;
- if (scheduleName.empty())
- return false;
- //cerr << "C"<< endl;
- currRunwayGroup = rwyPrefs.getGroup(scheduleName);
- //cerr << "D"<< endl;
- if (!(currRunwayGroup))
- return false;
- nrActiveRunways = currRunwayGroup->getNrActiveRunways();
+ double windSpeed;
+ double windHeading;
+ double maxTail;
+ double maxCross;
+ string name;
+ string type;
+
+ if (!rwyPrefs.available()) {
+ return false;
+ }
+
+ RunwayGroup *currRunwayGroup = 0;
+ int nrActiveRunways = 0;
+ time_t dayStart = fgGetLong("/sim/time/utc/day-seconds");
+ if ((abs((long) (dayStart - lastUpdate)) > 600)
+ || trafficType != prevTrafficType) {
+ landing.clear();
+ takeoff.clear();
+ lastUpdate = dayStart;
+ prevTrafficType = trafficType;
+
+ FGEnvironment
+ stationweather =
+ ((FGEnvironmentMgr *) globals->get_subsystem("environment"))
+ ->getEnvironment(getLatitude(), getLongitude(),
+ getElevation());
+
+ windSpeed = stationweather.get_wind_speed_kt();
+ windHeading = stationweather.get_wind_from_heading_deg();
+ string scheduleName;
+ //cerr << "finding active Runway for" << _ap->getId() << endl;
+ //cerr << "Nr of seconds since day start << " << dayStart << endl;
+
+ ScheduleTime *currSched;
+ //cerr << "A"<< endl;
+ currSched = rwyPrefs.getSchedule(trafficType.c_str());
+ if (!(currSched))
+ return false;
+ //cerr << "B"<< endl;
+ scheduleName = currSched->getName(dayStart);
+ maxTail = currSched->getTailWind();
+ maxCross = currSched->getCrossWind();
+ //cerr << "SChedule anme = " << scheduleName << endl;
+ if (scheduleName.empty())
+ return false;
+ //cerr << "C"<< endl;
+ currRunwayGroup = rwyPrefs.getGroup(scheduleName);
+ //cerr << "D"<< endl;
+ if (!(currRunwayGroup))
+ return false;
+ nrActiveRunways = currRunwayGroup->getNrActiveRunways();
// Keep a history of the currently active runways, to ensure
// that an already established selection of runways will not
// be overridden once a more preferred selection becomes
// available as that can lead to random runway swapping.
- if (trafficType == "com") {
- currentlyActive = &comActive;
+ if (trafficType == "com") {
+ currentlyActive = &comActive;
} else if (trafficType == "gen") {
- currentlyActive = &genActive;
+ currentlyActive = &genActive;
} else if (trafficType == "mil") {
- currentlyActive = &milActive;
+ currentlyActive = &milActive;
} else if (trafficType == "ul") {
- currentlyActive = &ulActive;
+ currentlyActive = &ulActive;
+ }
+
+ currRunwayGroup->setActive(_ap,
+ windSpeed,
+ windHeading,
+ maxTail, maxCross, currentlyActive);
+
+ // Note that I SHOULD keep multiple lists in memory, one for
+ // general aviation, one for commercial and one for military
+ // traffic.
+ currentlyActive->clear();
+ nrActiveRunways = currRunwayGroup->getNrActiveRunways();
+ //cerr << "Choosing runway for " << trafficType << endl;
+ for (int i = 0; i < nrActiveRunways; i++) {
+ type = "unknown"; // initialize to something other than landing or takeoff
+ currRunwayGroup->getActive(i, name, type);
+ if (type == "landing") {
+ landing.push_back(name);
+ currentlyActive->push_back(name);
+ //cerr << "Landing " << name << endl;
+ }
+ if (type == "takeoff") {
+ takeoff.push_back(name);
+ currentlyActive->push_back(name);
+ //cerr << "takeoff " << name << endl;
+ }
}
- //
- currRunwayGroup->setActive(_ap,
- windSpeed,
- windHeading,
- maxTail,
- maxCross,
- currentlyActive);
-
- // Note that I SHOULD keep multiple lists in memory, one for
- // general aviation, one for commercial and one for military
- // traffic.
- currentlyActive->clear();
- nrActiveRunways = currRunwayGroup->getNrActiveRunways();
- //cerr << "Choosing runway for " << trafficType << endl;
- for (int i = 0; i < nrActiveRunways; i++)
- {
- type = "unknown"; // initialize to something other than landing or takeoff
- currRunwayGroup->getActive(i, name, type);
- if (type == "landing")
- {
- landing.push_back(name);
- currentlyActive->push_back(name);
- //cerr << "Landing " << name << endl;
- }
- if (type == "takeoff")
- {
- takeoff.push_back(name);
- currentlyActive->push_back(name);
- //cerr << "takeoff " << name << endl;
- }
- }
- //cerr << endl;
- }
-
- if (action == 1) // takeoff
- {
- int nr = takeoff.size();
- if (nr)
- {
- // Note that the randomization below, is just a placeholder to choose between
- // multiple active runways for this action. This should be
- // under ATC control.
- runway = chooseRwyByHeading (takeoff, heading);
- }
- else
- { // Fallback
- runway = chooseRunwayFallback();
- }
- }
-
- if (action == 2) // landing
- {
- int nr = landing.size();
- if (nr)
- {
- runway = chooseRwyByHeading (landing, heading);
- }
- else
- { //fallback
- runway = chooseRunwayFallback();
- }
- }
-
- return true;
+ //cerr << endl;
+ }
+
+ if (action == 1) // takeoff
+ {
+ int nr = takeoff.size();
+ if (nr) {
+ // Note that the randomization below, is just a placeholder to choose between
+ // multiple active runways for this action. This should be
+ // under ATC control.
+ runway = chooseRwyByHeading(takeoff, heading);
+ } else { // Fallback
+ runway = chooseRunwayFallback();
+ }
+ }
+
+ if (action == 2) // landing
+ {
+ int nr = landing.size();
+ if (nr) {
+ runway = chooseRwyByHeading(landing, heading);
+ } else { //fallback
+ runway = chooseRunwayFallback();
+ }
+ }
+
+ return true;
}
-string FGAirportDynamics::chooseRwyByHeading(stringVec rwys, double heading) {
- double bestError = 360.0;
- double rwyHeading, headingError;
- string runway;
- for (stringVecIterator i = rwys.begin(); i != rwys.end(); i++) {
- FGRunway *rwy = _ap->getRunwayByIdent((*i));
- rwyHeading = rwy->headingDeg();
- headingError = fabs(heading - rwyHeading);
+string FGAirportDynamics::chooseRwyByHeading(stringVec rwys,
+ double heading)
+{
+ double bestError = 360.0;
+ double rwyHeading, headingError;
+ string runway;
+ for (stringVecIterator i = rwys.begin(); i != rwys.end(); i++) {
+ FGRunway *rwy = _ap->getRunwayByIdent((*i));
+ rwyHeading = rwy->headingDeg();
+ headingError = fabs(heading - rwyHeading);
if (headingError > 180)
headingError = fabs(headingError - 360);
if (headingError < bestError) {
runway = (*i);
bestError = headingError;
}
- }
- //cerr << "Using active runway " << runway << " for heading " << heading << endl;
- return runway;
+ }
+ //cerr << "Using active runway " << runway << " for heading " << heading << endl;
+ return runway;
}
-void FGAirportDynamics::getActiveRunway(const string &trafficType, int action, string &runway, double heading)
+void FGAirportDynamics::getActiveRunway(const string & trafficType,
+ int action, string & runway,
+ double heading)
{
- bool ok = innerGetActiveRunway(trafficType, action, runway, heading);
- if (!ok) {
- runway = chooseRunwayFallback();
- }
+ bool ok = innerGetActiveRunway(trafficType, action, runway, heading);
+ if (!ok) {
+ runway = chooseRunwayFallback();
+ }
}
string FGAirportDynamics::chooseRunwayFallback()
-{
- FGRunway* rwy = _ap->getActiveRunwayForUsage();
- return rwy->ident();
+{
+ FGRunway *rwy = _ap->getActiveRunwayForUsage();
+ return rwy->ident();
}
-void FGAirportDynamics::addParking(FGParking& park) {
- parkings.push_back(park);
+void FGAirportDynamics::addParking(FGParking & park)
+{
+ parkings.push_back(park);
}
-double FGAirportDynamics::getLatitude() const {
- return _ap->getLatitude();
+double FGAirportDynamics::getLatitude() const
+{
+ return _ap->getLatitude();
}
-double FGAirportDynamics::getLongitude() const {
- return _ap->getLongitude();
+double FGAirportDynamics::getLongitude() const
+{
+ return _ap->getLongitude();
}
-double FGAirportDynamics::getElevation() const {
- return _ap->getElevation();
+double FGAirportDynamics::getElevation() const
+{
+ return _ap->getElevation();
}
-const string& FGAirportDynamics::getId() const {
- return _ap->getId();
+const string & FGAirportDynamics::getId() const
+{
+ return _ap->getId();
}
// Experimental: Return a different ground frequency depending on the leg of the
// so that at least I can start working on assigning different frequencies to different
// operations.
-int FGAirportDynamics::getGroundFrequency(unsigned leg) {
- //return freqGround.size() ? freqGround[0] : 0; };
- int groundFreq = 0;
- if (leg < 2) {
- SG_LOG(SG_ATC, SG_ALERT, "Leg value is smaller than two at " << SG_ORIGIN);
- }
- if (freqGround.size() == 0) {
- return 0;
- }
- if ((freqGround.size() > leg-1) && (leg > 1)) {
- groundFreq = freqGround[leg-1];
- }
- if ((freqGround.size() < leg-1) && (leg > 1)) {
- groundFreq = (freqGround.size() < (leg-1)) ? freqGround[freqGround.size()-1] : freqGround[leg-2];
- }
- if ((freqGround.size() >= leg-1) && (leg > 1)) {
- groundFreq = freqGround[leg-2];
- }
+int FGAirportDynamics::getGroundFrequency(unsigned leg)
+{
+ //return freqGround.size() ? freqGround[0] : 0; };
+ int groundFreq = 0;
+ if (leg < 2) {
+ SG_LOG(SG_ATC, SG_ALERT,
+ "Leg value is smaller than two at " << SG_ORIGIN);
+ }
+ if (freqGround.size() == 0) {
+ return 0;
+ }
+ if ((freqGround.size() > leg - 1) && (leg > 1)) {
+ groundFreq = freqGround[leg - 1];
+ }
+ if ((freqGround.size() < leg - 1) && (leg > 1)) {
+ groundFreq =
+ (freqGround.size() <
+ (leg - 1)) ? freqGround[freqGround.size() -
+ 1] : freqGround[leg - 2];
+ }
+ if ((freqGround.size() >= leg - 1) && (leg > 1)) {
+ groundFreq = freqGround[leg - 2];
+ }
return groundFreq;
}
-FGAIFlightPlan *FGAirportDynamics::getSID(string activeRunway, double heading)
+FGAIFlightPlan *FGAirportDynamics::getSID(string activeRunway,
+ double heading)
{
- return SIDs.getBest(activeRunway, heading);
+ return SIDs.getBest(activeRunway, heading);
}
#include <Airports/dynamics.hxx>
+#include <AIModel/AIAircraft.hxx>
#include <AIModel/AIFlightPlan.hxx>
#include "groundnetwork.hxx"
* FGTaxiSegment
**************************************************************************/
-void FGTaxiSegment::setStart(FGTaxiNodeVector *nodes)
+void FGTaxiSegment::setStart(FGTaxiNodeVector * nodes)
{
- FGTaxiNodeVectorIterator i = nodes->begin();
- while (i != nodes->end())
- {
- //cerr << "Scanning start node index" << (*i)->getIndex() << endl;
- if ((*i)->getIndex() == startNode)
- {
- start = (*i)->getAddress();
- (*i)->addSegment(this);
- return;
- }
- i++;
- }
- SG_LOG(SG_GENERAL, SG_ALERT, "Could not find start node " << startNode << endl);
+ FGTaxiNodeVectorIterator i = nodes->begin();
+ while (i != nodes->end()) {
+ //cerr << "Scanning start node index" << (*i)->getIndex() << endl;
+ if ((*i)->getIndex() == startNode) {
+ start = (*i)->getAddress();
+ (*i)->addSegment(this);
+ return;
+ }
+ i++;
+ }
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "Could not find start node " << startNode << endl);
}
-void FGTaxiSegment::setEnd(FGTaxiNodeVector *nodes)
+void FGTaxiSegment::setEnd(FGTaxiNodeVector * nodes)
{
- FGTaxiNodeVectorIterator i = nodes->begin();
- while (i != nodes->end())
- {
- //cerr << "Scanning end node index" << (*i)->getIndex() << endl;
- if ((*i)->getIndex() == endNode)
- {
- end = (*i)->getAddress();
- return;
- }
- i++;
- }
- SG_LOG(SG_GENERAL, SG_ALERT, "Could not find end node " << endNode << endl);
+ FGTaxiNodeVectorIterator i = nodes->begin();
+ while (i != nodes->end()) {
+ //cerr << "Scanning end node index" << (*i)->getIndex() << endl;
+ if ((*i)->getIndex() == endNode) {
+ end = (*i)->getAddress();
+ return;
+ }
+ i++;
+ }
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "Could not find end node " << endNode << endl);
}
// doing this.
void FGTaxiSegment::setTrackDistance()
{
- length = SGGeodesy::distanceM(start->getGeod(), end->getGeod());
+ length = SGGeodesy::distanceM(start->getGeod(), end->getGeod());
}
void FGTaxiSegment::setCourseDiff(double crse)
{
- headingDiff = fabs(course-crse);
-
- if (headingDiff > 180)
- headingDiff = fabs(headingDiff - 360);
+ headingDiff = fabs(course - crse);
+
+ if (headingDiff > 180)
+ headingDiff = fabs(headingDiff - 360);
}
/***************************************************************************
* FGTaxiRoute
**************************************************************************/
-bool FGTaxiRoute::next(int *nde)
-{
- //for (intVecIterator i = nodes.begin(); i != nodes.end(); i++)
- // cerr << "FGTaxiRoute contains : " << *(i) << endl;
- //cerr << "Offset from end: " << nodes.end() - currNode << endl;
- //if (currNode != nodes.end())
- // cerr << "true" << endl;
- //else
- // cerr << "false" << endl;
- //if (nodes.size() != (routes.size()) +1)
- // cerr << "ALERT: Misconfigured TaxiRoute : " << nodes.size() << " " << routes.size() << endl;
-
- if (currNode == nodes.end())
- return false;
- *nde = *(currNode);
- if (currNode != nodes.begin()) // make sure route corresponds to the end node
- currRoute++;
- currNode++;
- return true;
+bool FGTaxiRoute::next(int *nde)
+{
+ //for (intVecIterator i = nodes.begin(); i != nodes.end(); i++)
+ // cerr << "FGTaxiRoute contains : " << *(i) << endl;
+ //cerr << "Offset from end: " << nodes.end() - currNode << endl;
+ //if (currNode != nodes.end())
+ // cerr << "true" << endl;
+ //else
+ // cerr << "false" << endl;
+ //if (nodes.size() != (routes.size()) +1)
+ // cerr << "ALERT: Misconfigured TaxiRoute : " << nodes.size() << " " << routes.size() << endl;
+
+ if (currNode == nodes.end())
+ return false;
+ *nde = *(currNode);
+ if (currNode != nodes.begin()) // make sure route corresponds to the end node
+ currRoute++;
+ currNode++;
+ return true;
};
-bool FGTaxiRoute::next(int *nde, int *rte)
-{
- //for (intVecIterator i = nodes.begin(); i != nodes.end(); i++)
- // cerr << "FGTaxiRoute contains : " << *(i) << endl;
- //cerr << "Offset from end: " << nodes.end() - currNode << endl;
- //if (currNode != nodes.end())
- // cerr << "true" << endl;
- //else
- // cerr << "false" << endl;
- if (nodes.size() != (routes.size()) +1) {
- SG_LOG(SG_GENERAL, SG_ALERT, "ALERT: Misconfigured TaxiRoute : " << nodes.size() << " " << routes.size());
- exit(1);
- }
- if (currNode == nodes.end())
- return false;
- *nde = *(currNode);
- //*rte = *(currRoute);
- if (currNode != nodes.begin()) // Make sure route corresponds to the end node
- {
- *rte = *(currRoute);
- currRoute++;
+bool FGTaxiRoute::next(int *nde, int *rte)
+{
+ //for (intVecIterator i = nodes.begin(); i != nodes.end(); i++)
+ // cerr << "FGTaxiRoute contains : " << *(i) << endl;
+ //cerr << "Offset from end: " << nodes.end() - currNode << endl;
+ //if (currNode != nodes.end())
+ // cerr << "true" << endl;
+ //else
+ // cerr << "false" << endl;
+ if (nodes.size() != (routes.size()) + 1) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "ALERT: Misconfigured TaxiRoute : " << nodes.
+ size() << " " << routes.size());
+ exit(1);
}
- else
+ if (currNode == nodes.end())
+ return false;
+ *nde = *(currNode);
+ //*rte = *(currRoute);
+ if (currNode != nodes.begin()) // Make sure route corresponds to the end node
{
- // If currNode points to the first node, this means the aircraft is not on the taxi node
- // yet. Make sure to return a unique identifyer in this situation though, because otherwise
- // the speed adjust AI code may be unable to resolve whether two aircraft are on the same
- // taxi route or not. the negative of the preceding route seems a logical choice, as it is
- // unique for any starting location.
- // Note that this is probably just a temporary fix until I get Parking / tower control working.
- *rte = -1 * *(currRoute);
- }
- currNode++;
- return true;
+ *rte = *(currRoute);
+ currRoute++;
+ } else {
+ // If currNode points to the first node, this means the aircraft is not on the taxi node
+ // yet. Make sure to return a unique identifyer in this situation though, because otherwise
+ // the speed adjust AI code may be unable to resolve whether two aircraft are on the same
+ // taxi route or not. the negative of the preceding route seems a logical choice, as it is
+ // unique for any starting location.
+ // Note that this is probably just a temporary fix until I get Parking / tower control working.
+ *rte = -1 * *(currRoute);
+ }
+ currNode++;
+ return true;
};
void FGTaxiRoute::rewind(int route)
{
- int currPoint;
- int currRoute;
- first();
- do {
- if (!(next(&currPoint, &currRoute))) {
- SG_LOG(SG_GENERAL,SG_ALERT, "Error in rewinding TaxiRoute: current" << currRoute
- << " goal " << route);
- }
- } while (currRoute != route);
+ int currPoint;
+ int currRoute;
+ first();
+ do {
+ if (!(next(&currPoint, &currRoute))) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "Error in rewinding TaxiRoute: current" << currRoute <<
+ " goal " << route);
+ }
+ } while (currRoute != route);
}
/***************************************************************************
* FGGroundNetwork()
**************************************************************************/
-bool compare_nodes(FGTaxiNode *a, FGTaxiNode *b) {
-return (*a) < (*b);
+bool compare_nodes(FGTaxiNode * a, FGTaxiNode * b)
+{
+ return (*a) < (*b);
}
-bool compare_segments(FGTaxiSegment *a, FGTaxiSegment *b) {
-return (*a) < (*b);
+bool compare_segments(FGTaxiSegment * a, FGTaxiSegment * b)
+{
+ return (*a) < (*b);
}
FGGroundNetwork::FGGroundNetwork()
{
- hasNetwork = false;
- foundRoute = false;
- totalDistance = 0;
- maxDistance = 0;
- //maxDepth = 1000;
- count = 0;
- currTraffic = activeTraffic.begin();
+ hasNetwork = false;
+ foundRoute = false;
+ totalDistance = 0;
+ maxDistance = 0;
+ //maxDepth = 1000;
+ count = 0;
+ currTraffic = activeTraffic.begin();
}
FGGroundNetwork::~FGGroundNetwork()
{
- for (FGTaxiNodeVectorIterator node = nodes.begin();
- node != nodes.end();
- node++)
- {
- delete (*node);
+ for (FGTaxiNodeVectorIterator node = nodes.begin();
+ node != nodes.end(); node++) {
+ delete(*node);
}
- nodes.clear();
- pushBackNodes.clear();
- for (FGTaxiSegmentVectorIterator seg = segments.begin();
- seg != segments.end();
- seg++)
- {
- delete (*seg);
+ nodes.clear();
+ pushBackNodes.clear();
+ for (FGTaxiSegmentVectorIterator seg = segments.begin();
+ seg != segments.end(); seg++) {
+ delete(*seg);
}
- segments.clear();
+ segments.clear();
}
-void FGGroundNetwork::addSegment(const FGTaxiSegment &seg)
+void FGGroundNetwork::addSegment(const FGTaxiSegment & seg)
{
- segments.push_back(new FGTaxiSegment(seg));
+ segments.push_back(new FGTaxiSegment(seg));
}
-void FGGroundNetwork::addNode(const FGTaxiNode &node)
+void FGGroundNetwork::addNode(const FGTaxiNode & node)
{
- nodes.push_back(new FGTaxiNode(node));
+ nodes.push_back(new FGTaxiNode(node));
}
-void FGGroundNetwork::addNodes(FGParkingVec *parkings)
+void FGGroundNetwork::addNodes(FGParkingVec * parkings)
{
- FGTaxiNode n;
- FGParkingVecIterator i = parkings->begin();
- while (i != parkings->end())
- {
- n.setIndex(i->getIndex());
- n.setLatitude(i->getLatitude());
- n.setLongitude(i->getLongitude());
- nodes.push_back(new FGTaxiNode(n));
-
- i++;
+ FGTaxiNode n;
+ FGParkingVecIterator i = parkings->begin();
+ while (i != parkings->end()) {
+ n.setIndex(i->getIndex());
+ n.setLatitude(i->getLatitude());
+ n.setLongitude(i->getLongitude());
+ nodes.push_back(new FGTaxiNode(n));
+
+ i++;
}
}
void FGGroundNetwork::init()
{
- hasNetwork = true;
- int index = 1;
- sort(nodes.begin(), nodes.end(), compare_nodes);
- //sort(segments.begin(), segments.end(), compare_segments());
- FGTaxiSegmentVectorIterator i = segments.begin();
- while(i != segments.end()) {
- (*i)->setStart(&nodes);
- (*i)->setEnd (&nodes);
- (*i)->setTrackDistance();
- (*i)->setIndex(index);
- if ((*i)->isPushBack()) {
- pushBackNodes.push_back((*i)->getEnd());
- }
- //SG_LOG(SG_GENERAL, SG_BULK, "initializing segment " << (*i)->getIndex() << endl);
- //SG_LOG(SG_GENERAL, SG_BULK, "Track distance = " << (*i)->getLength() << endl);
- //SG_LOG(SG_GENERAL, SG_BULK, "Track runs from " << (*i)->getStart()->getIndex() << " to "
- // << (*i)->getEnd()->getIndex() << endl);
- i++;
- index++;
- }
-
- i = segments.begin();
- while(i != segments.end()) {
- FGTaxiSegmentVectorIterator j = (*i)->getEnd()->getBeginRoute();
- while (j != (*i)->getEnd()->getEndRoute())
- {
- if ((*j)->getEnd()->getIndex() == (*i)->getStart()->getIndex())
- {
-// int start1 = (*i)->getStart()->getIndex();
-// int end1 = (*i)->getEnd() ->getIndex();
-// int start2 = (*j)->getStart()->getIndex();
-// int end2 = (*j)->getEnd()->getIndex();
-// int oppIndex = (*j)->getIndex();
- //cerr << "Opposite of " << (*i)->getIndex() << " (" << start1 << "," << end1 << ") "
- // << "happens to be " << oppIndex << " (" << start2 << "," << end2 << ") " << endl;
- (*i)->setOpposite(*j);
- break;
- }
- j++;
- }
- i++;
- }
- //FGTaxiNodeVectorIterator j = nodes.begin();
- //while (j != nodes.end()) {
- // if ((*j)->getHoldPointType() == 3) {
- // pushBackNodes.push_back((*j));
- // }
- // j++;
- //}
- //cerr << "Done initializing ground network" << endl;
- //exit(1);
+ hasNetwork = true;
+ int index = 1;
+ sort(nodes.begin(), nodes.end(), compare_nodes);
+ //sort(segments.begin(), segments.end(), compare_segments());
+ FGTaxiSegmentVectorIterator i = segments.begin();
+ while (i != segments.end()) {
+ (*i)->setStart(&nodes);
+ (*i)->setEnd(&nodes);
+ (*i)->setTrackDistance();
+ (*i)->setIndex(index);
+ if ((*i)->isPushBack()) {
+ pushBackNodes.push_back((*i)->getEnd());
+ }
+ //SG_LOG(SG_GENERAL, SG_BULK, "initializing segment " << (*i)->getIndex() << endl);
+ //SG_LOG(SG_GENERAL, SG_BULK, "Track distance = " << (*i)->getLength() << endl);
+ //SG_LOG(SG_GENERAL, SG_BULK, "Track runs from " << (*i)->getStart()->getIndex() << " to "
+ // << (*i)->getEnd()->getIndex() << endl);
+ i++;
+ index++;
+ }
+
+ i = segments.begin();
+ while (i != segments.end()) {
+ FGTaxiSegmentVectorIterator j = (*i)->getEnd()->getBeginRoute();
+ while (j != (*i)->getEnd()->getEndRoute()) {
+ if ((*j)->getEnd()->getIndex() == (*i)->getStart()->getIndex()) {
+// int start1 = (*i)->getStart()->getIndex();
+// int end1 = (*i)->getEnd() ->getIndex();
+// int start2 = (*j)->getStart()->getIndex();
+// int end2 = (*j)->getEnd()->getIndex();
+// int oppIndex = (*j)->getIndex();
+ //cerr << "Opposite of " << (*i)->getIndex() << " (" << start1 << "," << end1 << ") "
+ // << "happens to be " << oppIndex << " (" << start2 << "," << end2 << ") " << endl;
+ (*i)->setOpposite(*j);
+ break;
+ }
+ j++;
+ }
+ i++;
+ }
+ //FGTaxiNodeVectorIterator j = nodes.begin();
+ //while (j != nodes.end()) {
+ // if ((*j)->getHoldPointType() == 3) {
+ // pushBackNodes.push_back((*j));
+ // }
+ // j++;
+ //}
+ //cerr << "Done initializing ground network" << endl;
+ //exit(1);
}
-int FGGroundNetwork::findNearestNode(const SGGeod& aGeod)
+int FGGroundNetwork::findNearestNode(const SGGeod & aGeod)
{
- double minDist = HUGE_VAL;
- int index = -1;
-
- for (FGTaxiNodeVectorIterator itr = nodes.begin(); itr != nodes.end(); itr++)
- {
- double d = SGGeodesy::distanceM(aGeod, (*itr)->getGeod());
- if (d < minDist)
- {
- minDist = d;
- index = (*itr)->getIndex();
- //cerr << "Minimum distance of " << minDist << " for index " << index << endl;
+ double minDist = HUGE_VAL;
+ int index = -1;
+
+ for (FGTaxiNodeVectorIterator itr = nodes.begin(); itr != nodes.end();
+ itr++) {
+ double d = SGGeodesy::distanceM(aGeod, (*itr)->getGeod());
+ if (d < minDist) {
+ minDist = d;
+ index = (*itr)->getIndex();
+ //cerr << "Minimum distance of " << minDist << " for index " << index << endl;
+ }
}
- }
-
- return index;
+
+ return index;
}
int FGGroundNetwork::findNearestNode(double lat, double lon)
{
- return findNearestNode(SGGeod::fromDeg(lon, lat));
+ return findNearestNode(SGGeod::fromDeg(lon, lat));
}
FGTaxiNode *FGGroundNetwork::findNode(unsigned idx)
-{ /*
- for (FGTaxiNodeVectorIterator
- itr = nodes.begin();
- itr != nodes.end(); itr++)
- {
- if (itr->getIndex() == idx)
- return itr->getAddress();
- }*/
-
- if ((idx >= 0) && (idx < nodes.size()))
- return nodes[idx]->getAddress();
- else
- return 0;
+{ /*
+ for (FGTaxiNodeVectorIterator
+ itr = nodes.begin();
+ itr != nodes.end(); itr++)
+ {
+ if (itr->getIndex() == idx)
+ return itr->getAddress();
+ } */
+
+ if ((idx >= 0) && (idx < nodes.size()))
+ return nodes[idx]->getAddress();
+ else
+ return 0;
}
FGTaxiSegment *FGGroundNetwork::findSegment(unsigned idx)
-{/*
- for (FGTaxiSegmentVectorIterator
- itr = segments.begin();
- itr != segments.end(); itr++)
- {
- if (itr->getIndex() == idx)
- return itr->getAddress();
- }
- */
- if ((idx > 0) && (idx <= segments.size()))
- return segments[idx-1]->getAddress();
- else
- {
- //cerr << "Alert: trying to find invalid segment " << idx << endl;
- return 0;
+{ /*
+ for (FGTaxiSegmentVectorIterator
+ itr = segments.begin();
+ itr != segments.end(); itr++)
+ {
+ if (itr->getIndex() == idx)
+ return itr->getAddress();
+ }
+ */
+ if ((idx > 0) && (idx <= segments.size()))
+ return segments[idx - 1]->getAddress();
+ else {
+ //cerr << "Alert: trying to find invalid segment " << idx << endl;
+ return 0;
}
}
-FGTaxiRoute FGGroundNetwork::findShortestRoute(int start, int end, bool fullSearch)
+FGTaxiRoute FGGroundNetwork::findShortestRoute(int start, int end,
+ bool fullSearch)
{
//implements Dijkstra's algorithm to find shortest distance route from start to end
//taken from http://en.wikipedia.org/wiki/Dijkstra's_algorithm
int nParkings = parent->getDynamics()->getNrOfParkings();
FGTaxiNodeVector *currNodesSet;
if (fullSearch) {
- currNodesSet = &nodes;
+ currNodesSet = &nodes;
} else {
- currNodesSet = &pushBackNodes;
+ currNodesSet = &pushBackNodes;
}
for (FGTaxiNodeVectorIterator
- itr = currNodesSet->begin();
- itr != currNodesSet->end(); itr++) {
- (*itr)->setPathScore(HUGE_VAL); //infinity by all practical means
- (*itr)->setPreviousNode(0); //
- (*itr)->setPreviousSeg (0); //
- }
+ itr = currNodesSet->begin(); itr != currNodesSet->end(); itr++) {
+ (*itr)->setPathScore(HUGE_VAL); //infinity by all practical means
+ (*itr)->setPreviousNode(0); //
+ (*itr)->setPreviousSeg(0); //
+ }
FGTaxiNode *firstNode = findNode(start);
firstNode->setPathScore(0);
- FGTaxiNode *lastNode = findNode(end);
+ FGTaxiNode *lastNode = findNode(end);
- FGTaxiNodeVector unvisited(*currNodesSet); // working copy
+ FGTaxiNodeVector unvisited(*currNodesSet); // working copy
while (!unvisited.empty()) {
- FGTaxiNode* best = *(unvisited.begin());
+ FGTaxiNode *best = *(unvisited.begin());
for (FGTaxiNodeVectorIterator
- itr = unvisited.begin();
- itr != unvisited.end(); itr++) {
- if ((*itr)->getPathScore() < best->getPathScore())
- best = (*itr);
+ itr = unvisited.begin(); itr != unvisited.end(); itr++) {
+ if ((*itr)->getPathScore() < best->getPathScore())
+ best = (*itr);
}
- FGTaxiNodeVectorIterator newend = remove(unvisited.begin(), unvisited.end(), best);
+ FGTaxiNodeVectorIterator newend =
+ remove(unvisited.begin(), unvisited.end(), best);
unvisited.erase(newend, unvisited.end());
-
+
if (best == lastNode) { // found route or best not connected
break;
} else {
seg = best->getBeginRoute();
seg != best->getEndRoute(); seg++) {
if (fullSearch || (*seg)->isPushBack()) {
- FGTaxiNode* tgt = (*seg)->getEnd();
- double alt = best->getPathScore() + (*seg)->getLength() + (*seg)->getPenalty(nParkings);
- if (alt < tgt->getPathScore()) { // Relax (u,v)
+ FGTaxiNode *tgt = (*seg)->getEnd();
+ double alt =
+ best->getPathScore() + (*seg)->getLength() +
+ (*seg)->getPenalty(nParkings);
+ if (alt < tgt->getPathScore()) { // Relax (u,v)
tgt->setPathScore(alt);
tgt->setPreviousNode(best);
- tgt->setPreviousSeg(*seg); //
- }
+ tgt->setPreviousSeg(*seg); //
+ }
} else {
- // // cerr << "Skipping TaxiSegment " << (*seg)->getIndex() << endl;
+ // // cerr << "Skipping TaxiSegment " << (*seg)->getIndex() << endl;
}
}
}
if (lastNode->getPathScore() == HUGE_VAL) {
// no valid route found
- if (fullSearch) {
- SG_LOG( SG_GENERAL, SG_ALERT, "Failed to find route from waypoint " << start << " to " << end << " at " <<
- parent->getId());
+ if (fullSearch) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "Failed to find route from waypoint " << start << " to "
+ << end << " at " << parent->getId());
}
- FGTaxiRoute empty;
- return empty;
+ FGTaxiRoute empty;
+ return empty;
//exit(1); //TODO exit more gracefully, no need to stall the whole sim with broken GN's
} else {
// assemble route from backtrace information
intVec nodes, routes;
- FGTaxiNode* bt = lastNode;
+ FGTaxiNode *bt = lastNode;
while (bt->getPreviousNode() != 0) {
nodes.push_back(bt->getIndex());
routes.push_back(bt->getPreviousSegment()->getIndex());
}
}
-int FGTaxiSegment::getPenalty(int nGates) {
- int penalty = 0;
- if (end->getIndex() < nGates) {
- penalty += 10000;
- }
- if (end->getIsOnRunway()) { // For now. In future versions, need to find out whether runway is active.
- penalty += 1000;
- }
- return penalty;
+int FGTaxiSegment::getPenalty(int nGates)
+{
+ int penalty = 0;
+ if (end->getIndex() < nGates) {
+ penalty += 10000;
+ }
+ if (end->getIsOnRunway()) { // For now. In future versions, need to find out whether runway is active.
+ penalty += 1000;
+ }
+ return penalty;
}
/* ATC Related Functions */
-void FGGroundNetwork::announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentPosition,
- double lat, double lon, double heading,
- double speed, double alt, double radius, int leg,
- FGAIAircraft *aircraft)
+void FGGroundNetwork::announcePosition(int id,
+ FGAIFlightPlan * intendedRoute,
+ int currentPosition, double lat,
+ double lon, double heading,
+ double speed, double alt,
+ double radius, int leg,
+ FGAIAircraft * aircraft)
{
- TrafficVectorIterator i = activeTraffic.begin();
- // Search search if the current id alread has an entry
- // This might be faster using a map instead of a vector, but let's start by taking a safe route
- if (activeTraffic.size()) {
- //while ((i->getId() != id) && i != activeTraffic.end()) {
- while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- // Add a new TrafficRecord if no one exsists for this aircraft.
- if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
- FGTrafficRecord rec;
- rec.setId(id);
- rec.setPositionAndIntentions(currentPosition, intendedRoute);
- rec.setPositionAndHeading(lat, lon, heading, speed, alt);
- rec.setRadius(radius); // only need to do this when creating the record.
- rec.setAircraft(aircraft);
- activeTraffic.push_back(rec);
- } else {
- i->setPositionAndIntentions(currentPosition, intendedRoute);
- i->setPositionAndHeading(lat, lon, heading, speed, alt);
- }
+ TrafficVectorIterator i = activeTraffic.begin();
+ // Search search if the current id alread has an entry
+ // This might be faster using a map instead of a vector, but let's start by taking a safe route
+ if (activeTraffic.size()) {
+ //while ((i->getId() != id) && i != activeTraffic.end()) {
+ while (i != activeTraffic.end()) {
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
+ }
+ }
+ // Add a new TrafficRecord if no one exsists for this aircraft.
+ if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
+ FGTrafficRecord rec;
+ rec.setId(id);
+ rec.setLeg(leg);
+ rec.setPositionAndIntentions(currentPosition, intendedRoute);
+ rec.setPositionAndHeading(lat, lon, heading, speed, alt);
+ rec.setRadius(radius); // only need to do this when creating the record.
+ rec.setAircraft(aircraft);
+ activeTraffic.push_back(rec);
+ } else {
+ i->setPositionAndIntentions(currentPosition, intendedRoute);
+ i->setPositionAndHeading(lat, lon, heading, speed, alt);
+ }
}
-void FGGroundNetwork::signOff(int id) {
- TrafficVectorIterator i = activeTraffic.begin();
- // Search search if the current id alread has an entry
- // This might be faster using a map instead of a vector, but let's start by taking a safe route
- if (activeTraffic.size()) {
- //while ((i->getId() != id) && i != activeTraffic.end()) {
- while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Aircraft without traffic record is signing off");
- } else {
- i = activeTraffic.erase(i);
- }
+void FGGroundNetwork::signOff(int id)
+{
+ TrafficVectorIterator i = activeTraffic.begin();
+ // Search search if the current id alread has an entry
+ // This might be faster using a map instead of a vector, but let's start by taking a safe route
+ if (activeTraffic.size()) {
+ //while ((i->getId() != id) && i != activeTraffic.end()) {
+ while (i != activeTraffic.end()) {
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
+ }
+ }
+ if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "AI error: Aircraft without traffic record is signing off");
+ } else {
+ i = activeTraffic.erase(i);
+ }
}
-void FGGroundNetwork::update(int id, double lat, double lon, double heading, double speed, double alt,
- double dt) {
- // Check whether aircraft are on hold due to a preceding pushback. If so, make sure to
- // Transmit air-to-ground "Ready to taxi request:
- // Transmit ground to air approval / hold
- // Transmit confirmation ...
- // Probably use a status mechanism similar to the Engine start procedure in the startup controller.
-
-
- TrafficVectorIterator i = activeTraffic.begin();
- // Search search if the current id has an entry
- // This might be faster using a map instead of a vector, but let's start by taking a safe route
- TrafficVectorIterator current, closest;
- if (activeTraffic.size()) {
- //while ((i->getId() != id) && i != activeTraffic.end()) {
- while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- // update position of the current aircraft
- if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "AI error: updating aircraft without traffic record");
- } else {
- i->setPositionAndHeading(lat, lon, heading, speed, alt);
- current = i;
- }
-
- setDt(getDt() + dt);
-
- // Update every three secs, but add some randomness
- // to prevent all IA objects doing this in synchrony
- //if (getDt() < (3.0) + (rand() % 10))
- // return;
- //else
- // setDt(0);
- current->clearResolveCircularWait();
- current->setWaitsForId(0);
- checkSpeedAdjustment(id, lat, lon, heading, speed, alt);
- checkHoldPosition (id, lat, lon, heading, speed, alt);
- if (checkForCircularWaits(id)) {
- i->setResolveCircularWait();
- }
+void FGGroundNetwork::update(int id, double lat, double lon,
+ double heading, double speed, double alt,
+ double dt)
+{
+ // Check whether aircraft are on hold due to a preceding pushback. If so, make sure to
+ // Transmit air-to-ground "Ready to taxi request:
+ // Transmit ground to air approval / hold
+ // Transmit confirmation ...
+ // Probably use a status mechanism similar to the Engine start procedure in the startup controller.
+
+
+ TrafficVectorIterator i = activeTraffic.begin();
+ // Search search if the current id has an entry
+ // This might be faster using a map instead of a vector, but let's start by taking a safe route
+ TrafficVectorIterator current, closest;
+ if (activeTraffic.size()) {
+ //while ((i->getId() != id) && i != activeTraffic.end()) {
+ while (i != activeTraffic.end()) {
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
+ }
+ }
+ // update position of the current aircraft
+ if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "AI error: updating aircraft without traffic record");
+ } else {
+ i->setPositionAndHeading(lat, lon, heading, speed, alt);
+ current = i;
+ }
+
+ setDt(getDt() + dt);
+
+ // Update every three secs, but add some randomness
+ // to prevent all IA objects doing this in synchrony
+ //if (getDt() < (3.0) + (rand() % 10))
+ // return;
+ //else
+ // setDt(0);
+ current->clearResolveCircularWait();
+ current->setWaitsForId(0);
+ checkSpeedAdjustment(id, lat, lon, heading, speed, alt);
+ checkHoldPosition(id, lat, lon, heading, speed, alt);
+ if (checkForCircularWaits(id)) {
+ i->setResolveCircularWait();
+ }
+ bool needsTaxiClearance = current->getAircraft()->getTaxiClearanceRequest();
+ int state = current->getState();
+ time_t now = time(NULL) + fgGetLong("/sim/time/warp");
+ if ((now - lastTransmission) > 15) {
+ available = true;
+ }
+ if (needsTaxiClearance && available) {
+ transmit(&(*current), MSG_REQUEST_TAXI_CLEARANCE, ATC_AIR_TO_GROUND);
+ current->getAircraft()->setTaxiClearanceRequest(false);
+ current->setState(3);
+ lastTransmission = now;
+ available = false;
+ }
+ if ((state == 3) && available) {
+ transmit(&(*current), MSG_ISSUE_TAXI_CLEARANCE, ATC_GROUND_TO_AIR);
+ current->setState(4);
+ lastTransmission = now;
+ available = false;
+ }
+ if ((state == 4) && available) {
+ transmit(&(*current), MSG_ACKNOWLEDGE_TAXI_CLEARANCE, ATC_AIR_TO_GROUND);
+ current->setState(0);
+ lastTransmission = now;
+ available = false;
+ }
}
/**
not addressed yet, but should be.
*/
-void FGGroundNetwork::checkSpeedAdjustment(int id, double lat,
- double lon, double heading,
- double speed, double alt)
+void FGGroundNetwork::checkSpeedAdjustment(int id, double lat,
+ double lon, double heading,
+ double speed, double alt)
{
-
- TrafficVectorIterator current, closest;
- TrafficVectorIterator i = activeTraffic.begin();
- bool otherReasonToSlowDown = false;
- bool previousInstruction;
- if (activeTraffic.size())
- {
- //while ((i->getId() != id) && (i != activeTraffic.end()))
- while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- else
- {
- return;
- }
- if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkSpeedAdjustment");
- }
- current = i;
- //closest = current;
-
- previousInstruction = current->getSpeedAdjustment();
- double mindist = HUGE_VAL;
- if (activeTraffic.size())
- {
- double course, dist, bearing, minbearing, az2;
- SGGeod curr(SGGeod::fromDegM(lon, lat, alt));
- //TrafficVector iterator closest;
- closest = current;
- for (TrafficVectorIterator i = activeTraffic.begin();
- i != activeTraffic.end(); i++)
- {
- if (i == current) {
- continue;
- }
-
- SGGeod other(SGGeod::fromDegM(i->getLongitude(),
- i->getLatitude(), i->getAltitude()));
- SGGeodesy::inverse(curr, other, course, az2, dist);
- bearing = fabs(heading-course);
- if (bearing > 180)
- bearing = 360-bearing;
- if ((dist < mindist) && (bearing < 60.0))
- {
- mindist = dist;
- closest = i;
- minbearing = bearing;
- }
- }
- //Check traffic at the tower controller
- if (towerController->hasActiveTraffic())
- {
- for (TrafficVectorIterator i = towerController->getActiveTraffic().begin();
- i != towerController->getActiveTraffic().end(); i++)
- {
- //cerr << "Comparing " << current->getId() << " and " << i->getId() << endl;
- SGGeod other(SGGeod::fromDegM(i->getLongitude(),
- i->getLatitude(),
- i->getAltitude()));
- SGGeodesy::inverse(curr, other, course, az2, dist);
- bearing = fabs(heading-course);
- if (bearing > 180)
- bearing = 360-bearing;
- if ((dist < mindist) && (bearing < 60.0))
- {
- mindist = dist;
- closest = i;
- minbearing = bearing;
- otherReasonToSlowDown = true;
- }
- }
- }
- // Finally, check UserPosition
- double userLatitude = fgGetDouble("/position/latitude-deg");
- double userLongitude = fgGetDouble("/position/longitude-deg");
- SGGeod user(SGGeod::fromDeg(userLongitude,userLatitude));
- SGGeodesy::inverse(curr, user, course, az2, dist);
-
- bearing = fabs(heading-course);
- if (bearing > 180)
- bearing = 360-bearing;
- if ((dist < mindist) && (bearing < 60.0))
- {
- mindist = dist;
- //closest = i;
- minbearing = bearing;
- otherReasonToSlowDown = true;
- }
-
- current->clearSpeedAdjustment();
-
- if (current->checkPositionAndIntentions(*closest) || otherReasonToSlowDown)
- {
- double maxAllowableDistance = (1.1*current->getRadius()) + (1.1*closest->getRadius());
- if (mindist < 2*maxAllowableDistance)
- {
- if (current->getId() == closest->getWaitsForId())
- return;
- else
- current->setWaitsForId(closest->getId());
- if (closest->getId() != current->getId())
- current->setSpeedAdjustment(closest->getSpeed()* (mindist/100));
- else
- current->setSpeedAdjustment(0); // This can only happen when the user aircraft is the one closest
- if (mindist < maxAllowableDistance)
- {
- //double newSpeed = (maxAllowableDistance-mindist);
- //current->setSpeedAdjustment(newSpeed);
- //if (mindist < 0.5* maxAllowableDistance)
- // {
- current->setSpeedAdjustment(0);
- // }
- }
- }
- }
+
+ TrafficVectorIterator current, closest;
+ TrafficVectorIterator i = activeTraffic.begin();
+ bool otherReasonToSlowDown = false;
+ bool previousInstruction;
+ if (activeTraffic.size()) {
+ //while ((i->getId() != id) && (i != activeTraffic.end()))
+ while (i != activeTraffic.end()) {
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
+ }
+ } else {
+ return;
+ }
+ if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkSpeedAdjustment");
+ }
+ current = i;
+ //closest = current;
+
+ previousInstruction = current->getSpeedAdjustment();
+ double mindist = HUGE_VAL;
+ if (activeTraffic.size()) {
+ double course, dist, bearing, minbearing, az2;
+ SGGeod curr(SGGeod::fromDegM(lon, lat, alt));
+ //TrafficVector iterator closest;
+ closest = current;
+ for (TrafficVectorIterator i = activeTraffic.begin();
+ i != activeTraffic.end(); i++) {
+ if (i == current) {
+ continue;
+ }
+
+ SGGeod other(SGGeod::fromDegM(i->getLongitude(),
+ i->getLatitude(),
+ i->getAltitude()));
+ SGGeodesy::inverse(curr, other, course, az2, dist);
+ bearing = fabs(heading - course);
+ if (bearing > 180)
+ bearing = 360 - bearing;
+ if ((dist < mindist) && (bearing < 60.0)) {
+ mindist = dist;
+ closest = i;
+ minbearing = bearing;
+ }
+ }
+ //Check traffic at the tower controller
+ if (towerController->hasActiveTraffic()) {
+ for (TrafficVectorIterator i =
+ towerController->getActiveTraffic().begin();
+ i != towerController->getActiveTraffic().end(); i++) {
+ //cerr << "Comparing " << current->getId() << " and " << i->getId() << endl;
+ SGGeod other(SGGeod::fromDegM(i->getLongitude(),
+ i->getLatitude(),
+ i->getAltitude()));
+ SGGeodesy::inverse(curr, other, course, az2, dist);
+ bearing = fabs(heading - course);
+ if (bearing > 180)
+ bearing = 360 - bearing;
+ if ((dist < mindist) && (bearing < 60.0)) {
+ mindist = dist;
+ closest = i;
+ minbearing = bearing;
+ otherReasonToSlowDown = true;
+ }
+ }
+ }
+ // Finally, check UserPosition
+ double userLatitude = fgGetDouble("/position/latitude-deg");
+ double userLongitude = fgGetDouble("/position/longitude-deg");
+ SGGeod user(SGGeod::fromDeg(userLongitude, userLatitude));
+ SGGeodesy::inverse(curr, user, course, az2, dist);
+
+ bearing = fabs(heading - course);
+ if (bearing > 180)
+ bearing = 360 - bearing;
+ if ((dist < mindist) && (bearing < 60.0)) {
+ mindist = dist;
+ //closest = i;
+ minbearing = bearing;
+ otherReasonToSlowDown = true;
+ }
+
+ current->clearSpeedAdjustment();
+
+ if (current->checkPositionAndIntentions(*closest)
+ || otherReasonToSlowDown) {
+ double maxAllowableDistance =
+ (1.1 * current->getRadius()) +
+ (1.1 * closest->getRadius());
+ if (mindist < 2 * maxAllowableDistance) {
+ if (current->getId() == closest->getWaitsForId())
+ return;
+ else
+ current->setWaitsForId(closest->getId());
+ if (closest->getId() != current->getId())
+ current->setSpeedAdjustment(closest->getSpeed() *
+ (mindist / 100));
+ else
+ current->setSpeedAdjustment(0); // This can only happen when the user aircraft is the one closest
+ if (mindist < maxAllowableDistance) {
+ //double newSpeed = (maxAllowableDistance-mindist);
+ //current->setSpeedAdjustment(newSpeed);
+ //if (mindist < 0.5* maxAllowableDistance)
+ // {
+ current->setSpeedAdjustment(0);
+ // }
+ }
+ }
+ }
}
}
3) For crossing or merging taxiroutes.
*/
-void FGGroundNetwork::checkHoldPosition(int id, double lat,
- double lon, double heading,
- double speed, double alt)
+void FGGroundNetwork::checkHoldPosition(int id, double lat,
+ double lon, double heading,
+ double speed, double alt)
{
-
- TrafficVectorIterator current;
- TrafficVectorIterator i = activeTraffic.begin();
- if (activeTraffic.size())
- {
- //while ((i->getId() != id) && i != activeTraffic.end())
- while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- else
- {
- return ;
- }
- if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkHoldPosition");
- }
- current = i;
- current->setHoldPosition(false);
- SGGeod curr(SGGeod::fromDegM(lon, lat, alt));
-
- for (i = activeTraffic.begin();
- i != activeTraffic.end(); i++)
- {
- if (i->getId() != current->getId())
- {
- int node = current->crosses(this, *i);
- if (node != -1)
- {
- FGTaxiNode* taxiNode = findNode(node);
-
- // Determine whether it's save to continue or not.
- // If we have a crossing route, there are two possibilities:
- // 1) This is an interestion
- // 2) This is oncoming two-way traffic, using the same taxiway.
- //cerr << "Hold check 1 : " << id << " has common node " << node << endl;
-
- SGGeod other(SGGeod::fromDegM(i->getLongitude(), i->getLatitude(), i->getAltitude()));
- bool needsToWait;
- bool opposing;
- if (current->isOpposing(this, *i, node))
- {
- needsToWait = true;
- opposing = true;
- //cerr << "Hold check 2 : " << node << " has opposing segment " << endl;
- // issue a "Hold Position" as soon as we're close to the offending node
- // For now, I'm doing this as long as the other aircraft doesn't
- // have a hold instruction as soon as we're within a reasonable
- // distance from the offending node.
- // This may be a bit of a conservative estimate though, as it may
- // be well possible that both aircraft can both continue to taxi
- // without crashing into each other.
- }
- else
- {
- opposing = false;
- if (SGGeodesy::distanceM(other, taxiNode->getGeod()) > 200) // 2.0*i->getRadius())
- {
- needsToWait = false;
- //cerr << "Hold check 3 : " << id <<" Other aircraft approaching node is still far away. (" << dist << " nm). Can safely continue "
- // << endl;
- }
- else
- {
- needsToWait = true;
- //cerr << "Hold check 4: " << id << " Would need to wait for other aircraft : distance = " << dist << " meters" << endl;
- }
- }
-
- double dist = SGGeodesy::distanceM(curr, taxiNode->getGeod());
- if (!(i->hasHoldPosition()))
- {
-
- if ((dist < 200) && //2.5*current->getRadius()) &&
- (needsToWait) &&
- (i->onRoute(this, *current)) &&
- //((i->onRoute(this, *current)) || ((!(i->getSpeedAdjustment())))) &&
- (!(current->getId() == i->getWaitsForId())))
- //(!(i->getSpeedAdjustment()))) // &&
- //(!(current->getSpeedAdjustment())))
-
- {
- current->setHoldPosition(true);
- current->setWaitsForId(i->getId());
- //cerr << "Hold check 5: " << current->getCallSign() <<" Setting Hold Position: distance to node (" << node << ") "
- // << dist << " meters. Waiting for " << i->getCallSign();
- //if (opposing)
- //cerr <<" [opposing] " << endl;
- //else
- // cerr << "[non-opposing] " << endl;
- //if (i->hasSpeefAdjustment())
- // {
- // cerr << " (which in turn waits for ) " << i->
- }
- else
- {
- //cerr << "Hold check 6: " << id << " No need to hold yet: Distance to node : " << dist << " nm"<< endl;
- }
- }
- }
- }
+ TrafficVectorIterator current;
+ TrafficVectorIterator i = activeTraffic.begin();
+ if (activeTraffic.size()) {
+ //while ((i->getId() != id) && i != activeTraffic.end())
+ while (i != activeTraffic.end()) {
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
+ }
+ } else {
+ return;
+ }
+ if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkHoldPosition");
+ }
+ current = i;
+ bool origStatus = current->hasHoldPosition();
+ current->setHoldPosition(false);
+ SGGeod curr(SGGeod::fromDegM(lon, lat, alt));
+
+ for (i = activeTraffic.begin(); i != activeTraffic.end(); i++) {
+ if (i->getId() != current->getId()) {
+ int node = current->crosses(this, *i);
+ if (node != -1) {
+ FGTaxiNode *taxiNode = findNode(node);
+
+ // Determine whether it's save to continue or not.
+ // If we have a crossing route, there are two possibilities:
+ // 1) This is an interestion
+ // 2) This is oncoming two-way traffic, using the same taxiway.
+ //cerr << "Hold check 1 : " << id << " has common node " << node << endl;
+
+ SGGeod other(SGGeod::
+ fromDegM(i->getLongitude(), i->getLatitude(),
+ i->getAltitude()));
+ bool needsToWait;
+ bool opposing;
+ if (current->isOpposing(this, *i, node)) {
+ needsToWait = true;
+ opposing = true;
+ //cerr << "Hold check 2 : " << node << " has opposing segment " << endl;
+ // issue a "Hold Position" as soon as we're close to the offending node
+ // For now, I'm doing this as long as the other aircraft doesn't
+ // have a hold instruction as soon as we're within a reasonable
+ // distance from the offending node.
+ // This may be a bit of a conservative estimate though, as it may
+ // be well possible that both aircraft can both continue to taxi
+ // without crashing into each other.
+ } else {
+ opposing = false;
+ if (SGGeodesy::distanceM(other, taxiNode->getGeod()) > 200) // 2.0*i->getRadius())
+ {
+ needsToWait = false;
+ //cerr << "Hold check 3 : " << id <<" Other aircraft approaching node is still far away. (" << dist << " nm). Can safely continue "
+ // << endl;
+ } else {
+ needsToWait = true;
+ //cerr << "Hold check 4: " << id << " Would need to wait for other aircraft : distance = " << dist << " meters" << endl;
+ }
+ }
+
+ double dist =
+ SGGeodesy::distanceM(curr, taxiNode->getGeod());
+ if (!(i->hasHoldPosition())) {
+
+ if ((dist < 200) && //2.5*current->getRadius()) &&
+ (needsToWait) && (i->onRoute(this, *current)) &&
+ //((i->onRoute(this, *current)) || ((!(i->getSpeedAdjustment())))) &&
+ (!(current->getId() == i->getWaitsForId())))
+ //(!(i->getSpeedAdjustment()))) // &&
+ //(!(current->getSpeedAdjustment())))
+
+ {
+ current->setHoldPosition(true);
+ current->setWaitsForId(i->getId());
+ //cerr << "Hold check 5: " << current->getCallSign() <<" Setting Hold Position: distance to node (" << node << ") "
+ // << dist << " meters. Waiting for " << i->getCallSign();
+ //if (opposing)
+ //cerr <<" [opposing] " << endl;
+ //else
+ // cerr << "[non-opposing] " << endl;
+ //if (i->hasSpeefAdjustment())
+ // {
+ // cerr << " (which in turn waits for ) " << i->
+ } else {
+ //cerr << "Hold check 6: " << id << " No need to hold yet: Distance to node : " << dist << " nm"<< endl;
+ }
+ }
+ }
+ }
+ }
+ bool currStatus = current->hasHoldPosition();
+
+ // Either a Hold Position or a resume taxi transmission has been issued
+ time_t now = time(NULL) + fgGetLong("/sim/time/warp");
+ if ((now - lastTransmission) > 2) {
+ available = true;
+ }
+ if ((origStatus != currStatus) && available) {
+ //cerr << "Issueing hold short instrudtion " << currStatus << " " << available << endl;
+ if (currStatus == true) { // No has a hold short instruction
+ transmit(&(*current), MSG_HOLD_POSITION, ATC_GROUND_TO_AIR);
+ //cerr << "Transmittin hold short instrudtion " << currStatus << " " << available << endl;
+ current->setState(1);
+ } else {
+ transmit(&(*current), MSG_RESUME_TAXI, ATC_GROUND_TO_AIR);
+ //cerr << "Transmittig resume instrudtion " << currStatus << " " << available << endl;
+ current->setState(2);
+ }
+ lastTransmission = now;
+ available = false;
+ // Don't act on the changed instruction until the transmission is confirmed
+ // So set back to original status
+ current->setHoldPosition(origStatus);
+ //cerr << "Current state " << current->getState() << endl;
+ } else {
+ }
+ int state = current->getState();
+ if ((state == 1) && (available)) {
+ //cerr << "ACKNOWLEDGE HOLD" << endl;
+ transmit(&(*current), MSG_ACKNOWLEDGE_HOLD_POSITION, ATC_AIR_TO_GROUND);
+ current->setState(0);
+ current->setHoldPosition(true);
+ lastTransmission = now;
+ available = false;
+
+ }
+ if ((state == 2) && (available)) {
+ //cerr << "ACKNOWLEDGE RESUME" << endl;
+ transmit(&(*current), MSG_ACKNOWLEDGE_RESUME_TAXI, ATC_AIR_TO_GROUND);
+ current->setState(0);
+ current->setHoldPosition(false);
+ lastTransmission = now;
+ available = false;
}
}
*/
bool FGGroundNetwork::checkForCircularWaits(int id)
-{
- //cerr << "Performing Wait check " << id << endl;
- int target = 0;
- TrafficVectorIterator current, other;
- TrafficVectorIterator i = activeTraffic.begin();
- int trafficSize = activeTraffic.size();
- if (trafficSize) {
+{
+ //cerr << "Performing Wait check " << id << endl;
+ int target = 0;
+ TrafficVectorIterator current, other;
+ TrafficVectorIterator i = activeTraffic.begin();
+ int trafficSize = activeTraffic.size();
+ if (trafficSize) {
while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- else {
- return false;
- }
- if (i == activeTraffic.end() || (trafficSize == 0)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkForCircularWaits");
- }
-
- current = i;
- target = current->getWaitsForId();
- //bool printed = false; // Note that this variable is for debugging purposes only.
- int counter = 0;
-
- if (id == target) {
- //cerr << "aircraft waits for user" << endl;
- return false;
- }
-
-
- while ((target > 0) && (target != id) && counter++ < trafficSize) {
- //printed = true;
- TrafficVectorIterator i = activeTraffic.begin();
- if (trafficSize) {
- //while ((i->getId() != id) && i != activeTraffic.end())
- while (i != activeTraffic.end()) {
- if (i->getId() == target) {
- break;
- }
- i++;
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
}
- }
- else {
+ } else {
return false;
- }
+ }
if (i == activeTraffic.end() || (trafficSize == 0)) {
- //cerr << "[Waiting for traffic at Runway: DONE] " << endl << endl;;
- // The target id is not found on the current network, which means it's at the tower
- //SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkForCircularWaits");
- return false;
- }
- other = i;
- target = other->getWaitsForId();
-
- // actually this trap isn't as impossible as it first seemed:
- // the setWaitsForID(id) is set to current when the aircraft
- // is waiting for the user controlled aircraft.
- //if (current->getId() == other->getId()) {
- // cerr << "Caught the impossible trap" << endl;
- // cerr << "Current = " << current->getId() << endl;
- // cerr << "Other = " << other ->getId() << endl;
- // for (TrafficVectorIterator at = activeTraffic.begin();
- // at != activeTraffic.end();
- // at++) {
- // cerr << "currently active aircraft : " << at->getCallSign() << " with Id " << at->getId() << " waits for " << at->getWaitsForId() << endl;
- // }
- // exit(1);
- if (current->getId() == other->getId())
- return false;
- //}
- //cerr << current->getCallSign() << " (" << current->getId() << ") " << " -> " << other->getCallSign()
- // << " (" << other->getId() << "); " << endl;;
- //current = other;
- }
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkForCircularWaits");
+ }
+
+ current = i;
+ target = current->getWaitsForId();
+ //bool printed = false; // Note that this variable is for debugging purposes only.
+ int counter = 0;
+
+ if (id == target) {
+ //cerr << "aircraft waits for user" << endl;
+ return false;
+ }
+
+
+ while ((target > 0) && (target != id) && counter++ < trafficSize) {
+ //printed = true;
+ TrafficVectorIterator i = activeTraffic.begin();
+ if (trafficSize) {
+ //while ((i->getId() != id) && i != activeTraffic.end())
+ while (i != activeTraffic.end()) {
+ if (i->getId() == target) {
+ break;
+ }
+ i++;
+ }
+ } else {
+ return false;
+ }
+ if (i == activeTraffic.end() || (trafficSize == 0)) {
+ //cerr << "[Waiting for traffic at Runway: DONE] " << endl << endl;;
+ // The target id is not found on the current network, which means it's at the tower
+ //SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkForCircularWaits");
+ return false;
+ }
+ other = i;
+ target = other->getWaitsForId();
+
+ // actually this trap isn't as impossible as it first seemed:
+ // the setWaitsForID(id) is set to current when the aircraft
+ // is waiting for the user controlled aircraft.
+ //if (current->getId() == other->getId()) {
+ // cerr << "Caught the impossible trap" << endl;
+ // cerr << "Current = " << current->getId() << endl;
+ // cerr << "Other = " << other ->getId() << endl;
+ // for (TrafficVectorIterator at = activeTraffic.begin();
+ // at != activeTraffic.end();
+ // at++) {
+ // cerr << "currently active aircraft : " << at->getCallSign() << " with Id " << at->getId() << " waits for " << at->getWaitsForId() << endl;
+ // }
+ // exit(1);
+ if (current->getId() == other->getId())
+ return false;
+ //}
+ //cerr << current->getCallSign() << " (" << current->getId() << ") " << " -> " << other->getCallSign()
+ // << " (" << other->getId() << "); " << endl;;
+ //current = other;
+ }
- //if (printed)
- // cerr << "[done] " << endl << endl;;
- if (id == target) {
- SG_LOG(SG_GENERAL, SG_WARN, "Detected circular wait condition: Id = " << id << "target = " << target);
- return true;
- } else {
- return false;
- }
+ //if (printed)
+ // cerr << "[done] " << endl << endl;;
+ if (id == target) {
+ SG_LOG(SG_GENERAL, SG_WARN,
+ "Detected circular wait condition: Id = " << id <<
+ "target = " << target);
+ return true;
+ } else {
+ return false;
+ }
}
// Note that this function is probably obsolete...
bool FGGroundNetwork::hasInstruction(int id)
{
TrafficVectorIterator i = activeTraffic.begin();
- // Search search if the current id has an entry
- // This might be faster using a map instead of a vector, but let's start by taking a safe route
- if (activeTraffic.size())
- {
- //while ((i->getId() != id) && i != activeTraffic.end()) {
- while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "AI error: checking ATC instruction for aircraft without traffic record");
- } else {
- return i->hasInstruction();
- }
- return false;
+ // Search search if the current id has an entry
+ // This might be faster using a map instead of a vector, but let's start by taking a safe route
+ if (activeTraffic.size()) {
+ //while ((i->getId() != id) && i != activeTraffic.end()) {
+ while (i != activeTraffic.end()) {
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
+ }
+ }
+ if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "AI error: checking ATC instruction for aircraft without traffic record");
+ } else {
+ return i->hasInstruction();
+ }
+ return false;
}
FGATCInstruction FGGroundNetwork::getInstruction(int id)
{
- TrafficVectorIterator i = activeTraffic.begin();
- // Search search if the current id has an entry
- // This might be faster using a map instead of a vector, but let's start by taking a safe route
- if (activeTraffic.size()) {
- //while ((i->getId() != id) && i != activeTraffic.end()) {
- while (i != activeTraffic.end()) {
- if (i->getId() == id) {
- break;
- }
- i++;
- }
- }
- if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "AI error: requesting ATC instruction for aircraft without traffic record");
- } else {
- return i->getInstruction();
- }
- return FGATCInstruction();
+ TrafficVectorIterator i = activeTraffic.begin();
+ // Search search if the current id has an entry
+ // This might be faster using a map instead of a vector, but let's start by taking a safe route
+ if (activeTraffic.size()) {
+ //while ((i->getId() != id) && i != activeTraffic.end()) {
+ while (i != activeTraffic.end()) {
+ if (i->getId() == id) {
+ break;
+ }
+ i++;
+ }
+ }
+ if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "AI error: requesting ATC instruction for aircraft without traffic record");
+ } else {
+ return i->getInstruction();
+ }
+ return FGATCInstruction();
}
-
-
void init();
bool exists() { return hasNetwork; };
void setTowerController(FGTowerController *twrCtrlr) { towerController = twrCtrlr; };
-
+
int findNearestNode(double lat, double lon);
int findNearestNode(const SGGeod& aGeod);
-
+
FGTaxiNode *findNode(unsigned idx);
FGTaxiSegment *findSegment(unsigned idx);
FGTaxiRoute findShortestRoute(int start, int end, bool fullSearch=true);
validSelection = true;
for (int j = 0; j < activeRwys; j++)
{
- rwy = airport->getRunwayByIdent(rwyList[j].getRwyList(i));
+ string ident(rwyList[j].getRwyList(i));
+ if (!airport->hasRunwayWithIdent(ident)) {
+ SG_LOG(SG_GENERAL, SG_WARN, "no such runway:" << ident << " at " << airport->ident());
+ continue;
+ }
+
+ rwy = airport->getRunwayByIdent(ident);
//cerr << "Succes" << endl;
hdgDiff = fabs(windHeading - rwy->headingDeg());
#include <simgear/misc/strutils.hxx>
#include <simgear/structure/exception.hxx>
+#include <simgear/misc/sgstream.hxx>
#include <simgear/props/props_io.hxx>
#include <simgear/misc/sg_path.hxx>
wpn->getChild("eta", 0, true);
_route->clear();
+ _route->set_current(0);
update_mirror();
_pathNode = fgGetNode(RM "file-path", 0, true);
aProp->setStringValue( eta_str );
}
-void FGRouteMgr::add_waypoint( const SGWayPoint& wp, int n ) {
+void FGRouteMgr::add_waypoint( const SGWayPoint& wp, int n )
+{
_route->add_waypoint( wp, n );
- if (_route->current_index() > n) {
+ if ((n >= 0) && (_route->current_index() > n)) {
_route->set_current(_route->current_index() + 1);
}
+ waypointsChanged();
+}
+
+void FGRouteMgr::waypointsChanged()
+{
+ 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));
+ }
+
update_mirror();
_edited->fireValueChanged();
+ checkFinished();
}
-
SGWayPoint FGRouteMgr::pop_waypoint( int n ) {
if ( _route->size() <= 0 ) {
return SGWayPoint();
SGWayPoint wp = _route->get_waypoint(n);
_route->delete_waypoint(n);
- update_mirror();
- _edited->fireValueChanged();
- checkFinished();
-
+ waypointsChanged();
return wp;
}
mgr->loadRoute();
} else if (!strcmp(s, "@SAVE")) {
mgr->saveRoute();
- } else if (!strcmp(s, "@POP"))
- mgr->pop_waypoint(0);
- else if (!strncmp(s, "@DELETE", 7))
+ } else if (!strcmp(s, "@POP")) {
+ SG_LOG(SG_AUTOPILOT, SG_WARN, "route-manager @POP command is deprecated");
+ } else if (!strcmp(s, "@NEXT")) {
+ mgr->jumpToIndex(mgr->currentWaypoint() + 1);
+ } else if (!strcmp(s, "@PREVIOUS")) {
+ mgr->jumpToIndex(mgr->currentWaypoint() - 1);
+ } else if (!strncmp(s, "@JUMP", 5)) {
+ mgr->jumpToIndex(atoi(s + 5));
+ } else if (!strncmp(s, "@DELETE", 7))
mgr->pop_waypoint(atoi(s + 7));
else if (!strncmp(s, "@INSERT", 7)) {
char *r;
}
_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::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");
_route->set_current(index);
currentWaypointChanged();
+ _currentWpt->fireValueChanged();
}
void FGRouteMgr::currentWaypointChanged()
return _route->current_index();
}
+void FGRouteMgr::setWaypointTargetAltitudeFt(unsigned int index, int altFt)
+{
+ SGWayPoint wp = _route->get_waypoint(index);
+ wp.setTargetAltFt(altFt);
+ // simplest way to update a waypoint is to remove and re-add it
+ _route->delete_waypoint(index);
+ _route->add_waypoint(wp, index);
+ waypointsChanged();
+}
+
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);
+ SGPropertyNode_ptr d(new SGPropertyNode);
+ SGPath path(_pathNode->getStringValue());
+ d->setIntValue("version", 1);
+
+ if (_departure) {
+ d->setStringValue("departure/airport", _departure->ident());
+ d->setStringValue("departure/sid", departure->getStringValue("sid"));
+ d->setStringValue("departure/runway", departure->getStringValue("runway"));
+ }
+
+ if (_destination) {
+ d->setStringValue("destination/airport", _destination->ident());
+ d->setStringValue("destination/star", destination->getStringValue("star"));
+ d->setStringValue("destination/transition", destination->getStringValue("transition"));
+ d->setStringValue("destination/runway", destination->getStringValue("runway"));
+ }
+
+ // route nodes
+ SGPropertyNode* routeNode = d->getChild("route", 0, true);
+ for (int i=0; i<_route->size(); ++i) {
+ SGPropertyNode* wpNode = routeNode->getChild("wp",i, true);
+ SGWayPoint wp(_route->get_waypoint(i));
+
+ wpNode->setStringValue("ident", wp.get_id());
+ wpNode->setStringValue("name", wp.get_name());
+ SGGeod geod(wp.get_target());
+
+ wpNode->setDoubleValue("longitude-deg", geod.getLongitudeDeg());
+ wpNode->setDoubleValue("latitude-deg", geod.getLatitudeDeg());
+
+ if (geod.getElevationFt() > -9990.0) {
+ wpNode->setDoubleValue("altitude-ft", geod.getElevationFt());
+ }
+ } // of waypoint iteration
+
+ writeProperties(path.str(), d, true /* write-all */);
} 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());
+ // 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());
- SG_LOG(SG_IO, SG_INFO, "going to read flight-plan from:" << path.str());
+ try {
readProperties(path.str(), routeData);
-
+ } catch (sg_exception& e) {
+ // if XML parsing fails, the file might be simple textual list of waypoints
+ loadPlainTextRoute(path);
+ return;
+ }
+
+ try {
// departure nodes
SGPropertyNode* dep = routeData->getChild("departure");
if (!dep) {
// cruise
SGPropertyNode* crs = routeData->getChild("cruise");
if (crs) {
- cruise->setDoubleValue(crs->getDoubleValue("speed"));
+ cruise->setDoubleValue("speed-kts", crs->getDoubleValue("speed-kts"));
+ cruise->setDoubleValue("mach", crs->getDoubleValue("mach"));
+ cruise->setDoubleValue("altitude-ft", crs->getDoubleValue("altitude-ft"));
} // of cruise data loading
// route nodes
}
SGPropertyNode_ptr altProp = aWP->getChild("altitude-ft");
- double altM = cruise->getDoubleValue("altitude-ft") * SG_FEET_TO_METER;
+ double altM = -9999.0;
if (altProp) {
altM = altProp->getDoubleValue() * SG_FEET_TO_METER;
}
}
}
+void FGRouteMgr::loadPlainTextRoute(const SGPath& path)
+{
+ sg_gzifstream in(path.str().c_str());
+ if (!in.is_open()) {
+ return;
+ }
+
+ _route->clear();
+ while (!in.eof()) {
+ string line;
+ getline(in, line, '\n');
+ // trim CR from end of line, if found
+ if (line[line.size() - 1] == '\r') {
+ line.erase(line.size() - 1, 1);
+ }
+
+ new_waypoint(line, -1);
+ } // of line iteration
+}
+
const char* FGRouteMgr::getDepartureICAO() const
{
if (!_departure) {
*/
SGWayPoint* make_waypoint(const string& target);
+ /**
+ * Helper to keep various pieces of state in sync when the SGRoute is
+ * modified (waypoints added, inserted, removed). Notably, this fires the
+ * 'edited' signal.
+ */
+ void waypointsChanged();
void update_mirror();
*/
bool checkFinished();
+
+ void loadPlainTextRoute(const SGPath& path);
+
// tied getters and setters
const char* getDepartureICAO() const;
const char* getDepartureName() const;
*/
void jumpToIndex(int index);
+ /**
+ *
+ */
+ void setWaypointTargetAltitudeFt(unsigned int index, int altFt);
+
void saveRoute();
void loadRoute();
};
using std::cout;
using std::endl;
+using simgear::PropertyList;
+
FGPeriodicalValue::FGPeriodicalValue( SGPropertyNode_ptr root )
{
SGPropertyNode_ptr minNode = root->getChild( "min" );
double phase = fabs(max - min);
if( phase > SGLimitsd::min() ) {
- while( value < min ) value += phase;
+ while( value < min ) value += phase;
while( value >= max ) value -= phase;
} else {
value = min; // phase is zero
*/
void FGPIDController::update( double dt ) {
- double ep_n; // proportional error with reference weighing
double e_n; // error
- double ed_n; // derivative error
- double edf_n; // derivative error filter
- double Tf; // filter time
+ double edf_n;
double delta_u_n = 0.0; // incremental output
double u_n = 0.0; // absolute output
double Ts; // sampling interval (sec)
if ( debug ) cout << " input = " << y_n << " ref = " << r_n << endl;
// Calculates proportional error:
- ep_n = beta * r_n - y_n;
+ double ep_n = beta * r_n - y_n;
if ( debug ) cout << " ep_n = " << ep_n;
if ( debug ) cout << " ep_n_1 = " << ep_n_1;
e_n = r_n - y_n;
if ( debug ) cout << " e_n = " << e_n;
- // Calculates derivate error:
- ed_n = gamma * r_n - y_n;
- if ( debug ) cout << " ed_n = " << ed_n;
-
double td = Td.get_value();
- if ( td > 0.0 ) {
+ if ( td > 0.0 ) { // do we need to calcluate derivative error?
+
+ // Calculates derivate error:
+ double ed_n = gamma * r_n - y_n;
+ if ( debug ) cout << " ed_n = " << ed_n;
+
// Calculates filter time:
- Tf = alpha * td;
+ double Tf = alpha * td;
if ( debug ) cout << " Tf = " << Tf;
// Filters the derivate error:
+ ed_n * (Ts/Tf) / (Ts/Tf + 1);
if ( debug ) cout << " edf_n = " << edf_n;
} else {
- edf_n = ed_n;
+ edf_n_2 = edf_n_1 = edf_n = 0.0;
}
// Calculates the incremental output:
delta_u_n = Kp.get_value() * ( (ep_n - ep_n_1)
+ ((Ts/ti) * e_n)
+ ((td/Ts) * (edf_n - 2*edf_n_1 + edf_n_2)) );
- }
- if ( debug ) {
- cout << " delta_u_n = " << delta_u_n << endl;
- cout << "P:" << Kp.get_value() * (ep_n - ep_n_1)
- << " I:" << Kp.get_value() * ((Ts/ti) * e_n)
- << " D:" << Kp.get_value() * ((td/Ts) * (edf_n - 2*edf_n_1 + edf_n_2))
- << endl;
+ if ( debug ) {
+ cout << " delta_u_n = " << delta_u_n << endl;
+ cout << "P:" << Kp.get_value() * (ep_n - ep_n_1)
+ << " I:" << Kp.get_value() * ((Ts/ti) * e_n)
+ << " D:" << Kp.get_value() * ((td/Ts) * (edf_n - 2*edf_n_1 + edf_n_2))
+ << endl;
+ }
}
// Integrator anti-windup logic:
set_output_value( u_n );
} else if ( !enabled ) {
- ep_n = 0.0;
- edf_n = 0.0;
- // Updates indexed values;
- u_n_1 = u_n;
- ep_n_1 = ep_n;
- edf_n_2 = edf_n_1;
- edf_n_1 = edf_n;
+ ep_n_1 = 0.0;
+ edf_n_2 = edf_n_1 = edf_n = 0.0;
}
}
<< " error = " << error
<< endl;
- double prop_comp = error * Kp.get_value();
+ double prop_comp = clamp(error * Kp.get_value());
int_sum += error * Ki.get_value() * dt;
+ double output = prop_comp + int_sum;
+ double clamped_output = clamp( output );
+ if( output != clamped_output ) // anti-windup
+ int_sum = clamped_output - prop_comp;
+
if ( debug ) cout << "prop_comp = " << prop_comp
<< " int_sum = " << int_sum << endl;
- double output = prop_comp + int_sum;
- output = clamp( output );
- set_output_value( output );
- if ( debug ) cout << "output = " << output << endl;
+ set_output_value( clamped_output );
+ if ( debug ) cout << "output = " << clamped_output << endl;
}
}
{
if ( isPropertyEnabled() ) {
- input.push_front(valueInput.get_value());
+ input.push_front(valueInput.get_value()-referenceInput.get_value());
input.resize(samplesInput.get_value() + 1, 0.0);
if ( !enabled ) {
}
}
+FGXMLAutoLogic::FGXMLAutoLogic(SGPropertyNode * node ) :
+ FGXMLAutoComponent(),
+ inverted(false)
+{
+ parseNode(node);
+}
+
+bool FGXMLAutoLogic::parseNodeHook(const std::string& aName, SGPropertyNode* aNode)
+{
+ if (aName == "input") {
+ input = sgReadCondition( fgGetNode("/"), aNode );
+ } else if (aName == "inverted") {
+ inverted = aNode->getBoolValue();
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+void FGXMLAutoLogic::update(double dt)
+{
+ if ( isPropertyEnabled() ) {
+ if ( !enabled ) {
+ // we have just been enabled
+ }
+ enabled = true;
+ } else {
+ enabled = false;
+ do_feedback();
+ }
+
+ if ( !enabled || dt < SGLimitsd::min() )
+ return;
+
+ if( input == NULL ) {
+ if ( debug ) cout << "No input for " << get_name() << endl;
+ return;
+ }
+
+ bool i = input->test();
+
+ if ( debug ) cout << "Updating " << get_name() << ": " << (inverted ? !i : i) << endl;
+
+ set_output_value( i );
+}
+
+
FGXMLAutopilotGroup::FGXMLAutopilotGroup() :
- SGSubsystemGroup(),
- average(0.0), // average/filtered prediction
+ SGSubsystemGroup()
+#ifdef XMLAUTO_USEHELPER
+ ,average(0.0), // average/filtered prediction
v_last(0.0), // last velocity
last_static_pressure(0.0),
vel(fgGetNode( "/velocities/airspeed-kt", true )),
static_pressure(fgGetNode( "/systems/static[0]/pressure-inhg", true )),
pressure_rate(fgGetNode( "/autopilot/internal/pressure-rate", true )),
track(fgGetNode( "/orientation/track-deg", true ))
+#endif
{
}
{
// update all configured autopilots
SGSubsystemGroup::update( dt );
-
+#ifdef XMLAUTO_USEHELPER
// update helper values
double v = vel->getDoubleValue();
double a = 0.0;
pressure_rate->setDoubleValue(current_pressure_rate);
last_static_pressure = current_static_pressure;
}
+#endif
}
void FGXMLAutopilotGroup::reinit()
void FGXMLAutopilotGroup::init()
{
- vector<SGPropertyNode_ptr> autopilotNodes = fgGetNode( "/sim/systems", true )->getChildren("autopilot");
+ PropertyList autopilotNodes = fgGetNode( "/sim/systems", true )->getChildren("autopilot");
if( autopilotNodes.size() == 0 ) {
SG_LOG( SG_ALL, SG_WARN, "No autopilot configuration specified for this model!");
return;
}
- for( vector<SGPropertyNode_ptr>::size_type i = 0; i < autopilotNodes.size(); i++ ) {
+ for( PropertyList::size_type i = 0; i < autopilotNodes.size(); i++ ) {
SGPropertyNode_ptr pathNode = autopilotNodes[i]->getNode( "path" );
if( pathNode == NULL ) {
SG_LOG( SG_ALL, SG_WARN, "No autopilot configuration file specified for this autopilot!");
continue;
}
} catch (const sg_exception& e) {
- SG_LOG( SG_ALL, SG_ALERT, "Failed to load autopilot configuration: "
+ SG_LOG( SG_AUTOPILOT, SG_ALERT, "Failed to load autopilot configuration: "
<< config.str() << ":" << e.getMessage() );
delete ap;
continue;
}
- SG_LOG( SG_ALL, SG_INFO, "adding autopilot subsystem " << apName );
+ SG_LOG( SG_AUTOPILOT, SG_INFO, "adding autopilot subsystem " << apName );
set_subsystem( apName, ap );
_autopilotNames.push_back( apName );
}
node = config_props->getChild(i);
string name = node->getName();
// cout << name << endl;
- SG_LOG( SG_ALL, SG_INFO, "adding autopilot component " << name );
+ SG_LOG( SG_AUTOPILOT, SG_BULK, "adding autopilot component " << name );
if ( name == "pid-controller" ) {
components.push_back( new FGPIDController( node ) );
} else if ( name == "pi-simple-controller" ) {
components.push_back( new FGPredictor( node ) );
} else if ( name == "filter" ) {
components.push_back( new FGDigitalFilter( node ) );
-// } else {
-// SG_LOG( SG_ALL, SG_ALERT, "Unknown top level section: "
-// << name );
+ } else if ( name == "logic" ) {
+ components.push_back( new FGXMLAutoLogic( node ) );
+ } else {
+ SG_LOG( SG_AUTOPILOT, SG_WARN, "Unknown top level autopilot section: " << name );
// return false;
}
}
#ifndef _XMLAUTO_HXX
#define _XMLAUTO_HXX 1
+/*
+Torsten Dreyer:
+I'd like to deprecate the so called autopilot helper function
+(which is now part of the AutopilotGroup::update() method).
+Every property calculated within this helper can be calculated
+using filters defined in an external autopilot definition file.
+The complete set of calculations may be extracted into a separate
+configuration file. The current implementation is able to hande
+multiple config files and autopilots. The helper doubles code
+and writes properties used only by a few aircraft.
+*/
+// FIXME: this should go into config.h and/or configure
+// or removed along with the "helper" one day.
+#define XMLAUTO_USEHELPER
+
#include <simgear/compiler.h>
#include <string>
class FGXMLAutoComponent : public SGReferenced {
private:
- std::vector <SGPropertyNode_ptr> output_list;
+ simgear::PropertyList output_list;
SGSharedPtr<const SGCondition> _condition;
SGPropertyNode_ptr enable_prop;
// helpful for things like flight directors which position
// their vbars from the autopilot computations.
if ( honor_passive && passive_mode->getBoolValue() ) return;
- for( std::vector <SGPropertyNode_ptr>::iterator it = output_list.begin(); it != output_list.end(); ++it)
+ for( simgear::PropertyList::iterator it = output_list.begin();
+ it != output_list.end(); ++it)
(*it)->setDoubleValue( clamp( value ) );
}
+ inline void set_output_value( bool value ) {
+ // passive_ignore == true means that we go through all the
+ // motions, but drive the outputs. This is analogous to
+ // running the autopilot with the "servos" off. This is
+ // helpful for things like flight directors which position
+ // their vbars from the autopilot computations.
+ if ( honor_passive && passive_mode->getBoolValue() ) return;
+ for( simgear::PropertyList::iterator it = output_list.begin();
+ it != output_list.end(); ++it)
+ (*it)->setBoolValue( value ); // don't use clamp here, bool is clamped anyway
+ }
+
inline double get_output_value() {
return output_list.size() == 0 ? 0.0 : clamp(output_list[0]->getDoubleValue());
}
void update(double dt);
};
+class FGXMLAutoLogic : public FGXMLAutoComponent
+{
+private:
+ SGSharedPtr<SGCondition> input;
+ bool inverted;
+
+protected:
+ bool parseNodeHook(const std::string& aName, SGPropertyNode* aNode);
+
+public:
+ FGXMLAutoLogic(SGPropertyNode * node );
+ ~FGXMLAutoLogic() {}
+
+ void update(double dt);
+};
+
/**
* Model an autopilot system.
*
private:
std::vector<std::string> _autopilotNames;
+#ifdef XMLAUTO_USEHELPER
double average;
double v_last;
double last_static_pressure;
SGPropertyNode_ptr static_pressure;
SGPropertyNode_ptr pressure_rate;
SGPropertyNode_ptr track;
+#endif
};
class FGXMLAutopilot : public SGSubsystem
}
- SG_LOG(SG_INPUT, SG_INFO, "Read properties for " <<
+ SG_LOG(SG_INPUT, SG_DEBUG, "Read properties for " <<
root.getStringValue("name"));
if (!root.getNode("depreciated"))
HUD_deque.erase( HUD_deque.begin(), HUD_deque.end());
- SG_LOG(SG_INPUT, SG_INFO, "Reading Hud instruments");
+ SG_LOG(SG_INPUT, SG_DEBUG, "Reading Hud instruments");
const SGPropertyNode * instrument_group = root.getChild("instruments");
int nInstruments = instrument_group->nChildren();
SGPath path( globals->get_fg_root() );
path.append(node->getStringValue("path"));
- SG_LOG(SG_INPUT, SG_INFO, "Reading Instrument "
+ SG_LOG(SG_INPUT, SG_DEBUG, "Reading Instrument "
<< node->getName()
<< " from "
<< path.str());
Maj_div(node->getIntValue("major_divs")), // FIXME dup
Min_div(node->getIntValue("minor_divs")) // FIXME dup
{
- SG_LOG(SG_INPUT, SG_INFO, "Done reading dial/tape instrument "
+ SG_LOG(SG_INPUT, SG_BULK, "Done reading dial/tape instrument "
<< node->getStringValue("name", "[unnamed]"));
set_data_source(get_func(node->getStringValue("loadfn")));
0, /* hud.cxx: static int dp_shoing = 0; */ // FIXME
node->getBoolValue("working", true))
{
- SG_LOG(SG_INPUT, SG_INFO, "Done reading gauge instrument "
+ SG_LOG(SG_INPUT, SG_BULK, "Done reading gauge instrument "
<< node->getStringValue("name", "[unnamed]"));
set_data_source(get_func(node->getStringValue("loadfn")));
lon_node(fgGetNode("/position/longitude-string", true)),
lat_node(fgGetNode("/position/latitude-string", true))
{
- SG_LOG(SG_INPUT, SG_INFO, "Done reading instr_label instrument "
+ SG_LOG(SG_INPUT, SG_BULK, "Done reading instr_label instrument "
<< node->getStringValue("name", "[unnamed]"));
set_data_source(get_func(node->getStringValue("data_source")));
if (fgGetBool("/sim/hud/enable3d", true) && HUD_style == 1)
factor = 640.0 / 55.0;
- SG_LOG(SG_INPUT, SG_INFO, "Done reading HudLadder instrument"
+ SG_LOG(SG_INPUT, SG_BULK, "Done reading HudLadder instrument"
<< node->getStringValue("name", "[unnamed]"));
if (!width_units)
drawIA(arrowScale > 0 ? true : false),
drawIAAlways(arrowScale > 0 ? node->getBoolValue("arrow_always") : false)
{
- SG_LOG(SG_INPUT, SG_INFO, "Done reading runway instrument "
+ SG_LOG(SG_INPUT, SG_BULK, "Done reading runway instrument "
<< node->getStringValue("name", "[unnamed]"));
view[0] = 0;
rad(node->getFloatValue("rad"))
{
- SG_LOG(SG_INPUT, SG_INFO, "Done reading TBI instrument"
+ SG_LOG(SG_INPUT, SG_BULK, "Done reading TBI instrument"
<< node->getStringValue("name", "[unnamed]"));
}
transform();
FGFontCache *fc = globals->get_fontcache();
- text_renderer.setFont(fc->getTexFont(_font_name.c_str()));
+ fntFont* font = fc->getTexFont(_font_name.c_str());
+ if (!font) {
+ return; // don't crash on missing fonts
+ }
+
+ text_renderer.setFont(font);
text_renderer.setPointSize(_pointSize);
text_renderer.begin();
FGTextLayer::setFontName(const string &name)
{
_font_name = name + ".txf";
+ FGFontCache *fc = globals->get_fontcache();
+ fntFont* font = fc->getTexFont(_font_name.c_str());
+ if (!font) {
+ SG_LOG(SG_GENERAL, SG_WARN, "unable to find font:" << name);
+ }
}
if (bgTexture.empty())
bgTexture = "FOO";
panel->setBackground(FGTextureManager::createTexture(bgTexture.c_str()));
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << bgTexture );
//
// Get multibackground if any...
string mbgTexture = root->getStringValue("multibackground[0]");
if (!mbgTexture.empty()) {
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 0);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[1]");
if (mbgTexture.empty())
mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 1);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[2]");
if (mbgTexture.empty())
mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 2);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[3]");
if (mbgTexture.empty())
mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 3);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[4]");
if (mbgTexture.empty())
mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 4);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[5]");
if (mbgTexture.empty())
mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 5);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[6]");
if (mbgTexture.empty())
mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 6);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[7]");
if (mbgTexture.empty())
mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 7);
- SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
}
//
// Create each instrument.
//
- SG_LOG( SG_COCKPIT, SG_INFO, "Reading panel instruments" );
+ SG_LOG( SG_COCKPIT, SG_DEBUG, "Reading panel instruments" );
const SGPropertyNode * instrument_group = root->getChild("instruments");
if (instrument_group != 0) {
int nInstruments = instrument_group->nChildren();
SG_LOG( SG_COCKPIT, SG_WARN, "Unknown special instrument found" );
}
} else {
- SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
+ SG_LOG( SG_COCKPIT, SG_WARN, "Skipping " << node->getName()
<< " in instruments section" );
}
}
}
- SG_LOG( SG_COCKPIT, SG_INFO, "Done reading panel instruments" );
+ SG_LOG( SG_COCKPIT, SG_BULK, "Done reading panel instruments" );
//
wind_from_down_fps = 0;
thermal_lift_fps = 0;
ridge_lift_fps= 0;
+ local_weather_lift_fps=0;
altitude_half_to_sun_m = 1000;
altitude_tropo_top_m = 10000;
#ifdef USING_TABLES
wind_from_down_fps = env.wind_from_down_fps;
thermal_lift_fps = env.thermal_lift_fps;
ridge_lift_fps= env.ridge_lift_fps;
+ local_weather_lift_fps = env.local_weather_lift_fps;
turbulence_magnitude_norm = env.turbulence_magnitude_norm;
turbulence_rate_hz = env.turbulence_rate_hz;
}
maybe_copy_value(this, node, "turbulence/rate-hz",
&FGEnvironment::set_turbulence_rate_hz);
+
// calculate derived properties here to avoid duplicate expensive computations
_recalc_ne();
_recalc_alt_pt();
return ridge_lift_fps;
}
+double
+FGEnvironment::get_local_weather_lift_fps () const
+{
+ return local_weather_lift_fps;
+}
+
double
FGEnvironment::get_turbulence_magnitude_norm () const
{
ridge_lift_fps = ri;
if( live_update ) {
_recalc_updraft();
+ }
}
+
+void
+FGEnvironment::set_local_weather_lift_fps (double lwl)
+{
+ local_weather_lift_fps = lwl;
+ if( live_update ) {
+ _recalc_updraft();
+ }
}
void
void
FGEnvironment::_recalc_updraft ()
{
- wind_from_down_fps = thermal_lift_fps + ridge_lift_fps ;
+ wind_from_down_fps = thermal_lift_fps + ridge_lift_fps + local_weather_lift_fps ;
}
// Intended to help with the interpretation of METAR data,
virtual double get_wind_from_down_fps () const;
virtual double get_thermal_lift_fps () const;
virtual double get_ridge_lift_fps () const;
+ virtual double get_local_weather_lift_fps () const;
virtual double get_turbulence_magnitude_norm () const;
virtual double get_turbulence_rate_hz () const;
virtual void set_wind_from_down_fps (double d);
virtual void set_thermal_lift_fps (double th);
virtual void set_ridge_lift_fps (double ri);
+ virtual void set_local_weather_lift_fps (double lwl);
virtual void set_turbulence_magnitude_norm (double t);
virtual void set_turbulence_rate_hz (double t);
double wind_from_down_fps;
double thermal_lift_fps;
double ridge_lift_fps;
+ double local_weather_lift_fps;
bool live_update;
metar_valid(false),
setup_winds_aloft(true),
wind_interpolation_required(true),
+ metar_sealevel_temperature(15.0),
+ metar_sealevel_dewpoint(5.0),
// Interpolation constant definitions.
- EnvironmentUpdatePeriodSec( 0.2 ),
MaxWindChangeKtsSec( 0.2 ),
MaxVisChangePercentSec( 0.05 ),
- MaxPressureChangeInHgSec( 0.0033 ),
+ MaxPressureChangeInHgSec( 0.0005 ), // approx 1hpa/min
+ MaxTemperatureChangeDegcSec(10.0/60.0), // approx 10degc/min
MaxCloudAltitudeChangeFtSec( 20.0 ),
MaxCloudThicknessChangeFtSec( 50.0 ),
MaxCloudInterpolationHeightFt( 5000.0 ),
latitude_n = fgGetNode( "/position/latitude-deg", true );
environment_clouds_n = fgGetNode("/environment/clouds");
- boundary_wind_speed_n = fgGetNode("/environment/config/boundary/entry/wind-speed-kt");
- boundary_wind_from_heading_n = fgGetNode("/environment/config/boundary/entry/wind-from-heading-deg");
- boundary_visibility_n = fgGetNode("/environment/config/boundary/entry/visibility-m");
- boundary_sea_level_pressure_n = fgGetNode("/environment/config/boundary/entry/pressure-sea-level-inhg");
+ boundary_wind_speed_n = fgGetNode("/environment/config/boundary/entry/wind-speed-kt", true );
+ boundary_wind_from_heading_n = fgGetNode("/environment/config/boundary/entry/wind-from-heading-deg", true );
+ boundary_visibility_n = fgGetNode("/environment/config/boundary/entry/visibility-m", true );
+ boundary_sea_level_pressure_n = fgGetNode("/environment/config/boundary/entry/pressure-sea-level-inhg", true );
+ boundary_sea_level_temperature_n = fgGetNode("/environment/config/boundary/entry/temperature-sea-level-degc", true );
+ boundary_sea_level_dewpoint_n = fgGetNode("/environment/config/boundary/entry/dewpoint-sea-level-degc", true );
}
FGMetarCtrl::~FGMetarCtrl ()
}
// use a "command" to set station temp at station elevation
-static void set_temp_at_altitude( float temp_degc, float altitude_ft ) {
+static void set_temp_at_altitude( double temp_degc, double altitude_ft ) {
SGPropertyNode args;
SGPropertyNode *node = args.getNode("temp-degc", 0, true);
- node->setFloatValue( temp_degc );
+ node->setDoubleValue( temp_degc );
node = args.getNode("altitude-ft", 0, true);
- node->setFloatValue( altitude_ft );
- globals->get_commands()->execute("set-outside-air-temp-degc", &args);
+ node->setDoubleValue( altitude_ft );
+ globals->get_commands()->execute( altitude_ft == 0.0 ?
+ "set-sea-level-air-temp-degc" :
+ "set-outside-air-temp-degc", &args);
}
-static void set_dewpoint_at_altitude( float dewpoint_degc, float altitude_ft ) {
+static void set_dewpoint_at_altitude( double dewpoint_degc, double altitude_ft ) {
SGPropertyNode args;
SGPropertyNode *node = args.getNode("dewpoint-degc", 0, true);
- node->setFloatValue( dewpoint_degc );
+ node->setDoubleValue( dewpoint_degc );
node = args.getNode("altitude-ft", 0, true);
- node->setFloatValue( altitude_ft );
- globals->get_commands()->execute("set-dewpoint-temp-degc", &args);
+ node->setDoubleValue( altitude_ft );
+ globals->get_commands()->execute( altitude_ft == 0.0 ?
+ "set-dewpoint-sea-level-air-temp-degc" :
+ "set-dewpoint-temp-degc", &args);
}
/*
setupWindBranch( "aloft", dir, speed, gust );
}
-double FGMetarCtrl::interpolate_val(double currentval, double requiredval, double dt)
+double FGMetarCtrl::interpolate_val(double currentval, double requiredval, double dval )
{
- double dval = EnvironmentUpdatePeriodSec * dt;
-
if (fabs(currentval - requiredval) < dval) return requiredval;
if (currentval < requiredval) return (currentval + dval);
if (currentval > requiredval) return (currentval - dval);
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;
+ 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
bool reinit_required = false;
bool layer_rebuild_required = false;
- double station_elevation_ft = station_elevation_n->getDoubleValue();
+ double station_elevation_ft = station_elevation_n->getDoubleValue();
if (first_update) {
double dir = base_wind_dir_n->getDoubleValue()+magnetic_variation_n->getDoubleValue();
double metarvis = min_visibility_n->getDoubleValue();
fgDefaultWeatherValue("visibility-m", metarvis);
+ set_temp_at_altitude(temperature_n->getDoubleValue(), station_elevation_ft);
+ set_dewpoint_at_altitude(dewpoint_n->getDoubleValue(), station_elevation_ft);
+
double metarpressure = pressure_n->getDoubleValue();
fgDefaultWeatherValue("pressure-sea-level-inhg",
- reducePressureSl(metarpressure,
- station_elevation_ft,
- temperature_n->getDoubleValue()));
+ 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");
double maxdy = dy * MaxWindChangeKtsSec;
// Interpolate each component separately.
- current[0] = interpolate_val(current[0], metar[0], maxdx);
- current[1] = interpolate_val(current[1], metar[1], maxdy);
+ current[0] = interpolate_val(current[0], metar[0], maxdx*dt);
+ current[1] = interpolate_val(current[1], metar[1], maxdy*dt);
// Now convert back to polar coordinates.
if ((fabs(current[0]) > 0.1) || (fabs(current[1]) > 0.1)) {
double currentxval = log(1000.0 + vis);
double metarxval = log(1000.0 + metarvis);
- currentxval = interpolate_val(currentxval, metarxval, MaxVisChangePercentSec);
+ currentxval = interpolate_val(currentxval, metarxval, MaxVisChangePercentSec*dt);
// Now convert back from an X-value to a straightforward visibility.
vis = exp(currentxval) - 1000.0;
double pressure = boundary_sea_level_pressure_n->getDoubleValue();
double metarpressure = pressure_n->getDoubleValue();
- double newpressure = reducePressureSl(metarpressure,
- station_elevation_ft,
- temperature_n->getDoubleValue());
+ double newpressure = reducePressureSl(metarpressure,
+ station_elevation_ft,
+ temperature_n->getDoubleValue());
if( pressure != newpressure ) {
- pressure = interpolate_val( pressure, newpressure, MaxPressureChangeInHgSec );
+ pressure = interpolate_val( pressure, newpressure, MaxPressureChangeInHgSec*dt );
fgDefaultWeatherValue("pressure-sea-level-inhg", pressure);
reinit_required = true;
}
+ {
+ double temperature = boundary_sea_level_temperature_n->getDoubleValue();
+ double dewpoint = boundary_sea_level_dewpoint_n->getDoubleValue();
+ if( metar_sealevel_temperature != temperature ) {
+ temperature = interpolate_val( temperature, metar_sealevel_temperature, MaxTemperatureChangeDegcSec*dt );
+ set_temp_at_altitude( temperature, 0.0 );
+ }
+ if( metar_sealevel_dewpoint != dewpoint ) {
+ dewpoint = interpolate_val( dewpoint, metar_sealevel_dewpoint, MaxTemperatureChangeDegcSec*dt );
+ set_dewpoint_at_altitude( dewpoint, 0.0 );
+ }
+ }
+
// Set the cloud layers by interpolating over the METAR versions.
vector<SGPropertyNode_ptr> layers = clouds_n->getChildren("layer");
vector<SGPropertyNode_ptr>::const_iterator layer;
} else {
// Interpolate the other values in the usual way
if (current_alt != required_alt) {
- current_alt = interpolate_val(current_alt, required_alt, MaxCloudAltitudeChangeFtSec);
+ current_alt = interpolate_val(current_alt, required_alt, MaxCloudAltitudeChangeFtSec*dt);
target->setDoubleValue("elevation-ft", current_alt);
}
if (current_thickness != required_thickness) {
current_thickness = interpolate_val(current_thickness,
required_thickness,
- MaxCloudThicknessChangeFtSec);
+ MaxCloudThicknessChangeFtSec*dt);
thickness->setDoubleValue(current_thickness);
}
}
}
}
- 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
if( layer_rebuild_required )
station_elevation_n->setDoubleValue( station_elevation_ft );
+ { // calculate sea level temperature and dewpoint
+ FGEnvironment dummy; // instantiate a dummy so we can leech a method
+ dummy.set_elevation_ft( station_elevation_ft );
+ dummy.set_temperature_degc( temperature_n->getDoubleValue() );
+ dummy.set_dewpoint_degc( dewpoint_n->getDoubleValue() );
+ metar_sealevel_temperature = dummy.get_temperature_sea_level_degc();
+ metar_sealevel_dewpoint = dummy.get_dewpoint_sea_level_degc();
+ }
+
vector<SGMetarCloud> cv = m->getClouds();
vector<SGMetarCloud>::const_iterator cloud, cloud_end = cv.end();
bool first_update;
bool wind_interpolation_required;
string metar;
+ double metar_sealevel_temperature;
+ double metar_sealevel_dewpoint;
double interpolate_prop(const char * currentname, const char * requiredname, double dvalue);
double interpolate_val(double currentval, double requiredval, double dvalue);
- const double EnvironmentUpdatePeriodSec; // Seconds between interpolations
const double MaxWindChangeKtsSec; // Max wind change in kts/sec
const double MaxVisChangePercentSec; // Max visibility change in %/sec
const double MaxPressureChangeInHgSec; // Max pressure change in InHg/sec
+ const double MaxTemperatureChangeDegcSec; // Max temperature change in degc/s
const double MaxCloudAltitudeChangeFtSec; // Max cloud altitude change in ft/s
const double MaxCloudThicknessChangeFtSec; // Max cloud thickness change in ft/s
const double MaxCloudInterpolationHeightFt; // Max distance from aircraft to
SGPropertyNode_ptr boundary_wind_from_heading_n;
SGPropertyNode_ptr boundary_visibility_n;
SGPropertyNode_ptr boundary_sea_level_pressure_n;
+ SGPropertyNode_ptr boundary_sea_level_temperature_n;
+ SGPropertyNode_ptr boundary_sea_level_dewpoint_n;
private:
};
fgSetArchivable("/environment/thermal-lift-fps");
fgTie("/environment/ridge-lift-fps", _environment,
&FGEnvironment::get_ridge_lift_fps,
- &FGEnvironment::set_ridge_lift_fps);
+ &FGEnvironment::set_ridge_lift_fps);
fgSetArchivable("/environment/ridge-lift-fps");
-
+
+ fgTie("/environment/local-weather-lift", _environment,
+ &FGEnvironment::get_local_weather_lift_fps); //read-only
+
fgTie("/environment/turbulence/magnitude-norm", _environment,
&FGEnvironment::get_turbulence_magnitude_norm,
&FGEnvironment::set_turbulence_magnitude_norm);
fgUntie("/environment/thermal-lift-fps");
fgUntie("/environment/ridge-lift-fps");
+ fgUntie("/environment/local-weather-lift");
fgUntie("/environment/atmosphere/altitude-half-to-sun");
fgUntie("/environment/atmosphere/altitude-troposphere-top");
_environment->get_wind_from_east_fps(),
_environment->get_wind_from_down_fps());
_environment->set_elevation_ft(fgGetDouble("/position/altitude-ft"));
+ _environment->set_local_weather_lift_fps(fgGetDouble("/local-weather/current/thermal-lift"));
osg::Vec3 windVec(-_environment->get_wind_from_north_fps(),
-_environment->get_wind_from_east_fps(),
_environment->get_wind_from_down_fps());
libGUI_a_SOURCES = \
new_gui.cxx new_gui.hxx \
dialog.cxx dialog.hxx \
- menubar.cxx menubar.hxx \
- gui.cxx gui.h gui_funcs.cxx \
- fonts.cxx \
- AirportList.cxx AirportList.hxx \
+ menubar.cxx menubar.hxx \
+ gui.cxx gui.h gui_funcs.cxx \
+ fonts.cxx \
+ AirportList.cxx AirportList.hxx \
property_list.cxx property_list.hxx \
layout.cxx layout-props.cxx layout.hxx \
- SafeTexFont.cxx SafeTexFont.hxx
-
+ SafeTexFont.cxx SafeTexFont.hxx \
+ WaypointList.cxx WaypointList.hxx \
+ MapWidget.cxx MapWidget.hxx
+
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
layout_test_SOURCES = layout-test.cxx
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "MapWidget.hxx"
+
+#include <sstream>
+#include <algorithm> // for std::sort
+#include <plib/puAux.h>
+
+#include <simgear/route/waypoint.hxx>
+#include <simgear/sg_inlines.h>
+#include <simgear/misc/strutils.hxx>
+#include <simgear/magvar/magvar.hxx>
+#include <simgear/timing/sg_time.hxx> // for magVar julianDate
+#include <simgear/structure/exception.hxx>
+
+#include <Main/globals.hxx>
+#include <Main/fg_props.hxx>
+#include <Autopilot/route_mgr.hxx>
+#include <Navaids/positioned.hxx>
+#include <Navaids/navrecord.hxx>
+#include <Navaids/navlist.hxx>
+#include <Navaids/fix.hxx>
+#include <Airports/simple.hxx>
+#include <Airports/runways.hxx>
+#include <Main/fg_os.hxx> // fgGetKeyModifiers()
+
+const char* RULER_LEGEND_KEY = "ruler-legend";
+
+/* equatorial and polar earth radius */
+const float rec = 6378137; // earth radius, equator (?)
+const float rpol = 6356752.314f; // earth radius, polar (?)
+
+/************************************************************************
+ some trigonometric helper functions
+ (translated more or less directly from Alexei Novikovs perl original)
+*************************************************************************/
+
+//Returns Earth radius at a given latitude (Ellipsoide equation with two equal axis)
+static float earth_radius_lat( float lat )
+{
+ double a = cos(lat)/rec;
+ double b = sin(lat)/rpol;
+ return 1.0f / sqrt( a * a + b * b );
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+static puBox makePuBox(int x, int y, int w, int h)
+{
+ puBox r;
+ r.min[0] = x;
+ r.min[1] = y;
+ r.max[0] = x + w;
+ r.max[1] = y + h;
+ return r;
+}
+
+static bool puBoxIntersect(const puBox& a, const puBox& b)
+{
+ int x0 = SG_MAX2(a.min[0], b.min[0]);
+ int y0 = SG_MAX2(a.min[1], b.min[1]);
+ int x1 = SG_MIN2(a.max[0], b.max[0]);
+ int y1 = SG_MIN2(a.max[1], b.max[1]);
+
+ return (x0 <= x1) && (y0 <= y1);
+}
+
+class MapData;
+typedef std::vector<MapData*> MapDataVec;
+
+class MapData
+{
+public:
+ static const int HALIGN_LEFT = 1;
+ static const int HALIGN_CENTER = 2;
+ static const int HALIGN_RIGHT = 3;
+
+ static const int VALIGN_TOP = 1 << 4;
+ static const int VALIGN_CENTER = 2 << 4;
+ static const int VALIGN_BOTTOM = 3 << 4;
+
+ MapData(int priority) :
+ _dirtyText(true),
+ _age(0),
+ _priority(priority),
+ _width(0),
+ _height(0),
+ _offsetDir(HALIGN_LEFT | VALIGN_CENTER),
+ _offsetPx(10),
+ _dataVisible(false)
+ {
+ }
+
+ void setLabel(const std::string& label)
+ {
+ if (label == _label) {
+ return; // common case, and saves invalidation
+ }
+
+ _label = label;
+ _dirtyText = true;
+ }
+
+ void setText(const std::string &text)
+ {
+ if (_rawText == text) {
+ return; // common case, and saves invalidation
+ }
+
+ _rawText = text;
+ _dirtyText = true;
+ }
+
+ void setDataVisible(bool vis) {
+ if (vis == _dataVisible) {
+ return;
+ }
+
+ if (_rawText.empty()) {
+ vis = false;
+ }
+
+ _dataVisible = vis;
+ _dirtyText = true;
+ }
+
+ static void setFont(puFont f)
+ {
+ _font = f;
+ _fontHeight = f.getStringHeight();
+ _fontDescender = f.getStringDescender();
+ }
+
+ static void setPalette(puColor* pal)
+ {
+ _palette = pal;
+ }
+
+ void setPriority(int pri)
+ {
+ _priority = pri;
+ }
+
+ int priority() const
+ { return _priority; }
+
+ void setAnchor(const SGVec2d& anchor)
+ {
+ _anchor = anchor;
+ }
+
+ void setOffset(int direction, int px)
+ {
+ if ((_offsetPx == px) && (_offsetDir == direction)) {
+ return;
+ }
+
+ _dirtyOffset = true;
+ _offsetDir = direction;
+ _offsetPx = px;
+ }
+
+ bool isClipped(const puBox& vis) const
+ {
+ validate();
+ if ((_width < 1) || (_height < 1)) {
+ return true;
+ }
+
+ return !puBoxIntersect(vis, box());
+ }
+
+ bool overlaps(const MapDataVec& l) const
+ {
+ validate();
+ puBox b(box());
+
+ MapDataVec::const_iterator it;
+ for (it = l.begin(); it != l.end(); ++it) {
+ if (puBoxIntersect(b, (*it)->box())) {
+ return true;
+ }
+ } // of list iteration
+
+ return false;
+ }
+
+ puBox box() const
+ {
+ validate();
+ return makePuBox(
+ _anchor.x() + _offset.x(),
+ _anchor.y() + _offset.y(),
+ _width, _height);
+ }
+
+ void draw()
+ {
+ validate();
+
+ int xx = _anchor.x() + _offset.x();
+ int yy = _anchor.y() + _offset.y();
+
+ if (_dataVisible) {
+ puBox box(makePuBox(0,0,_width, _height));
+ int border = 1;
+ box.draw(xx, yy, PUSTYLE_DROPSHADOW, _palette, FALSE, border);
+
+ // draw lines
+ int lineHeight = _fontHeight;
+ int xPos = xx + MARGIN;
+ int yPos = yy + _height - (lineHeight + MARGIN);
+ glColor3f(0.8, 0.8, 0.8);
+
+ for (unsigned int ln=0; ln<_lines.size(); ++ln) {
+ _font.drawString(_lines[ln].c_str(), xPos, yPos);
+ yPos -= lineHeight + LINE_LEADING;
+ }
+ } else {
+ glColor3f(0.8, 0.8, 0.8);
+ _font.drawString(_label.c_str(), xx, yy + _fontDescender);
+ }
+ }
+
+ void age()
+ {
+ ++_age;
+ }
+
+ void resetAge()
+ {
+ _age = 0;
+ }
+
+ bool isExpired() const
+ { return (_age > 100); }
+
+ static bool order(MapData* a, MapData* b)
+ {
+ return a->_priority > b->_priority;
+ }
+private:
+ void validate() const
+ {
+ if (!_dirtyText) {
+ if (_dirtyOffset) {
+ computeOffset();
+ }
+
+ return;
+ }
+
+ if (_dataVisible) {
+ measureData();
+ } else {
+ measureLabel();
+ }
+
+ computeOffset();
+ _dirtyText = false;
+ }
+
+ void measureData() const
+ {
+ _lines = simgear::strutils::split(_rawText, "\n");
+ // measure text to find width and height
+ _width = -1;
+ _height = 0;
+
+ for (unsigned int ln=0; ln<_lines.size(); ++ln) {
+ _height += _fontHeight;
+ if (ln > 0) {
+ _height += LINE_LEADING;
+ }
+
+ int lw = _font.getStringWidth(_lines[ln].c_str());
+ _width = std::max(_width, lw);
+ } // of line measurement
+
+ if ((_width < 1) || (_height < 1)) {
+ // will be clipped
+ return;
+ }
+
+ _height += MARGIN * 2;
+ _width += MARGIN * 2;
+ }
+
+ void measureLabel() const
+ {
+ if (_label.empty()) {
+ _width = _height = -1;
+ return;
+ }
+
+ _height = _fontHeight;
+ _width = _font.getStringWidth(_label.c_str());
+ }
+
+ void computeOffset() const
+ {
+ _dirtyOffset = false;
+ if ((_width <= 0) || (_height <= 0)) {
+ return;
+ }
+
+ int hOffset = 0;
+ int vOffset = 0;
+
+ switch (_offsetDir & 0x0f) {
+ default:
+ case HALIGN_LEFT:
+ hOffset = _offsetPx;
+ break;
+
+ case HALIGN_CENTER:
+ hOffset = -(_width>>1);
+ break;
+
+ case HALIGN_RIGHT:
+ hOffset = -(_offsetPx + _width);
+ break;
+ }
+
+ switch (_offsetDir & 0xf0) {
+ default:
+ case VALIGN_TOP:
+ vOffset = -(_offsetPx + _height);
+ break;
+
+ case VALIGN_CENTER:
+ vOffset = -(_height>>1);
+ break;
+
+ case VALIGN_BOTTOM:
+ vOffset = _offsetPx;
+ break;
+ }
+
+ _offset = SGVec2d(hOffset, vOffset);
+ }
+
+ static const int LINE_LEADING = 3;
+ static const int MARGIN = 3;
+
+ mutable bool _dirtyText;
+ mutable bool _dirtyOffset;
+ int _age;
+ std::string _rawText;
+ std::string _label;
+ mutable std::vector<std::string> _lines;
+ int _priority;
+ mutable int _width, _height;
+ SGVec2d _anchor;
+ int _offsetDir;
+ int _offsetPx;
+ mutable SGVec2d _offset;
+ bool _dataVisible;
+
+ static puFont _font;
+ static puColor* _palette;
+ static int _fontHeight;
+ static int _fontDescender;
+};
+
+puFont MapData::_font;
+puColor* MapData::_palette;
+int MapData::_fontHeight = 0;
+int MapData::_fontDescender = 0;
+
+///////////////////////////////////////////////////////////////////////////
+
+const int MAX_ZOOM = 16;
+const int SHOW_DETAIL_ZOOM = 8;
+const int CURSOR_PAN_STEP = 32;
+
+MapWidget::MapWidget(int x, int y, int maxX, int maxY) :
+ puObject(x,y,maxX, maxY)
+{
+ _route = static_cast<FGRouteMgr*>(globals->get_subsystem("route-manager"));
+ _gps = fgGetNode("/instrumentation/gps");
+
+ _zoom = 6;
+ _width = maxX - x;
+ _height = maxY - y;
+
+ MapData::setFont(legendFont);
+ MapData::setPalette(colour);
+
+ _magVar = new SGMagVar();
+}
+
+MapWidget::~MapWidget()
+{
+ delete _magVar;
+}
+
+void MapWidget::setProperty(SGPropertyNode_ptr prop)
+{
+ _root = prop;
+ _root->setBoolValue("centre-on-aircraft", true);
+ _root->setBoolValue("draw-data", false);
+ _root->setBoolValue("magnetic-headings", true);
+}
+
+void MapWidget::setSize(int w, int h)
+{
+ puObject::setSize(w, h);
+
+ _width = w;
+ _height = h;
+
+}
+
+void MapWidget::doHit( int button, int updown, int x, int y )
+{
+ puObject::doHit(button, updown, x, y);
+ if (updown == PU_DRAG) {
+ handlePan(x, y);
+ return;
+ }
+
+ if (button == 3) { // mouse-wheel up
+ zoomIn();
+ } else if (button == 4) { // mouse-wheel down
+ zoomOut();
+ }
+
+ if (button != active_mouse_button) {
+ return;
+ }
+
+ _hitLocation = SGVec2d(x - abox.min[0], y - abox.min[1]);
+
+ if (updown == PU_UP) {
+ puDeactivateWidget();
+ } else if (updown == PU_DOWN) {
+ puSetActiveWidget(this, x, y);
+
+ if (fgGetKeyModifiers() & KEYMOD_CTRL) {
+ _clickGeod = unproject(_hitLocation - SGVec2d(_width>>1, _height>>1));
+ }
+ }
+}
+
+void MapWidget::handlePan(int x, int y)
+{
+ SGVec2d delta = SGVec2d(x, y) - _hitLocation;
+ pan(delta);
+ _hitLocation = SGVec2d(x,y);
+}
+
+int MapWidget::checkKey (int key, int updown )
+{
+ if ((updown == PU_UP) || !isVisible () || !isActive () || (window != puGetWindow())) {
+ return FALSE ;
+ }
+
+ switch (key)
+ {
+
+ case PU_KEY_UP:
+ pan(SGVec2d(0, -CURSOR_PAN_STEP));
+ break;
+
+ case PU_KEY_DOWN:
+ pan(SGVec2d(0, CURSOR_PAN_STEP));
+ break ;
+
+ case PU_KEY_LEFT:
+ pan(SGVec2d(CURSOR_PAN_STEP, 0));
+ break;
+
+ case PU_KEY_RIGHT:
+ pan(SGVec2d(-CURSOR_PAN_STEP, 0));
+ break;
+
+ case '-':
+ zoomOut();
+
+ break;
+
+ case '=':
+ zoomIn();
+ break;
+
+ default :
+ return FALSE;
+ }
+
+ return TRUE ;
+}
+
+void MapWidget::pan(const SGVec2d& delta)
+{
+ _projectionCenter = unproject(-delta);
+}
+
+void MapWidget::zoomIn()
+{
+ if (_zoom <= 0) {
+ return;
+ }
+
+ --_zoom;
+ SG_LOG(SG_GENERAL, SG_INFO, "zoom is now:" << _zoom);
+}
+
+void MapWidget::zoomOut()
+{
+ if (_zoom >= MAX_ZOOM) {
+ return;
+ }
+
+ ++_zoom;
+ SG_LOG(SG_GENERAL, SG_INFO, "zoom is now:" << _zoom);
+}
+
+void MapWidget::draw(int dx, int dy)
+{
+ _aircraft = SGGeod::fromDeg(fgGetDouble("/position/longitude-deg"),
+ fgGetDouble("/position/latitude-deg"));
+ _magneticHeadings = _root->getBoolValue("magnetic-headings");
+
+ if (_root->getBoolValue("centre-on-aircraft")) {
+ _projectionCenter = _aircraft;
+ _root->setBoolValue("centre-on-aircraft", false);
+ }
+
+ double julianDate = globals->get_time_params()->getJD();
+ _magVar->update(_projectionCenter, julianDate);
+
+ bool aircraftUp = _root->getBoolValue("aircraft-heading-up");
+ if (aircraftUp) {
+ _upHeading = fgGetDouble("/orientation/heading-deg");
+ } else {
+ _upHeading = 0.0;
+ }
+
+ SGGeod topLeft = unproject(SGVec2d(_width/2, _height/2));
+ // compute draw range, including a fudge factor for ILSs and other 'long'
+ // symbols
+ _drawRangeNm = SGGeodesy::distanceNm(_projectionCenter, topLeft) + 10.0;
+
+// drawing operations
+ GLint sx = (int) abox.min[0],
+ sy = (int) abox.min[1];
+ glScissor(dx + sx, dy + sy, _width, _height);
+ glEnable(GL_SCISSOR_TEST);
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ // cetere drawing about the widget center (which is also the
+ // projection centre)
+ glTranslated(dx + sx + (_width/2), dy + sy + (_height/2), 0.0);
+
+ drawLatLonGrid();
+
+ if (aircraftUp) {
+ int textHeight = legendFont.getStringHeight() + 5;
+
+ // draw heading line
+ SGVec2d loc = project(_aircraft);
+ glColor3f(1.0, 1.0, 1.0);
+ drawLine(loc, SGVec2d(loc.x(), (_height / 2) - textHeight));
+
+ int displayHdg;
+ if (_magneticHeadings) {
+ displayHdg = (int) fgGetDouble("/orientation/heading-magnetic-deg");
+ } else {
+ displayHdg = (int) _upHeading;
+ }
+
+ double y = (_height / 2) - textHeight;
+ char buf[16];
+ ::snprintf(buf, 16, "%d", displayHdg);
+ int sw = legendFont.getStringWidth(buf);
+ legendFont.drawString(buf, loc.x() - sw/2, y);
+ }
+
+ drawAirports();
+ drawNavaids();
+ drawTraffic();
+ drawGPSData();
+ drawNavRadio(fgGetNode("/instrumentation/nav[0]", false));
+ drawNavRadio(fgGetNode("/instrumentation/nav[1]", false));
+ paintAircraftLocation(_aircraft);
+ paintRoute();
+ paintRuler();
+
+ drawData();
+
+ glPopMatrix();
+ glDisable(GL_SCISSOR_TEST);
+}
+
+void MapWidget::paintRuler()
+{
+ if (_clickGeod == SGGeod()) {
+ return;
+ }
+
+ SGVec2d acftPos = project(_aircraft);
+ SGVec2d clickPos = project(_clickGeod);
+
+ glColor4f(0.0, 1.0, 1.0, 0.6);
+ drawLine(acftPos, clickPos);
+
+ circleAtAlt(clickPos, 8, 10, 5);
+
+ double dist, az, az2;
+ SGGeodesy::inverse(_aircraft, _clickGeod, az, az2, dist);
+ if (_magneticHeadings) {
+ az -= _magVar->get_magvar();
+ SG_NORMALIZE_RANGE(az, 0.0, 360.0);
+ }
+
+ char buffer[1024];
+ ::snprintf(buffer, 1024, "%03d/%.1fnm",
+ SGMiscd::roundToInt(az), dist * SG_METER_TO_NM);
+
+ MapData* d = getOrCreateDataForKey((void*) RULER_LEGEND_KEY);
+ d->setLabel(buffer);
+ d->setAnchor(clickPos);
+ d->setOffset(MapData::VALIGN_TOP | MapData::HALIGN_CENTER, 15);
+ d->setPriority(20000);
+
+
+}
+
+void MapWidget::paintAircraftLocation(const SGGeod& aircraftPos)
+{
+ SGVec2d loc = project(aircraftPos);
+
+ double hdg = fgGetDouble("/orientation/heading-deg");
+
+ glLineWidth(2.0);
+ glColor4f(1.0, 1.0, 0.0, 1.0);
+ glPushMatrix();
+ glTranslated(loc.x(), loc.y(), 0.0);
+ glRotatef(hdg - _upHeading, 0.0, 0.0, -1.0);
+
+ const SGVec2d wingspan(12, 0);
+ const SGVec2d nose(0, 8);
+ const SGVec2d tail(0, -14);
+ const SGVec2d tailspan(4,0);
+
+ drawLine(-wingspan, wingspan);
+ drawLine(nose, tail);
+ drawLine(tail - tailspan, tail + tailspan);
+
+ glPopMatrix();
+ glLineWidth(1.0);
+}
+
+void MapWidget::paintRoute()
+{
+ if (_route->size() < 2) {
+ return;
+ }
+
+// first pass, draw the actual line
+ glLineWidth(2.0);
+ glBegin(GL_LINE_STRIP);
+
+ SGVec2d prev = project(_route->get_waypoint(0).get_target());
+ glVertex2d(prev.x(), prev.y());
+
+ for (int w=1; w < _route->size(); ++w) {
+
+ SGVec2d p = project(_route->get_waypoint(w).get_target());
+
+ if (w < _route->currentWaypoint()) {
+ glColor4f(0.5, 0.5, 0.5, 0.7);
+ } else {
+ glColor4f(1.0, 0.0, 1.0, 1.0);
+ }
+
+ glVertex2d(p.x(), p.y());
+
+ }
+ glEnd();
+
+ glLineWidth(1.0);
+// second pass, draw waypoint symbols and data
+ for (int w=0; w < _route->size(); ++w) {
+ const SGWayPoint& wpt(_route->get_waypoint(w));
+ SGVec2d p = project(wpt.get_target());
+ glColor4f(1.0, 0.0, 1.0, 1.0);
+ circleAtAlt(p, 8, 12, 5);
+
+ std::ostringstream legend;
+ legend << wpt.get_id();
+ if (wpt.get_target_alt() > -9990.0) {
+ legend << '\n' << SGMiscd::roundToInt(wpt.get_target_alt()) << '\'';
+ }
+
+ if (wpt.get_speed() > 0.0) {
+ legend << '\n' << SGMiscd::roundToInt(wpt.get_speed()) << "Kts";
+ }
+
+ MapData* d = getOrCreateDataForKey(reinterpret_cast<void*>(w * 2));
+ d->setText(legend.str());
+ d->setLabel(wpt.get_id());
+ d->setAnchor(p);
+ d->setOffset(MapData::VALIGN_TOP | MapData::HALIGN_CENTER, 15);
+ d->setPriority(w < _route->currentWaypoint() ? 9000 : 12000);
+
+ if (w > 0) {
+ SGVec2d legMid = (prev + p) * 0.5;
+ std::ostringstream legLegend;
+
+ double track = wpt.get_track();
+ if (_magneticHeadings) {
+ track -= _magVar->get_magvar(); // show magnetic track for leg
+ }
+
+ legLegend << SGMiscd::roundToInt(track) << " "
+ << SGMiscd::roundToInt(wpt.get_distance() * SG_METER_TO_NM) << "Nm";
+
+ MapData* ld = getOrCreateDataForKey(reinterpret_cast<void*>(w * 2 + 1));
+ ld->setText(legLegend.str());
+ ld->setAnchor(legMid);
+ ld->setOffset(MapData::VALIGN_TOP | MapData::HALIGN_CENTER, 15);
+ ld->setPriority(w < _route->currentWaypoint() ? 8000 : 11000);
+ } // of draw leg data
+
+ prev = p;
+ } // of second waypoint iteration
+}
+
+/**
+ * Round a SGGeod to an arbitrary precision.
+ * For example, passing precision of 0.5 will round to the nearest 0.5 of
+ * a degree in both lat and lon - passing in 3.0 rounds to the nearest 3 degree
+ * multiple, and so on.
+ */
+static SGGeod roundGeod(double precision, const SGGeod& g)
+{
+ double lon = SGMiscd::round(g.getLongitudeDeg() / precision);
+ double lat = SGMiscd::round(g.getLatitudeDeg() / precision);
+
+ return SGGeod::fromDeg(lon * precision, lat * precision);
+}
+
+bool MapWidget::drawLineClipped(const SGVec2d& a, const SGVec2d& b)
+{
+ double minX = SGMiscd::min(a.x(), b.x()),
+ minY = SGMiscd::min(a.y(), b.y()),
+ maxX = SGMiscd::max(a.x(), b.x()),
+ maxY = SGMiscd::max(a.y(), b.y());
+
+ int hh = _height >> 1, hw = _width >> 1;
+
+ if ((maxX < -hw) || (minX > hw) || (minY > hh) || (maxY < -hh)) {
+ return false;
+ }
+
+ glVertex2dv(a.data());
+ glVertex2dv(b.data());
+ return true;
+}
+
+SGVec2d MapWidget::gridPoint(int ix, int iy)
+{
+ int key = (ix + 0x7fff) | ((iy + 0x7fff) << 16);
+ GridPointCache::iterator it = _gridCache.find(key);
+ if (it != _gridCache.end()) {
+ return it->second;
+ }
+
+ SGGeod gp = SGGeod::fromDeg(
+ _gridCenter.getLongitudeDeg() + ix * _gridSpacing,
+ _gridCenter.getLatitudeDeg() + iy * _gridSpacing);
+
+ SGVec2d proj = project(gp);
+ _gridCache[key] = proj;
+ return proj;
+}
+
+void MapWidget::drawLatLonGrid()
+{
+ _gridSpacing = 1.0;
+ _gridCenter = roundGeod(_gridSpacing, _projectionCenter);
+ _gridCache.clear();
+
+ int ix = 0;
+ int iy = 0;
+
+ glColor4f(0.8, 0.8, 0.8, 0.4);
+ glBegin(GL_LINES);
+ bool didDraw;
+ do {
+ didDraw = false;
+ ++ix;
+ ++iy;
+
+ for (int x = -ix; x < ix; ++x) {
+ didDraw |= drawLineClipped(gridPoint(x, -iy), gridPoint(x+1, -iy));
+ didDraw |= drawLineClipped(gridPoint(x, iy), gridPoint(x+1, iy));
+ didDraw |= drawLineClipped(gridPoint(x, -iy), gridPoint(x, -iy + 1));
+ didDraw |= drawLineClipped(gridPoint(x, iy), gridPoint(x, iy - 1));
+
+ }
+
+ for (int y = -iy; y < iy; ++y) {
+ didDraw |= drawLineClipped(gridPoint(-ix, y), gridPoint(-ix, y+1));
+ didDraw |= drawLineClipped(gridPoint(-ix, y), gridPoint(-ix + 1, y));
+ didDraw |= drawLineClipped(gridPoint(ix, y), gridPoint(ix, y+1));
+ didDraw |= drawLineClipped(gridPoint(ix, y), gridPoint(ix - 1, y));
+ }
+
+ if (ix > 30) {
+ break;
+ }
+ } while (didDraw);
+
+ glEnd();
+}
+
+void MapWidget::drawGPSData()
+{
+ std::string gpsMode = _gps->getStringValue("mode");
+
+ SGGeod wp0Geod = SGGeod::fromDeg(
+ _gps->getDoubleValue("wp/wp[0]/longitude-deg"),
+ _gps->getDoubleValue("wp/wp[0]/latitude-deg"));
+
+ SGGeod wp1Geod = SGGeod::fromDeg(
+ _gps->getDoubleValue("wp/wp[1]/longitude-deg"),
+ _gps->getDoubleValue("wp/wp[1]/latitude-deg"));
+
+// draw track line
+ double gpsTrackDeg = _gps->getDoubleValue("indicated-track-true-deg");
+ double gpsSpeed = _gps->getDoubleValue("indicated-ground-speed-kt");
+ double az2;
+
+ if (gpsSpeed > 3.0) { // only draw track line if valid
+ SGGeod trackRadial;
+ SGGeodesy::direct(_aircraft, gpsTrackDeg, _drawRangeNm * SG_NM_TO_METER, trackRadial, az2);
+
+ glColor4f(1.0, 1.0, 0.0, 1.0);
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple(1, 0x00FF);
+ drawLine(project(_aircraft), project(trackRadial));
+ glDisable(GL_LINE_STIPPLE);
+ }
+
+ if (gpsMode == "dto") {
+ SGVec2d wp0Pos = project(wp0Geod);
+ SGVec2d wp1Pos = project(wp1Geod);
+
+ glColor4f(1.0, 0.0, 1.0, 1.0);
+ drawLine(wp0Pos, wp1Pos);
+
+ }
+
+ if (_gps->getBoolValue("scratch/valid")) {
+ // draw scratch data
+
+ }
+}
+
+class MapAirportFilter : public FGAirport::AirportFilter
+{
+public:
+ MapAirportFilter(SGPropertyNode_ptr nd)
+ {
+ _heliports = nd->getBoolValue("show-heliports", false);
+ _hardRunwaysOnly = nd->getBoolValue("hard-surfaced-airports", true);
+ _minLengthFt = nd->getDoubleValue("min-runway-length-ft", 2000.0);
+ }
+
+ virtual FGPositioned::Type maxType() const {
+ return _heliports ? FGPositioned::HELIPORT : FGPositioned::AIRPORT;
+ }
+
+ virtual bool passAirport(FGAirport* aApt) const {
+ if (_hardRunwaysOnly) {
+ return aApt->hasHardRunwayOfLengthFt(_minLengthFt);
+ }
+
+ return true;
+ }
+
+private:
+ bool _heliports;
+ bool _hardRunwaysOnly;
+ double _minLengthFt;
+};
+
+void MapWidget::drawAirports()
+{
+ MapAirportFilter af(_root);
+ FGPositioned::List apts = FGPositioned::findWithinRange(_projectionCenter, _drawRangeNm, &af);
+ for (unsigned int i=0; i<apts.size(); ++i) {
+ drawAirport((FGAirport*) apts[i].get());
+ }
+}
+
+class NavaidFilter : public FGPositioned::Filter
+{
+public:
+ NavaidFilter(bool fixesEnabled, bool navaidsEnabled) :
+ _fixes(fixesEnabled),
+ _navaids(navaidsEnabled)
+ {}
+
+ virtual bool pass(FGPositioned* aPos) const {
+ if (_fixes && (aPos->type() == FGPositioned::FIX)) {
+ // ignore fixes which end in digits - expirmental
+ if (isdigit(aPos->ident()[3]) && isdigit(aPos->ident()[4])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ virtual FGPositioned::Type minType() const {
+ return _fixes ? FGPositioned::FIX : FGPositioned::VOR;
+ }
+
+ virtual FGPositioned::Type maxType() const {
+ return _navaids ? FGPositioned::NDB : FGPositioned::FIX;
+ }
+
+private:
+ bool _fixes, _navaids;
+};
+
+void MapWidget::drawNavaids()
+{
+ bool fixes = _root->getBoolValue("draw-fixes");
+ NavaidFilter f(fixes, _root->getBoolValue("draw-navaids"));
+
+ if (f.minType() <= f.maxType()) {
+ FGPositioned::List navs = FGPositioned::findWithinRange(_projectionCenter, _drawRangeNm, &f);
+
+ glLineWidth(1.0);
+ for (unsigned int i=0; i<navs.size(); ++i) {
+ FGPositioned::Type ty = navs[i]->type();
+ if (ty == FGPositioned::NDB) {
+ drawNDB(false, (FGNavRecord*) navs[i].get());
+ } else if (ty == FGPositioned::VOR) {
+ drawVOR(false, (FGNavRecord*) navs[i].get());
+ } else if (ty == FGPositioned::FIX) {
+ drawFix((FGFix*) navs[i].get());
+ }
+ } // of navaid iteration
+ } // of navaids || fixes are drawn test
+}
+
+void MapWidget::drawNDB(bool tuned, FGNavRecord* ndb)
+{
+ SGVec2d pos = project(ndb->geod());
+
+ if (tuned) {
+ glColor3f(0.0, 1.0, 1.0);
+ } else {
+ glColor3f(0.0, 0.0, 0.0);
+ }
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple(1, 0x00FF);
+ circleAt(pos, 20, 6);
+ circleAt(pos, 20, 10);
+ glDisable(GL_LINE_STIPPLE);
+
+ if (validDataForKey(ndb)) {
+ setAnchorForKey(ndb, pos);
+ return;
+ }
+
+ char buffer[1024];
+ ::snprintf(buffer, 1024, "%s\n%s %3.0fKhz",
+ ndb->name().c_str(), ndb->ident().c_str(),ndb->get_freq()/100.0);
+
+ MapData* d = createDataForKey(ndb);
+ d->setPriority(40);
+ d->setLabel(ndb->ident());
+ d->setText(buffer);
+ d->setOffset(MapData::HALIGN_CENTER | MapData::VALIGN_BOTTOM, 10);
+ d->setAnchor(pos);
+
+}
+
+void MapWidget::drawVOR(bool tuned, FGNavRecord* vor)
+{
+ SGVec2d pos = project(vor->geod());
+ if (tuned) {
+ glColor3f(0.0, 1.0, 1.0);
+ } else {
+ glColor3f(0.0, 0.0, 1.0);
+ }
+
+ circleAt(pos, 6, 8);
+
+ if (validDataForKey(vor)) {
+ setAnchorForKey(vor, pos);
+ return;
+ }
+
+ char buffer[1024];
+ ::snprintf(buffer, 1024, "%s\n%s %6.3fMhz",
+ vor->name().c_str(), vor->ident().c_str(),
+ vor->get_freq() / 100.0);
+
+ MapData* d = createDataForKey(vor);
+ d->setText(buffer);
+ d->setLabel(vor->ident());
+ d->setPriority(tuned ? 10000 : 100);
+ d->setOffset(MapData::HALIGN_CENTER | MapData::VALIGN_BOTTOM, 12);
+ d->setAnchor(pos);
+}
+
+void MapWidget::drawFix(FGFix* fix)
+{
+ SGVec2d pos = project(fix->geod());
+ glColor3f(0.0, 0.0, 0.0);
+ circleAt(pos, 3, 6);
+
+ if (_zoom > SHOW_DETAIL_ZOOM) {
+ return; // hide fix labels beyond a certain zoom level
+ }
+
+ if (validDataForKey(fix)) {
+ setAnchorForKey(fix, pos);
+ return;
+ }
+
+ MapData* d = createDataForKey(fix);
+ d->setLabel(fix->ident());
+ d->setPriority(20);
+ d->setOffset(MapData::VALIGN_CENTER | MapData::HALIGN_LEFT, 10);
+ d->setAnchor(pos);
+}
+
+void MapWidget::drawNavRadio(SGPropertyNode_ptr radio)
+{
+ if (!radio || radio->getBoolValue("slaved-to-gps", false)
+ || !radio->getBoolValue("in-range", false)) {
+ return;
+ }
+
+ if (radio->getBoolValue("nav-loc", false)) {
+ drawTunedLocalizer(radio);
+ }
+
+ // identify the tuned station - unfortunately we don't get lat/lon directly,
+ // need to do the frequency search again
+ double mhz = radio->getDoubleValue("frequencies/selected-mhz", 0.0);
+ FGNavRecord* nav = globals->get_navlist()->findByFreq(mhz, _aircraft);
+ if (!nav || (nav->ident() != radio->getStringValue("nav-id"))) {
+ // mismatch between navradio selection logic and ours!
+ return;
+ }
+
+ glLineWidth(1.0);
+ drawVOR(true, nav);
+
+ SGVec2d pos = project(nav->geod());
+ SGGeod range;
+ double az2;
+ double trueRadial = radio->getDoubleValue("radials/target-radial-deg");
+ SGGeodesy::direct(nav->geod(), trueRadial, nav->get_range() * SG_NM_TO_METER, range, az2);
+ SGVec2d prange = project(range);
+
+ SGVec2d norm = normalize(prange - pos);
+ SGVec2d perp(norm.y(), -norm.x());
+
+ circleAt(pos, 64, length(prange - pos));
+ drawLine(pos, prange);
+
+// draw to/from arrows
+ SGVec2d midPoint = (pos + prange) * 0.5;
+ if (radio->getBoolValue("from-flag")) {
+ norm = -norm;
+ perp = -perp;
+ }
+
+ int sz = 10;
+ SGVec2d arrowB = midPoint - (norm * sz) + (perp * sz);
+ SGVec2d arrowC = midPoint - (norm * sz) - (perp * sz);
+ drawLine(midPoint, arrowB);
+ drawLine(arrowB, arrowC);
+ drawLine(arrowC, midPoint);
+
+ drawLine(pos, (2 * pos) - prange); // reciprocal radial
+}
+
+void MapWidget::drawTunedLocalizer(SGPropertyNode_ptr radio)
+{
+ double mhz = radio->getDoubleValue("frequencies/selected-mhz", 0.0);
+ FGNavRecord* loc = globals->get_loclist()->findByFreq(mhz, _aircraft);
+ if (!loc || (loc->ident() != radio->getStringValue("nav-id"))) {
+ // mismatch between navradio selection logic and ours!
+ return;
+ }
+
+ if (loc->runway()) {
+ drawILS(true, loc->runway());
+ }
+}
+
+/*
+void MapWidget::drawObstacle(FGPositioned* obs)
+{
+ SGVec2d pos = project(obs->geod());
+ glColor3f(0.0, 0.0, 0.0);
+ glLineWidth(2.0);
+ drawLine(pos, pos + SGVec2d());
+}
+*/
+
+void MapWidget::drawAirport(FGAirport* apt)
+{
+ // draw tower location
+ SGVec2d towerPos = project(apt->getTowerLocation());
+
+ if (_zoom <= SHOW_DETAIL_ZOOM) {
+ glColor3f(1.0, 1.0, 1.0);
+ glLineWidth(1.0);
+
+ drawLine(towerPos + SGVec2d(3, 0), towerPos + SGVec2d(3, 10));
+ drawLine(towerPos + SGVec2d(-3, 0), towerPos + SGVec2d(-3, 10));
+ drawLine(towerPos + SGVec2d(-6, 20), towerPos + SGVec2d(-3, 10));
+ drawLine(towerPos + SGVec2d(6, 20), towerPos + SGVec2d(3, 10));
+ drawLine(towerPos + SGVec2d(-6, 20), towerPos + SGVec2d(6, 20));
+ }
+
+ if (validDataForKey(apt)) {
+ setAnchorForKey(apt, towerPos);
+ } else {
+ char buffer[1024];
+ ::snprintf(buffer, 1024, "%s\n%s",
+ apt->ident().c_str(), apt->name().c_str());
+
+ MapData* d = createDataForKey(apt);
+ d->setText(buffer);
+ d->setLabel(apt->ident());
+ d->setPriority(100 + scoreAirportRunways(apt));
+ d->setOffset(MapData::VALIGN_TOP | MapData::HALIGN_CENTER, 6);
+ d->setAnchor(towerPos);
+ }
+
+ if (_zoom > SHOW_DETAIL_ZOOM) {
+ return;
+ }
+
+ for (unsigned int r=0; r<apt->numRunways(); ++r) {
+ FGRunway* rwy = apt->getRunwayByIndex(r);
+ if (!rwy->isReciprocal()) {
+ drawRunwayPre(rwy);
+ }
+ }
+
+ for (unsigned int r=0; r<apt->numRunways(); ++r) {
+ FGRunway* rwy = apt->getRunwayByIndex(r);
+ if (!rwy->isReciprocal()) {
+ drawRunway(rwy);
+ }
+
+ if (rwy->ILS()) {
+ drawILS(false, rwy);
+ }
+ } // of runway iteration
+
+}
+
+int MapWidget::scoreAirportRunways(FGAirport* apt)
+{
+ bool needHardSurface = _root->getBoolValue("hard-surfaced-airports", true);
+ double minLength = _root->getDoubleValue("min-runway-length-ft", 2000.0);
+
+ int score = 0;
+ unsigned int numRunways(apt->numRunways());
+ for (unsigned int r=0; r<numRunways; ++r) {
+ FGRunway* rwy = apt->getRunwayByIndex(r);
+ if (rwy->isReciprocal()) {
+ continue;
+ }
+
+ if (needHardSurface && !rwy->isHardSurface()) {
+ continue;
+ }
+
+ if (rwy->lengthFt() < minLength) {
+ continue;
+ }
+
+ int scoreLength = SGMiscd::roundToInt(rwy->lengthFt() / 200.0);
+ score += scoreLength;
+ } // of runways iteration
+
+ return score;
+}
+
+void MapWidget::drawRunwayPre(FGRunway* rwy)
+{
+ SGVec2d p1 = project(rwy->begin());
+ SGVec2d p2 = project(rwy->end());
+
+ glLineWidth(4.0);
+ glColor3f(1.0, 0.0, 1.0);
+ drawLine(p1, p2);
+}
+
+void MapWidget::drawRunway(FGRunway* rwy)
+{
+ // line for runway
+ // optionally show active, stopway, etc
+ // in legend, show published heading and length
+ // and threshold elevation
+
+ SGVec2d p1 = project(rwy->begin());
+ SGVec2d p2 = project(rwy->end());
+ glLineWidth(2.0);
+ glColor3f(1.0, 1.0, 1.0);
+ SGVec2d inset = normalize(p2 - p1) * 2;
+
+ drawLine(p1 + inset, p2 - inset);
+
+ if (validDataForKey(rwy)) {
+ setAnchorForKey(rwy, (p1 + p2) * 0.5);
+ return;
+ }
+
+ char buffer[1024];
+ ::snprintf(buffer, 1024, "%s/%s\n%3.0f/%3.0f\n%.0f'",
+ rwy->ident().c_str(),
+ rwy->reciprocalRunway()->ident().c_str(),
+ rwy->headingDeg(),
+ rwy->reciprocalRunway()->headingDeg(),
+ rwy->lengthFt());
+
+ MapData* d = createDataForKey(rwy);
+ d->setText(buffer);
+ d->setLabel(rwy->ident() + "/" + rwy->reciprocalRunway()->ident());
+ d->setPriority(50);
+ d->setOffset(MapData::HALIGN_CENTER | MapData::VALIGN_BOTTOM, 12);
+ d->setAnchor((p1 + p2) * 0.5);
+}
+
+void MapWidget::drawILS(bool tuned, FGRunway* rwy)
+{
+ // arrow, tip centered on the landing threshold
+ // using LOC transmitter position would be more accurate, but
+ // is visually cluttered
+ // arrow width is based upon the computed localizer width
+
+ FGNavRecord* loc = rwy->ILS();
+ double halfBeamWidth = loc->localizerWidth() * 0.5;
+ SGVec2d t = project(rwy->threshold());
+ SGGeod locEnd;
+ double rangeM = loc->get_range() * SG_NM_TO_METER;
+ double radial = loc->get_multiuse();
+ SG_NORMALIZE_RANGE(radial, 0.0, 360.0);
+ double az2;
+
+// compute the three end points at the widge end of the arrow
+ SGGeodesy::direct(loc->geod(), radial, -rangeM, locEnd, az2);
+ SGVec2d endCentre = project(locEnd);
+
+ SGGeodesy::direct(loc->geod(), radial + halfBeamWidth, -rangeM * 1.1, locEnd, az2);
+ SGVec2d endR = project(locEnd);
+
+ SGGeodesy::direct(loc->geod(), radial - halfBeamWidth, -rangeM * 1.1, locEnd, az2);
+ SGVec2d endL = project(locEnd);
+
+// outline two triangles
+ glLineWidth(1.0);
+ if (tuned) {
+ glColor3f(0.0, 1.0, 1.0);
+ } else {
+ glColor3f(0.0, 0.0, 1.0);
+ }
+
+ glBegin(GL_LINE_LOOP);
+ glVertex2dv(t.data());
+ glVertex2dv(endCentre.data());
+ glVertex2dv(endL.data());
+ glEnd();
+ glBegin(GL_LINE_LOOP);
+ glVertex2dv(t.data());
+ glVertex2dv(endCentre.data());
+ glVertex2dv(endR.data());
+ glEnd();
+}
+
+void MapWidget::drawTraffic()
+{
+ if (!_root->getBoolValue("draw-traffic")) {
+ return;
+ }
+
+ if (_zoom > SHOW_DETAIL_ZOOM) {
+ return;
+ }
+
+ const SGPropertyNode* ai = fgGetNode("/ai/models", true);
+
+ for (int i = 0; i < ai->nChildren(); ++i) {
+ const SGPropertyNode *model = ai->getChild(i);
+ // skip bad or dead entries
+ if (!model || model->getIntValue("id", -1) < 0) {
+ continue;
+ }
+
+ const std::string& name(model->getName());
+ SGGeod pos = SGGeod::fromDegFt(
+ model->getDoubleValue("position/longitude-deg"),
+ model->getDoubleValue("position/latitude-deg"),
+ model->getDoubleValue("position/altitude-ft"));
+
+ double dist = SGGeodesy::distanceNm(_projectionCenter, pos);
+ if (dist > _drawRangeNm) {
+ continue;
+ }
+
+ double heading = model->getDoubleValue("orientation/true-heading-deg");
+ if ((name == "aircraft") || (name == "multiplayer") ||
+ (name == "wingman") || (name == "tanker")) {
+ drawAIAircraft(model, pos, heading);
+ } else if ((name == "ship") || (name == "carrier") || (name == "escort")) {
+ drawAIShip(model, pos, heading);
+ }
+ } // of ai/models iteration
+}
+
+void MapWidget::drawAIAircraft(const SGPropertyNode* model, const SGGeod& pos, double hdg)
+{
+
+ SGVec2d p = project(pos);
+
+ glColor3f(0.0, 0.0, 0.0);
+ glLineWidth(2.0);
+ circleAt(p, 4, 6.0); // black diamond
+
+// draw heading vector
+ int speedKts = static_cast<int>(model->getDoubleValue("velocities/true-airspeed-kt"));
+ if (speedKts > 1) {
+ glLineWidth(1.0);
+
+ const double dt = 15.0 / (3600.0); // 15 seconds look-ahead
+ double distanceM = speedKts * SG_NM_TO_METER * dt;
+
+ SGGeod advance;
+ double az2;
+ SGGeodesy::direct(pos, hdg, distanceM, advance, az2);
+
+ drawLine(p, project(advance));
+ }
+
+ if (validDataForKey((void*) model)) {
+ setAnchorForKey((void*) model, p);
+ return;
+ }
+
+ // draw callsign / altitude / speed
+
+
+ char buffer[1024];
+ ::snprintf(buffer, 1024, "%s\n%d'\n%dkts",
+ model->getStringValue("callsign", "<>"),
+ static_cast<int>(pos.getElevationFt() / 50.0) * 50,
+ speedKts);
+
+ MapData* d = createDataForKey((void*) model);
+ d->setText(buffer);
+ d->setLabel(model->getStringValue("callsign", "<>"));
+ d->setPriority(speedKts > 5 ? 60 : 10); // low priority for parked aircraft
+ d->setOffset(MapData::VALIGN_CENTER | MapData::HALIGN_LEFT, 10);
+ d->setAnchor(p);
+
+}
+
+void MapWidget::drawAIShip(const SGPropertyNode* model, const SGGeod& pos, double hdg)
+{
+
+}
+
+SGVec2d MapWidget::project(const SGGeod& geod) const
+{
+ // Sanson-Flamsteed projection, relative to the projection center
+ double r = earth_radius_lat(geod.getLatitudeRad());
+ double lonDiff = geod.getLongitudeRad() - _projectionCenter.getLongitudeRad(),
+ latDiff = geod.getLatitudeRad() - _projectionCenter.getLatitudeRad();
+
+ SGVec2d p = SGVec2d(cos(geod.getLatitudeRad()) * lonDiff, latDiff) * r * currentScale();
+
+// rotate as necessary
+ double cost = cos(_upHeading * SG_DEGREES_TO_RADIANS),
+ sint = sin(_upHeading * SG_DEGREES_TO_RADIANS);
+ double rx = cost * p.x() - sint * p.y();
+ double ry = sint * p.x() + cost * p.y();
+ return SGVec2d(rx, ry);
+}
+
+SGGeod MapWidget::unproject(const SGVec2d& p) const
+{
+ // unrotate, if necessary
+ double cost = cos(-_upHeading * SG_DEGREES_TO_RADIANS),
+ sint = sin(-_upHeading * SG_DEGREES_TO_RADIANS);
+ SGVec2d ur(cost * p.x() - sint * p.y(),
+ sint * p.x() + cost * p.y());
+
+ double r = earth_radius_lat(_projectionCenter.getLatitudeRad());
+ SGVec2d unscaled = ur * (1.0 / (currentScale() * r));
+
+ double lat = unscaled.y() + _projectionCenter.getLatitudeRad();
+ double lon = (unscaled.x() / cos(lat)) + _projectionCenter.getLongitudeRad();
+
+ return SGGeod::fromRad(lon, lat);
+}
+
+double MapWidget::currentScale() const
+{
+ return 1.0 / pow(2.0, _zoom);
+}
+
+void MapWidget::circleAt(const SGVec2d& center, int nSides, double r)
+{
+ glBegin(GL_LINE_LOOP);
+ double advance = (SGD_PI * 2) / nSides;
+ glVertex2d(center.x(), center.y() + r);
+ double t=advance;
+ for (int i=1; i<nSides; ++i) {
+ glVertex2d(center.x() + (sin(t) * r), center.y() + (cos(t) * r));
+ t += advance;
+ }
+ glEnd();
+}
+
+void MapWidget::circleAtAlt(const SGVec2d& center, int nSides, double r, double r2)
+{
+ glBegin(GL_LINE_LOOP);
+ double advance = (SGD_PI * 2) / nSides;
+ glVertex2d(center.x(), center.y() + r);
+ double t=advance;
+ for (int i=1; i<nSides; ++i) {
+ double rr = (i%2 == 0) ? r : r2;
+ glVertex2d(center.x() + (sin(t) * rr), center.y() + (cos(t) * rr));
+ t += advance;
+ }
+ glEnd();
+}
+
+void MapWidget::drawLine(const SGVec2d& p1, const SGVec2d& p2)
+{
+ glBegin(GL_LINES);
+ glVertex2dv(p1.data());
+ glVertex2dv(p2.data());
+ glEnd();
+}
+
+void MapWidget::drawLegendBox(const SGVec2d& pos, const std::string& t)
+{
+ std::vector<std::string> lines(simgear::strutils::split(t, "\n"));
+ const int LINE_LEADING = 4;
+ const int MARGIN = 4;
+
+// measure
+ int maxWidth = -1, totalHeight = 0;
+ int lineHeight = legendFont.getStringHeight();
+
+ for (unsigned int ln=0; ln<lines.size(); ++ln) {
+ totalHeight += lineHeight;
+ if (ln > 0) {
+ totalHeight += LINE_LEADING;
+ }
+
+ int lw = legendFont.getStringWidth(lines[ln].c_str());
+ maxWidth = std::max(maxWidth, lw);
+ } // of line measurement
+
+ if (maxWidth < 0) {
+ return; // all lines are empty, don't draw
+ }
+
+ totalHeight += MARGIN * 2;
+
+// draw box
+ puBox box;
+ box.min[0] = 0;
+ box.min[1] = -totalHeight;
+ box.max[0] = maxWidth + (MARGIN * 2);
+ box.max[1] = 0;
+ int border = 1;
+ box.draw (pos.x(), pos.y(), PUSTYLE_DROPSHADOW, colour, FALSE, border);
+
+// draw lines
+ int xPos = pos.x() + MARGIN;
+ int yPos = pos.y() - (lineHeight + MARGIN);
+ glColor3f(0.8, 0.8, 0.8);
+
+ for (unsigned int ln=0; ln<lines.size(); ++ln) {
+ legendFont.drawString(lines[ln].c_str(), xPos, yPos);
+ yPos -= lineHeight + LINE_LEADING;
+ }
+}
+
+void MapWidget::drawData()
+{
+ std::sort(_dataQueue.begin(), _dataQueue.end(), MapData::order);
+
+ int hw = _width >> 1,
+ hh = _height >> 1;
+ puBox visBox(makePuBox(-hw, -hh, _width, _height));
+
+ unsigned int d = 0;
+ int drawn = 0;
+ std::vector<MapData*> drawQueue;
+
+ bool drawData = _root->getBoolValue("draw-data");
+ const int MAX_DRAW_DATA = 25;
+ const int MAX_DRAW = 50;
+
+ for (; (d < _dataQueue.size()) && (drawn < MAX_DRAW); ++d) {
+ MapData* md = _dataQueue[d];
+ md->setDataVisible(drawData);
+
+ if (md->isClipped(visBox)) {
+ continue;
+ }
+
+ if (md->overlaps(drawQueue)) {
+ if (drawData) { // overlapped with data, let's try just the label
+ md->setDataVisible(false);
+ if (md->overlaps(drawQueue)) {
+ continue;
+ }
+ } else {
+ continue;
+ }
+ } // of overlaps case
+
+ drawQueue.push_back(md);
+ ++drawn;
+ if (drawData && (drawn >= MAX_DRAW_DATA)) {
+ drawData = false;
+ }
+ }
+
+ // draw lowest-priority first, so higher-priorty items appear on top
+ std::vector<MapData*>::reverse_iterator r;
+ for (r = drawQueue.rbegin(); r!= drawQueue.rend(); ++r) {
+ (*r)->draw();
+ }
+
+ _dataQueue.clear();
+ KeyDataMap::iterator it = _mapData.begin();
+ for (; it != _mapData.end(); ) {
+ it->second->age();
+ if (it->second->isExpired()) {
+ delete it->second;
+ KeyDataMap::iterator cur = it++;
+ _mapData.erase(cur);
+ } else {
+ ++it;
+ }
+ } // of expiry iteration
+}
+
+bool MapWidget::validDataForKey(void* key)
+{
+ KeyDataMap::iterator it = _mapData.find(key);
+ if (it == _mapData.end()) {
+ return false; // no valid data for the key!
+ }
+
+ it->second->resetAge(); // mark data as valid this frame
+ _dataQueue.push_back(it->second);
+ return true;
+}
+
+void MapWidget::setAnchorForKey(void* key, const SGVec2d& anchor)
+{
+ KeyDataMap::iterator it = _mapData.find(key);
+ if (it == _mapData.end()) {
+ throw sg_exception("no valid data for key!");
+ }
+
+ it->second->setAnchor(anchor);
+}
+
+MapData* MapWidget::getOrCreateDataForKey(void* key)
+{
+ KeyDataMap::iterator it = _mapData.find(key);
+ if (it == _mapData.end()) {
+ return createDataForKey(key);
+ }
+
+ it->second->resetAge(); // mark data as valid this frame
+ _dataQueue.push_back(it->second);
+ return it->second;
+}
+
+MapData* MapWidget::createDataForKey(void* key)
+{
+ KeyDataMap::iterator it = _mapData.find(key);
+ if (it != _mapData.end()) {
+ throw sg_exception("duplicate data requested for key!");
+ }
+
+ MapData* d = new MapData(0);
+ _mapData[key] = d;
+ _dataQueue.push_back(d);
+ d->resetAge();
+ return d;
+}
--- /dev/null
+#ifndef GUI_MAPWIDGET_HXX
+#define GUI_MAPWIDGET_HXX
+
+#include <simgear/compiler.h>
+#include <simgear/math/SGMath.hxx>
+#include <simgear/props/props.hxx>
+
+#include <plib/pu.h>
+
+#include "dialog.hxx" // for GUI_ID
+
+// forward decls
+class FGRouteMgr;
+class FGRunway;
+class FGAirport;
+class FGNavRecord;
+class FGFix;
+class MapData;
+class SGMagVar;
+
+class MapWidget : public puObject
+{
+public:
+ MapWidget(int x, int y, int width, int height);
+ virtual ~MapWidget();
+
+ virtual void setSize(int width, int height);
+ virtual void doHit( int button, int updown, int x, int y ) ;
+ virtual void draw( int dx, int dy ) ;
+ virtual int checkKey(int key, int updown);
+
+ void setProperty(SGPropertyNode_ptr prop);
+private:
+ void handlePan(int x, int y);
+
+ void pan(const SGVec2d& delta);
+ void zoomIn();
+ void zoomOut();
+
+ void paintAircraftLocation(const SGGeod& aircraftPos);
+ void paintRoute();
+ void paintRuler();
+
+ void drawGPSData();
+ void drawNavRadio(SGPropertyNode_ptr radio);
+ void drawTunedLocalizer(SGPropertyNode_ptr radio);
+
+ void drawLatLonGrid();
+ SGVec2d gridPoint(int ix, int iy);
+ bool drawLineClipped(const SGVec2d& a, const SGVec2d& b);
+
+ void drawAirports();
+ void drawAirport(FGAirport* apt);
+ int scoreAirportRunways(FGAirport* apt);
+ void drawRunwayPre(FGRunway* rwy);
+ void drawRunway(FGRunway* rwy);
+ void drawILS(bool tuned, FGRunway* rwy);
+
+ void drawNavaids();
+ void drawNDB(bool tuned, FGNavRecord* nav);
+ void drawVOR(bool tuned, FGNavRecord* nav);
+ void drawFix(FGFix* fix);
+
+ void drawTraffic();
+ void drawAIAircraft(const SGPropertyNode* model, const SGGeod& pos, double hdg);
+ void drawAIShip(const SGPropertyNode* model, const SGGeod& pos, double hdg);
+
+ void drawData();
+ bool validDataForKey(void* key);
+ MapData* getOrCreateDataForKey(void* key);
+ MapData* createDataForKey(void* key);
+ void setAnchorForKey(void* key, const SGVec2d& anchor);
+
+ SGVec2d project(const SGGeod& geod) const;
+ SGGeod unproject(const SGVec2d& p) const;
+ double currentScale() const;
+
+ void circleAt(const SGVec2d& center, int nSides, double r);
+ void circleAtAlt(const SGVec2d& center, int nSides, double r, double r2);
+ void drawLine(const SGVec2d& p1, const SGVec2d& p2);
+ void drawLegendBox(const SGVec2d& pos, const std::string& t);
+
+ int _width, _height;
+ int _zoom;
+ double _drawRangeNm;
+ double _upHeading; // true heading corresponding to +ve y-axis
+ bool _magneticHeadings;
+
+ SGGeod _projectionCenter;
+ SGGeod _aircraft;
+ SGGeod _clickGeod;
+ SGVec2d _hitLocation;
+ FGRouteMgr* _route;
+ SGPropertyNode_ptr _root;
+ SGPropertyNode_ptr _gps;
+
+ typedef std::map<void*, MapData*> KeyDataMap;
+ KeyDataMap _mapData;
+ std::vector<MapData*> _dataQueue;
+
+ SGMagVar* _magVar;
+
+ typedef std::map<int, SGVec2d> GridPointCache;
+ GridPointCache _gridCache;
+ double _gridSpacing;
+ SGGeod _gridCenter;
+};
+
+#endif // of GUI_MAPWIDGET_HXX
--- /dev/null
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "WaypointList.hxx"
+
+#include <algorithm>
+#include <plib/puAux.h>
+
+#include <simgear/route/waypoint.hxx>
+#include <simgear/structure/callback.hxx>
+#include <simgear/sg_inlines.h>
+
+#include <Main/globals.hxx>
+#include <Main/fg_props.hxx>
+
+#include <Autopilot/route_mgr.hxx>
+
+enum {
+ SCROLL_NO = 0,
+ SCROLL_UP,
+ SCROLL_DOWN
+};
+
+static const int DRAG_START_DISTANCE_PX = 5;
+
+class RouteManagerWaypointModel :
+ public WaypointList::Model,
+ public SGPropertyChangeListener
+{
+public:
+ RouteManagerWaypointModel()
+ {
+ _rm = static_cast<FGRouteMgr*>(globals->get_subsystem("route-manager"));
+
+ SGPropertyNode* routeEdited = fgGetNode("/autopilot/route-manager/signals/edited", true);
+ routeEdited->addChangeListener(this);
+ }
+
+ virtual ~RouteManagerWaypointModel()
+ {
+ SGPropertyNode* routeEdited = fgGetNode("/autopilot/route-manager/signals/edited", true);
+ routeEdited->removeChangeListener(this);
+ }
+
+// implement WaypointList::Model
+ virtual unsigned int numWaypoints() const
+ {
+ return _rm->size();
+ }
+
+ virtual int currentWaypoint() const
+ {
+ return _rm->currentWaypoint();
+ }
+
+ virtual SGWayPoint waypointAt(unsigned int index) const
+ {
+ return _rm->get_waypoint(index);
+ }
+
+ virtual void deleteAt(unsigned int index)
+ {
+ _rm->pop_waypoint(index);
+ }
+
+ virtual void setWaypointTargetAltitudeFt(unsigned int index, int altFt)
+ {
+ _rm->setWaypointTargetAltitudeFt(index, altFt);
+ }
+
+ virtual void moveWaypointToIndex(unsigned int srcIndex, unsigned int destIndex)
+ {
+ if (destIndex > srcIndex) {
+ --destIndex;
+ }
+
+ SGWayPoint wp = _rm->pop_waypoint(srcIndex);
+ _rm->add_waypoint(wp, destIndex);
+ }
+
+ virtual void setUpdateCallback(SGCallback* cb)
+ {
+ _cb = cb;
+ }
+
+// implement SGPropertyChangeListener
+ void valueChanged(SGPropertyNode *prop)
+ {
+ if (_cb) {
+ (*_cb)();
+ }
+ }
+private:
+ FGRouteMgr* _rm;
+ SGCallback* _cb;
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+static void drawClippedString(puFont& font, const char* s, int x, int y, int maxWidth)
+{
+ int fullWidth = font.getStringWidth(s);
+ if (fullWidth <= maxWidth) { // common case, easy and efficent
+ font.drawString(s, x, y);
+ return;
+ }
+
+ std::string buf(s);
+ int len = buf.size();
+ do {
+ buf.resize(--len);
+ fullWidth = font.getStringWidth(buf.c_str());
+ } while (fullWidth > maxWidth);
+
+ font.drawString(buf.c_str(), x, y);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+WaypointList::WaypointList(int x, int y, int width, int height) :
+ puFrame(x, y, width, height),
+ GUI_ID(FGCLASS_WAYPOINTLIST),
+ _scrollPx(0),
+ _dragging(false),
+ _dragScroll(SCROLL_NO),
+ _showLatLon(false),
+ _model(NULL),
+ _updateCallback(NULL),
+ _scrollCallback(NULL)
+{
+ // pretend to be a list, so fgPopup doesn't mess with our mouse events
+ type |= PUCLASS_LIST;
+ setModel(new RouteManagerWaypointModel());
+ setSize(width, height);
+ setValue(-1);
+}
+
+WaypointList::~WaypointList()
+{
+ delete _model;
+ delete _updateCallback;
+ delete _scrollCallback;
+}
+
+void WaypointList::setUpdateCallback(SGCallback* cb)
+{
+ _updateCallback = cb;
+}
+
+void WaypointList::setScrollCallback(SGCallback* cb)
+{
+ _scrollCallback = cb;
+}
+
+void WaypointList::setSize(int width, int height)
+{
+ double scrollP = getVScrollPercent();
+ _heightPx = height;
+ puFrame::setSize(width, height);
+
+ if (wantsVScroll()) {
+ setVScrollPercent(scrollP);
+ } else {
+ _scrollPx = 0;
+ }
+}
+
+int WaypointList::checkHit ( int button, int updown, int x, int y )
+{
+ if ( isHit( x, y ) || ( puActiveWidget () == this ) )
+ {
+ doHit ( button, updown, x, y ) ;
+ return TRUE ;
+ }
+
+ return FALSE ;
+}
+
+
+void WaypointList::doHit( int button, int updown, int x, int y )
+{
+ puFrame::doHit(button, updown, x, y);
+ if (updown == PU_DRAG) {
+ handleDrag(x, y);
+ return;
+ }
+
+ if (button != active_mouse_button) {
+ return;
+ }
+
+ if (updown == PU_UP) {
+ puDeactivateWidget();
+ if (_dragging) {
+ doDrop(x, y);
+ return;
+ }
+ } else if (updown == PU_DOWN) {
+ puSetActiveWidget(this, x, y);
+ _mouseDownX = x;
+ _mouseDownY = y;
+ return;
+ }
+
+// update selection
+ int row = rowForY(y - abox.min[1]);
+ if (row >= (int) _model->numWaypoints()) {
+ row = -1; // 'no selection'
+ }
+
+ if (row == getSelected()) {
+ _showLatLon = !_showLatLon;
+ puPostRefresh();
+ return;
+ }
+
+ setSelected(row);
+}
+
+void WaypointList::handleDrag(int x, int y)
+{
+ if (!_dragging) {
+ // don't start drags immediately, require a certain mouse movement first
+ int manhattanLength = abs(x - _mouseDownX) + abs(y - _mouseDownY);
+ if (manhattanLength < DRAG_START_DISTANCE_PX) {
+ return;
+ }
+
+ _dragSourceRow = rowForY(y - abox.min[1]);
+ _dragging = true;
+ _dragScroll = SCROLL_NO;
+ }
+
+ if (y < abox.min[1]) {
+ if (_dragScroll != SCROLL_DOWN) {
+ _dragScroll = SCROLL_DOWN;
+ _dragScrollTime.stamp();
+ }
+ } else if (y > abox.max[1]) {
+ if (_dragScroll != SCROLL_UP) {
+ _dragScroll = SCROLL_UP;
+ _dragScrollTime.stamp();
+ }
+ } else {
+ _dragScroll = SCROLL_NO;
+ _dragTargetRow = rowForY(y - abox.min[1] - (rowHeightPx() / 2));
+ }
+}
+
+void WaypointList::doDrop(int x, int y)
+{
+ _dragging = false;
+ puDeactivateWidget();
+
+ if ((y < abox.min[1]) || (y >= abox.max[1])) {
+ return;
+ }
+
+ if (_dragSourceRow != _dragTargetRow) {
+ _model->moveWaypointToIndex(_dragSourceRow, _dragTargetRow);
+
+ // keep row indexes linged up when moving an item down the list
+ if (_dragSourceRow < _dragTargetRow) {
+ --_dragTargetRow;
+ }
+
+ setSelected(_dragTargetRow);
+ }
+}
+
+void WaypointList::invokeDownCallback(void)
+{
+ _dragging = false;
+ _dragScroll = SCROLL_NO;
+ SG_LOG(SG_GENERAL, SG_INFO, "cancel drag");
+}
+
+int WaypointList::rowForY(int y) const
+{
+ if (!_model) {
+ return -1;
+ }
+
+ // flip y to increase down, not up (as rows do)
+ int flipY = _heightPx - y;
+ int row = (flipY + _scrollPx) / rowHeightPx();
+ return row;
+}
+
+void WaypointList::draw( int dx, int dy )
+{
+ puFrame::draw(dx, dy);
+
+ if (!_model) {
+ return;
+ }
+
+ if (_dragScroll != SCROLL_NO) {
+ doDragScroll();
+ }
+
+ glEnable(GL_SCISSOR_TEST);
+ GLint sx = (int) abox.min[0],
+ sy = abox.min[1];
+ GLsizei w = (GLsizei) abox.max[0] - abox.min[0],
+ h = _heightPx;
+
+ sx += border_thickness;
+ sy += border_thickness;
+ w -= 2 * border_thickness;
+ h -= 2 * border_thickness;
+
+ glScissor(sx + dx, sy + dy, w, h);
+ int row = firstVisibleRow(),
+ final = lastVisibleRow(),
+ rowHeight = rowHeightPx(),
+ y = rowHeight;
+
+ y -= (_scrollPx % rowHeight); // partially draw the first row
+
+ for ( ; row <= final; ++row, y += rowHeight) {
+ drawRow(dx, dy, row, y);
+ } // of row drawing iteration
+
+ glDisable(GL_SCISSOR_TEST);
+
+ if (_dragging) {
+ // draw the insert marker after the rows
+ int insertY = (_dragTargetRow * rowHeight) - _scrollPx;
+ SG_CLAMP_RANGE(insertY, 0, std::min(_heightPx, totalHeightPx()));
+
+ glColor4f(1.0f, 0.5f, 0.0f, 0.8f);
+ glLineWidth(3.0f);
+ glBegin(GL_LINES);
+ glVertex2f(dx + abox.min[0], dy + abox.max[1] - insertY);
+ glVertex2f(dx + abox.max[0], dy + abox.max[1] - insertY);
+ glEnd();
+ }
+}
+
+void WaypointList::drawRow(int dx, int dy, int rowIndex, int y)
+{
+ bool isSelected = (rowIndex == getSelected());
+ bool isCurrent = (rowIndex == _model->currentWaypoint());
+ bool isDragSource = (_dragging && (rowIndex == _dragSourceRow));
+
+ puBox bkgBox = abox;
+ bkgBox.min[1] = abox.max[1] - y;
+ bkgBox.max[1] = bkgBox.min[1] + rowHeightPx();
+
+ puColour currentColor;
+ puSetColor(currentColor, 1.0, 1.0, 0.0, 0.5);
+
+ if (isDragSource) {
+ // draw later, on *top* of text string
+ } else if (isCurrent) {
+ bkgBox.draw(dx, dy, PUSTYLE_PLAIN, ¤tColor, false, 0);
+ } else if (isSelected) { // -PLAIN means selected, apparently
+ bkgBox.draw(dx, dy, -PUSTYLE_PLAIN, colour, false, 0);
+ }
+
+ int xx = dx + abox.min[0] + PUSTR_LGAP;
+ int yy = dy + abox.max[1] - y ;
+ yy += 4; // center text in row height
+
+ // row textual data
+ const SGWayPoint wp(_model->waypointAt(rowIndex));
+ char buffer[128];
+ int count = ::snprintf(buffer, 128, "%03d %-5s", rowIndex, wp.get_id().c_str());
+
+ if (wp.get_name().size() > 0 && (wp.get_name() != wp.get_id())) {
+ // append name if present, and different to id
+ ::snprintf(buffer + count, 128 - count, " (%s)", wp.get_name().c_str());
+ }
+
+ glColor4fv ( colour [ PUCOL_LEGEND ] ) ;
+ drawClippedString(legendFont, buffer, xx, yy, 300);
+
+ if (_showLatLon) {
+ char ns = (wp.get_target_lat() > 0.0) ? 'N' : 'S';
+ char ew = (wp.get_target_lon() > 0.0) ? 'E' : 'W';
+
+ ::snprintf(buffer, 128 - count, "%4.2f%c %4.2f%c",
+ fabs(wp.get_target_lon()), ew, fabs(wp.get_target_lat()), ns);
+ } else {
+ ::snprintf(buffer, 128 - count, "%03.0f %5.1fnm",
+ wp.get_track(), wp.get_distance() * SG_METER_TO_NM);
+ }
+
+ legendFont.drawString(buffer, xx + 300 + PUSTR_LGAP, yy);
+
+ int altFt = (int) wp.get_target_alt() * SG_METER_TO_FEET;
+ if (altFt > -9990) {
+ int altHundredFt = (altFt + 50) / 100; // round to nearest 100ft
+ if (altHundredFt < 100) {
+ count = ::snprintf(buffer, 128, "%d'", altHundredFt * 100);
+ } else { // display as a flight-level
+ count = ::snprintf(buffer, 128, "FL%d", altHundredFt);
+ }
+
+ legendFont.drawString(buffer, xx + 400 + PUSTR_LGAP, yy);
+ } // of valid wp altitude
+
+ if (isDragSource) {
+ puSetColor(currentColor, 1.0, 0.5, 0.0, 0.5);
+ bkgBox.draw(dx, dy, PUSTYLE_PLAIN, ¤tColor, false, 0);
+ }
+}
+
+const double SCROLL_PX_SEC = 200.0;
+
+void WaypointList::doDragScroll()
+{
+ double dt = (SGTimeStamp::now() - _dragScrollTime).toSecs();
+ _dragScrollTime.stamp();
+ int deltaPx = (int)(dt * SCROLL_PX_SEC);
+
+ if (_dragScroll == SCROLL_UP) {
+ _scrollPx = _scrollPx - deltaPx;
+ SG_CLAMP_RANGE(_scrollPx, 0, scrollRangePx());
+ _dragTargetRow = firstVisibleRow();
+ } else {
+ _scrollPx = _scrollPx + deltaPx;
+ SG_CLAMP_RANGE(_scrollPx, 0, scrollRangePx());
+ _dragTargetRow = lastFullyVisibleRow() + 1;
+ }
+
+ if (_scrollCallback) {
+ (*_scrollCallback)();
+ }
+}
+
+int WaypointList::getSelected()
+{
+ return getIntegerValue();
+}
+
+void WaypointList::setSelected(int rowIndex)
+{
+ if (rowIndex == getSelected()) {
+ return;
+ }
+
+ setValue(rowIndex);
+ invokeCallback();
+ if (rowIndex == -1) {
+ return;
+ }
+
+ ensureRowVisible(rowIndex);
+}
+
+void WaypointList::ensureRowVisible(int rowIndex)
+{
+ if ((rowIndex >= firstFullyVisibleRow()) && (rowIndex <= lastFullyVisibleRow())) {
+ return; // already visible, fine
+ }
+
+ // ideal position would place the desired row in the middle of the
+ // visible section - hence subtract half the visible height.
+ int targetScrollPx = (rowIndex * rowHeightPx()) - (_heightPx / 2);
+
+ // clamp the scroll value to something valid
+ SG_CLAMP_RANGE(targetScrollPx, 0, scrollRangePx());
+ _scrollPx = targetScrollPx;
+
+ puPostRefresh();
+ if (_scrollCallback) { // keep scroll observers in sync
+ (*_scrollCallback)();
+ }
+}
+
+unsigned int WaypointList::numWaypoints() const
+{
+ if (!_model) {
+ return 0;
+ }
+
+ return _model->numWaypoints();
+}
+
+bool WaypointList::wantsVScroll() const
+{
+ return totalHeightPx() > _heightPx;
+}
+
+float WaypointList::getVScrollPercent() const
+{
+ float scrollRange = scrollRangePx();
+ if (scrollRange < 1.0f) {
+ return 0.0;
+ }
+
+ return _scrollPx / scrollRange;
+}
+
+float WaypointList::getVScrollThumbPercent() const
+{
+ return _heightPx / (float) totalHeightPx();
+}
+
+void WaypointList::setVScrollPercent(float perc)
+{
+ float scrollRange = scrollRangePx();
+ _scrollPx = (int)(scrollRange * perc);
+}
+
+int WaypointList::firstVisibleRow() const
+{
+ return _scrollPx / rowHeightPx();
+}
+
+int WaypointList::firstFullyVisibleRow() const
+{
+ int rh = rowHeightPx();
+ return (_scrollPx + rh - 1) / rh;
+}
+
+int WaypointList::numVisibleRows() const
+{
+ int rh = rowHeightPx();
+ int topOffset = _scrollPx % rh; // pixels of first visible row
+ return (_heightPx - topOffset + rh - 1) / rh;
+
+}
+
+int WaypointList::numFullyVisibleRows() const
+{
+ int rh = rowHeightPx();
+ int topOffset = _scrollPx % rh; // pixels of first visible row
+ return (_heightPx - topOffset) / rh;
+}
+
+int WaypointList::rowHeightPx() const
+{
+ return legendFont.getStringHeight() + PUSTR_BGAP;
+}
+
+int WaypointList::scrollRangePx() const
+{
+ return std::max(0, totalHeightPx() - _heightPx);
+}
+
+int WaypointList::totalHeightPx() const
+{
+ if (!_model) {
+ return 0;
+ }
+
+ return (int) _model->numWaypoints() * rowHeightPx();
+}
+
+int WaypointList::lastFullyVisibleRow() const
+{
+ int row = firstFullyVisibleRow() + numFullyVisibleRows();
+ return std::min(row, (int) _model->numWaypoints() - 1);
+}
+
+int WaypointList::lastVisibleRow() const
+{
+ int row = firstVisibleRow() + numVisibleRows();
+ return std::min(row, (int) _model->numWaypoints() - 1);
+}
+
+void WaypointList::setModel(Model* model)
+{
+ if (_model) {
+ delete _model;
+ }
+
+ _model = model;
+ _model->setUpdateCallback(make_callback(this, &WaypointList::modelUpdateCallback));
+
+ puPostRefresh();
+}
+
+int WaypointList::checkKey (int key, int updown )
+{
+ if ((updown == PU_UP) || !isVisible () || !isActive () || (window != puGetWindow())) {
+ return FALSE ;
+ }
+
+ switch (key)
+ {
+ case PU_KEY_HOME:
+ setSelected(0);
+ break;
+
+ case PU_KEY_END:
+ setSelected(_model->numWaypoints() - 1);
+ break ;
+
+ case PU_KEY_UP :
+ case PU_KEY_PAGE_UP :
+ if (getSelected() >= 0) {
+ setSelected(getSelected() - 1);
+ }
+ break ;
+
+ case PU_KEY_DOWN :
+ case PU_KEY_PAGE_DOWN : {
+ int newSel = getSelected() + 1;
+ if (newSel >= (int) _model->numWaypoints()) {
+ setSelected(-1);
+ } else {
+ setSelected(newSel);
+ }
+ break ;
+ }
+
+ case '-':
+ if (getSelected() >= 0) {
+ int newAlt = wayptAltFtHundreds(getSelected()) - 10;
+ if (newAlt < 0) {
+ _model->setWaypointTargetAltitudeFt(getSelected(), -9999);
+ } else {
+ _model->setWaypointTargetAltitudeFt(getSelected(), newAlt * 100);
+ }
+ }
+ break;
+
+ case '=':
+ if (getSelected() >= 0) {
+ int newAlt = wayptAltFtHundreds(getSelected()) + 10;
+ if (newAlt < 0) {
+ _model->setWaypointTargetAltitudeFt(getSelected(), 0);
+ } else {
+ _model->setWaypointTargetAltitudeFt(getSelected(), newAlt * 100);
+ }
+ }
+ break;
+
+ case 0x7f: // delete
+ if (getSelected() >= 0) {
+ int index = getSelected();
+ _model->deleteAt(index);
+ setSelected(index - 1);
+ }
+ break;
+
+ default :
+ return FALSE;
+ }
+
+ return TRUE ;
+}
+
+int WaypointList::wayptAltFtHundreds(int index) const
+{
+ double alt = _model->waypointAt(index).get_target_alt();
+ if (alt < -9990.0) {
+ return -9999;
+ }
+
+ int altFt = (int) alt * SG_METER_TO_FEET;
+ return (altFt + 50) / 100; // round to nearest 100ft
+}
+
+void WaypointList::modelUpdateCallback()
+{
+ // local stuff
+
+ if (_updateCallback) {
+ (*_updateCallback)();
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+
+static void handle_scrollbar(puObject* scrollbar)
+{
+ ScrolledWaypointList* self = (ScrolledWaypointList*)scrollbar->getUserData();
+ self->setScrollPercent(scrollbar->getFloatValue());
+}
+
+static void waypointListCb(puObject* wpl)
+{
+ ScrolledWaypointList* self = (ScrolledWaypointList*)wpl->getUserData();
+ self->setValue(wpl->getIntegerValue());
+ self->invokeCallback();
+}
+
+ScrolledWaypointList::ScrolledWaypointList(int x, int y, int width, int height) :
+ puGroup(x,y),
+ _scrollWidth(16)
+{
+ // ensure our type is compound, so fgPopup::applySize doesn't descend into
+ // us, and try to cast our children's user-data to GUIInfo*.
+ type |= PUCLASS_LIST;
+
+ init(width, height);
+}
+
+void ScrolledWaypointList::setValue(float v)
+{
+ puGroup::setValue(v);
+ _list->setValue(v);
+}
+
+void ScrolledWaypointList::setValue(int v)
+{
+ puGroup::setValue(v);
+ _list->setValue(v);
+}
+
+void ScrolledWaypointList::init(int w, int h)
+{
+ _list = new WaypointList(0, 0, w, h);
+ _list->setUpdateCallback(make_callback(this, &ScrolledWaypointList::modelUpdated));
+ _hasVScroll = _list->wantsVScroll();
+ _list->setUserData(this);
+ _list->setCallback(waypointListCb);
+
+ _list->setScrollCallback(make_callback(this, &ScrolledWaypointList::updateScroll));
+
+ _scrollbar = new puaScrollBar(w - _scrollWidth, 0, h,
+ 1 /*arrow*/, 1 /* vertical */, _scrollWidth);
+ _scrollbar->setMinValue(0.0);
+ _scrollbar->setMaxValue(1.0);
+ _scrollbar->setUserData(this);
+ _scrollbar->setCallback(handle_scrollbar);
+ close(); // close the group
+
+ setSize(w, h);
+}
+
+void ScrolledWaypointList::modelUpdated()
+{
+ int w, h;
+ getSize(&w, &h);
+ updateWantsScroll(w, h);
+}
+
+void ScrolledWaypointList::setScrollPercent(float v)
+{
+ // slider's min is the bottom, so invert the value
+ _list->setVScrollPercent(1.0f - v);
+}
+
+void ScrolledWaypointList::setSize(int w, int h)
+{
+ updateWantsScroll(w, h);
+}
+
+void ScrolledWaypointList::updateWantsScroll(int w, int h)
+{
+ _hasVScroll = _list->wantsVScroll();
+
+ if (_hasVScroll) {
+ _scrollbar->reveal();
+ _scrollbar->setPosition(w - _scrollWidth, 0);
+ _scrollbar->setSize(_scrollWidth, h);
+ _list->setSize(w - _scrollWidth, h);
+ updateScroll();
+ } else {
+ _scrollbar->hide();
+ _list->setSize(w, h);
+ }
+}
+
+void ScrolledWaypointList::updateScroll()
+{
+ // _scrollbar->setMaxValue(_list->numWaypoints());
+ _scrollbar->setValue(1.0f - _list->getVScrollPercent());
+ _scrollbar->setSliderFraction(_list->getVScrollThumbPercent());
+}
+
--- /dev/null
+/**
+ * WaypointList.hxx - scrolling list of waypoints, with special formatting
+ */
+
+#ifndef GUI_WAYPOINT_LIST_HXX
+#define GUI_WAYPOINT_LIST_HXX
+
+#include <simgear/compiler.h>
+#include <simgear/timing/timestamp.hxx>
+
+#include <plib/pu.h>
+
+#include "dialog.hxx" // for GUI_ID
+
+// forward decls
+class puaScrollBar;
+class SGWayPoint;
+class SGCallback;
+
+class WaypointList : public puFrame, public GUI_ID
+{
+public:
+ WaypointList(int x, int y, int width, int height);
+ virtual ~WaypointList();
+
+ virtual void setSize(int width, int height);
+ virtual int checkHit ( int button, int updown, int x, int y);
+ virtual void doHit( int button, int updown, int x, int y ) ;
+ virtual void draw( int dx, int dy ) ;
+ virtual int checkKey(int key, int updown);
+ virtual void invokeDownCallback (void);
+
+ void setSelected(int rowIndex);
+ int getSelected();
+
+ /**
+ * Do we want a vertical scrollbar (or similar)
+ */
+ bool wantsVScroll() const;
+
+ /**
+ * Get scrollbar position as a percentage of total range.
+ * returns negative number if scrolling is not possible
+ */
+ float getVScrollPercent() const;
+
+ /**
+ *
+ */
+ void setVScrollPercent(float perc);
+
+ /**
+ * Get required thumb size as percentage of total height
+ */
+ float getVScrollThumbPercent() const;
+
+ int numVisibleRows() const;
+
+ void ensureRowVisible(int row);
+
+ void setUpdateCallback(SGCallback* cb);
+ void setScrollCallback(SGCallback* cb);
+
+ /**
+ * Abstract interface for waypoint source
+ */
+ class Model
+ {
+ public:
+ virtual ~Model() { }
+
+ virtual unsigned int numWaypoints() const = 0;
+ virtual int currentWaypoint() const = 0;
+ virtual SGWayPoint waypointAt(unsigned int index) const = 0;
+
+ // update notifications
+ virtual void setUpdateCallback(SGCallback* cb) = 0;
+
+ // editing operations
+ virtual void deleteAt(unsigned int index) = 0;
+ virtual void setWaypointTargetAltitudeFt(unsigned int index, int altFt) = 0;
+ virtual void moveWaypointToIndex(unsigned int srcIndex, unsigned int dstIndex) = 0;
+ };
+
+ void setModel(Model* model);
+
+ unsigned int numWaypoints() const;
+protected:
+
+private:
+ void drawRow(int dx, int dy, int rowIndex, int yOrigin);
+
+ void handleDrag(int x, int y);
+ void doDrop(int x, int y);
+ void doDragScroll();
+
+ /**
+ * Pixel height of a row, including padding
+ */
+ int rowHeightPx() const;
+
+ /**
+ * model row corresponding to an on-screen y-value
+ */
+ int rowForY(int y) const;
+
+ /**
+ * reutrn rowheight * total number of rows, i.e the height we'd
+ * need to be to show every row without scrolling
+ */
+ int totalHeightPx() const;
+
+ /**
+ * Pixel scroll range, based on widget height and number of rows
+ */
+ int scrollRangePx() const;
+
+ int firstVisibleRow() const;
+ int lastVisibleRow() const;
+
+ int numFullyVisibleRows() const;
+ int firstFullyVisibleRow() const;
+ int lastFullyVisibleRow() const;
+
+ int wayptAltFtHundreds(int index) const;
+
+ void modelUpdateCallback();
+
+ int _scrollPx; // scroll ammount (in pixels)
+ int _heightPx;
+
+ bool _dragging;
+ int _dragSourceRow;
+ int _dragTargetRow;
+ int _mouseDownX, _mouseDownY;
+
+ int _dragScroll;
+ SGTimeStamp _dragScrollTime;
+
+ bool _showLatLon;
+ Model* _model;
+ SGCallback* _updateCallback;
+ SGCallback* _scrollCallback;
+};
+
+class ScrolledWaypointList : public puGroup
+{
+public:
+ ScrolledWaypointList(int x, int y, int width, int height);
+
+ virtual void setSize(int width, int height);
+
+ void setScrollPercent(float v);
+
+ virtual void setValue(float v);
+ virtual void setValue(int v);
+private:
+ void init(int w, int h);
+
+ void updateScroll();
+ void updateWantsScroll(int w, int h);
+
+ void modelUpdated();
+
+ puaScrollBar* _scrollbar;
+ WaypointList* _list;
+ int _scrollWidth;
+ bool _hasVScroll;
+};
+
+#endif // GUI_WAYPOINT_LIST_HXX
#include "AirportList.hxx"
#include "property_list.hxx"
#include "layout.hxx"
-
+#include "WaypointList.hxx"
+#include "MapWidget.hxx"
enum format_type { f_INVALID, f_INT, f_LONG, f_FLOAT, f_DOUBLE, f_STRING };
static const int FORMAT_BUFSIZE = 255;
getFirstChild()->setSize(w, h); // dialog background puFrame
}
} else {
- setPosition(x + _dlgX - _startX, y + _dlgY - _startY);
- }
+ int posX = x + _dlgX - _startX,
+ posY = y + _dlgY - _startY;
+ setPosition(posX, posY);
+
+ GUIInfo *info = (GUIInfo *)getUserData();
+ if (info && info->node) {
+ info->node->setIntValue("x", posX);
+ info->node->setIntValue("y", posY);
+ }
+ } // re-positioning
} else if (_dragging) {
fgSetMouseCursor(_start_cursor);
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();
+ if (widgetType & PUCLASS_LIST) {
+ GUI_ID* gui_id = dynamic_cast<GUI_ID *>(widget);
+ if (gui_id && (gui_id->id & FGCLASS_LIST)) {
+ fgList *pl = static_cast<fgList*>(widget);
+ pl->update();
+ } else {
+ copy_to_pui(_propertyObjects[i]->node, widget);
+ }
} else if (widgetType & PUCLASS_COMBOBOX) {
fgComboBox* combo = static_cast<fgComboBox*>(widget);
combo->update();
setupObject(obj, props);
setColor(obj, props);
return obj;
-
+ } else if (type == "map") {
+ MapWidget* mapWidget = new MapWidget(x, y, x + width, y + height);
+ setupObject(mapWidget, props);
+ return mapWidget;
} else if (type == "combo") {
fgComboBox *obj = new fgComboBox(x, y, x + width, y + height, props,
props->getBoolValue("editable", false));
setupObject(obj, props);
setColor(obj, props, EDITFIELD);
return obj;
+ } else if (type == "waypointlist") {
+ ScrolledWaypointList* obj = new ScrolledWaypointList(x, y, width, height);
+ setupObject(obj, props);
+ return obj;
} else {
return 0;
}
name = "";
const char *propname = props->getStringValue("property");
SGPropertyNode_ptr node = fgGetNode(propname, true);
- copy_to_pui(node, object);
+ if (type == "map") {
+ // mapWidget binds to a sub-tree of properties, and
+ // ignroes the puValue mechanism, so special case things here
+ MapWidget* mw = static_cast<MapWidget*>(object);
+ mw->setProperty(node);
+ } else {
+ // normal widget, creating PropertyObject
+ copy_to_pui(node, object);
+ PropertyObject *po = new PropertyObject(name, object, node);
+ _propertyObjects.push_back(po);
+ if (props->getBoolValue("live"))
+ _liveObjects.push_back(po);
+ }
+
- PropertyObject *po = new PropertyObject(name, object, node);
- _propertyObjects.push_back(po);
- if (props->getBoolValue("live"))
- _liveObjects.push_back(po);
}
SGPropertyNode *dest = fgGetNode("/sim/bindings/gui", true);
#define FGCLASS_LIST 0x00000001
#define FGCLASS_AIRPORTLIST 0x00000002
#define FGCLASS_PROPERTYLIST 0x00000004
+#define FGCLASS_WAYPOINTLIST 0x00000008
+
class GUI_ID { public: GUI_ID(int id) : id(id) {} virtual ~GUI_ID() {} int id; };
// Delete all the character arrays
// we were forced to keep around for
// plib.
- SG_LOG(SG_GENERAL, SG_INFO, "Deleting char arrays");
+ SG_LOG(SG_GENERAL, SG_BULK, "Deleting char arrays");
for (i = 0; i < _char_arrays.size(); i++) {
for (int j = 0; _char_arrays[i][j] != 0; j++)
free(_char_arrays[i][j]); // added with strdup
// Delete all the callback arrays
// we were forced to keep around for
// plib.
- SG_LOG(SG_GENERAL, SG_INFO, "Deleting callback arrays");
+ SG_LOG(SG_GENERAL, SG_BULK, "Deleting callback arrays");
for (i = 0; i < _callback_arrays.size(); i++)
delete[] _callback_arrays[i];
// Delete all those bindings
- SG_LOG(SG_GENERAL, SG_INFO, "Deleting bindings");
+ SG_LOG(SG_GENERAL, SG_BULK, "Deleting bindings");
map<string,vector<SGBinding *> >::iterator it;
for (it = _bindings.begin(); it != _bindings.end(); it++) {
- SG_LOG(SG_GENERAL, SG_INFO, "Deleting bindings for " << it->first);
+ SG_LOG(SG_GENERAL, SG_BULK, "Deleting bindings for " << it->first);
for ( i = 0; i < it->second.size(); i++ )
delete it->second[i];
}
- SG_LOG(SG_GENERAL, SG_INFO, "Done.");
+ SG_LOG(SG_GENERAL, SG_BULK, "Done.");
}
void
bool
FGMenuBar::enable_item(const SGPropertyNode * node, bool state)
{
- const char *path = node->getPath();
+ string path = node->getPath();
if (_objects.find(path) == _objects.end()) {
SG_LOG(SG_GENERAL, SG_ALERT, "Trying to enable/disable "
"non-existent menu item for node `" << path << '\'');
#include <simgear/structure/exception.hxx>
#include <simgear/props/props_io.hxx>
+#include <boost/algorithm/string/case_conv.hpp>
+
#include <Main/fg_props.hxx>
#include "menubar.hxx"
struct FGFontCache::fnt *
FGFontCache::getfnt(const char *name, float size, float slant)
{
- string fontName(name);
+ string fontName = boost::to_lower_copy(string(name));
FntParams fntParams(fontName, size, slant);
PuFontMap::iterator i = _puFonts.find(fntParams);
- if (i != _puFonts.end())
+ if (i != _puFonts.end()) {
+ // found in the puFonts map, all done
return i->second;
+ }
+
// fntTexFont s are all preloaded into the _texFonts map
TexFontMap::iterator texi = _texFonts.find(fontName);
- fntTexFont* texfont = 0;
- puFont* pufont = 0;
+ fntTexFont* texfont = NULL;
+ puFont* pufont = NULL;
if (texi != _texFonts.end()) {
texfont = texi->second;
} else {
+ // check the built-in PUI fonts (in guifonts array)
const GuiFont* guifont = std::find_if(&guifonts[0], guifontsEnd,
GuiFont::Predicate(name));
if (guifont != guifontsEnd) {
pufont = guifont->font;
}
}
+
fnt* f = new fnt;
if (pufont) {
f->pufont = pufont;
void FGFontCache::init()
{
- if (!_initialized) {
- char *envp = ::getenv("FG_FONTS");
- if (envp != NULL) {
- _path.set(envp);
- } else {
- _path.set(globals->get_fg_root());
- _path.append("Fonts");
- }
- _initialized = true;
+ if (_initialized) {
+ return;
}
+
+ char *envp = ::getenv("FG_FONTS");
+ if (envp != NULL) {
+ _path.set(envp);
+ } else {
+ _path.set(globals->get_fg_root());
+ _path.append("Fonts");
+ }
+ _initialized = true;
}
SGPath
path = SGPath(_path);
path.append("Helvetica.txf");
-
+ SG_LOG(SG_GENERAL, SG_WARN, "Unknown font name '" << name << "', defaulting to Helvetica");
return path;
}
path.append(dirEntry->d_name);
if (path.extension() == fontext) {
fntTexFont* f = new fntTexFont;
- if (f->load((char *)path.c_str()))
- _texFonts[string(dirEntry->d_name)] = f;
- else
+ if (f->load((char *)path.c_str())) {
+ // convert font names in the map to lowercase for matching
+ string fontName = boost::to_lower_copy(string(dirEntry->d_name));
+ _texFonts[fontName] = f;
+ } else
delete f;
}
}
#ifndef _PROPERTY_LIST_HXX
#define _PROPERTY_LIST_HXX
+#include <string>
#include <plib/puAux.h>
#include <simgear/props/props.hxx>
void toggleVerbosity() { _verbose = !_verbose; }
// overridden plib pui methods
- virtual char *getStringValue(void) { return (char *)(_return ? _return->getPath(true) : ""); }
+ virtual char *getStringValue(void)
+ {
+ _return_path.clear();
+ if (_return)
+ _return_path = _return->getPath(true);
+ return const_cast<char*>(_return_path.c_str());
+ }
//virtual char *getListStringValue() { return (char *)(_return ? _return->getPath(true) : ""); }
virtual void setValue(const char *);
bool _dot_files; // . and .. pseudo-dirs currently shown?
bool _verbose; // show SGPropertyNode flags
+ std::string _return_path;
};
#include <simgear/math/SGMath.hxx>
+using simgear::PropertyList;
+
void FGCommonInput::read_bindings (const SGPropertyNode * node, binding_list_t * binding_list, int modifiers, const string & module )
{
SG_LOG(SG_INPUT, SG_DEBUG, "Reading all bindings");
- vector<SGPropertyNode_ptr> bindings = node->getChildren("binding");
+ PropertyList bindings = node->getChildren("binding");
static string nasal = "nasal";
for (unsigned int i = 0; i < bindings.size(); i++) {
const char *cmd = bindings[i]->getStringValue("command");
#include <simgear/props/props_io.hxx>
#include <Main/globals.hxx>
+using simgear::PropertyList;
+
FGDeviceConfigurationMap::FGDeviceConfigurationMap( const char * relative_path, SGPropertyNode_ptr aBase, const char * aChildname ) :
base(aBase),
childname(aChildname)
int index = 1000;
scan_dir( path, &index);
- vector<SGPropertyNode_ptr> childNodes = base->getChildren(childname);
+ PropertyList childNodes = base->getChildren(childname);
for (int k = (int)childNodes.size() - 1; k >= 0; k--) {
SGPropertyNode *n = childNodes[k];
- vector<SGPropertyNode_ptr> names = n->getChildren("name");
+ PropertyList names = n->getChildren("name");
if (names.size() ) // && (n->getChildren("axis").size() || n->getChildren("button").size()))
for (unsigned int j = 0; j < names.size(); j++)
(*this)[names[j]->getStringValue()] = n;
#include <simgear/io/sg_file.hxx>
#include <Scripting/NasalSys.hxx>
+using simgear::PropertyList;
+
FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) :
value(0.0)
{
read_bindings( node, bindings, KEYMOD_NONE, device->GetNasalModule() );
- vector<SGPropertyNode_ptr> settingNodes = node->getChildren("setting");
- for( vector<SGPropertyNode_ptr>::iterator it = settingNodes.begin(); it != settingNodes.end(); it++ )
+ PropertyList settingNodes = node->getChildren("setting");
+ for( PropertyList::iterator it = settingNodes.begin(); it != settingNodes.end(); it++ )
settings.push_back( new FGEventSetting( *it ) );
}
nasalModule = string("__event:") + GetName();
- vector<SGPropertyNode_ptr> eventNodes = deviceNode->getChildren( "event" );
- for( vector<SGPropertyNode_ptr>::iterator it = eventNodes.begin(); it != eventNodes.end(); it++ )
+ PropertyList eventNodes = deviceNode->getChildren( "event" );
+ for( PropertyList::iterator it = eventNodes.begin(); it != eventNodes.end(); it++ )
AddHandledEvent( FGInputEvent::NewObject( this, *it ) );
debugEvents = deviceNode->getBoolValue("debug-events", debugEvents );
#include <Main/fg_props.hxx>
#include <Scripting/NasalSys.hxx>
+using simgear::PropertyList;
+
FGJoystickInput::axis::axis ()
: last_value(9999999),
tolerance(0.002),
string module = str.str();
nasalsys->createModule(module.c_str(), module.c_str(), "", 0);
- vector<SGPropertyNode_ptr> nasal = js_node->getChildren("nasal");
+ PropertyList nasal = js_node->getChildren("nasal");
unsigned int j;
for (j = 0; j < nasal.size(); j++) {
nasal[j]->setStringValue("module", module.c_str());
//
// Initialize the axes.
//
- vector<SGPropertyNode_ptr> axes = js_node->getChildren("axis");
+ PropertyList axes = js_node->getChildren("axis");
size_t nb_axes = axes.size();
for (j = 0; j < nb_axes; j++ ) {
const SGPropertyNode * axis_node = axes[j];
//
// Initialize the buttons.
//
- vector<SGPropertyNode_ptr> buttons = js_node->getChildren("button");
+ PropertyList buttons = js_node->getChildren("button");
char buf[32];
for (j = 0; j < buttons.size() && j < nbuttons; j++) {
const SGPropertyNode * button_node = buttons[j];
#include <Scripting/NasalSys.hxx>
#include <plib/pu.h>
+using simgear::PropertyList;
+
static int getModifiers ()
{
return fgGetKeyModifiers() >> 1;
}
FGNasalSys *nasalsys = (FGNasalSys *)globals->get_subsystem("nasal");
- vector<SGPropertyNode_ptr> nasal = key_nodes->getChildren("nasal");
+ PropertyList nasal = key_nodes->getChildren("nasal");
for (unsigned int j = 0; j < nasal.size(); j++) {
nasal[j]->setStringValue("module", module.c_str());
nasalsys->handleCommand(nasal[j]);
}
- vector<SGPropertyNode_ptr> keys = key_nodes->getChildren("key");
+ PropertyList keys = key_nodes->getChildren("key");
for (unsigned int i = 0; i < keys.size(); i++) {
int index = keys[i]->getIndex();
SG_LOG(SG_INPUT, SG_DEBUG, "Binding key " << index);
#include "jsinput.h"
+using simgear::PropertyList;
bool confirmAnswer() {
char answer;
cout << e.getFormattedMessage ();
}
- vector<SGPropertyNode_ptr> axes = templatetree->getChildren("axis");
- for(vector<SGPropertyNode_ptr>::iterator iter = axes.begin(); iter != axes.end(); iter++) {
+ PropertyList axes = templatetree->getChildren("axis");
+ for(PropertyList::iterator iter = axes.begin(); iter != axes.end(); iter++) {
cout << "Move the control you wish to use for " << (*iter)->getStringValue("desc")
<< " " << (*iter)->getStringValue("direction") << endl;
cout << "Pressing a button skips this axis" << endl;
cout << endl;
}
- vector<SGPropertyNode_ptr> buttons = templatetree->getChildren("button");
- for(vector<SGPropertyNode_ptr>::iterator iter = buttons.begin(); iter != buttons.end(); iter++) {
+ PropertyList buttons = templatetree->getChildren("button");
+ for(PropertyList::iterator iter = buttons.begin(); iter != buttons.end(); iter++) {
cout << "Press the button you wish to use for " << (*iter)->getStringValue("desc") << endl;
cout << "Moving a joystick axis skips this button" << endl;
fflush( stdout );
void draw_stipple_line(float x1, float y1, float x2, float y2);
void draw_text(float x, float y, const char *msg, int align = 0, int digit = 0);
void draw_circle(float x1, float y1, float r) const;
+ void draw_arc(float x1, float y1, float t0, float t1, float r) const;
void draw_bullet(float, float, float);
HUD *_hud;
private:
SGSharedPtr<SGCondition> _active_condition; // stadiametric (true) or standby (false)
+ SGSharedPtr<SGCondition> _tachy_condition; // tachymetric (true) or standby (false)
+ SGSharedPtr<SGCondition> _align_condition; // tachymetric (true) or standby (false)
+
Input _diameter; // inner/outer radius relation
+ Input _pitch;
+ Input _yaw;
+ Input _speed;
+ Input _range;
+ Input _t0;
+ Input _t1;
+ Input _offset_x;
+ Input _offset_y;
+
float _bullet_size;
float _inner_radius;
+ float _compression;
+ float _limit_x;
+ float _limit_y;
+
};
glEnd();
}
+void HUD::Item::draw_arc(float xoffs, float yoffs, float t0, float t1, float r) const
+{
+ glBegin(GL_LINE_STRIP);
+ float step = SG_PI / r;
+ t0 = t0 * SG_DEGREES_TO_RADIANS;
+ t1 = t1 * SG_DEGREES_TO_RADIANS;
+
+ for (float alpha = t0; alpha < t1; alpha += step) {
+ float x = r * cos(alpha);
+ float y = r * sin(alpha);
+ glVertex2f(x + xoffs, y + yoffs);
+ }
+ glEnd();
+}
void HUD::Item::draw_bullet(float x, float y, float size)
{
#include "HUD.hxx"
-
// MIL-STD-1787B aiming reticle
HUD::AimingReticle::AimingReticle(HUD *hud, const SGPropertyNode *n, float x, float y) :
- Item(hud, n, x, y),
- _active_condition(0),
- _diameter(n->getNode("diameter-input", false)),
- _bullet_size(_w / 6.0),
- _inner_radius(_w / 2.0)
+Item(hud, n, x, y),
+_active_condition(0),
+_tachy_condition(0),
+_align_condition(0),
+_diameter(n->getNode("diameter-input", false)),
+_pitch(n->getNode("pitch-input", false)),
+_yaw(n->getNode("yaw-input", false)),
+_speed(n->getNode("speed-input", false)),
+_range(n->getNode("range-input", false)),
+_t0(n->getNode("arc-start-input", false)),
+_t1(n->getNode("arc-stop-input", false)),
+_offset_x(n->getNode("offset-x-input", false)),
+_offset_y(n->getNode("offset-y-input", false)),
+_bullet_size(_w / 6.0),
+_inner_radius(_w / 2.0),
+_compression(n->getFloatValue("compression-factor")),
+_limit_x(n->getFloatValue("limit-x")),
+_limit_y(n->getFloatValue("limit-y"))
+
{
const SGPropertyNode *node = n->getNode("active-condition");
if (node)
- _active_condition = sgReadCondition(globals->get_props(), node);
+ _active_condition = sgReadCondition(globals->get_props(), node);
+
+ const SGPropertyNode *tnode = n->getNode("tachy-condition");
+ if (tnode)
+ _tachy_condition = sgReadCondition(globals->get_props(), tnode);
+
+ const SGPropertyNode *anode = n->getNode("align-condition");
+ if (anode)
+ _align_condition = sgReadCondition(globals->get_props(), anode);
+
}
void HUD::AimingReticle::draw(void)
{
bool active = _active_condition ? _active_condition->test() : true;
- float diameter = _diameter.isValid() ? _diameter.getFloatValue() : 2.0f; // outer circle
+ bool tachy = _tachy_condition ? _tachy_condition->test() : false;
+ bool align = _align_condition ? _align_condition->test() : false;
- float x = _center_x;
- float y = _center_y;
+ float diameter = _diameter.isValid() ? _diameter.getFloatValue() : 2.0f; // outer circle
+ float x = _center_x + (_offset_x.isValid() ? _offset_x.getFloatValue() : 0);
+ float y = _center_y + (_offset_y.isValid() ? _offset_y.getFloatValue() : 0);
if (active) { // stadiametric (4.2.4.4)
draw_bullet(x, y, _bullet_size);
draw_circle(x, y, _inner_radius);
draw_circle(x, y, diameter * _inner_radius);
+ } else if (tachy){//tachiametric
+ float t0 = _t0.isValid() ? _t0.getFloatValue() : 2.0f; // start arc
+ float t1 = _t1.isValid() ? _t1.getFloatValue() : 2.0f; // stop arc
+ float yaw_value = _yaw.getFloatValue();
+ float pitch_value = _pitch.getFloatValue();
+ float tof_value = _range.getFloatValue()* 3 / _speed.getFloatValue();
+ draw_bullet(x, y, _bullet_size);
+ draw_circle(x, y, _inner_radius);
+ draw_line(x + _inner_radius, y, x + _inner_radius * 3, y);
+ draw_line(x - _inner_radius, y, x - _inner_radius * 3, y);
+ draw_line(x, y + _inner_radius, x, y + _inner_radius * 3);
+ draw_line(x, y - _inner_radius, x, y - _inner_radius * 3);
+
+ if(align){
+ draw_line(x + _limit_x, y + _limit_y, x - _limit_x, y + _limit_y);
+ draw_line(x + _limit_x, y - _limit_y, x - _limit_x, y - _limit_y);
+ draw_line(x + _limit_x, y + _limit_y, x + _limit_x, y - _limit_y);
+ draw_line(x - _limit_x, y + _limit_y, x - _limit_x, y - _limit_y);
+ }
+
+ float limit_offset = diameter * _inner_radius;
+
+ float pos_x = x + (yaw_value * tof_value)
+ * _compression;
+
+ pos_x > x + _limit_x - limit_offset ?
+ pos_x = x + _limit_x - limit_offset : pos_x;
+
+ pos_x < x - _limit_x + limit_offset ?
+ pos_x = x - _limit_x + limit_offset: pos_x;
+
+ float pos_y = y + (pitch_value * tof_value)
+ * _compression;
+
+ pos_y > y + _limit_y - limit_offset ?
+ pos_y = y + _limit_y - limit_offset : pos_y;
+
+ pos_y < y - _limit_y + limit_offset?
+ pos_y = y - _limit_y + limit_offset: pos_y;
+
+ draw_circle(pos_x, pos_y, diameter * _inner_radius);
+
+ draw_arc(x, y, t0, t1, (diameter + 2) * _inner_radius );
} else { // standby (4.2.4.5)
// TODO
}
+
}
#include "airspeed_indicator.hxx"
#include <Main/fg_props.hxx>
#include <Main/util.hxx>
+#include <Environment/environment_mgr.hxx>
+#include <Environment/environment.hxx>
// A higher number means more responsive.
_name(node->getStringValue("name", "airspeed-indicator")),
_num(node->getIntValue("number", 0)),
_total_pressure(node->getStringValue("total-pressure", "/systems/pitot/total-pressure-inhg")),
- _static_pressure(node->getStringValue("static-pressure", "/systems/static/pressure-inhg"))
+ _static_pressure(node->getStringValue("static-pressure", "/systems/static/pressure-inhg")),
+ _has_overspeed(node->getBoolValue("has-overspeed-indicator",false)),
+ _pressure_alt_source(node->getStringValue("pressure-alt-source", "/instrumentation/altimeter/pressure-alt-ft")),
+ _ias_limit(node->getDoubleValue("ias-limit", 248.0)),
+ _mach_limit(node->getDoubleValue("mach-limit", 0.48)),
+ _alt_threshold(node->getDoubleValue("alt-threshold", 13200))
{
+ _environmentManager = NULL;
}
AirspeedIndicator::~AirspeedIndicator ()
_static_pressure_node = fgGetNode(_static_pressure.c_str(), true);
_density_node = fgGetNode("/environment/density-slugft3", true);
_speed_node = node->getChild("indicated-speed-kt", 0, true);
+ _tas_node = node->getChild("true-speed-kt", 0, true);
+ _mach_node = node->getChild("indicated-mach", 0, true);
+
+ // overspeed-indicator properties
+ if (_has_overspeed) {
+ _ias_limit_node = node->getNode("ias-limit",0, true);
+ _mach_limit_node = node->getNode("mach-limit",0, true);
+ _alt_threshold_node = node->getNode("alt-threshold",0, true);
+
+ if (!_ias_limit_node->hasValue()) {
+ _ias_limit_node->setDoubleValue(_ias_limit);
+ }
+
+ if (!_mach_limit_node->hasValue()) {
+ _mach_limit_node->setDoubleValue(_mach_limit);
+ }
+
+ if (!_alt_threshold_node->hasValue()) {
+ _alt_threshold_node->setDoubleValue(_alt_threshold);
+ }
+
+ _airspeed_limit = node->getChild("airspeed-limit-kt", 0, true);
+ _pressure_alt = fgGetNode(_pressure_alt_source.c_str(), true);
+ }
+
+ _environmentManager = (FGEnvironmentMgr*) globals->get_subsystem("environment");
}
#ifndef FPSTOKTS
void
AirspeedIndicator::update (double dt)
{
- if (_serviceable_node->getBoolValue()) {
- double pt = _total_pressure_node->getDoubleValue() * INHGTOPSF;
- double p = _static_pressure_node->getDoubleValue() * INHGTOPSF;
- double r = _density_node->getDoubleValue();
- double q = ( pt - p ); // dynamic pressure
-
- // Now, reverse the equation (normalize dynamic pressure to
- // avoid "nan" results from sqrt)
- if ( q < 0 ) { q = 0.0; }
- double v_fps = sqrt((2 * q) / r);
-
- // Publish the indicated airspeed
- double last_speed_kt = _speed_node->getDoubleValue();
- double current_speed_kt = v_fps * FPSTOKTS;
- _speed_node->setDoubleValue(fgGetLowPass(last_speed_kt,
- current_speed_kt,
- dt * RESPONSIVENESS));
+ if (!_serviceable_node->getBoolValue()) {
+ return;
+ }
+
+ double pt = _total_pressure_node->getDoubleValue() * INHGTOPSF;
+ double p = _static_pressure_node->getDoubleValue() * INHGTOPSF;
+ double r = _density_node->getDoubleValue();
+ double q = ( pt - p ); // dynamic pressure
+
+ // Now, reverse the equation (normalize dynamic pressure to
+ // avoid "nan" results from sqrt)
+ if ( q < 0 ) { q = 0.0; }
+ double v_fps = sqrt((2 * q) / r);
+
+ // Publish the indicated airspeed
+ double last_speed_kt = _speed_node->getDoubleValue();
+ double current_speed_kt = v_fps * FPSTOKTS;
+ double filtered_speed = fgGetLowPass(last_speed_kt,
+ current_speed_kt,
+ dt * RESPONSIVENESS);
+ _speed_node->setDoubleValue(filtered_speed);
+ computeMach(filtered_speed);
+
+ if (!_has_overspeed) {
+ return;
+ }
+
+ double lmt = _ias_limit_node->getDoubleValue();
+ if (_pressure_alt->getDoubleValue() > _alt_threshold_node->getDoubleValue()) {
+ double mmo = _mach_limit_node->getDoubleValue();
+ lmt = (filtered_speed/_mach_node->getDoubleValue())* mmo;
}
+
+ _airspeed_limit->setDoubleValue(lmt);
+}
+
+void
+AirspeedIndicator::computeMach(double ias)
+{
+ if (!_environmentManager) {
+ return;
+ }
+
+ FGEnvironment env(_environmentManager->getEnvironment());
+
+ // derived from http://williams.best.vwh.net/avform.htm#Mach
+ // names here are picked to be consistent with those formulae!
+
+ double oatK = env.get_temperature_degc() + 273.15; // OAT in Kelvin
+ double CS = 38.967854 * sqrt(oatK); // speed-of-sound in knots at altitude
+ double CS_0 = 661.4786; // speed-of-sound in knots at sea-level
+ double P_0 = env.get_pressure_sea_level_inhg();
+ double P = _static_pressure_node->getDoubleValue();
+
+ double DP = P_0 * (pow(1 + 0.2*pow(ias/CS_0, 2), 3.5) - 1);
+ double mach = pow(5 * ( pow(DP/P + 1, 2.0/7.0) -1) , 0.5);
+
+ // publish Mach and TAS
+ _mach_node->setDoubleValue(mach);
+ _tas_node->setDoubleValue(CS * mach);
}
// end of airspeed_indicator.cxx
#include <simgear/props/props.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
+// forward decls
+class FGEnvironmentMgr;
/**
* Model an airspeed indicator tied to the pitot and static ports.
virtual void update (double dt);
private:
+ void computeMach(double ias);
string _name;
unsigned int _num;
string _total_pressure;
string _static_pressure;
+ bool _has_overspeed;
+ string _pressure_alt_source;
+ double _ias_limit;
+ double _mach_limit;
+ double _alt_threshold;
+
+ SGPropertyNode_ptr _ias_limit_node;
+ SGPropertyNode_ptr _mach_limit_node;
+ SGPropertyNode_ptr _alt_threshold_node;
SGPropertyNode_ptr _serviceable_node;
SGPropertyNode_ptr _total_pressure_node;
SGPropertyNode_ptr _static_pressure_node;
SGPropertyNode_ptr _density_node;
SGPropertyNode_ptr _speed_node;
+ SGPropertyNode_ptr _airspeed_limit;
+ SGPropertyNode_ptr _pressure_alt;
+ SGPropertyNode_ptr _mach_node;
+ SGPropertyNode_ptr _tas_node;
+ FGEnvironmentMgr* _environmentManager;
};
#endif // __INSTRUMENTS_AIRSPEED_INDICATOR_HXX
_time_before_search_sec = 0;
_last_frequency_mhz = frequency_mhz;
}
+ _frequency_node->setDoubleValue(frequency_mhz);
// Get the aircraft position
double longitude_rad =
_turnRate(3.0), // degrees-per-second, so 180 degree turn takes 60 seconds
_overflightArmDistance(1.0),
_waypointAlertTime(30.0),
- _tuneRadio1ToRefVor(false),
_minRunwayLengthFt(0.0),
_requireHardSurface(true),
_cdiMaxDeflectionNm(3.0), // linear mode, 3nm at the peg
- _driveAutopilot(true)
+ _driveAutopilot(true),
+ _courseSelectable(false)
{
_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));
+ aOwner->tie(aCfg, "course-selectable", SGRawValuePointer<bool>(&_courseSelectable));
}
-const char*
-GPS::Config::getCourseSource() const
-{
- if (!_extCourseSource) {
- return "";
- }
-
- return _extCourseSource->getPath(true);
-}
-
-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),
+ _desiredCourse(0.0),
_dataValid(false),
_lastPosValid(false),
_mode("init"),
_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);
+ _eastWestVelocity = _gpsNode->getChild("ew-velocity-msec", 0, true);
+ _northSouthVelocity = _gpsNode->getChild("ns-velocity-msec", 0, true);
// waypoints
SGPropertyNode *wp_node = _gpsNode->getChild("wp", 0, 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"));
+ wp1Crs->alias(_gpsNode->getChild("desired-course-deg", 0, true));
// _true_wp1_bearing_error_node =
// wp1_node->getChild("true-bearing-error-deg", 0, true);
fromFlag->alias(wp1_node->getChild("from-flag"));
// autopilot drive properties
+ _apDrivingFlag = fgGetNode("/autopilot/settings/gps-driving-true-heading", true);
_apTrueHeading = fgGetNode("/autopilot/settings/true-heading-deg",true);
_apTargetAltitudeFt = fgGetNode("/autopilot/settings/target-altitude-ft", true);
_apAltitudeLock = fgGetNode("/autopilot/locks/altitude", true);
_config.bind(this, _gpsNode->getChild("config", 0, true));
// basic GPS outputs
tie(_gpsNode, "selected-course-deg", SGRawValueMethods<GPS, double>
- (*this, &GPS::getSelectedCourse, NULL));
-
+ (*this, &GPS::getSelectedCourse, &GPS::setSelectedCourse));
+ tie(_gpsNode, "desired-course-deg", SGRawValueMethods<GPS, double>
+ (*this, &GPS::getDesiredCourse, NULL));
+ _desiredCourseNode = _gpsNode->getChild("desired-course-deg");
+
tieSGGeodReadOnly(_gpsNode, _indicated_pos, "indicated-longitude-deg",
"indicated-latitude-deg", "indicated-altitude-ft");
_indicated_pos = SGGeod();
_last_vertical_speed = 0.0;
_last_true_track = 0.0;
+ _lastEWVelocity = _lastNSVelocity = 0.0;
_raim_node->setDoubleValue(0.0);
_indicated_pos = SGGeod();
_tracking_bug_node->setDoubleValue(0);
_true_bug_error_node->setDoubleValue(0);
_magnetic_bug_error_node->setDoubleValue(0);
+ _northSouthVelocity->setDoubleValue(0.0);
+ _eastWestVelocity->setDoubleValue(0.0);
}
void
updateBasicData(delta_time_sec);
if (_dataValid) {
- if (_mode == "obs") {
- _selectedCourse = _config.getExternalCourse();
- } else {
+ if (_mode != "obs") {
updateTurn();
}
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");
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);
+ speed_kt = fgGetLowPass(_last_speed_kts, speed_kt, dt/10.0);
_last_speed_kts = speed_kt;
+ SGGeod g = _indicated_pos;
+ g.setLongitudeDeg(_last_pos.getLongitudeDeg());
+ double northSouthM = SGGeodesy::distanceM(_last_pos, g);
+ northSouthM = copysign(northSouthM, _indicated_pos.getLatitudeDeg() - _last_pos.getLatitudeDeg());
+
+ double nsMSec = fgGetLowPass(_lastNSVelocity, northSouthM / dt, dt/2.0);
+ _lastNSVelocity = nsMSec;
+ _northSouthVelocity->setDoubleValue(nsMSec);
+
+
+ g = _indicated_pos;
+ g.setLatitudeDeg(_last_pos.getLatitudeDeg());
+ double eastWestM = SGGeodesy::distanceM(_last_pos, g);
+ eastWestM = copysign(eastWestM, _indicated_pos.getLongitudeDeg() - _last_pos.getLongitudeDeg());
+
+ double ewMSec = fgGetLowPass(_lastEWVelocity, eastWestM / dt, dt/2.0);
+ _lastEWVelocity = ewMSec;
+ _eastWestVelocity->setDoubleValue(ewMSec);
+
double odometer = _odometer_node->getDoubleValue();
_odometer_node->setDoubleValue(odometer + distance_m * SG_METER_TO_NM);
odometer = _trip_odometer_node->getDoubleValue();
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_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::tuneNavRadios()
-{
- 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()) {
_wp1Name = wp1.get_name();
_wp1_position = wp1.get_target();
- _selectedCourse = getLegMagCourse();
+ _desiredCourse = getLegMagCourse();
+ _desiredCourseNode->fireValueChanged();
wp1Changed();
}
return;
}
- _turnStartBearing = _selectedCourse;
+ _turnStartBearing = _desiredCourse;
// compute next leg course
SGWayPoint wp1(_routeMgr->get_waypoint(curIndex)),
wp2(_routeMgr->get_waypoint(curIndex + 1));
void GPS::driveAutopilot()
{
if (!_config.driveAutopilot() || !_realismSimpleGps->getBoolValue()) {
+ _apDrivingFlag->setBoolValue(false);
return;
}
// compatability feature - allow the route-manager / GPS to drive the
// generic autopilot heading hold *in leg mode only*
- if (_mode == "leg") {
+
+ bool drive = _mode == "leg";
+ _apDrivingFlag->setBoolValue(drive);
+
+ if (drive) {
// 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;
}
/////////////////////////////////////////////////////////////////////////////
// property getter/setters
+void GPS::setSelectedCourse(double crs)
+{
+ if (_selectedCourse == crs) {
+ return;
+ }
+
+ _selectedCourse = crs;
+ if ((_mode == "obs") || _config.courseSelectable()) {
+ _desiredCourse = _selectedCourse;
+ _desiredCourseNode->fireValueChanged();
+ }
+}
+
double GPS::getLegDistance() const
{
if (!_dataValid || (_mode == "obs")) {
return -9999.0;
}
- return _wp1TrueBearing - _magvar_node->getDoubleValue();
+ double magBearing = _wp1TrueBearing - _magvar_node->getDoubleValue();
+ SG_NORMALIZE_RANGE(magBearing, 0.0, 360.0);
+ return magBearing;
}
double GPS::getWP1CourseDeviation() const
return 0.0;
}
- double dev = getWP1MagBearing() - _selectedCourse;
+ double dev = getWP1MagBearing() - _desiredCourse;
SG_NORMALIZE_RANGE(dev, -180.0, 180.0);
if (fabs(dev) > 90.0) {
return false;
}
- double dev = getWP1MagBearing() - _selectedCourse;
+ double dev = getWP1MagBearing() - _desiredCourse;
SG_NORMALIZE_RANGE(dev, -180.0, 180.0);
return (fabs(dev) < 90.0);
void GPS::directTo()
{
- if (!isScratchPositionValid()) {
- SG_LOG(SG_INSTR, SG_WARN, "invalid DTO lat/lon");
- return;
+ _wp0_position = _indicated_pos;
+
+ if (isScratchPositionValid()) {
+ _wp1Ident = _scratchNode->getStringValue("ident");
+ _wp1Name = _scratchNode->getStringValue("name");
+ _wp1_position = _scratchPos;
}
- _wp0_position = _indicated_pos;
- _wp1Ident = _scratchNode->getStringValue("ident");
- _wp1Name = _scratchNode->getStringValue("name");
- _wp1_position = _scratchPos;
-
_mode = "dto";
- _selectedCourse = getLegMagCourse();
+ _desiredCourse = getLegMagCourse();
+ _desiredCourseNode->fireValueChanged();
clearScratch();
-
wp1Changed();
}
void GPS::selectOBSMode()
{
- if (!isScratchPositionValid()) {
- SG_LOG(SG_INSTR, SG_WARN, "invalid OBS lat/lon");
- return;
+ if (isScratchPositionValid()) {
+ _wp1Ident = _scratchNode->getStringValue("ident");
+ _wp1Name = _scratchNode->getStringValue("name");
+ _wp1_position = _scratchPos;
}
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();
}
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); }
bool driveAutopilot() const
{ return _driveAutopilot; }
+
+ bool courseSelectable() const
+ { return _courseSelectable; }
private:
bool _enableTurnAnticipation;
// (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;
+ // should we drive the autopilot directly or not?
bool _driveAutopilot;
+
+ // is selected-course-deg read to set desired-course or not?
+ bool _courseSelectable;
};
class SearchFilter : public FGPositioned::Filter
void updateTrackingBug();
void updateReferenceNavaid(double dt);
void referenceNavaidSet(const std::string& aNavaid);
- void tuneNavRadios();
void updateRouteData();
void driveAutopilot();
bool getScratchHasNext() const { return _searchHasNext; }
double getSelectedCourse() const { return _selectedCourse; }
+ void setSelectedCourse(double crs);
+ double getDesiredCourse() const { return _desiredCourse; }
+
double getCDIDeflection() const;
double getLegDistance() const;
SGPropertyNode_ptr _trip_odometer_node;
SGPropertyNode_ptr _true_bug_error_node;
SGPropertyNode_ptr _magnetic_bug_error_node;
+ SGPropertyNode_ptr _eastWestVelocity;
+ SGPropertyNode_ptr _northSouthVelocity;
SGPropertyNode_ptr _ref_navaid_id_node;
SGPropertyNode_ptr _ref_navaid_bearing_node;
SGPropertyNode_ptr _routeETE;
SGPropertyNode_ptr _routeEditedSignal;
SGPropertyNode_ptr _routeFinishedSignal;
-
+ SGPropertyNode_ptr _desiredCourseNode;
+
double _selectedCourse;
+ double _desiredCourse;
bool _dataValid;
SGGeod _last_pos;
double _last_speed_kts;
double _last_true_track;
double _last_vertical_speed;
+ double _lastEWVelocity;
+ double _lastNSVelocity;
std::string _mode;
GPSListener* _listener;
SGPropertyNode_ptr _realismSimpleGps; ///< should the GPS be simple or realistic?
// autopilot drive properties
+ SGPropertyNode_ptr _apDrivingFlag;
SGPropertyNode_ptr _apTrueHeading;
SGPropertyNode_ptr _apTargetAltitudeFt;
SGPropertyNode_ptr _apAltitudeLock;
// Destructor
FGNavRadio::~FGNavRadio()
{
+ if (gps_course_node) {
+ gps_course_node->removeChangeListener(this);
+ }
+
+ if (nav_slaved_to_gps_node) {
+ nav_slaved_to_gps_node->removeChangeListener(this);
+ }
+
delete term_tbl;
delete low_tbl;
delete high_tbl;
// gps slaving support
nav_slaved_to_gps_node = node->getChild("slaved-to-gps", 0, true);
+ nav_slaved_to_gps_node->addChangeListener(this);
+
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_course_node = fgGetNode("/instrumentation/gps/desired-course-deg", true);
+ gps_course_node->addChangeListener(this);
+
gps_xtrack_error_nm_node = fgGetNode("/instrumentation/gps/wp/wp[1]/course-error-nm", true);
_magvarNode = fgGetNode("/environment/magnetic-variation-deg", true);
_dmeInRange = (dme_distance < _dme->get_range() * SG_NM_TO_METER);
}
+void FGNavRadio::valueChanged (SGPropertyNode* prop)
+{
+ if (prop == gps_course_node) {
+ if (!nav_slaved_to_gps_node->getBoolValue()) {
+ return;
+ }
+
+ // GPS desired course has changed, sync up our selected-course
+ double v = prop->getDoubleValue();
+ if (v != sel_radial_node->getDoubleValue()) {
+ sel_radial_node->setDoubleValue(v);
+ }
+ } else if (prop == nav_slaved_to_gps_node) {
+ if (prop->getBoolValue()) {
+ // slaved-to-GPS activated, sync up selected course
+ sel_radial_node->setDoubleValue(gps_course_node->getDoubleValue());
+ }
+ }
+}
+
void FGNavRadio::updateGPSSlaved()
{
has_gs_node->setBoolValue(gps_has_gs_node->getBoolValue());
} else { // ILS or LOC
_gs = globals->get_gslist()->findByFreq(freq, pos);
has_gs_node->setBoolValue(_gs != NULL);
- _localizerWidth = localizerWidth(nav);
+ _localizerWidth = nav->localizerWidth();
twist = 0.0;
effective_range = nav->get_range();
id_c4_node->setIntValue( (int)identBuffer[3] );
}
-double FGNavRadio::localizerWidth(FGNavRecord* aLOC)
-{
- FGRunway* rwy = aLOC->runway();
- assert(rwy);
-
- SGVec3d thresholdCart(SGVec3d::fromGeod(rwy->threshold()));
- double axisLength = dist(aLOC->cart(), thresholdCart);
- double landingLength = dist(thresholdCart, SGVec3d::fromGeod(rwy->end()));
-
-// Reference: http://dcaa.slv.dk:8000/icaodocs/
-// ICAO standard width at threshold is 210 m = 689 feet = approx 700 feet.
-// ICAO 3.1.1 half course = DDM = 0.0775
-// ICAO 3.1.3.7.1 Sensitivity 0.00145 DDM/m at threshold
-// implies peg-to-peg of 214 m ... we will stick with 210.
-// ICAO 3.1.3.7.1 "Course sector angle shall not exceed 6 degrees."
-
-// Very short runway: less than 1200 m (4000 ft) landing length:
- if (landingLength < 1200.0) {
-// ICAO fudges localizer sensitivity for very short runways.
-// This produces a non-monotonic sensitivity-versus length relation.
- axisLength += 1050.0;
- }
-
-// Example: very short: San Diego KMYF (Montgomery Field) ILS RWY 28R
-// Example: short: Tom's River KMJX (Robert J. Miller) ILS RWY 6
-// Example: very long: Denver KDEN (Denver) ILS RWY 16R
- double raw_width = 210.0 / axisLength * SGD_RADIANS_TO_DEGREES;
- return raw_width < 6.0? raw_width : 6.0;
-}
-
void FGNavRadio::audioNavidChanged()
{
if (_sgr->exists(nav_fx_name)) {
class FGNavRecord;
typedef SGSharedPtr<FGNavRecord> FGNavRecordPtr;
-class FGNavRadio : public SGSubsystem
+class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener
{
FGMorse morse;
void clearOutputs();
- /**
- * Compute the localizer width in degrees - see implementation for
- * more information on the relevant standards and formulae.
- */
- double localizerWidth(FGNavRecord* aLOC);
FGNavRecord* findPrimaryNavaid(const SGGeod& aPos, double aFreqMHz);
/// accessor for tied, read-only 'operable' property
_tiedNodes.push_back(nd);
nd->tie(aRawValue);
}
+
+ // implement SGPropertyChangeListener
+ virtual void valueChanged (SGPropertyNode * prop);
public:
FGNavRadio(SGPropertyNode *node);
* boundary and aloft environment layers.
*/
static bool
-do_set_sea_level_degc (const SGPropertyNode * arg)
+do_set_sea_level_degc ( double temp_sea_level_degc)
{
- double temp_sea_level_degc = arg->getDoubleValue("temp-degc", 15.0);
-
SGPropertyNode *node, *child;
// boundary layers
return true;
}
+static bool
+do_set_sea_level_degc (const SGPropertyNode * arg)
+{
+ return do_set_sea_level_degc( arg->getDoubleValue("temp-degc", 15.0) );
+}
+
/**
* Set the outside air temperature at the "current" altitude by first
static bool
do_set_oat_degc (const SGPropertyNode * arg)
{
- const string &temp_str = arg->getStringValue("temp-degc", "15.0");
-
+ double oat_degc = arg->getDoubleValue("temp-degc", 15.0);
// check for an altitude specified in the arguments, otherwise use
// current aircraft altitude.
const SGPropertyNode *altitude_ft = arg->getChild("altitude-ft");
FGEnvironment dummy; // instantiate a dummy so we can leech a method
dummy.set_elevation_ft( altitude_ft->getDoubleValue() );
- dummy.set_temperature_degc( atof( temp_str.c_str() ) );
- double temp_sea_level_degc = dummy.get_temperature_sea_level_degc();
-
- //cout << "Altitude = " << altitude_ft->getDoubleValue() << endl;
- //cout << "Temp at alt (C) = " << atof( temp_str.c_str() ) << endl;
- //cout << "Temp sea level (C) = " << temp_sea_level_degc << endl;
-
- SGPropertyNode *node, *child;
-
- // boundary layers
- node = fgGetNode( "/environment/config/boundary" );
- if ( node != NULL ) {
- int i = 0;
- while ( ( child = node->getNode( "entry", i ) ) != NULL ) {
- child->setDoubleValue( "temperature-sea-level-degc",
- temp_sea_level_degc );
- ++i;
- }
- }
-
- // aloft layers
- node = fgGetNode( "/environment/config/aloft" );
- if ( node != NULL ) {
- int i = 0;
- while ( ( child = node->getNode( "entry", i ) ) != NULL ) {
- child->setDoubleValue( "temperature-sea-level-degc",
- temp_sea_level_degc );
- ++i;
- }
- }
-
- return true;
+ dummy.set_temperature_degc( oat_degc );
+ return do_set_sea_level_degc( dummy.get_temperature_sea_level_degc());
}
/**
* boundary and aloft environment layers.
*/
static bool
-do_set_dewpoint_sea_level_degc (const SGPropertyNode * arg)
+do_set_dewpoint_sea_level_degc (double dewpoint_sea_level_degc)
{
- double dewpoint_sea_level_degc = arg->getDoubleValue("dewpoint-degc", 5.0);
SGPropertyNode *node, *child;
return true;
}
+static bool
+do_set_dewpoint_sea_level_degc (const SGPropertyNode * arg)
+{
+ return do_set_dewpoint_sea_level_degc(arg->getDoubleValue("dewpoint-degc", 5.0));
+}
/**
* Set the outside air dewpoint at the "current" altitude by first
static bool
do_set_dewpoint_degc (const SGPropertyNode * arg)
{
- const string &dewpoint_str = arg->getStringValue("dewpoint-degc", "5.0");
+ double dewpoint_degc = arg->getDoubleValue("dewpoint-degc", 5.0);
// check for an altitude specified in the arguments, otherwise use
// current aircraft altitude.
FGEnvironment dummy; // instantiate a dummy so we can leech a method
dummy.set_elevation_ft( altitude_ft->getDoubleValue() );
- dummy.set_dewpoint_degc( atof( dewpoint_str.c_str() ) );
- double dewpoint_sea_level_degc = dummy.get_dewpoint_sea_level_degc();
-
- //cout << "Altitude = " << altitude_ft->getDoubleValue() << endl;
- //cout << "Dewpoint at alt (C) = " << atof( dewpoint_str.c_str() ) << endl;
- //cout << "Dewpoint at sea level (C) = " << dewpoint_sea_level_degc << endl;
-
- SGPropertyNode *node, *child;
-
- // boundary layers
- node = fgGetNode( "/environment/config/boundary" );
- if ( node != NULL ) {
- int i = 0;
- while ( ( child = node->getNode( "entry", i ) ) != NULL ) {
- child->setDoubleValue( "dewpoint-sea-level-degc",
- dewpoint_sea_level_degc );
- ++i;
- }
- }
-
- // aloft layers
- node = fgGetNode( "/environment/config/aloft" );
- if ( node != NULL ) {
- int i = 0;
- while ( ( child = node->getNode( "entry", i ) ) != NULL ) {
- child->setDoubleValue( "dewpoint-sea-level-degc",
- dewpoint_sea_level_degc );
- ++i;
- }
- }
-
- return true;
+ dummy.set_dewpoint_degc( dewpoint_degc );
+ return do_set_dewpoint_sea_level_degc(dummy.get_dewpoint_sea_level_degc());
}
/**
void
fgInitCommands ()
{
- SG_LOG(SG_GENERAL, SG_INFO, "Initializing basic built-in commands:");
+ SG_LOG(SG_GENERAL, SG_BULK, "Initializing basic built-in commands:");
for (int i = 0; built_ins[i].name != 0; i++) {
- SG_LOG(SG_GENERAL, SG_INFO, " " << built_ins[i].name);
+ SG_LOG(SG_GENERAL, SG_BULK, " " << built_ins[i].name);
globals->get_commands()->addCommand(built_ins[i].name,
built_ins[i].command);
}
#include <simgear/magvar/magvar.hxx>
#include <simgear/timing/sg_time.hxx>
#include <simgear/misc/sg_path.hxx>
+#include <simgear/scene/model/particles.hxx>
#include <simgear/sound/soundmgr_openal.hxx>
#include <Aircraft/aircraft.hxx>
smgr->resume();
}
}
+
+ // Pause the particle system
+ simgear::Particles::setFrozen(f);
}
fgGetNode(entry->getStringValue("property"), true);
log.nodes.push_back(node);
(*log.output) << log.delimiter
- << entry->getStringValue("title", node->getPath());
+ << entry->getStringValue("title", node->getPath().c_str());
}
(*log.output) << endl;
}
// is processing the scenery (doubled the frame-rate for me) -EMH-
#ifdef ENABLE_AUDIO_SUPPORT
static bool smgr_init = true;
+ static SGPropertyNode *sound_working = fgGetNode("/sim/sound/working");
if (smgr_init == true) {
- static SGPropertyNode *sound_working = fgGetNode("/sim/sound/working");
if (sound_working->getBoolValue() == true) {
fgInitSoundManager();
smgr_init = false;
static SGSoundMgr *smgr = globals->get_soundmgr();
static bool smgr_enabled = true;
+ if (sound_working->getBoolValue() == false) { // request to reinit
+ smgr->reinit();
+ smgr->resume();
+ sound_working->setBoolValue(true);
+ }
+
if (smgr_enabled != sound_enabled->getBoolValue()) {
if (smgr_enabled == true) { // request to suspend
smgr->suspend();
_roll_deg(0),
_pitch_deg(0),
_heading_deg(0),
- _damp_sync(0),
- _damp_roll(0),
- _damp_pitch(0),
- _damp_heading(0),
_scaling_type(FG_SCALING_MAX),
_aspect_ratio(0),
_cameraGroup(CameraGroup::getDefault())
_internal = internal;
+ _dampFactor = SGVec3d::zeros();
+ _dampOutput = SGVec3d::zeros();
+ _dampTarget = SGVec3d::zeros();
+
if (damp_roll > 0.0)
- _damp_roll = 1.0 / pow(10.0, fabs(damp_roll));
+ _dampFactor[0] = 1.0 / pow(10.0, fabs(damp_roll));
if (damp_pitch > 0.0)
- _damp_pitch = 1.0 / pow(10.0, fabs(damp_pitch));
+ _dampFactor[1] = 1.0 / pow(10.0, fabs(damp_pitch));
if (damp_heading > 0.0)
- _damp_heading = 1.0 / pow(10.0, fabs(damp_heading));
+ _dampFactor[2] = 1.0 / pow(10.0, fabs(damp_heading));
_offset_m.x() = x_offset_m;
_offset_m.y() = y_offset_m;
double roll = _roll_deg;
if ( !_from_model ) {
// update from our own data...
- dampEyeData(roll, pitch, head);
+ setDampTarget(roll, pitch, head);
+ getDampOutput(roll, pitch, head);
}
// The rotation rotating from the earth centerd frame to
_target_roll_deg = placement->getRollDeg();
} else {
// if not model then calculate our own target position...
- dampEyeData(_target_roll_deg, _target_pitch_deg, _target_heading_deg);
-
+ setDampTarget(_target_roll_deg, _target_pitch_deg, _target_heading_deg);
+ getDampOutput(_target_roll_deg, _target_pitch_deg, _target_heading_deg);
}
SGQuatd geodTargetOr = SGQuatd::fromYawPitchRollDeg(_target_heading_deg,
- _target_pitch_deg,
- _target_roll_deg);
+ _target_pitch_deg,
+ _target_roll_deg);
SGQuatd geodTargetHlOr = SGQuatd::fromLonLat(_target);
_roll_deg = placement->getRollDeg();
} else {
// update from our own data, just the rotation here...
- dampEyeData(_roll_deg, _pitch_deg, _heading_deg);
+ setDampTarget(_roll_deg, _pitch_deg, _heading_deg);
+ getDampOutput(_roll_deg, _pitch_deg, _heading_deg);
}
- SGQuatd geodEyeOr = SGQuatd::fromYawPitchRollDeg(_heading_deg,
- _pitch_deg,
- _roll_deg);
+ SGQuatd geodEyeOr = SGQuatd::fromYawPitchRollDeg(_heading_deg, _pitch_deg, _roll_deg);
SGQuatd geodEyeHlOr = SGQuatd::fromLonLat(_position);
// the rotation offset, don't know why heading is negative here ...
}
void
-FGViewer::dampEyeData(double &roll_deg, double &pitch_deg, double &heading_deg)
+FGViewer::setDampTarget(double roll, double pitch, double heading)
{
- const double interval = 0.01;
+ _dampTarget = SGVec3d(roll, pitch, heading);
+}
+
+void
+FGViewer::getDampOutput(double& roll, double& pitch, double& heading)
+{
+ roll = _dampOutput[0];
+ pitch = _dampOutput[1];
+ heading = _dampOutput[2];
+}
+
+void
+FGViewer::updateDampOutput(double dt)
+{
static FGViewer *last_view = 0;
- if (last_view != this) {
- _damp_sync = 0.0;
- _damped_roll_deg = roll_deg;
- _damped_pitch_deg = pitch_deg;
- _damped_heading_deg = heading_deg;
+ if ((last_view != this) || (dt > 1.0)) {
+ _dampOutput = _dampTarget;
last_view = this;
return;
}
-
- if (_damp_sync < interval) {
- if (_damp_roll > 0.0)
- roll_deg = _damped_roll_deg;
- if (_damp_pitch > 0.0)
- pitch_deg = _damped_pitch_deg;
- if (_damp_heading > 0.0)
- heading_deg = _damped_heading_deg;
- return;
- }
-
- while (_damp_sync >= interval) {
- _damp_sync -= interval;
-
- double d;
- if (_damp_roll > 0.0) {
- d = _damped_roll_deg - roll_deg;
- if (d >= 180.0)
- _damped_roll_deg -= 360.0;
- else if (d < -180.0)
- _damped_roll_deg += 360.0;
- roll_deg = _damped_roll_deg = roll_deg * _damp_roll + _damped_roll_deg * (1 - _damp_roll);
- }
-
- if (_damp_pitch > 0.0) {
- d = _damped_pitch_deg - pitch_deg;
- if (d >= 180.0)
- _damped_pitch_deg -= 360.0;
- else if (d < -180.0)
- _damped_pitch_deg += 360.0;
- pitch_deg = _damped_pitch_deg = pitch_deg * _damp_pitch + _damped_pitch_deg * (1 - _damp_pitch);
- }
-
- if (_damp_heading > 0.0) {
- d = _damped_heading_deg - heading_deg;
- if (d >= 180.0)
- _damped_heading_deg -= 360.0;
- else if (d < -180.0)
- _damped_heading_deg += 360.0;
- heading_deg = _damped_heading_deg = heading_deg * _damp_heading + _damped_heading_deg * (1 - _damp_heading);
- }
- }
+
+ const double interval = 0.01;
+ while (dt > interval) {
+
+ for (unsigned int i=0; i<3; ++i) {
+ if (_dampFactor[i] <= 0.0) {
+ // axis is un-damped, set output to target directly
+ _dampOutput[i] = _dampTarget[i];
+ continue;
+ }
+
+ double d = _dampOutput[i] - _dampTarget[i];
+ if (d > 180.0) {
+ _dampOutput[i] -= 360.0;
+ } else if (d < -180.0) {
+ _dampOutput[i] += 360.0;
+ }
+
+ _dampOutput[i] = (_dampTarget[i] * _dampFactor[i]) +
+ (_dampOutput[i] * (1.0 - _dampFactor[i]));
+ } // of axis iteration
+
+ dt -= interval;
+ } // of dt subdivision by interval
}
double
void
FGViewer::update (double dt)
{
- _damp_sync += dt;
-
+ updateDampOutput(dt);
+
int i;
int dt_ms = int(dt * 1000);
for ( i = 0; i < dt_ms; i++ ) {
double _target_pitch_deg;
double _target_heading_deg;
- double _damp_sync;
- double _damp_roll;
- double _damp_pitch;
- double _damp_heading;
-
- double _damped_roll_deg;
- double _damped_pitch_deg;
- double _damped_heading_deg;
-
+ SGVec3d _dampTarget; ///< current target value we are damping towards
+ SGVec3d _dampOutput; ///< current output of damping filter
+ SGVec3d _dampFactor; ///< weighting of the damping filter
+
// Position offsets from FDM origin. The X axis is positive
// out the tail, Y is out the right wing, and Z is positive up.
// distance in meters
void recalc ();
void recalcLookFrom();
void recalcLookAt();
- void dampEyeData(double &roll_deg, double &pitch_deg, double &heading_deg);
+ void setDampTarget(double h, double p, double r);
+ void getDampOutput(double& roll, double& pitch, double& heading);
+
+ void updateDampOutput(double dt);
+
// add to _heading_offset_deg
inline void incHeadingOffset_deg( double amt ) {
set_dirty();
mServer.set(txAddress.c_str(), txPort);
if (strncmp (mServer.getHost(), "0.0.0.0", 8) == 0) {
mHaveServer = false;
- SG_LOG(SG_NETWORK, SG_ALERT,
+ SG_LOG(SG_NETWORK, SG_DEBUG,
"FGMultiplayMgr - could not resolve '"
<< txAddress << "', Multiplayermode disabled");
} else {
rxPort = txPort;
}
if (rxPort <= 0) {
- SG_LOG(SG_NETWORK, SG_ALERT,
+ SG_LOG(SG_NETWORK, SG_DEBUG,
"FGMultiplayMgr - No receiver port, Multiplayermode disabled");
return (false);
}
// A memory leak was reported here by valgrind
mSocket = new netSocket();
if (!mSocket->open(false)) {
- SG_LOG( SG_NETWORK, SG_ALERT,
+ SG_LOG( SG_NETWORK, SG_DEBUG,
"FGMultiplayMgr::init - Failed to create data socket" );
return false;
}
mSocket->setBlocking(false);
if (mSocket->bind(rxAddress.c_str(), rxPort) != 0) {
perror("bind");
- SG_LOG( SG_NETWORK, SG_ALERT,
+ SG_LOG( SG_NETWORK, SG_DEBUG,
"FGMultiplayMgr::Open - Failed to bind receive socket" );
return false;
}
if ((! mInitialised) || (! mHaveServer))
return;
if (! mHaveServer) {
- SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::SendMyPosition - no server");
+ SG_LOG( SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::SendMyPosition - no server");
return;
}
break;
}
if (bytes <= static_cast<ssize_t>(sizeof(T_MsgHdr))) {
- SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - "
+ SG_LOG( SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::MP_ProcessData - "
<< "received message with insufficient data" );
break;
}
MsgHdr->ReplyPort = XDR_decode_uint32 (MsgHdr->ReplyPort);
MsgHdr->Callsign[MAX_CALLSIGN_LEN -1] = '\0';
if (MsgHdr->Magic != MSG_MAGIC) {
- SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - "
+ SG_LOG( SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::MP_ProcessData - "
<< "message has invalid magic number!" );
break;
}
if (MsgHdr->Version != PROTO_VER) {
- SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - "
+ SG_LOG( SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::MP_ProcessData - "
<< "message has invalid protocoll number!" );
break;
}
if (MsgHdr->MsgLen != bytes) {
- SG_LOG(SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - "
+ SG_LOG(SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::MP_ProcessData - "
<< "message from " << MsgHdr->Callsign << " has invalid length!");
break;
}
case OLD_POS_DATA_ID:
break;
default:
- SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - "
+ SG_LOG( SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::MP_ProcessData - "
<< "Unknown message Id received: " << MsgHdr->MsgId );
break;
}
{
const T_MsgHdr* MsgHdr = Msg.msgHdr();
if (MsgHdr->MsgLen < sizeof(T_MsgHdr) + sizeof(T_PositionMsg)) {
- SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - "
+ SG_LOG( SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::MP_ProcessData - "
<< "Position message received with insufficient data" );
return;
}
default:
pData->float_value = XDR_decode_float(*xdr);
- SG_LOG(SG_NETWORK, SG_ALERT, "Unknown Prop type " << pData->id << " " << pData->type);
+ SG_LOG(SG_NETWORK, SG_DEBUG, "Unknown Prop type " << pData->id << " " << pData->type);
xdr++;
break;
}
{
const T_MsgHdr* MsgHdr = Msg.msgHdr();
if (MsgHdr->MsgLen < sizeof(T_MsgHdr) + 1) {
- SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - "
+ SG_LOG( SG_NETWORK, SG_DEBUG, "FGMultiplayMgr::MP_ProcessData - "
<< "Chat message received with insufficient data" );
return;
}
}
}
+double FGNavRecord::localizerWidth() const
+{
+ if (!mRunway) {
+ return 6.0;
+ }
+
+ SGVec3d thresholdCart(SGVec3d::fromGeod(mRunway->threshold()));
+ double axisLength = dist(cart(), thresholdCart);
+ double landingLength = dist(thresholdCart, SGVec3d::fromGeod(mRunway->end()));
+
+// Reference: http://dcaa.slv.dk:8000/icaodocs/
+// ICAO standard width at threshold is 210 m = 689 feet = approx 700 feet.
+// ICAO 3.1.1 half course = DDM = 0.0775
+// ICAO 3.1.3.7.1 Sensitivity 0.00145 DDM/m at threshold
+// implies peg-to-peg of 214 m ... we will stick with 210.
+// ICAO 3.1.3.7.1 "Course sector angle shall not exceed 6 degrees."
+
+// Very short runway: less than 1200 m (4000 ft) landing length:
+ if (landingLength < 1200.0) {
+// ICAO fudges localizer sensitivity for very short runways.
+// This produces a non-monotonic sensitivity-versus length relation.
+ axisLength += 1050.0;
+ }
+
+// Example: very short: San Diego KMYF (Montgomery Field) ILS RWY 28R
+// Example: short: Tom's River KMJX (Robert J. Miller) ILS RWY 6
+// Example: very long: Denver KDEN (Denver) ILS RWY 16R
+ double raw_width = 210.0 / axisLength * SGD_RADIANS_TO_DEGREES;
+ return raw_width < 6.0? raw_width : 6.0;
+
+}
+
FGTACANRecord::FGTACANRecord(void) :
channel(""),
freq(0)
* Retrieve the runway this navaid is associated with (for ILS/LOC/GS)
*/
FGRunway* runway() const { return mRunway; }
+
+ /**
+ * return the localizer width, in degrees
+ * computation is based up ICAO stdandard width at the runway threshold
+ * see implementation for further details.
+ */
+ double localizerWidth() const;
};
class FGTACANRecord : public SGReferenced {
#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 <simgear/math/SGGeometry.hxx>
#include "positioned.hxx"
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;
-}
-
/**
* Decorate an object with a double value, and use that value to order
* items, for the purpoises of the STL algorithms
double distSqrToNearest(const SGVec3d& aPos) const
{
- return distSqr(aPos, getClosestPoint(aPos));
+ return distSqr(aPos, _box.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;
return new FGPositioned(WAYPOINT, aIdent, aPos, true);
}
-SGBucket
-FGPositioned::bucket() const
-{
- return SGBucket(mPosition);
-}
-
SGVec3d
FGPositioned::cart() const
{
#include <vector>
#include <simgear/structure/SGSharedPtr.hxx>
-#include <simgear/bucket/newbucket.hxx>
+#include <simgear/math/SGMath.hxx>
class FGPositioned;
*/
SGVec3d cart() const;
- SGBucket bucket() const;
-
double latitude() const
{ return mPosition.getLatitudeDeg(); }
case FG_DOUBLE:
val = _out_message[i].offset +
- _out_message[i].prop->getFloatValue() * _out_message[i].factor;
- snprintf(tmp, 255, _out_message[i].format.c_str(), (float)val);
+ _out_message[i].prop->getDoubleValue() * _out_message[i].factor;
+ snprintf(tmp, 255, _out_message[i].format.c_str(), (double)val);
break;
default: // SG_STRING
}
}
} else {
- do {
- if (!binary_mode) {
- length = io->readline( buf, FG_MAX_MSG_SIZE );
- if ( length > 0 ) {
- parse_message();
- }
- } else {
- length = io->read( buf, binary_record_length );
- if ( length == binary_record_length ) {
- parse_message();
- } else if ( length > 0 ) {
- SG_LOG( SG_IO, SG_ALERT,
- "Generic protocol: Received binary "
- "record of unexpected size, expected: "
- << binary_record_length << " but received: "
- << length);
- }
+ if (!binary_mode) {
+ while ((length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) {
+ parse_message();
}
- } while ( length == binary_record_length );
+ } else {
+ while ((length = io->read( buf, binary_record_length ))
+ == binary_record_length ) {
+ parse_message();
+ }
+
+ if ( length > 0 ) {
+ SG_LOG( SG_IO, SG_ALERT,
+ "Generic protocol: Received binary "
+ "record of unexpected size, expected: "
+ << binary_record_length << " but received: "
+ << length);
+ }
+ }
}
}
return true;
#include <simgear/debug/logstream.hxx>
#include <simgear/io/iochannel.hxx>
+#include <simgear/misc/stdint.hxx>
#include <Aircraft/aircraft.hxx>
#include <Main/fg_props.hxx>
if ( io->get_type() == sgFileType ) {
if ( io->read( (char *)(& buf), length ) == length ) {
SG_LOG( SG_IO, SG_DEBUG, "Success reading data." );
- long int *msg;
- msg = (long int *)buf;
+ int32_t *msg = (int32_t *)buf;
for( int i = 0; i < 4; ++i )
{
axis[i] = ((double)msg[i] / 2147483647.0);
} else {
while ( io->read( (char *)(& buf), length ) == length ) {
SG_LOG( SG_IO, SG_DEBUG, "Success reading data." );
- long int *msg;
- msg = (long int *)buf;
+ int32_t *msg = (int32_t *)buf;
SG_LOG( SG_IO, SG_DEBUG, "ax0 = " << msg[0] << " ax1 = "
<< msg[1] << "ax2 = " << msg[2] << "ax3 = " << msg[3]);
for( int i = 0; i < 4; ++i )
const char* src = n->getStringValue("script");
if(!n->hasChild("script")) src = 0; // Hrm...
if(src)
- createModule(module, n->getPath(), src, strlen(src));
+ createModule(module, n->getPath().c_str(), src, strlen(src));
if(!file_specified && !src)
SG_LOG(SG_NASAL, SG_ALERT, "Nasal error: " <<
{
const char* nasal = arg->getStringValue("script");
const char* moduleName = arg->getStringValue("module");
- naRef code = parse(arg->getPath(true), nasal, strlen(nasal));
+ naRef code = parse(arg->getPath(true).c_str(), nasal, strlen(nasal));
if(naIsNil(code)) return false;
// Commands can be run "in" a module. Make sure that module
#include "SchedFlight.hxx"
#include "TrafficMgr.hxx"
-using std::sort;
-
/******************************************************************************
* the FGAISchedule class contains data members and code to maintain a
* schedule of Flights for an articically controlled aircraft.
AIManagerRef = 0;
heavy = false;
- lat = 0;
- lon = 0;
radius = 0;
groundOffset = 0;
distanceToUser = 0;
airline = arln;
m_class = mclass;
flightType = fltpe;
- lat = 0;
- lon = 0;
radius = rad;
groundOffset = grnd;
distanceToUser = 0;
heavy = other.heavy;
flightIdentifier = other.flightIdentifier;
flights = other.flights;
- lat = other.lat;
- lon = other.lon;
AIManagerRef = other.AIManagerRef;
acType = other.acType;
airline = other.airline;
return true;
}
-bool FGAISchedule::update(time_t now)
+bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
{
- FGAirport *dep;
- FGAirport *arr;
- double angle;
-
- FGAIManager *aimgr;
- string airport;
-
- double speed;
-
+ if (!fgGetBool("/sim/traffic-manager/enabled"))
+ return true;
+
time_t
totalTimeEnroute,
elapsedTimeEnroute,
- remainingTimeEnroute, deptime = 0;
- double
- userLatitude,
- userLongitude;
-
- SGVec3d newPos(0, 0, 0);
-
-
- if (fgGetBool("/sim/traffic-manager/enabled") == false)
- return true;
+ remainingTimeEnroute,
+ deptime = 0;
- aimgr = (FGAIManager *) globals-> get_subsystem("ai_model");
- // Out-of-work aircraft seeks employment. Willing to work irregular hours ...
- //cerr << "About to find a flight " << endl;
- if (flights.empty()) {
- //execute this loop at least once.
- SG_LOG(SG_GENERAL, SG_BULK, "Scheduling for : " << modelPath << " " << registration << " " << homePort);
- FGScheduledFlight *flight = 0;
- do {
- flight = findAvailableFlight(currentDestination, flightIdentifier);
- if (flight) {
- currentDestination = flight->getArrivalAirport()->getId();
- time_t arr, dep;
- dep = flight->getDepartureTime();
- arr = flight->getArrivalTime();
- string depT = asctime(gmtime(&dep));
- string arrT = asctime(gmtime(&arr));
-
- depT = depT.substr(0,24);
- arrT = arrT.substr(0,24);
- SG_LOG(SG_GENERAL, SG_BULK, " " << flight->getCallSign() << ":"
- << " " << flight->getDepartureAirport()->getId() << ":"
- << " " << depT << ":"
- << " \"" << flight->getArrivalAirport()->getId() << "\"" << ":"
- << " " << arrT << ":");
- flights.push_back(flight);
- }
- } while ((currentDestination != homePort) && (flight != 0));
- SG_LOG(SG_GENERAL, SG_BULK, cerr << " Done " << endl);
- }
- //cerr << " Done " << endl;
- // No flights available for this aircraft
- if (flights.size() == 0) {
+ scheduleFlights();
+ if (flights.empty()) { // No flights available for this aircraft
return false;
}
+
// Sort all the scheduled flights according to scheduled departure time.
// Because this is done at every update, we only need to check the status
// of the first listed flight.
//sort(flights.begin(), flights.end(), compareScheduledFlights);
- if (firstRun) {
+
+ if (firstRun) {
if (fgGetBool("/sim/traffic-manager/instantaneous-action") == true) {
- deptime = now + rand() % 300; // Wait up to 5 minutes until traffic starts moving to prevent too many aircraft
+ deptime = now; // + rand() % 300; // Wait up to 5 minutes until traffic starts moving to prevent too many aircraft
// from cluttering the gate areas.
- cerr << "Scheduling " << registration << " for instantaneous action flight " << endl;
}
firstRun = false;
}
- if (!deptime)
- deptime = (*flights.begin())->getDepartureTime();
- FGScheduledFlightVecIterator i = flights.begin();
- SG_LOG (SG_GENERAL, SG_DEBUG,"Traffic Manager: Processing registration " << registration << " with callsign " << (*i)->getCallSign());
- if (AIManagerRef)
- {
- // Check if this aircraft has been released.
- FGTrafficManager *tmgr = (FGTrafficManager *) globals->get_subsystem("Traffic Manager");
- if (tmgr->isReleased(AIManagerRef))
- AIManagerRef = 0;
+
+ FGScheduledFlight* flight = flights.front();
+ if (!deptime) {
+ deptime = flight->getDepartureTime();
+ //cerr << "Settiing departure time " << deptime << endl;
+ }
+
+ if (AIManagerRef) {
+ // Check if this aircraft has been released.
+ FGTrafficManager *tmgr = (FGTrafficManager *) globals->get_subsystem("Traffic Manager");
+ if (tmgr->isReleased(AIManagerRef)) {
+ AIManagerRef = NULL;
+ } else {
+ return true; // in visual range, let the AIManager handle it
}
-
- if (!AIManagerRef)
- {
- userLatitude = fgGetDouble("/position/latitude-deg");
- userLongitude = fgGetDouble("/position/longitude-deg");
-
- //cerr << "Estimated minimum distance to user: " << distanceToUser << endl;
- // This flight entry is entirely in the past, do we need to
- // push it forward in time to the next scheduled departure.
- if (((*i)->getDepartureTime() < now) && ((*i)->getArrivalTime() < now))
- {
- SG_LOG (SG_GENERAL, SG_DEBUG, "Traffic Manager: Flight is in the Past");
- //cerr << modelPath << " " << registration << ": Flights from the past belong to the past :-)" << endl;
- //exit(1);
- // Don't just update: check whether we need to load a new leg. etc.
- // This update occurs for distant aircraft, so we can update the current leg
- // and detach it from the current list of aircraft.
- (*i)->update();
- i = flights.erase(i);
+ }
+
+ // This flight entry is entirely in the past, do we need to
+ // push it forward in time to the next scheduled departure.
+ if (flight->getArrivalTime() < now) {
+ SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager: Flight is in the Past");
+ // Don't just update: check whether we need to load a new leg. etc.
+ // This update occurs for distant aircraft, so we can update the current leg
+ // and detach it from the current list of aircraft.
+ flight->update();
+ flights.erase(flights.begin()); // pop_front(), effectively
return true;
}
-
- // Departure time in the past and arrival time in the future.
- // This flight is in progress, so we need to calculate it's
- // approximate position and -if in range- create an AIAircraft
- // object for it.
- //if ((i->getDepartureTime() < now) && (i->getArrivalTime() > now))
+
+ FGAirport* dep = flight->getDepartureAirport();
+ FGAirport* arr = flight->getArrivalAirport();
+ if (!dep || !arr) {
+ return false;
+ }
+
+ double speed = 450.0;
+ if (dep != arr) {
+ totalTimeEnroute = flight->getArrivalTime() - flight->getDepartureTime();
+ if (flight->getDepartureTime() < now) {
+ elapsedTimeEnroute = now - flight->getDepartureTime();
+ remainingTimeEnroute = totalTimeEnroute - elapsedTimeEnroute;
+ double x = elapsedTimeEnroute / (double) totalTimeEnroute;
- // Part of this flight is in the future.
- if ((*i)->getArrivalTime() > now)
- {
-
- dep = (*i)->getDepartureAirport();
- arr = (*i)->getArrivalAirport ();
- if (!(dep && arr))
- return false;
-
- 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));
-
- // 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());
- 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
- // one hour flight time, so that would be a good approximate point
- // to start a more detailed simulation of this aircraft.
- SG_LOG (SG_GENERAL, SG_DEBUG, "Traffic manager: " << registration << " is scheduled for a flight from "
+ // current pos is based on great-circle course between departure/arrival,
+ // with percentage of distance travelled, based upon percentage of time
+ // enroute elapsed.
+ double course, az2, distanceM;
+ SGGeodesy::inverse(dep->geod(), arr->geod(), course, az2, distanceM);
+ double coveredDistance = distanceM * x;
+
+ SGGeodesy::direct(dep->geod(), course, coveredDistance, position, az2);
+
+ SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager: Flight is in progress, %=" << x);
+ speed = ((distanceM - coveredDistance) * SG_METER_TO_NM) / 3600.0;
+ } else {
+ // not departed yet
+ remainingTimeEnroute = totalTimeEnroute;
+ elapsedTimeEnroute = 0;
+ position = dep->geod();
+ SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager: Flight is pending, departure in "
+ << flight->getDepartureTime() - now << " seconds ");
+ }
+ } else {
+ // departure / arrival coincident
+ remainingTimeEnroute = totalTimeEnroute = 0.0;
+ elapsedTimeEnroute = 0;
+ position = dep->geod();
+ }
+
+ // cartesian calculations are more numerically stable over the (potentially)
+ // large distances involved here: see bug #80
+ distanceToUser = dist(userCart, SGVec3d::fromGeod(position)) * SG_METER_TO_NM;
+
+ // If distance between user and simulated aircaft is less
+ // then 500nm, create this flight. At jet speeds 500 nm is roughly
+ // one hour flight time, so that would be a good approximate point
+ // to start a more detailed simulation of this aircraft.
+ SG_LOG (SG_GENERAL, SG_BULK, "Traffic manager: " << registration << " is scheduled for a flight from "
<< dep->getId() << " to " << arr->getId() << ". Current distance to user: "
<< distanceToUser);
- if (distanceToUser < TRAFFICTOAIDISTTOSTART)
- {
- string flightPlanName = dep->getId() + string("-") + arr->getId() +
- string(".xml");
- SG_LOG (SG_GENERAL, SG_DEBUG, "Traffic manager: Creating AIModel");
- //int alt;
- //if ((i->getDepartureTime() < now))
- //{
- // alt = i->getCruiseAlt() *100;
- // }
- //else
- //{
- // alt = dep->_elevation+19;
- // }
-
- // Only allow traffic to be created when the model path (or the AI version of mp) exists
- SGPath mp(globals->get_fg_root());
- SGPath mp_ai = mp;
-
- mp.append(modelPath);
- mp_ai.append("AI");
- mp_ai.append(modelPath);
-
- if (mp.exists() || mp_ai.exists())
- {
- FGAIAircraft *aircraft = new FGAIAircraft(this);
- aircraft->setPerformance(m_class); //"jet_transport";
- aircraft->setCompany(airline); //i->getAirline();
- aircraft->setAcType(acType); //i->getAcType();
- aircraft->setPath(modelPath.c_str());
- //aircraft->setFlightPlan(flightPlanName);
- aircraft->setLatitude(lat);
- aircraft->setLongitude(lon);
- aircraft->setAltitude((*i)->getCruiseAlt()*100); // convert from FL to feet
- aircraft->setSpeed(speed);
- aircraft->setBank(0);
+ if (distanceToUser >= TRAFFICTOAIDISTTOSTART) {
+ return true; // out of visual range, for the moment.
+ }
+
+ return createAIAircraft(flight, speed, deptime);
+}
+
+bool FGAISchedule::createAIAircraft(FGScheduledFlight* flight, double speedKnots, time_t deptime)
+{
+ FGAirport* dep = flight->getDepartureAirport();
+ FGAirport* arr = flight->getArrivalAirport();
+ string flightPlanName = dep->getId() + "-" + arr->getId() + ".xml";
+ SG_LOG(SG_GENERAL, SG_INFO, "Traffic manager: Creating AIModel from:" << flightPlanName);
+
+ // Only allow traffic to be created when the model path (or the AI version of mp) exists
+ SGPath mp(globals->get_fg_root());
+ SGPath mp_ai = mp;
+
+ mp.append(modelPath);
+ mp_ai.append("AI");
+ mp_ai.append(modelPath);
+
+ if (!mp.exists() && !mp_ai.exists()) {
+ SG_LOG(SG_INPUT, SG_WARN, "TrafficManager: Could not load model " << mp.str());
+ return true;
+ }
+
+ FGAIAircraft *aircraft = new FGAIAircraft(this);
+ aircraft->setPerformance(m_class); //"jet_transport";
+ aircraft->setCompany(airline); //i->getAirline();
+ aircraft->setAcType(acType); //i->getAcType();
+ aircraft->setPath(modelPath.c_str());
+ //aircraft->setFlightPlan(flightPlanName);
+ aircraft->setLatitude(position.getLatitudeDeg());
+ aircraft->setLongitude(position.getLongitudeDeg());
+ aircraft->setAltitude(flight->getCruiseAlt()*100); // convert from FL to feet
+ aircraft->setSpeed(speedKnots);
+ aircraft->setBank(0);
- courseToDest = SGGeodesy::courseDeg(current, arr->geod());
- aircraft->SetFlightPlan(new FGAIFlightPlan(aircraft, flightPlanName, courseToDest, deptime,
- dep, arr,true, radius,
- (*i)->getCruiseAlt()*100,
- lat, lon, speed, flightType, acType,
+ courseToDest = SGGeodesy::courseDeg(position, arr->geod());
+ aircraft->SetFlightPlan(new FGAIFlightPlan(aircraft, flightPlanName, courseToDest, deptime,
+ dep, arr, true, radius,
+ flight->getCruiseAlt()*100,
+ position.getLatitudeDeg(),
+ position.getLongitudeDeg(),
+ speedKnots, flightType, acType,
airline));
- aimgr->attach(aircraft);
-
-
- AIManagerRef = aircraft->getID();
- //cerr << "Class: " << m_class << ". acType: " << acType << ". Airline: " << airline << ". Speed = " << speed << ". From " << dep->getId() << " to " << arr->getId() << ". Time Fraction = " << (remainingTimeEnroute/(double) totalTimeEnroute) << endl;
- //cerr << "Latitude : " << lat << ". Longitude : " << lon << endl;
- //cerr << "Dep : " << dep->getLatitude()<< ", "<< dep->getLongitude() << endl;
- //cerr << "Arr : " << arr->getLatitude()<< ", "<< arr->getLongitude() << endl;
- //cerr << "Time remaining = " << (remainingTimeEnroute/3600.0) << endl;
- //cerr << "Total time = " << (totalTimeEnroute/3600.0) << endl;
- //cerr << "Distance remaining = " << distanceToDest*SG_METER_TO_NM << endl;
- }
- else
- {
- SG_LOG(SG_INPUT, SG_WARN, "TrafficManager: Could not load model " << mp.str());
- }
- }
- return true;
- }
+
+
+ FGAIManager* aimgr = (FGAIManager *) globals-> get_subsystem("ai_model");
+ aimgr->attach(aircraft);
+ AIManagerRef = aircraft->getID();
+ return true;
+}
- // Both departure and arrival time are in the future, so this
- // the aircraft is parked at the departure airport.
- // Currently this status is mostly ignored, but in future
- // versions, code should go here that -if within user range-
- // positions these aircraft at parking locations at the airport.
- if (((*i)->getDepartureTime() > now) && ((*i)->getArrivalTime() > now))
- {
- dep = (*i)->getDepartureAirport();
- return true;
- }
+void FGAISchedule::scheduleFlights()
+{
+ if (!flights.empty()) {
+ return;
+ }
+
+ SG_LOG(SG_GENERAL, SG_BULK, "Scheduling for : " << modelPath << " " << registration << " " << homePort);
+ FGScheduledFlight *flight = NULL;
+ do {
+ flight = findAvailableFlight(currentDestination, flightIdentifier);
+ if (!flight) {
+ break;
}
- //cerr << "Traffic schedule got to beyond last clause" << endl;
- // EMH: prevent a warning, should this be 'true' instead?
- // DT: YES. Originally, this code couldn't be reached, but
- // when the "if(!(AIManagerManager))" clause is false we
- // fall through right to the end. This is a valid flow.
- // the actual value is pretty innocent, only it triggers
- // warning in TrafficManager::update().
- // (which was added as a sanity check for myself in the first place. :-)
- return true;
+
+ currentDestination = flight->getArrivalAirport()->getId();
+
+ time_t arr, dep;
+ dep = flight->getDepartureTime();
+ arr = flight->getArrivalTime();
+ string depT = asctime(gmtime(&dep));
+ string arrT = asctime(gmtime(&arr));
+
+ depT = depT.substr(0,24);
+ arrT = arrT.substr(0,24);
+ SG_LOG(SG_GENERAL, SG_BULK, " " << flight->getCallSign() << ":"
+ << " " << flight->getDepartureAirport()->getId() << ":"
+ << " " << depT << ":"
+ << " \"" << flight->getArrivalAirport()->getId() << "\"" << ":"
+ << " " << arrT << ":");
+
+ flights.push_back(flight);
+ } while (currentDestination != homePort);
+ SG_LOG(SG_GENERAL, SG_BULK, " Done ");
}
-
bool FGAISchedule::next()
{
- FGScheduledFlightVecIterator i = flights.begin();
- (*i)->release();
- //FIXME: remove first entry,
- // load new flights until back at home airport
- // Lock loaded flights
- //sort(flights.begin(), flights.end(), compareScheduledFlights);
- // until that time
- i = flights.erase(i);
- //cerr << "Next: scheduling for : " << modelPath << " " << registration << endl;
+ if (!flights.empty()) {
+ flights.front()->release();
+ flights.erase(flights.begin());
+ }
+
FGScheduledFlight *flight = findAvailableFlight(currentDestination, flightIdentifier);
- if (flight) {
- currentDestination = flight->getArrivalAirport()->getId();
- time_t arr, dep;
- dep = flight->getDepartureTime();
- arr = flight->getArrivalTime();
- string depT = asctime(gmtime(&dep));
- string arrT = asctime(gmtime(&arr));
-
- depT = depT.substr(0,24);
- arrT = arrT.substr(0,24);
- //cerr << " " << flight->getCallSign() << ":"
- // << " " << flight->getDepartureAirport()->getId() << ":"
- // << " " << depT << ":"
- // << " \"" << flight->getArrivalAirport()->getId() << "\"" << ":"
- // << " " << arrT << ":" << endl;
-
- flights.push_back(flight);
- return true;
- } else {
- return false;
+ if (!flight) {
+ return false;
}
- //cerr << "FGAISchedule :: next needs updating" << endl;
- //exit(1);
+
+ currentDestination = flight->getArrivalAirport()->getId();
+/*
+ time_t arr, dep;
+ dep = flight->getDepartureTime();
+ arr = flight->getArrivalTime();
+ string depT = asctime(gmtime(&dep));
+ string arrT = asctime(gmtime(&arr));
+
+ depT = depT.substr(0,24);
+ arrT = arrT.substr(0,24);
+ //cerr << " " << flight->getCallSign() << ":"
+ // << " " << flight->getDepartureAirport()->getId() << ":"
+ // << " " << depT << ":"
+ // << " \"" << flight->getArrivalAirport()->getId() << "\"" << ":"
+ // << " " << arrT << ":" << endl;
+*/
+ flights.push_back(flight);
+ return true;
}
FGScheduledFlight* FGAISchedule::findAvailableFlight (const string ¤tDestination,
//sort(fltBegin, fltEnd, compareScheduledFlights);
//cerr << counter++ << endl;
}
- sort(fltBegin, fltEnd, compareScheduledFlights);
+ std::sort(fltBegin, fltEnd, compareScheduledFlights);
for (FGScheduledFlightVecIterator i = fltBegin; i != fltEnd; i++) {
//bool valid = true;
counter++;
// is departure port valid?
// is arrival port valid?
//cerr << "Ack no flight found: " << endl;
- return 0;
+ return NULL;
}
double FGAISchedule::getSpeed()
string currentDestination;
bool heavy;
FGScheduledFlightVec flights;
- float lat;
- float lon;
+ SGGeod position;
double radius;
double groundOffset;
double distanceToUser;
bool firstRun;
double courseToDest;
-
+ void scheduleFlights();
+
+ /**
+ * Transition this schedule from distant mode to AI mode;
+ * create the AIAircraft (and flight plan) and register with the AIManager
+ */
+ bool createAIAircraft(FGScheduledFlight* flight, double speedKnots, time_t deptime);
+
public:
FGAISchedule(); // constructor
FGAISchedule(string model,
~FGAISchedule(); //destructor
- bool update(time_t now);
+ bool update(time_t now, const SGVec3d& userCart);
bool init();
double getSpeed ();
if (scheduledAircraft.size() == 0) {
return;
}
+
+ SGVec3d userCart = SGVec3d::fromGeod(SGGeod::fromDeg(
+ fgGetDouble("/position/longitude-deg"),
+ fgGetDouble("/position/latitude-deg")));
+
if(currAircraft == scheduledAircraft.end())
{
currAircraft = scheduledAircraft.begin();
}
- if (!((*currAircraft)->update(now)))
+ if (!((*currAircraft)->update(now, userCart)))
{
// NOTE: With traffic manager II, this statement below is no longer true
// after proper initialization, we shouldnt get here.
-DIST_SUBDIRS = GPSsmooth TerraSync Modeller js_server fgadmin xmlgrep propmerge
+DIST_SUBDIRS = GPSsmooth TerraSync Modeller js_server fgadmin xmlgrep propmerge fgviewer
SUBDIRS = GPSsmooth TerraSync Modeller js_server propmerge fgviewer
}
sz = strlen(opt);
- if (!strncmp(opt, "-help", sz)) {
- printf("usage:\n normalmap [-c=contrast] [-b=brightness]");
- printf(" --t=file [--o=file]\n");
- exit(0);
- }
if (!strncmp(opt, "-contrast", sz)) {
contrast = atof(arg);
return ret;
normalmap_file = strdup(arg);
return ret;
}
+ if (!strncmp(opt, "-help", sz)) {
+ printf("usage:\n normalmap [-c=contrast] [-b=brightness]");
+ printf(" --i=file [--o=file]\n\n");
+ exit(0);
+ }
return 1;
}
if ( !texture_file )
{
- printf("Error: texture file not specified\n");
+ printf("Error: texture file not specified.\n");
+ printf("usage:\n normalmap [-c=contrast] [-b=brightness]");
+ printf(" --i=file [--o=file]\n\n");
return -1;
}
if ( !texture.texture() )
{
printf("Error: unable to process input file: %s\n", texture_file);
- printf(" (%s)\n", texture.err_str());
+ printf(" (%s)\n\n", texture.err_str());
return -2;
}
int yp1 = (y < (texture_height-1)) ? y+1 : 0;
int posxp1 = (xp1 + ytw)*num_colors;
int posyp1 = (x + yp1*texture_width)*num_colors;
+ float fx,fy;
GLubyte c = texture_data[dpos];
GLubyte cx1 = texture_data[posxp1];
map[mpos+3] = a;
}
- map[mpos+0] = (128+(cx1-c)/2);
- map[mpos+1] = (128+(cy1-c)/2);
+ fx = asin((c/256.0-cx1/256.0))/1.57079633;
+ fy = asin((cy1/256.0-c/256.0))/1.57079633;
+
+ map[mpos+0] = (GLuint)(fx*256.0)-128;
+ map[mpos+1] = (GLuint)(fy*256.0)-128;
map[mpos+2] = 127+int(brightness*128); // 255-c/2;
mpos += colors;
#ifdef __MINGW32__
#include <time.h>
#include <unistd.h>
+#elif defined(_MSC_VER)
+#include <io.h>
#endif
#include <stdlib.h> // atoi() atof() abs() system()
+#include <signal.h> // signal()
#include <simgear/compiler.h>
}
-std::deque<std::string> waitingTiles;
-typedef std::map<std::string,time_t> CompletedTiles;
+deque<string> waitingTiles;
+typedef map<string,time_t> CompletedTiles;
CompletedTiles completedTiles;
+netSocket theSocket;
#ifdef HAVE_SVN_CLIENT_H
}
}
+#ifdef _MSC_VER
+typedef void (__cdecl * sighandler_t)(int);
+#elif defined( __APPLE__ )
+typedef sig_t sighandler_t;
+#endif
+
+bool terminating = false;
+sighandler_t prior_signal_handlers[32];
+int termination_triggering_signals[] = {
+#ifndef _MSC_VER
+ SIGHUP, SIGINT, SIGQUIT, SIGKILL,
+#else
+ SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGTERM, SIGBREAK, SIGABRT,
+#endif
+ 0}; // zero terminated
+
+void terminate_request_handler(int param) {
+ char msg[] = "\nReceived signal XX, intend to exit soon.\n"
+ "repeat the signal to force immediate termination.\n";
+ msg[17] = '0' + param / 10;
+ msg[18] = '0' + param % 10;
+ write(1, msg, sizeof(msg) - 1);
+ terminating = true;
+ signal(param, prior_signal_handlers[param]);
+ theSocket.close();
+}
+
const int nowhere = -9999;
+
// parse message
static void parse_message( const string &msg, int *lat, int *lon ) {
double dlat, dlon;
string::size_type pos = text.find( "$GPGGA" );
if ( pos == string::npos )
{
- *lat = -9999.0;
- *lon = -9999.0;
+ *lat = nowhere;
+ *lon = nowhere;
return;
}
string tmp = text.substr( pos + 7 );
void getWaitingTile() {
while ( !waitingTiles.empty() ) {
- CompletedTiles::iterator ii = completedTiles.find( waitingTiles.front() );
+ CompletedTiles::iterator ii =
+ completedTiles.find( waitingTiles.front() );
time_t now = time(0);
if ( ii == completedTiles.end() || ii->second + 600 < now ) {
sync_tree(waitingTiles.front().c_str());
int main( int argc, char **argv ) {
int port = 5501;
- char host[256] = ""; // accept messages from anyone
+ char host[256] = "localhost";
bool testing = false;
bool do_checkout(true);
int verbose(0);
// Must call this before any other net stuff
netInit( &argc,argv );
- netSocket s;
-
- if ( ! s.open( false ) ) { // open a UDP socket
+ if ( ! theSocket.open( false ) ) { // open a UDP socket
printf("error opening socket\n");
return -1;
}
- if ( s.bind( host, port ) == -1 ) {
+ if ( theSocket.bind( host, port ) == -1 ) {
printf("error binding to port %d\n", port);
return -1;
}
}
- while ( true ) { // main loop
+ for (int* sigp=termination_triggering_signals; *sigp; sigp++) {
+ prior_signal_handlers[*sigp] =
+ signal(*sigp, *terminate_request_handler);
+ if (verbose) cout << "Intercepted signal " << *sigp << endl;
+ }
+
+ while ( !terminating ) {
+ // main loop
recv_msg = false;
if ( testing ) {
// No FGFS communications
lon = -123;
recv_msg = (lat != last_lat) || (lon != last_lon);
} else {
- s.setBlocking(waitingTiles.empty());
- len = s.recv(msg, maxlen, 0);
+ if (verbose && waitingTiles.empty()) {
+ cout << "Idle; waiting for FlightGear position\n";
+ }
+ theSocket.setBlocking(waitingTiles.empty());
+ len = theSocket.recv(msg, maxlen, 0);
if (len >= 0) {
msg[len] = '\0';
recv_msg = true;
// 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;
+ deque<string> oldRequests;
oldRequests.swap( waitingTiles );
int lat_dir, lon_dir, dist;
if ( last_lat == nowhere || last_lon == nowhere ) {
}
else if ( testing ) {
- exit( 0 );
+ terminating = true;
} else
ulSleep( 1 );
- } // while true
+ } // while !terminating
return 0;
}
ax = new float [ numaxes ] ;
activeaxes = numaxes;
- if( numaxes < 4 )
+ if( numaxes > 4 )
{
printf("max 4 axes joysticks supported at the moment, however %i axes were detected\nWill only use the first 4 axes!\n", numaxes);
activeaxes = 4;
js->read( &b, ax );
for ( axis = 0 ; axis < activeaxes ; axis++ )
{
- long axisvalue = (long int)(ax[axis]*2147483647.0);
- printf("axisval=%li\n", axisvalue);
- memcpy(packet+len, &axisvalue, 4);
- len+=4;
+ int32_t axisvalue = (int32_t)(ax[axis]*2147483647.0);
+ printf("axisval=%li\n", (long)axisvalue);
+ memcpy(packet+len, &axisvalue, sizeof(axisvalue));
+ len+=sizeof(axisvalue);
}
// fill emtpy values into packes when less than 4 axes
for( ; axis < 4; axis++ )
{
- long axisvalue = 0;
- memcpy(packet+len, &axisvalue, 4);
- len+=4;
+ int32_t axisvalue = 0;
+ memcpy(packet+len, &axisvalue, sizeof(axisvalue));
+ len+=sizeof(axisvalue);
}
- long int b_l = b;
- memcpy(packet+len, &b_l, 4);
- len+=4;
+ int32_t b_l = b;
+ memcpy(packet+len, &b_l, sizeof(b_l));
+ len+=sizeof(b_l);
- char termstr[5] = "\0\0\r\n";
- memcpy(packet+len, &termstr, 4);
+ const char * termstr = "\0\0\r\n";
+ memcpy(packet+len, termstr, 4);
len += 4;
c.send( packet, len, 0 );