1
0
Fork 0
Commit graph

1752 commits

Author SHA1 Message Date
andy
b162cf8707 Wrong units when interpreting <weight> tags. 2002-06-24 04:18:53 +00:00
andy
8199ece7dc Hack in an /accelerations/pilot-g property, for testing a new panel
instrument.  This needs to move somewhere permanent.

Also, remove a bogus fuel consumption setting that (1) was off by a factor
of 3600 (hours, not seconds) and (2) collided with identical code in FGFDM.
2002-06-20 04:11:19 +00:00
david
6df9479415 Allow an empty virtual model, to which other submodels can be attached
(when no path is specified).
2002-06-19 03:25:40 +00:00
david
9569c43126 Avoid a segfault when a named object is not found for an animation.
Ensure that global animations are applied to the model.
2002-06-19 02:58:06 +00:00
david
dc132d80b1 Added fgAddChangeListener convenience functions. 2002-06-18 03:27:21 +00:00
curt
ee98995d30 Updated to match changes in radiostack.[ch]xx 2002-06-16 15:23:22 +00:00
curt
a7e237abd6 A little prepratory code reorganization before modeling the King KR 87
Silver Crown Digital ADF.
2002-06-16 00:05:07 +00:00
andy
9541e06a1e Finally fixed the flap drag issue. Drag modifications need to be based on
the amount of drag that the produced lift *would* have produced given an
unflapped air surface.  A nifty trick involving the assumption that AoA is
small works for this, and produces plausible results in the high AoA case
as well.

Also, trim for approach using the elevator-trim control, not elevator.
Just cosmetic for current planes, but future ones might have differing
implementations of trim.
2002-06-15 05:40:02 +00:00
curt
22a55b25f9 Erik Hofman:
Specify default values for properties so we get expected behavior when
an option isn't specified in the sound config file.
2002-06-14 15:29:20 +00:00
curt
1bb0cbf0a7 Andy Ross:
Fixes for uninitialized variables.
2002-06-13 19:22:32 +00:00
curt
6800231cfa Erik Hofman:
This is the small code fix which is needed for the new options.xml file.
It is needed because otherwise the "--prop:name=value" is showed
incorrectly.

There is another problem though, when compiling with --without-logging
the help message isn't displayed at all! We *must* change that somehow.

Curt: good point, the SG_LOG()'s have been switched to cout's ...
2002-06-12 16:38:46 +00:00
andy
a682823ada Bugfix. The engine thrust is recalculated based on the current N1 value
(and not the throttle setting), but the recalculation left in a degeneracy
when the target/throttle setting was exactly zero.  Zero times a big number
is still zero.  Fixed to use real math, not theoretical math.
2002-06-12 08:23:05 +00:00
curt
2c5eb44cc3 Updates to the 610x interface:
- More progress with proper radio freq tuning and proper interpreting of the
  hardware values.
- Filter ignition and flap switch values since the hardware implimentation has
  a dead zone where the value can go to zero in the middle of a change in
  switch position.
2002-06-12 06:16:23 +00:00
curt
c93b79641d Erik Hofman:
I've updated the FIXME in the code, and fixed a typo (descr instead of
description), but the SG_LOG() functions doesn't produce any output for
me. Could you confirm it's still working for you?

Curt Olson:
I did a bit of further tweaking and it all looks good now.  The tricky thing
is that SG_LOG() always appends an endl at the end of every message.
2002-06-11 17:06:46 +00:00
curt
a4e81f4ff0 Erik Hofman:
This patch solves an unknown reference to a function which showed up
when using no-inlining.
2002-06-11 16:32:12 +00:00
curt
7d3448294b Erik Hofman:
This is an enhanced version of the options patch.
It's more robust now, and gives some helpful information if something
goes wrong. Also the naming in the options.xml file has changed to the
syntax David suggested.

Since no one objected to the patch I think it is safe to included it.
2002-06-10 23:30:23 +00:00
andy
df2b147ef5 Really simple command line airplane compiler. Basically a test program;
not integrated into the Makefile.am stuff.
2002-06-10 20:15:35 +00:00
david
a74c184cfb Separate the model geodetic position and orientation into a separate
class, FGModelPlacement, while FG3DModel retains control of animation.
This way, we can have a single, top-level placement, but multiple
layers of nested models underneath.  To include a nested model, use
something like this in the XML wrapper:

  <model>
   <path>Models/Stuff/my-component.xml</path>
   <offsets>
    <roll-offset-deg>45</roll-offset-deg>
   </offsets>
  </model>
2002-06-10 13:20:26 +00:00
andy
0cabedaa4f Use the density values from the environment subsystem, to properly handle
density variations due to humidity.
2002-06-10 08:47:29 +00:00
david
f12ba10c47 Modified --wind=DIR@SPEED option to allow both DIR and SPEED to
contain colon-separated ranges.  For examples, winds from 180 degrees
10 knots gusting 15 knots would be

  --wind=180@10:15

Winds variable from 180-220 degrees 5 knots would be

  --wind=180:220@5

FGEnvironment does not yet support variable-direction winds, so
nothing will yet happen in the second case.
2002-06-09 21:28:17 +00:00
tony
9299767541 Oops. Previous versions caused compile errors 2002-06-08 03:20:37 +00:00
tony
0975a42f49 The external atmosphere fix. Really this time. 2002-06-08 03:15:05 +00:00
tony
00dcf9f507 JSBSim updates, including external atmosphere fix 2002-06-08 03:14:03 +00:00
curt
0ba0a278b9 Patch from Norman to do the code/base version comparison check a little
more sensibly (and print the correct error message.)
2002-06-07 23:26:07 +00:00
curt
8b711a5782 James Turner:
Modifications to support querying navaid database by station ID (not just
frequency.)  Some corresponding changes to testnavs.cxx to test new
functionality.
2002-06-07 21:03:27 +00:00
david
bc179de4bd Patch from Jim Wilson:
This is a small patch that makes the autopilot work much better with big heavy
airliners as well as the small Cessnas.  Of course this doesn't address the
way autopilots should be modeled.

But by making a couple changes the "George" is now capable of landing either a
C172 or a 747 very close to the center line of the runway with a moderate
cross breeze (15-20kt).

The changes:
- Added turn configurability so that things like Max Aileron and Roll can be
configured per aircraft.
- Enhanced localizer routine (NAV mode) to begin lining up the aircraft as soon
as the cone is entered.  The former model is adopted for the last 5km of the
approach in order to ensure greater precision (makes a very slight difference).

[float cast added by David Megginson to keep G++ 3.0 happy]
2002-06-07 20:16:54 +00:00
david
88e93dc767 Patch from Jim Wilson:
This is a small patch that makes the autopilot work much better with big heavy
airliners as well as the small Cessnas.  Of course this doesn't address the
way autopilots should be modeled.

But by making a couple changes the "George" is now capable of landing either a
C172 or a 747 very close to the center line of the runway with a moderate
cross breeze (15-20kt).

The changes:
- Added turn configurability so that things like Max Aileron and Roll can be
configured per aircraft.
- Enhanced localizer routine (NAV mode) to begin lining up the aircraft as soon
as the cone is entered.  The former model is adopted for the last 5km of the
approach in order to ensure greater precision (makes a very slight difference).

[float cast added by David Megginson to keep G++ 3.0 happy]
2002-06-07 19:52:00 +00:00
david
e6f9caa41b Patch from Melchior Franz:
FGViewer::updateFromModelLocation does otherwise complain several
times about non-initialized values
2002-06-07 19:43:40 +00:00
david
d982efc4c4 Fix two problems:
1. Typo where /environment/density-inhg instead of
   /environment/density-slugft3 was flagged as archivable.

2. Density should no longer be archivable anyway, since it is
   calculated internally and not directly settable by the user.
2002-06-07 14:23:09 +00:00
david
a08d92e142 Correct temperature value passed to FDM. 2002-06-07 00:15:21 +00:00
david
56642901b5 Air density is now calculated automatically from air pressure,
temperature, and dewpoint.  The /environment/density-sea-level-slugft3
property has been removed, and the /environment/density-slugft3
property is read-only.
2002-06-06 00:21:23 +00:00
david
4acb59a020 Renamed property /steam/vertical-speed-fpm to /steam/vertical-speed-fps. 2002-06-05 22:39:00 +00:00
david
2df334378f Use factors instead of offset in atmosphere model. The troposphere is
hard-coded for 38,000ft.
2002-06-05 22:30:07 +00:00
david
34e2e52158 Patch from Georg Kaiser. 2002-06-05 21:43:44 +00:00
david
890c26a9ee Move initial setup of cloud layers to Main/main.cxx to ensure that
they are done only once, and ensure that all properties are untied in
unbind().
2002-06-05 17:45:42 +00:00
david
5bec60a602 Set up cloud layers when thesky is allocated, to ensure that they are
created only once.
2002-06-05 17:44:39 +00:00
david
0387b3a4ec Replace cout statement with SG_LOG. 2002-06-05 17:44:09 +00:00
david
384c3c254a Initialize default SLP to 29.92inHG. 2002-06-05 14:44:30 +00:00
curt
e2e640ef46 Set control surface positions when using an external network fdm.
Fetch all pending remote fdm network packets so there is not chance of
  getting behind.
Add support for driving control panel lights.
Working on better modeling KX 155 tuning behavior.
2002-06-05 05:22:42 +00:00
curt
63eb4d8668 Erik Hofman:
* Small updates and fixes
* Add random as an internal ( <intenral>random</internal> is now possible)
2002-06-04 16:27:20 +00:00
andy
2852f27bdc Uninitialized data problem. As it turns out, this never bit us because
the _chord member is only used uninitialized in circumstances where the
result is thrown away.  Still, bad practice.  Found with valgrind.
2002-06-04 07:23:34 +00:00
curt
11766afb6c Added flap_deflection so that remote fdm can pass back actual flap deflection
in order to drive the flap sound effects and animation.
2002-06-03 23:35:43 +00:00
andy
04e083083d Need to call recalc() on the RigidBody during solution, or else it
won't apply the right gross weight due to fuel differences.

When solving for zero force, do so in the global frame, not the
aircraft's.  In principle, this shouldn't matter (zero is zero in all
frames), but in practice this should help to avoid oscillations.
Calculating lift as force perpendicular to the ground (and not the
wing plane) is clearly the Right Thing, anyway.

Also added support for a /yasim/gross-weight-lbs property, which
should be generically useful.
2002-06-01 19:59:38 +00:00
andy
713920356b Property name typo. This resulted in all temperatures being 273K,
which is far too warm at altitude.  Thus, air density (and aircraft
performance) was too low for a given altitude.
2002-05-30 18:54:08 +00:00
curt
b2cefb1450 Check for the proper base package version. 2002-05-30 15:37:39 +00:00
david
25450e040a Patch from Melchior Franz:
The new dt/multiloop method requires new damping parameters.
2002-05-29 22:38:11 +00:00
david
1a4b6a37a3 Default to glider again when model is not present. 2002-05-29 22:04:36 +00:00
andy
7e63c0f6e8 Modify solution heuristics. Do the cruise AoA and tail incidence only
when the lift/drag are really solid.  And defer the approach trim until
the all four of the other variables are perfect.  I believe this should
fix the solution failures under gcc 2.95.2.
2002-05-29 08:41:13 +00:00
andy
adeeed1a0e Oops. Stray checkin. Revert. 2002-05-29 07:09:41 +00:00
andy
f324ea9bad The incidence setting only works on a compiled object. If setIncidence
is called on a non-compiled object, make sure to re-set it after compilation.
2002-05-29 07:07:29 +00:00
david
8cf573ae51 JSBSim change:
Reverse sense of rudder surface position, for consistency with
ailerons and FlightGear controls.
2002-05-28 13:50:51 +00:00
andy
040c508aa8 We don't handle propellers turning backwards. This got clamped
implicitly in PropEngine by disallowing negative torques, but that was
removed at some point.  We really need the explosion protection here
at the source.
2002-05-23 19:47:19 +00:00
andy
6af60f7462 Yank the "castering" attribute and replace it with a ControlMap-enabled
control that can be set via the property system.  This allows implementation
of the DC-3 wheel lock.
2002-05-23 19:30:56 +00:00
andy
4d10297732 Oops, left debug code in the checkin. 2002-05-21 18:45:56 +00:00
andy
4535c84b99 Solve for the elevator control input during approach. It turns out that
the downforce from the tail due to elevator trim is a significant contribution
to total lift.
2002-05-21 07:40:46 +00:00
curt
e380891c40 Erik Hofman:
This patch adds "elapsed time" support to the sound code.
It is now possible to define <internal>dt_play</internal> or
<internal>dt_stop</internal> instead of a propery in the <volume> and
<pitch> sections of the configuration file.
2002-05-20 16:28:21 +00:00
curt
2cafd466e2 Tony Peden:
Defeated the invasion once and for all.
2002-05-20 16:19:26 +00:00
curt
8ae364a220 Jim Wilson:
This is a small fix for what turned out to be a major bug.  Ground elevation
was calculated incorrectly when distant from one of the view locations. This
resulted in several problems including bizarre gear trimming, mid air
"crashes" (as in thinking we hit the ground) and so on when close to or on the
ground.

Unfortunately it does require a second ssg traversal when in tower view
(only), but the increased load isn't all that noticable.  For the time being
this really is the best solution.  In a future update I will be eliminating
the unecessary per frame traversals for the static views (without having to
maintain multiple ssgRoots).

When we go to multiple FDM instances we will perhaps need to put the ssg
traversal and ground elevation queries for the FDMs into an event timer that
updates the FDMs ground elevation in a round robin fashion (maybe every 1/n
seconds where n is the number of FDM instances running).
2002-05-20 16:13:37 +00:00
curt
0efc08b6b6 Bernie Bright:
Ensure lines sent to clients are CRLF terminated.
Ensure the dump command null terminates its output string.
Removed view command and comments.
2002-05-20 15:53:14 +00:00
curt
1ffd296e27 Jim Wilson:
Fix for the sound cranking bug.
2002-05-17 21:02:40 +00:00
david
89483df079 No longer initialize static cloud layers (handled dynamically in
environment_mgr.cxx).  The /environment/clouds/status property is now
checked each frame, so clouds can be turned on or off in the middle of
a session.
2002-05-17 19:04:20 +00:00
david
b2dcc4ca00 Removed old --clouds-asl option and initialization of clouds-asl
property, since neither makes sense for multiple cloud layers.
2002-05-17 19:03:20 +00:00
david
fe4a837d7f Modified to work with new cloud properties (sort-of). 2002-05-17 19:02:43 +00:00
david
b091433cf6 Added support for initializing and maintaining up to five cloud
layers.  The properties controlling each layer are inside
/environment/clouds/layer[n], and the available properties are type
("clear", "overcast", "mostly-cloudy", "mostly-sunny", or "cirrus"),
span-m (should be about 40000), elevation-ft, thickness-ft, and
transition-ft.
2002-05-17 19:02:24 +00:00
david
9002aa41ff Corrected "#ifdef 0" to "#if 0" to keep ANSI-conformant compilers
happy.
2002-05-17 18:56:13 +00:00
curt
b1674cb506 From: "Jim Wilson" <jimw@kelcomaine.com>
This is a new improved patch for the previous tile manager fixes.

Rather than building dependencies between FGlocation or the viewer or fdm with
tilemgr what I ended up doing was linking the pieces together in the Mainloop
in main.cxx.  You'll see what I mean...it's been commented fairly well.  More
than likely we should move that chunk somewhere...just not sure where yet.

The changes seem clean now. As I get more ideas there could be some further
improvement in organizing the update in tilemgr.  You'll note that I left an
override in there for the tilemgr::update() function to preserve earlier
functionality if someone needs it (e.g. usage independent of an fdm or
viewer), not to mention there are a few places in flightgear that call it
directly that have not been changed to the new interface (and may not need to be).

The code has been optimized to avoid duplicate traversals and seems to run
generally quite well.  Note that there can be a short delay reloading tiles
that have been dropped from static views.  We could call the tile scheduler on
a view switch, but it's not a big deal and at the moment I'd like to get this
in so people can try it and comment on it as it is.

Everything has been resycned with CVS tonight and I've included the
description submitted earlier (below).

Best,

Jim

Changes synced with CVS approx 20:30EDT 2002-05-09 (after this evenings updates).

Files:
http://www.spiderbark.com/fgfs/viewer-update-20020516.tar.gz
 or
http://www.spiderbark.com/fgfs/viewer-update-20020516.diffs.gz

Description:
In a nutshell, these patches begin to take what was one value for ground
elevation and calculate ground elevation values seperately for the FDM and the
viewer (eye position).  Several outstanding view related bugs have been fixed.

With the introduction of the new viewer code a lot of that Flight Gear code
broke related to use of a global variable called "scenery.cur_elev".

Therefore the ground_elevation and other associated items (like the current
tile bucket) is maintained per FDM instance and per View.  Each of these has a
"point" or location that can be identified.  See changes to FGLocation class
and main.cxx.

Most of the problems related to the new viewer in terms of sky, ground and
runway lights, and tower views are fixed.

There are four minor problems remaining.  1) The sun/moon spins when you pan
the "lookat" tower view only (view #3).  2) Under stress (esp. magic carpet
full speed with max visibility), there is a memory leak in the tile caching
that was not introduced with these changes.  3) I have not tested these
changes or made corrections to the ADA or External FDM interfaces.  4) The
change view function doesn't call the time/light update (not a problem unless
a tower is very far away).

Details:
FDM/flight.cxx, flight.hxx - FGInterface ties to FGAircraftModel so that it's
 location data can be accessed for runway (ground elevation under aircraft)
 elevation.

FDM/larsim.cxx, larcsim.hxx - gets runway elevation from FGInterface now.
Commented out function that is causing a namespace conflict, hasn't been
called with recent code anyway.

FDM/JSBSim/JSBSim.cxx, YASim/YASim.cxx - gets runway elevation from
FGInterface now.

Scenery/newcache.cxx, newcache.hxx - changed caching scheme to time based
(oldest tiles discard).

Scenery/tileentry.cxx, tileentry.hxx - added place to record time, changed
rendering to reference viewer altitude in order to fix a problem with ground
and runway lights.

Scenery/tilemgr.cxx, tilemgr.hxx - Modified update() to accept values for
multiple locations.   Refresh function added in  order to periodically make
the tiles current for a non-moving view (like a tower).

Main/fg_init.cxx - register event for making tiles current in a non-moving
view (like a tower).

Main/location.hxx - added support for current ground elevation data.

Main/main.cxx - added second tilemgr call for fdm, fixed places where viewer
position data was required for correct sky rendering.

Main/options.cxx - fixed segfault reported by Curtis when using --view-offset
command line parameter.

Main/viewer.cxx, viewer.hxx - removed fudging of view position. Fixed numerous
bugs that were causing eye and target values to get mixed up.
2002-05-17 17:25:28 +00:00
curt
e8a6836525 Bernie Bright:
Reverted fgUsage() to previous version that works on all platforms.
2002-05-17 17:01:16 +00:00
curt
fcd6b28e0f Bernie Bright:
I've defined snprintf as _snprintf in compiler.h for MSVC and MINGW
targets and removed duplicate definitions from FG sources.
2002-05-17 16:41:27 +00:00
david
279643226a Temporarily modified to support changes in SGSky and SGCloudLayer;
this will soon be removed into a separate module that allows dynamic
changes to cloud layers.
2002-05-17 01:23:00 +00:00
andy
4efbc97a4b Revert the recent changes to Atmosphere.cpp. They were actually in
the wrong place.  The Atmosphere::getStd*() calls are used by the
solver, and thus really need to return values for a "standard"
atmosphere.  Otherwise, an aircraft started up in Moscow will behave
differently than one initialized in Cairo. :)

The place where environmental pressure and temperature get inspected
at runtime is in YASim.cxx.  The changes there, happily, end up being
even smaller than the ones to Atmosphere.  This ends up replacing code
only, and removing some comments.
2002-05-16 07:49:22 +00:00
curt
99859a5ea9 Bernie Bright:
To make MSVC happy it appears we need backslashes on string literals
spanning multiple lines.
2002-05-16 06:02:31 +00:00
curt
f9f05aa870 Bernie Bright:
Here is the new super improved telnet property interface.  CVS changelog
is at the end of this message.  Once this new telnet code is in and
compiles every where we can remove Network/props.[ch]xx.  I've added a
--telnet=<port> command line option to invoke the new server.  Later on
we could remove the --props option, or least change it to invoke the new
server.  I'll let you decide.

I've added some new commands to the telnet interface:

view next      Select the next view.
view prev      Select the previous view.
view set <n>   Select view 'n'
view get       Return index of current view

I'm not sure if these same effects could be achieved through property
operations.  The commands provide a convenient shortcut in any case.

I'm also planning on adding a panel command to manipulate panels and
objects contained therein (eg simulated mouse clicks).  There is going
to be some commonality with the command objects so we may need to
rationalize this in the near future.

Finally, I've also included my python stuff.  This is still very much a
work in progress, basically I've been using it to test the new telnet
server.  I have  tested it with python 2.2.  Feel free to add it to the
repository if you want.  I would suggest a scripts/python directory

CVS Changelog

Network/telnet.cxx: New property telnet protocol interface.  It supports
the same user interface provided by the --props server.  Additionally it
handles multiple simultaneous connections.  Added "view" command to
manipulate viewmgr.

Network/protocol.hxx: Added protocol configuration exception.

Main/fg_io.cxx:  Added new "telnet" protocol.  Added protocol
configuration parse exceptions.  Simplified protocol configuration
parsing.

Main/options.cxx: Added --telnet=<port> command line option and help
message.
2002-05-15 21:44:34 +00:00
david
52c1cb2f7d Take the static temperature, static pressure, and density values from
an external source if requested by the
/environment/params/control-fdm-atmosphere property.
2002-05-15 12:10:48 +00:00
david
cade7aad70 Comment out set_Static_pressure, set_Static_temperature, and
set_Density; since JSBSim doesn't override the get_* methods from
FGInterface as well, the wrong values are always set anyway.

Take the static temperature, static pressure, and density values from
an external source if requested by the
/environment/params/control-fdm-atmosphere property.  This isn't
working properly yet for JSBSim because of interactions with the
trimming routine.
2002-05-15 12:06:33 +00:00
david
b112e72510 Actively manage the static temperature, static pressure, and density
values in the FDM if requested by the
/environment/params/control-fdm-atmosphere property.
2002-05-15 12:04:25 +00:00
david
663dc4b545 Minor tweaks and additional comments. 2002-05-15 12:03:41 +00:00
david
8a5cdbdbc6 Finished off the atmosphere model (Troposphere and lower
Stratosphere).  The atmospheric properties are as follow:

/environment/temperature-sea-level-degc
/environment/temperature-degc
/environment/pressure-sea-level-inhg
/environment/pressure-inhg
/environment/density-sea-level-slugft3
/environment/density-slugft3

Setting either the sea-level or altitude value automatically sets the
other value appropriate, except for temperature at altitude above the
Troposphere (where there's no reliable way to back-calculate it).  The
atmosphere model appears in the atmosphere_data array in
environment.cxx, and can easily be extended into the upper
stratosphere and beyond.

These are not yet tied into the FDMs or steam module.
2002-05-15 03:00:41 +00:00
david
abdb5abb6a Fixed handling of delta time (just a kludge for now): VSI behaves
reasonably again, and DG doesn't drift too fast any more.
2002-05-14 14:21:27 +00:00
curt
487a14d05b Moved some scenery component initialization into FGScenery. 2002-05-14 06:08:28 +00:00
curt
92a58f6555 Consolodating scenery structures in scenery.hxx. 2002-05-14 05:49:47 +00:00
curt
47825dcbae Moved "scenery" from being declaried in scenery.cxx to being declared
in globals.hxx.
2002-05-14 05:22:52 +00:00
david
1fe50d4cd2 Removed configuration option --with-old-mouse and FG_OLD_MOUSE macro.
Removed configuration option --with-new-environment and
FG_NEW_ENVIRONMENT macro.

Added configuration option --with-weathercm and FG_WEATHERCM macro.

FGEnvironment is now the default; use --with-weathercm to get the old
weather.
2002-05-12 00:12:19 +00:00
david
94a667a061 Changed WeatherPrecision to double; this may help to avoid compile
errors (untested).
2002-05-11 23:27:03 +00:00
david
49bb3306d9 Environment manager overhaul -- return a copy of an FGEnvironment
object rather than a pointer.

FGEnvironment now has the beginning of an atmospheric model, and will
recalculate temperature (not pressure or density, yet) based on
elevation.

FGEnvironment has a copy constructor.
2002-05-11 23:23:42 +00:00
david
f8df8ecda9 Modified to use FGEnvironment as well as WeatherCM. 2002-05-11 23:22:24 +00:00
david
ee4c3f728d Remove some dead code. 2002-05-11 21:10:11 +00:00
david
e1c2a95f2f Fix maximum speed bug. 2002-05-11 21:09:53 +00:00
david
5a849b66e8 Major overhaul:
- changed FGSubsystem::update(int) to
  FGSubsystem::update(delta_time_sec); the argument is now delta time
  in seconds rather than milliseconds

- added FGSubsystem::suspend(), FGSubsystem::suspend(bool),
  FGSubsystem::resume(), and FGSubsystem::is_suspended(), all with
  default implementations; is_suspended takes account of the master
  freeze as well as the subsystem's individual suspended state

- the FDMs now use the delta time argument the same as the rest of
  FlightGear; formerly, main.cxx made a special case and passed a
  multiloop argument

- FDMs now calculate multiloop internally instead of relying on
  main.cxx

There are probably some problems -- I've done basic testing with the
major FDMs and subsystems, but we'll probably need a few weeks to
sniff out bugs.
2002-05-11 16:28:50 +00:00
david
1ce573908c Mac OS X patches from Jonathan Polley. 2002-05-11 12:30:22 +00:00
david
f3eafe1007 Property patches from Frederic Bouvier:
The FlightGear patch is to take account the change in the getChildren
function that now returns a vector<SGPropertyNode_ptr>. If the
removeChild functionnality is to be added in FlightGear, all those
SGPropertyNode * floating around should be changed to
SGPropertyNode_ptr.
2002-05-11 00:59:26 +00:00
david
56473dc28d Mac OS X fixes and MSVC warning fixes from Jonathan Polley. 2002-05-10 23:35:06 +00:00
david
c37d2019e0 Patch from Melchior Franz:
- don't send "set" confirmation when in data mode. If an external
  program really cares if the settings were accepted, which is
  rather unlikely, it simply has to "get" the property again.
  The returned line would have been a pain to parse, anyway
  (something like "from-model =  'true'  (bool)").
- do not only "set" the first token, but concatenate all given
  tokens with a space in between. This won't be used much, but
  makes sense for setting strings, while it does no harm when setting
  numbers. Silently ignoring all but the first token is impolite. ;-)
- remove old, commented out debug message that doesn't make much
  sense any more.
2002-05-09 21:57:07 +00:00
david
907e2942bb Patch from Melchior Franz:
Due to jumpy joystick read-outs the UFO jitters a lot in turns.
This patch implements simple damping for aileron/elevator/throttle.
Furthermore it lets the UFO fly backwards if brake[0] is active
(by default associated with the joystick's fire button). After all,
everyone knows that UFO's can fly backwards!
2002-05-09 21:56:31 +00:00
david
5c799d1ba2 Patch from Melchior Franz:
It's cumbersome to use the MagicCarpet as 3D cursor, because everytime
you shoot over the target you have first to turn by 180 degrees and to
fly back.

This patch lets the magic carpet fly backwards if brake[0] is active,
which is by default associated with the joystick's fire button.
2002-05-09 21:56:07 +00:00
david
26e4ae9fc4 Patch from Jim Wilson:
Turns out it was a problem with a long string, not the font.  Plib is limited
to 80 characters in things like this listbox.  BTW I checked and all the fonts
are missing those characters.  So, no point in changing.

Description:
Fixed segfault caused by long string.
2002-05-09 21:15:01 +00:00
curt
37b665075f Robert Deters:
> I have attached some new additions to the UIUC code.  Most of the
> changes allow for the addition of apparent mass.  This is very
> useful with light aircraft and gliders.
2002-05-09 05:02:36 +00:00
curt
1c513868b7 Erik Hofman:
I changed the sound code to let it use FGCondition. This changes the
code and configuration files rather drastically. Furthermore I've added
an in-transit mode which plays the sound only when the tied property is
changing.

Changes:

Code:
* Added condition support to trigger an event
* Removed the <type> section from the main event definition
   (this could be done using conditions)
* Removed the abillity to use several events with the same name,
   instead it is required to use conditions.
* Updated the README.xmlsound

Base package:
* Changed the configuration files accordingly.
* Changed flaps and gear to use the new in-stransit mode.
* Changed the flps.wav file so it can be looped.
* Created a new gear.wav file (whcih can be looped)
   and a gear-lck.wav file for gear locking sound.

IMPORTANT:
To change existing configuration files to the new ones, it is important
to pack events with the same name together into one singel event, using
the condition specification. Also, when using special types (inverted,
flip-flop, raise or fall) these should be changed to a conditions also.
For more information, please look at
FLightGear/docs-mini/README.xmlsound and the supplied aircraft
configuration files located under FlightGear/Aircraft (espesially
c172/c172-sound.xml and c310/c310-sound.xml).
2002-05-09 04:24:39 +00:00
david
93e0274eb8 Last rev was based on an old version and blew away recent changes.
Reverted to the current JSBSim CVS version of each.
2002-05-07 23:11:16 +00:00
david
ce69eb8e79 Added an interface for an environment controller, together with a
default implementation that uses user-supplied params.  Currently, the
only parameters are

  /environment/params/base-wind-speed-kt
  /environment/params/gust-wind-speed-kt

but others will show up soon (i.e. sheer, variable direction, variable
visibility, etc.).  To activate these properties, you have to
configure --with-new-environment.

The gusting function is simplistic and needs to be replaced with
something better, though it doesn't feel too far off.
2002-05-07 00:03:54 +00:00
tony
be71e0f555 Added stall hysteresis modeling, nose should fall through nicely in a stall now. 2002-05-04 17:38:06 +00:00
david
cd041af9d8 Added a new 'billboard' animation type. This animation takes one
subproperty, 'spherical', which is true if the object has spherical
symmetry and should rotate around both the x-axis and z-axis to face
the camera (i.e. a simple cloud), and false if the object has only
cylindrical symmetry and should rotate only around the z-axis (i.e. a
tree).
2002-05-03 21:09:14 +00:00
tony
4306cebe9e Norman Vine's speed optimizations 2002-05-03 13:56:09 +00:00
david
ff6943bd09 Regularized the position initialization:
1. If /position/longitude-deg and /position/latitude-deg are in range,
   use them.
2. Otherwise, if /sim/startup/airport-id is not empty, use it.
3. Otherwise, set the lon/lat to the middle of the KSFO field.

The default used to be Globe, AZ, but that doesn't make sense since we
don't distribute that scenery by default any more.

With this change, starting from a save file seems to work properly:

  fgfs myflight.sav
2002-05-01 23:13:36 +00:00
andy
7a9e2aba71 Fix dumb typo. Very embarassing, but oddly not fatal... 2002-05-01 01:17:33 +00:00
tony
4a854fcc3e JSBSim updates, including MSVC fixes from Bernie Bright 2002-04-30 13:42:26 +00:00
david
8b411b244b Cleaned up initialization of parking brake to be more consistent. 2002-04-26 01:53:41 +00:00
curt
05bb076784 Pass along the status of the gear up/down control lever. 2002-04-25 22:41:13 +00:00
curt
7b69f0cbb4 Bernie Bright:
- Major rewrite making it more member function friendly.
2002-04-25 20:31:38 +00:00
curt
d15d3652b1 Bernie Bright:
- Added initial_value argument, in milliseconds, that specifies when
  event is first run.  The default value of -1 triggers the event
  immediately as per the existing behaviour.  A repeat_value greater than
  zero runs the event no less than every 'repeat_value' milliseconds
  afterwards.  A repeat_value of zero deletes the event.
- Modified run queue behaviour such that only one event per frame is
  run.
2002-04-25 20:31:14 +00:00
david
58a001ad32 Patch from Norman Vine:
Yikes  --
Looks like I broke the scenery.current_normal when I last
reworked the hitlist code.

I guess this is proof that no one has been using it.
2002-04-25 19:44:27 +00:00
david
830e274238 Patch from Melchior Franz:
the parking_brake state is requested in saveInitialState before it
is first set
2002-04-25 19:35:04 +00:00
david
1e73f62481 Patch from Melchior Franz:
the states of all the volume buttons are requested in saveInitialState before
they are first set
2002-04-25 19:26:47 +00:00
david
f2683c541b Patch from Melchior Franz:
ATCmgr.cxx:148 says:
// Returns true if the airport is found in the map

Yes, it returns true if the airport has been found. But it fails
to return the airport data. Just plays around with a local pointer.  ;-)
2002-04-25 19:26:18 +00:00
david
77cf6c7dc8 Patch from Melchior Franz:
FGAIEntity::FastWorldCoordinate (AIEntity.cxx:96) uses this->hdg
uninitialized.
2002-04-25 19:25:53 +00:00
david
18e36a3302 UFO FDM patches from Jonathan Polley:
I have finished working the bugs out of my "Enhanced" version of the Magic
Carpet FDM.  The UFO FDM works the same as the Magic Carpet with the
following exceptions:

The aircraft's pitch is determined by the Elevator setting (with a pitch
rate of 45 degrees per second).
Climb is forward velocity * sin(pitch)
Speed is forward velocity * soc(pitch)

Roll is tied to the aileron (again, with a roll rate of 45 degrees per
second)
Turn rate is sin(roll) * 45 degrees.

Yes, this does mean that turning is quite a bit more sluggish than
climbing.

If you are wondering why a UFO FDM, it is because it's best that I not
replace the existing magic carpet and this FDM does behave like a UFO (it
hovers, can spin and pitch while hovering, and does not obey the laws of
physics ;)
2002-04-25 16:23:16 +00:00
curt
6b22c85e24 Comment out ATC AI manager init() and update() calls until we can resolve
the tremendous performance hit they are imposing.
2002-04-22 22:28:00 +00:00
curt
cf146a7d1b Fix a couple "make dist" problems that crept in since the last release.
Regengerate msvc project files.
2002-04-21 05:51:37 +00:00
curt
17106105bb Fix for reset causing view problems when not in pilot view. 2002-04-21 03:27:34 +00:00
david
a8576b9e95 Make an animation with no object name apply to the model as a whole.
This replaces the old "range" subtree with something more general.
2002-04-20 17:07:47 +00:00
curt
586d767ab6 There was an integer overflow in the way elapsed_time_ms. Because the
SGTimeStamp "-" operator returns it's result in usec's, there is an upper bound of 37.8 minutes on the maximum difference this operator can reliably report
before the math overflows.  I change the global "int elapsed_time_ms" variable
to a "double sim_time_ms" and restructured how the value is calculated.
----
The practical result of the overflow bug is that a large negative dt was
passed to the event manager and the end effect was that no events would
be run until their counters caught up ... in another 37.8 minutes or so.
2002-04-20 14:52:43 +00:00
david
89324e0cfe Explicitly include model.hxx, since acmodel.hxx no longer includes it. 2002-04-20 14:08:06 +00:00
david
1094206677 Add support for interpolation tables for non-linear animations.
Remove header dependencies where possible, to speed up rebuilds.
2002-04-20 14:07:34 +00:00
david
17cfbd2a7c Remove header dependencies where possible, to speed up rebuilds. 2002-04-20 14:07:03 +00:00
david
4c101d7199 Updated docs for this directory. 2002-04-20 14:05:49 +00:00
curt
8b3f0ad7cc Jim Wilson:
Also move tower when teleporting to a new airport.
2002-04-19 15:48:27 +00:00
curt
f1d8d554d0 Jim Wilson:
Fix a scrolling problem where last item doesn't show in prop_picker.
Removed include for unreferenced header in viewmgr.
2002-04-19 15:36:51 +00:00
curt
b36f19b871 Detect and recover from a math overflow that can possibly prevent panel text
from updating if the instrument panel is not drawn for more then 35.7
minutes.
2002-04-19 14:05:58 +00:00
david
473ea84621 JSBSim fix:
Corrected typo "flaps-pos-deg" to "flap-pos-deg".  JSBSim now reports
the normalized flap position to FlightGear, and the model animation
works again.
2002-04-19 12:15:46 +00:00
curt
130902f788 Fixed an "==" vs. "=" typo. 2002-04-19 04:11:32 +00:00
david
eea531fbf5 Stop the sound when paused. We really need a separate control for
muting, but that will have to wait until someone has time.
2002-04-19 04:00:02 +00:00
curt
4656e3adca Jim Wilson:
Minor patch for flicker glitch when crossing from one tile to another.
2002-04-19 00:25:25 +00:00
curt
97cc733ac8 Tracked down a potential segfault when trying to audibly ident a vor station.
This led to an investigation into why the ident playing didn't work anymore.
Recent changes in the sound manager broke some assumptions the radiostack
code was making.  These patches should hopefully fix all that back up.
Erik, please review these changes to double check I didn't do more damage
than good. :-)
2002-04-18 21:43:00 +00:00
david
4c30ccf2d4 Added groundwork for reading a joystick name from the latest plib CVS
code.  It doesn't do anything but print a message, so far.
2002-04-18 20:18:33 +00:00
curt
71598c12f8 Jim Wilson:
These are the updates for the View manager properties.  Removed the last of
items (within the viewer/viewmgr) hard coded to view number.  Added support
for per view configuration of ground level nearplane value.  Tower views look
very nice with little or no z-buffer problem in the models.  Pilot offset
dialog can be used to move eye in all views.
2002-04-18 16:51:47 +00:00
curt
e5abcd1ef1 Replaced spaces with <tab> since this is a makefile. 2002-04-16 20:42:58 +00:00
curt
7311318e7e Small tweak to make the Irix compiler happy. 2002-04-16 17:28:57 +00:00
david
adcb4fc30e Latest JSBSim changes. 2002-04-16 13:15:29 +00:00
curt
bd9b1c7558 Fixed a recently introduced bug which cause the ground lighting to be
wrongly "lifted" a very, very, very large amount more than it was supposed
to be.  I guess the moral of the story is what goes up, must come down. :-)
2002-04-16 06:33:56 +00:00
curt
39cba9139c Of all the ILS stations that match the specified frequency and are in range,
return the one that is pointed most directly at us.
2002-04-15 17:53:05 +00:00
david
6c2039c5aa This module was filtering out all stations with localizer offset
>90deg, even though src/Cockpit/radiostack.cxx has code to deal with
those; as a result, no backcourses were getting through.

This fix allows the common case of backcourses to work again, but
breaks the uncommon case of a runway using the same frequency for two
separate localizers.  That special case will have to be detected
somehow.  Still, this fixes more approaches than it breaks.
2002-04-15 15:28:11 +00:00
david
e528324955 MSVC fix. 2002-04-13 21:41:51 +00:00
david
c5f6293f17 Fix for vanishing-model problem: models are drawn in the same scene
graph as the terrain, except for internal cockpit view.  The SSG
scene-graph variables (except for the lighting root -- I'll get that
later) are now held in globals.hxx.

FGModelMgr::draw() is obsolete; I'll remove it in a future revision.
2002-04-13 21:36:22 +00:00
david
7432b9c590 Patch from Jim Wilson:
Fix for problem where an incorrect frame or two got slipped in while
changing tiles.  Corrections to authorship in file level comments.
2002-04-13 16:25:49 +00:00
david
d164d565c0 Patch from Norm Vine to speed up model placement.
DPM: untabified file.
2002-04-13 13:30:38 +00:00
david
39416c2855 Patch from Jim Wilson:
Minor fixes.  Made some changes to get lighting correct for time of day
for now. MSVC compatibility fix and returned to clearing z-buffer only in
LOOKFROM (formerly pilot view).

[dpm: removed the last one, since I had already made a similar patch]
2002-04-13 13:11:34 +00:00
david
d254b2a331 Ensure that the aircraft model is in the same clip plane as everything
else and *doesn't* clear the z-buffer when in external view; tighten
the far plane for internal view back to 100m to give us maximum
precision (this will be important for some instruments; I might even
move it to 50m).
2002-04-13 12:11:27 +00:00
david
6b71800829 Add and document a "range" (level-of-detail) animation for individual
objects and a range for the model as a whole.
2002-04-13 12:10:20 +00:00
david
fa5a707128 JSBSim change:
Set an arbitrary cutoff (5RPM) where friction causes the propeller to
stop spinning.
2002-04-12 17:24:17 +00:00
david
dcac4d7e32 Fixed typo for indirect longitude property. 2002-04-12 15:07:49 +00:00
david
8bed5a8cf4 Added support for additional animated, dynamic 3D models configured in
XML.
2002-04-12 12:45:49 +00:00