1
0
Fork 0
Commit graph

3819 commits

Author SHA1 Message Date
mfranz
550352c0b6 keep panel and gui bindings nicely separated; useful for debugging,
especially now that the property path is shown in nasal error messages
2005-06-24 14:07:15 +00:00
mfranz
19b09cef28 FGBindings doesn't create its own, detached copy of the bindings property
subtree. Keeping bindings available is in the responsibility of the caller.
2005-06-24 13:44:22 +00:00
curt
baac4a98c9 Laurie Bradshaw:
Modified fgjs.cxx so it can produce xml or property list output.
There are also a couple of other additions (like a --deadband <float>
option).
2005-06-23 19:21:17 +00:00
mfranz
c70e5f20de - layout frames like groups (I forgot to commit that yesterday :-) 2005-06-21 12:13:07 +00:00
mfranz
0636ebfc86 - fix "frame" (the old code was broken and ... strange)
- add "hrule" (horizontal rule; accepts color and "pref-height" for thickness)
2005-06-20 20:54:47 +00:00
mfranz
d977c07908 - output property path in error messages 2005-06-20 18:53:00 +00:00
mfranz
ee7b882dd9 - delete bindings in the *destructor* (must have been an editing accident)
- create copies of bindings in /sim/bindings/, because FGBindings doesn't
  do that any more  (is there a better way to find the first free child?)
2005-06-20 18:52:54 +00:00
mfranz
1bcaf4bfdd - don't store link to a disconnected *copy* of a subtree, but a link to
that subtree in the property tree itself
- remove a binding from the property tree
2005-06-20 18:52:45 +00:00
mfranz
8027023862 - fix bug that let <mod-up> bindings be executed before the nasal init
block (this required to move most of init() into postinit())
- undo the "which" pseudo-namespace workaround, and do it proper:
- let all nasal code in a joystick config file be executed in its own
  namespace. This allows to define functions in the init block that
  can be used throughout the driver file, and to write state variables
  in one binding, while reading them in other bindings, all without
  having to make sure that the values aren't lost in between, or collide
  with another joystick driver's code.
      For this the input subsystem creates a namespace for each joystick:
  "__js0" for joystick 0, etc. The two leading underscores are there to
  avoid collisions with user defined modules (similar to internal compiler
  variables). The namespace shouldn't be used explicitly, at least not in
  releases, and not from outside code, except for testing purposes, for
  which it can be useful. (If using the Cyborg joystick as js[0], you
  can read the modifier level as "__js0.modifier" from any nasal context.)
2005-06-19 17:23:41 +00:00
mfranz
ece07db538 - rename initModule() to createModule() (as suggested by Andy)
- make it public
- enable handleCommand() to execute a binding (or other nasal code defined
  in a property system subtree) in a particular namespace (-> "module" child)
2005-06-19 17:09:03 +00:00
mfranz
5c31daf808 Josh Babcock: fix typo 2005-06-17 19:42:25 +00:00
curt
3a109c568a Adjust logging output. 2005-06-14 20:55:46 +00:00
andy
568d53875e Make readScriptFile() public, and rename it to loadModule(), so that external
code can have access to the facility for loading modules from files.

Also includes a cast-int-to-pointer fix that causes a warning on 64 bit
systems.
2005-06-14 19:57:24 +00:00
curt
6dd82d0502 Updated electrical system.
These changes represent some attempts to bandaid and patch a hopelessly
flawed system to impliment basic battery charging/discharging as well as
provide the ability to model ammeter gauges and draw current from multiple
sources (like load balancing multiple alternators in a multi-engine aircraft.)
The system design forces all these things to be horrible hacks or depend
on extremely subtle system side effects and call ordering so they may or9
may not work to one degree or another.

As mentioned in the mailing list, my recommendation is to move away from
using this system and instead build a procedural electrical system using
nasal.  Sometime in the future we hopefully can impliment a better conceived
data driven electrical system model.
2005-06-14 17:57:48 +00:00
curt
5fb87df1fb Turn the electrical system into a non-hardcoded system like all the other
systems.
2005-06-14 17:54:19 +00:00
curt
d0c8edd02d Fix a misuse of a return value that lead to an error message being displayed
when one shouldn't have been.
2005-06-14 17:53:40 +00:00
mfranz
72eecef8fa strip trailing spaces & garbage 2005-06-13 19:27:40 +00:00
mfranz
639ed2161f revert last patch, and do it differently: set /input/joysticks/which (int)
to the joystick index (x in /input/joysticks/js[x]) both when initializing
nasal init blocks & whenever updating the joystick. That's the only way to
make these nasal contexts aware of the joytick for which they were called.
And that's useful if a js maintains common variables, such as modifiers or
state variables, that should be shared between the namespace-less bindings
and initialization code. And, yes, it's over-engineered ...  :-)
2005-06-13 06:14:45 +00:00
mfranz
dec07ab83e leave temporary hint for the nasal init block, so that it can access
its own data, and can distinguish itself from other instances of the
same js driver. This property is removed after script execution.
Example:

  self = props.globals.getNode(getprop("/input/joysticks/this"));
2005-06-12 19:27:20 +00:00
mfranz
938502b239 sg_throwable's "origin" argument is optional and defaults to an empty
string. "(received from )" doesn't really look good.
2005-06-12 16:01:49 +00:00
mfranz
1167c31a84 even clearer error message :-/ 2005-06-12 13:54:27 +00:00
mfranz
10ab557452 clearer error message 2005-06-12 13:51:55 +00:00
mfranz
defa571d86 a missing /input/joysticks/ node is no alarming sign any more. It's
supposed to get populated from $FG_ROOT/Input/Joysticks/.
2005-06-12 13:35:55 +00:00
mfranz
4a1eadbf35 throw an exception if not even a default joystick could be found;
This can only happen if $FG_ROOT is corrupted or some developer has
broken the default js config. Better not keep that under the rug.
2005-06-11 15:26:32 +00:00
mfranz
325d545132 - read all joystick files from $FG_ROOT/Input/Joysticks automatically
(no need to list the paths explicitly in $FG_ROOT/joysticks.xml any more)
- move identified js nodes to /input/joysticks/js[0-9], but
- don't overwrite already set joystick data there
- remove all nodes when they aren't used any more
- add "id" node, which contains the js id that lead to the selection
  of a "named js" config
- add "source" node containing the path of the used js config file
- execute all nasal script groups at initialization time
2005-06-11 14:26:11 +00:00
mfranz
57aa9274d7 call the subsystems' postinit() methods after all of them are initialized 2005-06-11 09:13:44 +00:00
ehofman
34a4fb72b5 A few fixes from David Culp. 2005-06-11 08:19:16 +00:00
ehofman
c3037e3891 Fix by Durk Talsma to fix the Airport AI directory preread code. 2005-06-11 08:13:30 +00:00
ehofman
ab83702c16 David Culp:
I added an AIStatic object to my OV-10 sim for use in putting city signs,
vehicles, or anything else that will be static, but that I don't want to put
in the scenery files.  It's inexpensive.  Before, I was making such things
from AIShip.

I also added the ability to set flight plans to repeat, so that when an
airplane reaches the end it just starts over at the beginning.  This is
useful for my OV-10 sim.  I have C-141 and KC-135 traffic flying approaches
to Ramstein, and I only have to define two AI objects to do this.

Also, I found an inefficiency in AIBase, where every AI object was calculating
Mach number at every dt.  Now only AIBallistic objects do this.
2005-06-04 09:38:52 +00:00
curt
36929535d7 Fix some more of my own stupidity. 2005-06-03 15:25:19 +00:00
curt
00337c6c64 Fix some stupidity (mine). 2005-06-03 15:23:10 +00:00
mfranz
be1df4819a I had hoped that gmtime's lack of thread-safety wouldn't bite us. It does.
Fix jumping clock hands.
2005-06-03 08:39:50 +00:00
ehofman
557a879483 Mathias Frhlich:
this is basically the past patch I sent to the list and which should now
really (...!?!?) fix the no ground below aircraft problem.
Reasons:
I understood my remaining thinko I introduced with the prevous patch, and the
same thinko I made in my test cases.
The feedback from the list told me that it should help.
2005-06-02 08:51:47 +00:00
ehofman
807d2cc3ca Mathias Frhlich:
2.
I made YASim query the the ground cache at the wrong place. This one fixed
this, one can now land the bo105 on top of the oracle buildings  :)

3.
Is a followup of the scenery center update code: Register the scenery center
transform at the time it is put into the scene graph not at creation time.

4.
I held that part back from the past hitlist patch, because I hoped that it
will be sufficient (and the last one was in fact the biggest part) without.
As some test cases from Melchior showed me, it is not. We have additionally
to the wrong computed transform from the prevous patch some roundoff
problems. This patch adds some small tolerance to for the point in triangle
test.
... may be one even needs to increase the eps value further if starting at
some tile boundaries still fails.

5.
That is a big chunk.
Tested now for two days while hunting the second patch  :) .
That is a partial rewrite of the groundcache to use its own datastructures for
that flat scenegraph in the cache. The basic advantage is, what Erik
suggested, to precompute some often used values of these triangles. Also
allmost all computations are now in double precision which should decrease
(hopefully fix), together with a similar tolerance for some point in triangle
tests, the problems with 'no ground below aircraft'.
I am playing with octrees for the groundcache, that will finally solve the
performance problem when high triangular count models end up in the
groundcache. This patch is also some prework for those octrees ...
2005-05-30 08:48:27 +00:00
ehofman
8ff709439b Some small fixes and security updates. 2005-05-30 08:47:00 +00:00
ehofman
a383d6285b Fix a number of build issues; Not all compilers support strnlen(), some platforms use more than one lend-ending character and capture lines starting with a whitespace also. 2005-05-27 18:49:45 +00:00
ehofman
e4bce63391 Be a tad more clever on readin the apt database; optimize the if statements a bit and dont tokenize strings we don't want to see anyhow. 2005-05-27 17:46:35 +00:00
andy
88c73d0ece Don't try to open runway and parking files for every airport in the
database.  Works fine on Linux, but is a huge performance hit (1
minute) on cygwin.  Keep a cache of actual directories and check that
first.
2005-05-27 17:06:13 +00:00
ehofman
b71b3af66c A patch from Mathias to fix the startup at a tile boundry problem. 2005-05-26 08:13:06 +00:00
mfranz
61b5efb772 The "catching up on tile delete queue" doesn't justify an ALERT message.
It happens regularly during normal operation (ufo!) and only informs about
unfortunate, but known and deliberate behavior. The user can't do anything
about it, anyway. And finally: flooding the console with this message does
only *add* to fgfs' sluggish performance and makes every other message
go unnoticed.
2005-05-22 17:14:15 +00:00
ehofman
e59d38bf00 Harald JOHSNEN:
Changes
=======

- correct the transparency probleme when old 3d clouds were enabled
 (rendering context with an alpha channel)
- changed rain cone orientation, it can now be viewed from helicopter or chase
  view (still not tower view)
- clouds are a bit more yellow/red at dawn/dusk
- weather data is now correctly propagated to the interpolator, this correct
  visibility, wind, etc
- the 'metar' weather scenario now immedialty reuse the real metar data
- real metar no more overwrite custom weather scenario
2005-05-22 08:08:22 +00:00
ehofman
56a9034d95 Sync. w. JSBSim CVS. 2005-05-22 08:06:47 +00:00
ehofman
9c146d5527 MSVC fix. 2005-05-22 07:36:26 +00:00
curt
5c6020f2bc Added Farenheit temperature conversion to the property tree. 2005-05-20 19:42:53 +00:00
ehofman
70fe768e5c Revert the previous patch. 2005-05-17 09:56:52 +00:00
ehofman
4b5a80129d David Culp:
1)  The AIStorm sets the properties:
         /environment/turbulence/magnitude-norm
         /environment/turbulence/rate-hz

    The actual turbulence effects are handled by the FDM.
    If the effects are deemed unrealistic, then that will
    have to be fixed in the FDM(s).


2)  The zone of turbulence is cylindrical, and is centered
    at the AIStorm's lat/lon.  The diameter is set with
    <diameter-ft>, the top with <height-msl>, the bottom is
    assumed to be at <altitude> minus 1000 feet.

3)  Note that the zone of turbulence may not match well with
    the visual model of the storm.  In this case I had to
    x-offset the storm model by 4700 meters to match the zone
    of turbulence. (i.e. the storm model is 4700m off center).

4)  While I was in there I also increased the speed of the
    lightning flashes to look more realistic.
2005-05-16 09:48:00 +00:00
ehofman
a75c0859bd Oops, I didn't test compile the latest code and this is what happens. 2005-05-16 09:05:17 +00:00
ehofman
d4b8a81a44 Make the dialogs work again. 2005-05-16 08:37:18 +00:00
ehofman
d2271c3bf4 Harald JOHNSEN:
This is another update for the cloud code, a lot of lines but this time I have started to add the doxygen doc.

Misc
====

- corrected a bug when RTT is not available, the current rendering context was
  altered
- if RTT is not available then 3d clouds are not drawn at all
- impostors lighting is now recomputed when the sun changes position
- distant objects are no more seen in front of clouds
- blending of distant clouds is a bit better now
- litle optimization of code (uses a less cpu time)
- use layer wind speed and direction (no more hardcoded wind)
- fov is no more hardcoded

Changes
=======

- clouds (cu only) are dissipating/reforming (experimental)
- compute a turbulence factor that depends on surrounding clouds and type of
  clouds (experimental)
- clouds shapes are defined in cloudlayers.xml
- type of clouds present in a layer is also defined in cloudlayers.xml
- cloud layers are generated from metar and other misc. data (in progress)
- added a rain effect around the viewer (enabled in the rendering dialog and
  when the metar property says so)
- added a lightning effect (enabled in the rendering dialog) : cb clouds spawn
  new lightnings
- added a dialog to select from different weather source : metar/property,
  a 'fair weather' environment and a 'thunderstorm' environment.
2005-05-15 09:26:17 +00:00
mfranz
11a1ca0651 do also silence the marker sounds on --disable-sound 2005-05-12 18:30:59 +00:00
mfranz
172dd40844 currently "tailwheel-lock=true" means 'unlocked', which is
confusing and inconsistent with brake properties (where 1.0
means (b)locked) ==> reverse tailwheel-lock meaning
2005-05-10 10:56:55 +00:00
mfranz
1b88a799c0 don't use /sim/ATC/ and /sim/atc/ wildly mixed together; it's only /sim/atc/
now, just as it was everywhere in ATC/ATCDialog.cxx already
2005-05-10 09:44:13 +00:00
mfranz
e23c5e49c9 there's no such thing as /sim/time/elapsed-ms --> elapsed-sec 2005-05-10 09:29:24 +00:00
mfranz
51353ead72 Simon Hollier:
don't crash when using --disable-splash-screen and/or if font can't be found
2005-05-10 06:26:59 +00:00
mfranz
fb14bdb8ec the plib documentation says we should call fntInit() before using fonts;
not that it makes a difference ...
2005-05-08 14:32:56 +00:00
ehofman
408dcc38b1 Solaris fixes 2005-05-07 08:56:42 +00:00
mfranz
97811e8832 fade out text, too; cosmetics 2005-05-06 15:48:48 +00:00
ehofman
48f45296ce Add support for altering the border thickness of objects and add a 'frame' object as a visual representation of a group. 2005-05-06 11:46:52 +00:00
mfranz
8ddf716d8c navigation data alone doesn't take *that* long ... 2005-05-06 09:47:46 +00:00
mfranz
b04c31cc51 fix wording 2005-05-06 09:16:30 +00:00
mfranz
d80b718039 - implement progress information (enabled by default; can be turned off via
/sim/startup/splash-progress)
- a string in /sim/startup/splash-title is displayed on top of the screen
  and by default empty
- the splash image is scaled down if 512x512 is too big
- code cleanup
2005-05-06 09:08:44 +00:00
mfranz
608e56bfb4 remove redundant check 2005-05-04 21:31:16 +00:00
mfranz
99f4b7e66e - open window as soon as possible
- move most of the initialization in chunks into the idle loop
- remove unused first fgSplashUpdate() parameter
2005-05-04 21:28:42 +00:00
mfranz
2a5b1040d3 one dialog-show is enough 2005-05-04 21:25:57 +00:00
curt
5b9bd7ae4d Oops, forgot to update the network byte order conversion functions when I
updated the structures.
2005-05-04 21:07:03 +00:00
mfranz
510314f54d reverting last patch: the (non)redrawing problems are simply too annoying :-( 2005-05-04 12:11:37 +00:00
mfranz
69798de096 open black window immediately. This doesn't only give useful feedback,
it also allows to switch desktops shortly after starting fgfs without
having the window pop up on the "wrong" virtual desktop.
2005-05-04 10:57:35 +00:00
curt
927cb78aba 32 bit integers are somewhat magical and handled pretty well across platforms
in terms of predictable packing and byte ordering.  So rather than trying to
get fancy and shave a few bits off the structure sizes, just go with 32 bit
ints for everthing which saves a lot of potential headaches in the cross
platform and cross architecture arenas.
2005-05-03 20:34:21 +00:00
ehofman
a760869475 Fix a couple of stupid mistakes, I'm off to find a brown paper bag now. 2005-05-03 12:48:31 +00:00
ehofman
a4eebe4277 Shoot, I removed a bit of crucial information just before committing it. 2005-05-03 12:20:17 +00:00
ehofman
2c3b8e075c Make it possible to define a different font for the labels 2005-05-03 11:58:33 +00:00
ehofman
c3ba52d821 Allow for defining the label color. 2005-05-02 14:45:04 +00:00
ehofman
2d9108e253 Add lightning support from David Culp. 2005-05-02 12:29:13 +00:00
ehofman
0c61e0dae1 Make it optional whether a dialog can be dragged or not. 2005-05-02 12:14:12 +00:00
mfranz
34d23fe6f3 cleanup (deleting NULL pointers is explicitly allowed) 2005-05-02 06:03:25 +00:00
mfranz
b68429c862 don't crash if fgfs is called with an invalid argument to the --vor option 2005-05-01 14:27:06 +00:00
ehofman
4c10ef139c Mathias:
I have done a patch to eliminate the jitter of 3D-objects near the viewpoint
(for example 3D cockpit objects).
The problem is the roundoff accuracy of the float values used in the
scenegraph together with the transforms of the eyepoint relative to the
scenery center.

The solution will be to move the scenery center near the view point.
This way floats relative accuracy is enough to show a stable picture.

To get that right I have introduced a transform node for the scenegraph which
is responsible for that shift and uses double values as long as possible.
The scenery subsystem now has a list of all those transforms required to place
objects in the world and will tell all those transforms that the scenery
center has changed when the set_scenery_center() of the scenery subsystem is
called.
The problem was not solvable by SGModelPlacement and SGLocation, since not all
objects, especially the scenery, are placed using these classes.

The first approach was to have the scenery center exactly at the eyepoint.
This works well for the cockpit.
But then the ground jitters a bit below the aircraft. With our default views
you can't see that, but that F-18 has a camera view below the left engine
intake with the nose gear and the ground in its field of view, here I could
see that.
Having the scenery center constant will still have this roundoff problems, but
like it is now too, the roundoff error here is exactly the same in each
frame, so you will not notice any jitter.

The real solution is now to keep the scenery center constant as long as it is
in a ball of 30m radius around the view point. If the scenery center is
outside this ball, just put it at the view point.

As a sideeffect of now beeing able to switch the scenery center in the whole
scenegraph with one function call, I was able to remove a one half of a
problem when switching views, where the scenery center was far off for one or
two frames past switching from one view to the next. Also included is a fix
to the other half of this problem, where the view position was not yet copied
into a view when it is switched (at least under glut). This was responsible
for the 'Error: ...' messages of the cloud subsystem when views were
switched.
2005-04-29 14:38:24 +00:00
andy
3a6bc316ed Same bug, different place. Don't treat a length of zero as "please
strlen() it", because real files and properties can have lengths of
zero.
2005-04-26 20:57:06 +00:00
andy
239077599c Don't try to strlen() the input buffer if the length is zero. That
was probably my idea of a feature, but if the input buffer actually
does has a length of zero (as Melchior discovered for the case of a
zero-length .nas file) then there will be no null.
2005-04-26 17:18:00 +00:00
ehofman
a78dae1fb7 Harald Johnson:
Changes
=======

- corrected some strange behavior when playing with the render dialog options
- the density slider is now working : if you are fps limited and still want to see clouds in
  the distance you should play with that
- added the choice for texture resolution, its more comprehensible now (before it was
  wrongly allways choosing 64x64 textures)
- changed the initial texture size : you now have 64 texture of 64x64, this uses 1Mo of
  texture memory (before it was 20 texture of  256x256, that took more memory and there was
  not enought impostors)
- sun vector is now right so the lighting is a bit better
- removed useless sort and light computations for impostors, this should save a lot of cpu
- blending of distant cloud is more accurate now
- clouds are now positioned correctly, they don't try to escape you anymore
- no more red/white boxes around cloud
- textures are now filtered (no more big pixels)

known bugs
==========

- distant objects are seen in front of clouds
2005-04-26 08:31:25 +00:00
ehofman
1f35f4c1ab Harald Johnson:
- new and updated sources for the new volumetric clouds
- 2 new textures for the clouds
- an update to the render dialog to enable/disable and change a few parameters
  for the new clouds
2005-04-24 11:17:23 +00:00
mfranz
a14263a006 code simplification: use atan2() [discussed with David] 2005-04-22 06:41:07 +00:00
mfranz
73c1b5beb4 "condition" needs to be clamped like "mixture", so that it is settable via
controls.adjEngControl()  (this is necessary to make the b1900d's condition
settable via m/M keys or the joystick's configure mixture bindings)
2005-04-21 14:17:59 +00:00
ehofman
6a4b7302b0 Mathias Frhlich:
I have some small updates to the ground cache.

- Remove the usage of dynamic_cast where it is known that the result will be
  non null.
- Renormalize the surface normal in double precision.
- Place the groundcaches center at the point it was requested not at the
  scenery center. This fixes the problems with JSBSim's trimming together with
  the ground cache. Now I am ready to commit JSBSim's ground cache usage.
2005-04-19 13:21:43 +00:00
ehofman
cc3eacb88e Melchior: Make line wrapping in textboxes configurable, and enable it by default 2005-04-19 13:15:04 +00:00
ehofman
3b5512f573 David Culp:
I'm looking through the AI code, trying to find the bug that's killing the
thermals.  The following things don't look right:

1)  AIManager::101  ,   the Traffic Manager pointer is searched for by name at
every dt.   I'll leave this for you to look at.

2)  AIManager::295  ,  the thermal height is not being set.  We need to
restore the line:         ai_thermal->setHeight(entity->height_msl);
This fixes the thermal problem.

3)  AIManager::328  ,  I changed the fetching of the user state to occur every
sim cycle, and changed the fetching function from by-name lookup to a lookup
by node pointer.  It should be faster now, and more accurate too.  This helps
the air-refueling.
2005-04-19 12:52:26 +00:00
curt
86249209b9 This is a work in progress. I am extending the "ExternalPipe" protocol to
have a "property" mode as well as the original "binary" mode.  The property mode
will allow the remote module to request any set of properties, and it will send
those properties each frame.  The remote module can reply with a list of arbitrary
property name/value pairs to update on the FlightGear side.

This is a first stab, so it's not the cleanest, most well concieved code, but it
allows an external module (communicating via a pipe) to have a huge amount of
flexibility in the data in can access and update.
2005-04-19 01:44:56 +00:00
curt
a69bc500ef Fix a couple typos. 2005-04-19 01:41:17 +00:00
andy
142854d3d1 Upgrade to Nasal 1.0 test candidate 2005-04-18 19:49:13 +00:00
andy
cc09868772 Fix units bug with fuel flow 2005-04-13 19:42:29 +00:00
ehofman
3f6536fee6 Allow for recolloring the dialogs. 2005-04-13 11:39:53 +00:00
andy
88a678eb77 Don't overwrite the castering value with the non-castering one. Also,
make the caster-angle-deg a synonym for the steering angle when the
wheel is non-castering.
2005-04-08 22:39:46 +00:00
andy
a40cab8321 Oops, stray line in the checkin. I'm sure fenv.h would have broken on
at least one system...
2005-04-08 20:55:02 +00:00
andy
7eb194b3f8 Export "rollspeed-ms" and "caster-angle-deg" properties for gear
objects.  Josh Babcock wanted these for the B-29 model so he can
properly animate the gear.
2005-04-08 20:46:43 +00:00
ehofman
d28e99d913 Melchior FRANZ:
Make SDL window resizable; This exposes the same problem that many
GLUT users have: resizing up may cause a temporary switch to software
rendering if the card is low on memory. Resizing down again switches
back to HW rendering. (KSFO is texture intensive, but there are no
problems in LOWL, and elsewhere.) Less and less users will have the
problem as cards become better, and it's no reason not to allow
resizing altogether.
2005-04-06 08:46:39 +00:00
ehofman
28fe28ec4f Melchior FRANZ:
_course_deg is first initialized in the if()-branch (gps.cxx:419). But
this branch isn't entered at first run if wp0==wp1, so that in line 615
fgfs tries to SG_NORMALIZE_RANGE() a random value, which can take a
long while if the number huge. This was occasionally a number greater
than 10160!

- initialize all vars before they are used (fixes endless loop)
- fix some compiler warnings (initialization order, unused vars)
2005-04-06 08:24:30 +00:00
ehofman
d3bdc4e7bc Melchior FRANZ:
FGAIMgr::GenerateSimpleAirportTraffic() tries to determine the airport's local
hour from the /sim/time/gmt-time string, which fails, because at this time the
property is still empty. That's why I don't get ATIS at LOWG (where it is *not*
midnight right now.  :-)    -> use sg's get_cur_time() instead
2005-03-31 17:00:27 +00:00
ehofman
d461e7868f Melchior FRANZ:
- don't treat *every* child in the xml as submodel, especially not a "param"
  block
- do not only *enable* the contrail flag above some altitude, but also
  disable it below
2005-03-31 08:54:04 +00:00
ehofman
f43b011ee3 Cygwin (windows) fix. 2005-03-31 08:41:41 +00:00
ehofman
019a7a186b Melchior FRANZ:
showDialog() is careful not to create a new FGDialog() if a dialog with the
same name is already open (active). But at this point it is already too late:
newDialog(), which was called shortly before, has already overwritten the
dialog properties. This leads to animated garbage in the best case, and a
segfault in format_callback() in the worst case.

- GUI::newDialog(): Don't you overwrite properties of an active dialog!
- GUI::readDir(): You may do that, but delete the old dialog first!
  (necessary for reloading the GUI)

- FGDialog::makeObject(): only set format_callback() with setRenderCallback()
  if the property is "live". Otherwise, only call it once at construction
  time. This isn't only a performance improvement. Without this the label
  was growing until it hit the limit (256).
2005-03-29 08:35:13 +00:00
ehofman
71dd0f8f96 Melchior FRANZ:
The previous message wasn't totally correct. Strings are now allowed, too. And
the pattern is now '[ -+#]?\d*(\.\d*)?l?[fs]' and *may* be embedded in a string.
There may only be one %s or %f, though. %% is allowed in the preamble/postamble.
(Yes, %ls is allowed, too, and treated as %s.)

Also, "end" is superfluous now.
2005-03-26 10:45:00 +00:00
ehofman
db989269b8 Melchior FRANZ:
Printing floats in dialogs with 8 digits after the comma is inappropriate
for most cases.

- implement a "format" property for "text" gui elements (a.k.a. pui label).
  Number formats are set by strtod/snprintf, while formats on non-numbers
  are replaced by "%s". Practical example in the upcoming material.nas update.
  Valid formats regex:  '%[ -]?\d*(\.\d*)?l?f' (IOW: the format must begin
  with '%' and end with 'f').

  # Nasal:
  number = dialog.addChild("text");
  number.set("label", "3.1415926");
  number.set("format", "%.3f");
2005-03-26 10:09:34 +00:00
curt
babb51ba02 Update nasal function name. 2005-03-25 01:37:58 +00:00
curt
f55f96c44a Use standard length types (stdint.h where available) to make the FGNetCTRLS,
FGNetFDM, and FGNetGUI structures more cross platform/architecture portable.
2005-03-24 19:56:57 +00:00
ehofman
4b116a1196 Melchior FRANZ:
The dialog handling has been written at a time when only one dialog was
shown at the same time, and dialogs were shallow -- with only children, but
no grand-children. This makes finding a draggable spot on modern, dialogs
with nested objects quite a challenge. The patches fixes this, and other things:

- check full object tree on button press, not only the outmost layer;
  and don't give up just because we are in *something* (which could well be
  something harmless, like a group); only ignore a few, sensible objects
  (we don't want to drag after a click on a button or into an input field)

- don't lose dialogs as easily when dragging too fast (it does still happen
  if one manages to enter an editable field while dragging, but this is
  a plib problem and I don't feel like fixing that now  :-)

- don't "live"-update input fields while they are in edit mode

- remove some "if (foo) delete foo;" redundancy
2005-03-24 13:41:43 +00:00
andy
c89e5203a5 Insert a sanity hack from Melchior that apparently prevents a NaN from
popping up and crashing when the B-29 model is in use.  This isn't the
right solution; we should fine the NaN condition.  But it's harmless
and allows development with the B-29 to continue.
2005-03-23 18:54:58 +00:00
andy
e4142d94d4 I fixed the gear-ratio handling in the solution computations a while
back, but forgot to put the same fix into the runtime code.  Also
added some comments so I don't get confused again the next time I come
through here. :)
2005-03-22 18:17:08 +00:00
ehofman
50bdf6098a Mathias Frhlich:
I have done some cleanup where I moved some values out of classes where they
do not belong and such stuff.
Also the fols offsets are now named in the carrier xml file with a more
verbose name (flols-pos/offset-*) than before (only offset-*).
There is a little preparation for definitions of parking positions on the
carrier which should later be used for starting flightgear directly on the
carrier.
2005-03-19 09:57:18 +00:00
curt
ecfaa79b9e Permit a single nasal module to reference any number of files which are all
loaded into that single nasal name space.
2005-03-16 21:36:55 +00:00
curt
ebfaccd95b Add support for "offset" tag ... (value = raw * factor + offset) 2005-03-10 19:06:30 +00:00
curt
2e308fe928 Updated hybrid of original busy-wait frame rate throttling loop combined with
a safe undersleep() to conserve cpu.  Essentially we undersleep our target by
just a bit (to avoid the chance of oversleeping.)  Then we finish off the
remaining time slice with a busy-wait loop.
2005-03-09 21:56:00 +00:00
ehofman
d1168b493a Frederic Bouvier:
Norman Vine wrote :

> Frederic Bouvier writes:
>
>> Quoting Andy Ross:
>>> * Hopefully in a CPU-friendly way.  I know that older versions of
>>>  the NVidia drivers did this by spinning in a polling loop
>>>  inside the driver.  I'm not sure if this has been fixed or not.
>>>
>>> From my experience, the latest non-beta Windows NVidia driver seems to eat CPU
>>
>> even with sync to vblank enabled. The CPU usage is always 100%.
>
> Buried in the PPE sources is a 'hackish' but portable way to limit CPU usage if the desired framerate is met
>
>  /*
>    Frame Rate Limiter.
>
>    This prevents any one 3D window from updating faster than
>    about 60Hz.  This saves a ton of CPU time on fast machines.
>
>    ! I THINK I MUNGED THE VALUE FOR ulMilliSecondSleep() NHV !
>  */
>
>  static ulClock *ck = NULL ;
>
>  if ( frame_rate_limiter )
>  {
>     if ( ck == NULL )
>     {
>       ck = new ulClock ;
>       ck -> update () ;
>     }
>
>     int t_ms = (int) ( ck->getDeltaTime() * 1000.0 ) ; /* Convert to ms */
>
>     if ( t_ms < 16 )
>       ulMilliSecondSleep ( 16 - t_ms ) ;
>  }
>
>

I implemented the method pointed out by Norman. It works great on windows and saves me a lot of CPU cycles. This way, I can get the same framerate in moderately populated areas and have CPU idle 50% of the time instead of wildly looping in the NVidia driver while waiting to sync on vblank.

It has been tested on Linux by Melchior. He saw the same gain in CPU cycles.
2005-03-09 15:12:01 +00:00
ehofman
c1f250fd33 IRIX fixes. 2005-03-08 19:47:51 +00:00
ehofman
811591734e IRIX fix. 2005-03-08 18:05:24 +00:00
curt
fa2a9854a4 Revert last change. 2005-03-03 23:33:29 +00:00
curt
85509fff03 Change fuel selector data type from bool to int. 2005-03-03 23:14:57 +00:00
curt
076aa3b402 Fix a small oops. 2005-03-03 18:25:25 +00:00
curt
61ed285d06 Add support for a simple deadband. 2005-03-03 18:22:48 +00:00
curt
c6c094034c Add support for drawing only a portion of the configured view frustum. This
is one way to get an asymmetric view frustum without needing to compute the
sgFrustum parameters directly.
2005-02-25 22:27:15 +00:00
curt
5accfdeb90 Currently, aspect ratio is computed directly from the window dimensions.
I have added a --aspect-ratio-multiplier=x.xx option to give some end user
control over the aspect ratio.  (This may seem a little strange, but it's a
building block towards the capability of doing asymmetric view frustums in
FlightGear.)
2005-02-25 21:20:17 +00:00
curt
7c43f5c924 Oops, committed some code that should *not* be in the default. 2005-02-25 19:47:40 +00:00
curt
40170cb722 The view frustum is defined in plib apps using calls to ssgSetFOV() and
ssgSetNearFar().  This by default creates a symmetric view frustum which is
typically what an application wants.

However, to get control of the view frustum in order to build support for
asymmetric view frustums, we need to wrap these calls with a bit of our own
logic.

This set of changes wraps all calls to ssgSetFOV() and ssgSetNearFar() with
FGRenderer methods.

I also standardized how the FGRenderer class is handled in globals.[ch]xx.
This led to some cascading changes in a variety of source files.

As I was working my way through the changes, I fixed a few warnings along
the way.
2005-02-25 19:41:53 +00:00
ehofman
7cc58da6a9 Vivian Meazza:
I attach the long-promised improved version of the USS Nimitz.

It includes an improved version of the FLOLS, which requires the attached
diff to be applied to AICarrier.cxx and AICArrier.hxx.

I've made lots of eye-candy in the form or the flightdeck crew.
Unfortunately, it about doubles the size of the tarball. I'll send it to you
later; when I've figured out some way of only loading on request (any advice
would be very welcome).

I could provide a \u2018bare\u2019 version to cut down on the vertex count for
less capable systems however, the count isn\u2019t huge in the first place.
I've cut the textures down as far as I can without losing definition.
2005-02-24 15:05:56 +00:00
ehofman
743379925e update paths. 2005-02-22 18:56:13 +00:00
ehofman
ba13669d32 Add the ability to set the minimum allowed age for metar reports. 2005-02-22 18:12:32 +00:00
ehofman
d871ca845f Cygwin fixes. 2005-02-18 12:40:38 +00:00
ehofman
02a757f9e6 MSVC (warning) fixes. 2005-02-18 10:16:30 +00:00
ehofman
b5bfbcf706 Add the missing carrier files. 2005-02-17 10:37:26 +00:00
ehofman
c2e688244d Mathias Frohlich: Add carrier capabilities for YASim aircraft. 2005-02-17 10:26:14 +00:00
curt
4ec654d043 Add support for aileron and rudder trim. 2005-02-15 18:11:48 +00:00
curt
9d8b687fc5 Add support for aileron and rudder trims. 2005-02-15 18:11:03 +00:00
curt
cdfb43f94d Tweak ... 2005-02-15 18:09:52 +00:00
curt
bf4aa941be Add an "additive-switch" type. 2005-02-15 18:09:20 +00:00
curt
5783208d9d Fix a "signededness" error. 2005-02-15 18:07:06 +00:00
ehofman
5bc15d7a69 Durk Talsma:
I just heard from John Wojnaroski that you and he are going to work on getting
a flightgear demo machine up for the linux expo thursday and Friday. John
indicated that he would very much like to get a CVS version with the new
traffic code up and running before the expo.
2005-02-10 09:01:51 +00:00
daveluff
03f0ac8519 Minor fix 2005-02-02 19:16:51 +00:00
ehofman
a7ee9554e7 Make sure snprintf can be found 2005-02-02 08:47:33 +00:00
curt
ec50bcfb5a Roy Ovesen:
I've added some features to the PID controller:

Ability to set desired sampling interval in seconds. Use <Ts> under <config>
to set the desired sampling interval of the PID controller.

Example:
<config>
     <Ts>0.1</Ts>        <!-- desired sampling interval -->
     <Kp>-0.05</Kp>        <!-- proportional gain -->
     <beta>1.0</beta>    <!-- input value weighing factor -->
     ...
     ...
</config>

Ts defaults to 0.0, so if you don't set it it samples at the highest possible
frequency.


Add an offset to the input variables (input and reference).
Example:
    <reference>
      <prop>/controls/flight/elevator</prop>
      <scale>-1.5</scale>
      <offset>1.0</offset>
    </reference>

Note that <scale> has higher precedence than <offset>, regardless of the order
that they appear in the config file.
2005-02-01 21:00:24 +00:00
ehofman
964349e401 Andrew Midson:
I have made the
'Select Airport from List' option in FlightGear work
(I think) properly. I have some concerns about the
solution, which could be broken by changes to plib (if
they re-use the value I have assigned to
PUCLASS_LIST), but for the moment it seems to work OK.

Erik Hofman:
A request has been sent to John Fay to include the puList
code in the puAux subdirectory of plib so expect some
changes for future version of FlightGear.
2005-01-31 10:36:59 +00:00
ehofman
394fe84351 Put the code at the proper place. 2005-01-29 13:12:34 +00:00
ehofman
9c743fc4c9 Geoff Air:
RE: --aircraft=ufo in system.fgfsrc is ignored

To change a 'feature', one that has been mentioned here many
times, and again recently, place the following code block
into fgInitFGAircraft.

In its favour, I would argue this means FG can be run without
a command line, provided FG_ROOT has been set in the
environment, and that seems to me, as it should be ... ;=))

Perhaps the only counter, is that system.fgfsrc is read twice,
but so are others, like .fgfsrc, for other (local) options ...
or system.fgfsrc should .nt. be used for 'aircraft' ?
2005-01-29 10:22:44 +00:00
ehofman
ded8b8f34e Cosmetic updates. 2005-01-27 10:58:05 +00:00
ehofman
031f062686 Melchior FRANZ:
Here's again one of the more obscure bugs that valgrind complains about: somehow
the STL container classes manage to read out values before they were ever set.
This patch fixes that. This may not cause any harm in this case, but valgrind
seems to *always* be right about them.
2005-01-27 10:49:58 +00:00
andy
671bffe9af Constant-speed props were seeking to engine speed, not prop speed. 2005-01-26 18:30:45 +00:00
ehofman
91cb15d9b0 Martin Spott:
Remove all dependencies of plib's SL sound library.
2005-01-24 10:17:14 +00:00
daveluff
e2a170c7d4 Emergency fix for AI model loading - non existance of the piper model as in the latest base package crashes the program - add exception handler during load. Needs to be replaced with better AI aircraft loading logic at some point 2005-01-21 15:50:29 +00:00
curt
8191d6b00e Fix my contact info. 2005-01-21 01:59:30 +00:00
ehofman
4d8da078a4 Roy Vegard Ovesen:
I guess it is much more efficient to compare integers than comparing long strings like "double-exponential" every frame.
2005-01-20 09:55:47 +00:00
ehofman
33b6694311 Melchior FRANZ:
The following patches to SimGear & FlightGear ...

- create an FGMetar abstraction layer, whose purpose is:
  * provide defaults for unset values
  * interpolate/randomize data (GREATER_THAN)
  * derive additional values (time, age, snow cover)
  * consider minimum identifier (CAVOK, mil. color codes)
- add rain/hail/snow/snowcover support on the METAR side
- add max age of METAR data handling (currently set to
- add support for an external METAR cache proxy server
- add CAVOK handling
- set missing year/month in regular METAR messages
- fix a small bug in metar.cxx (wrong return value)
2005-01-20 09:28:45 +00:00
curt
1ad71dbbe0 Add some formated frequency outputs to aid panel builders. 2005-01-19 02:11:28 +00:00
curt
dd2ea8f77d Throw an exception when no valid scenery path defined. 2005-01-17 22:10:53 +00:00
curt
95e225adf1 Remove unneeded #include's 2005-01-17 13:39:00 +00:00
ehofman
6a6c3a0e9c ... and make sure the number can actually be negative. 2005-01-17 10:48:35 +00:00
ehofman
f88a9aab6a Oops, don't forget that the axisnumber can actually be 0 2005-01-17 10:46:39 +00:00
ehofman
b9c633721f Silently ignore platforms that are not specified within the <number></number> section 2005-01-17 10:39:55 +00:00
ehofman
f488051bd3 Change debug level: try --log-level=debug and you see why (takes very, very, *very* long to output all 21.000 airports that way). 2005-01-15 14:25:58 +00:00
ehofman
38d327ba24 Tie the Scenery loader thread and the real weather fetching thread to CPU1 (if supported). 2005-01-09 10:27:01 +00:00
curt
9f531ff901 A couple minor tweaks to the replay subsystem to allow "pausing" the replay. 2005-01-05 05:45:38 +00:00
curt
632f5993f7 Default KT-70 to serviceable = true. 2005-01-05 04:15:19 +00:00
curt
8512984da5 Add cht (cylinder head temp) and tit (turbine inlet temp) to net_fdm.hxx 2005-01-05 03:43:05 +00:00
curt
e7fa493b0d A quick fix to avoid breaking non-unix-ish platforms. 2005-01-04 22:45:08 +00:00
curt
90e4896fdf Fix a mistake in handling of engine starter property names. 2005-01-03 03:20:31 +00:00
curt
e2875babad Initialize the timer countdown value since this could conceivably start as
any randomly large number (thus preventing the first station seach from
happening at least for a very long time.)
2005-01-03 00:16:16 +00:00
curt
0da1cc6de0 Fix some property names. 2004-12-30 21:49:53 +00:00
curt
66ff2f15d3 Switch from bool to int for more deterministic structure packing. 2004-12-30 20:49:31 +00:00
curt
eef30df0a0 Fix several typos (first time this has been tested since radio/instrumentation
rewrite.)
2004-12-30 20:48:54 +00:00
curt
0b2de7bce0 Remove extraneous property. 2004-12-30 20:48:09 +00:00
curt
8e9f8674a6 Various tweaks to ATC Flight Sim hardware inputs/outputs. 2004-12-30 14:57:58 +00:00
curt
0f8d8bbf05 Add back power button binding, but move the location to /instrumentation/nav
rather than /instrumentation/comm ... we need to be a little careful here
because typically, a single knob controls power to both matched com/nav pairs.
2004-12-30 14:57:12 +00:00
curt
ca80161dcf FGIO::shutdown_all() is called from the FGIO destructor so remove the extra
explicit calls to shutdown_all() which was causing this to be called twice.
This could cause problems with some IO modules (such as attempting to close
an invalid file descriptor the second time.)
2004-12-29 20:40:41 +00:00
curt
3ad6d87576 FGIO::shutdown_all() is called from the FGIO destructor so we don't want
a seperate explicite call or the io channels will be forced to try to shutdown
twice which could cause problems for some IO modules (i.e. attempting to
close an invalid file descriptor the second time ...)
2004-12-29 20:38:17 +00:00
daveluff
7793c32f95 Make sure the ATIS reports surface winds at airports above sea-level 2004-12-27 23:55:54 +00:00
ehofman
a7139a816c Durk Talsma:
Fix a couple of places that were not yet using SGPath
2004-12-27 17:35:22 +00:00
ehofman
499c702ffb Mathias Frhlich:
We should now be able to find
wires or catapults when the ac3d model is loaded without the crease patch
(caused by the much more unstructured scene graph emitted by the old loader).
It should also emit more warnings if the carrier hardware configuration
includes conflicting definitions.
That code is the most intrusive one, it should not be used until you configure
an aircraft carrier as a aimodel. So I think it should be save to apply that
before the release too.
2004-12-27 13:21:18 +00:00
ehofman
afe94f63ea Remove some stale cout commands. 2004-12-27 13:19:28 +00:00
ehofman
18ff3a6108 Make yasim accept the launchbar and hook properties. They are not tied to anything yet though. 2004-12-27 13:18:29 +00:00
curt
5e81b331e1 David Luff:
Attached is a patched runways.cxx.  This fixes the find runway nearest to a given heading code.  This was returning the last runway loaded at a given airport, not the nearest runway to the heading requested (which seems to always be 270deg by default).  I have no idea how this has survived unnoticed for so long - I think it might be because you need to start at an airport with a runway near to 27 and one much greater than 27 eg. 36 to really tickle it, otherwise the runway nearest to 27 tends to be the final one loaded anyway.  Try starting at KARR with and without the patch and note the surface wind.  This should go in before the release.
2004-12-26 23:31:35 +00:00
curt
4ab7603523 Changes to correspond with ATC hardware code changes. 2004-12-24 02:16:05 +00:00
curt
ec82773222 More work on the ATC FS hardware interface. 2004-12-24 01:23:27 +00:00
curt
222446df29 Replace the data/Airports/basic.dat.gz and data/Airports/runways.dat.gz with
a single apt.dat.gz file which is in the native X-Plane format.

To do this I wrote a front end loader than builds the airport and runway
list.  Some of the changes I needed to make had a cascading effect, so there
are minor naming changes scattered throughout the code.
2004-12-22 23:57:07 +00:00
curt
c362ca795c Updates in preparation for the 0.9.8 release. 2004-12-21 00:16:06 +00:00
ehofman
f541c30e46 gcc 2.95 fix? 2004-12-20 08:36:56 +00:00
ehofman
93e6ebf116 Fix a property path. 2004-12-19 14:32:39 +00:00
ehofman
def25f39d5 gcc 4.0 fixes. 2004-12-18 11:59:33 +00:00
ehofman
127e84cee9 Mathias Frhlich:
I have a small update which fixes the algorythm used for marking solid
surfaces for some cases where some branch nodes carry the object names I had
expected in the leaf nodes.
That will also introduce the possibility to mark whole subtrees from the
scenegraph solid.
2004-12-18 10:33:36 +00:00
ehofman
800dad8273 Make sound audiable not until after the scenery is loaded. 2004-12-16 13:19:01 +00:00
ehofman
c09d1c92ca Sync. w. JSBSim CVS 2004-12-16 12:47:20 +00:00
ehofman
33a52bdca2 Fix a typo 2004-12-16 08:52:12 +00:00
andy
28f50df1d5 Support for a new "contra" attribute on propellers, which properly
models them as contra-rotating pairs.
2004-12-13 23:48:43 +00:00
ehofman
8214364414 Mathias Frhlich:
I still work on getting the YASim models see the detailed environment
especially the carrier.

I have *forgotten* to initialize and to destruct the ground cache object!
Oooopppss!
2004-12-08 14:48:06 +00:00
ehofman
ac27ead4a6 Melchior FRANZ:
The attached patch allows to put comments in *.stg files[1]. Lines with
# in the first column (and only there!) are skipped. This has no effect
on overall performance, but has two advantages:

A) possibility to temporarily comment out objects during scenery design,
   (or to put other remarks there);

B) possibility to put marks like "# BEGIN" and "# END" there that allow
   automated merging of local landmarks etc.

--

[1] actually, comments are possible now, too. But they aren't explicitly
    handled and fgfs tries to parse words in "comments" piece by piece. Ugly!

[2] Idea by Chris METZLER, that I make already use of. I have a local
    scenery dir for some tiles with extra objects, such as VOR/DME for
    all of Austria. These are surrounded by "# BEGIN LOCAL" and "# END LOCAL",
    and today I was able to merge the new 0.9.7 scenery with my locally
    changed files.   :-)
2004-12-08 14:45:47 +00:00
ehofman
7a58ef58e7 MSVC fix 2004-12-05 09:34:03 +00:00
curt
75747d3516 A couple more straggling instrumentation clean ups. 2004-12-05 01:04:32 +00:00
curt
c6f0d87a26 A few more radios -> instrumentation name changes thanks to Melchior for
catching these.
2004-12-04 21:06:57 +00:00
curt
a775631226 Create the nodes these modules use if they don't exist already, otherwise
we will segfault when we try to use them later in the routine.
2004-12-03 21:49:21 +00:00
curt
634e79353f Roy Vegard Ovesen:
I've finished the emigration of the radiostack, and I've also removed it
completely. It turned out that the comm radio is completely implemented in
the ATC subsystem. I've changed the affected ATC files to point
to /instrumentation/com, but I guess that the maintainer of the ATC code
should decide wether to make it configureable, and how.

I also had to change some files in Network and Main. The changes in network
should be obvious, but the changes in Main were a bit suspect. The files
included radiostack.hxx, but they weren't directly depending on
radiostack-hxx. They were depending on other files that were included by
radiostack.hxx. I got it to compile, but I'm not sure if I included the
correct directly depending file.

For the data directory I changed every occurrence of /radios/
with /instrumentation/ with this simple one-liner that I found on the net:

find -name '*.xml' -type f | xargs perl -pi -e
's/\/radios\//\/instrumentation\//g'

Instead of me sending all the files that got changed by this I suggest that
you execute the one-liner yourself. Of course I can not guarantee that this
will work perfectly, but I considered hand editing to be not an option (I'm
lazy). I don't want to test every aircraft to see if everything still works,
I think it's better to wait and see if anyone complaints about broken nav
radios/instruments.
2004-12-03 21:21:16 +00:00
ehofman
8ba9f4e3a4 Vivian Meazza:
This is a sub-system which can be added to any carrier.

These files add a functioning Fresnel Lens Optical Landing System (FLOLS).
The orange/red 'source' lights are illuminated according to the position of
the pilot's eye above/below the 3.5 deg glide slope. The apparent position
of the source light relative to the fixed green datum lights allow the pilot
to 'fly the meatball'. The green 'cut' lights flash when the pilot's eye is
below the coverage of the lowest (red) source light.

TODO - add rules for the operation of the wave-off lights.
2004-11-30 12:34:11 +00:00
ehofman
fee003e8cc Melchior FRANZ:
I understand that the new hud/runway feature is still very experimental,
and that the search criteria for the active runway don't necessarily make
much sense. (We are searching for a runway on /sim/presets/airport-id
that matches the current wind direction best, and not the tuned in ILS
runway or something!)

Anyway: the new hud code completely denies the possibility of
globals->get_runways()->search() not finding a runway and returning false.
There's always a runway found at KSFO, but not so at e.g. LOXL, in which
case we are handing garbage over to sg_geodesy.cxx and find ourselves
caught in an endless loop in geo_direct_wgs_84().
2004-11-30 12:14:17 +00:00
ehofman
c537267f96 Durk Talsma:
Okay, here's the latest update to the tarffic manager/AI Manager. AITraffic
can now fly multiple routes and be initialized while sitting statically at
airports.
2004-11-29 09:41:43 +00:00
david
ffafb573b2 Patch from Robert Swam to block enabling stencil at 16 bpp for glut
(allowing FlightGear to work at 16 bpp again for glut users).
2004-11-29 03:17:19 +00:00
ehofman
63c1f4b613 Mathias Frhlich:
This patch makes the aircraft carrier's hardware  appear in the scenegraph.
2004-11-26 10:24:48 +00:00
curt
91ae7ce82a Add a *really* crude model of ITT, Oil Temp, and Oil Pressure. This
currently just returns a lagged normalized value in the range of 0-1 that
is proportional to N1.  It's up to the engine gauge to scale to the right
range.  This is for lack of a real model of these items so we can have
something to drive the engine gauges.
2004-11-23 21:35:30 +00:00
ehofman
7159e318e1 Mathias Frhlich:
I have now split out the ground cache functions into src/FDM/groundcache.[ch]xx
Attached are the two files and the patch to integrate that cache into
FGInterface.

The code is nowhere used at the moment, the fdm's need to be updated to use
that ground cache. The JSBSim-dropin.tar.gz from Martins ftp server does this
for example.

The carrier's scenegraph is not yet processed to be visible for ground
intersection testing. So the only benefit up to now is that the api is set
up. Using this I can put the changes to make JSBSim work with that into
JSBSim's cvs. Also I aim to provide Andy a patch to make use of that with
YASim.
2004-11-22 10:10:33 +00:00
curt
16ca655c03 More FreeBSD fixes ... add -lusbhid where needed. 2004-11-21 03:15:19 +00:00
ehofman
4de23ad628 Melchior FRANZ:
Use a suggested exit method as described in the SDL_Quit man page. (fgOSExit() is still uncalled in both fg_os.cxx (glut) and fg_os_sdl.cxx, which makes these functions kind-of useless.) The other changes are fixes for gcc 3.3.4 warnings.
2004-11-20 13:04:26 +00:00
ehofman
b859e77072 MacOS X fix. 2004-11-20 12:47:42 +00:00
ehofman
337d0d1be6 Add some missing bits from Mathias' carrier code. 2004-11-20 12:44:42 +00:00
curt
161fb0c770 Various property name changes relating to moving the kr-87 adf to
/instrumentation
2004-11-19 23:56:12 +00:00
curt
1c2c76709e Roy Ovesen: remove src files from Cockpit and move them over to Instrumentation. 2004-11-19 23:10:44 +00:00
curt
e9b70e3ab8 Changes by Roy Ovesen to begin migrating the avionics out of the Cockpit
directory and over to the Instrumentation directory and make them modular
in the sense of being able to pick and choose what you include with any
particular aircraft.
2004-11-19 23:01:34 +00:00
curt
d05121ef46 Fix my mailing address by replacing it with my web page. 2004-11-19 22:10:41 +00:00
curt
62df58d4f8 I have added Aaron Wilson's virtual 3d runway projection to the HUD.
Aaron says:

I just got the virtual runway hud projection working on all views and
2D & 3D HUDs.  It is working awesome(see below).  I have attached every
file that was modified (hud.hxx, hud.cxx, and the default.xml for the hud)
and every file that was added (hud_rwy.cxx and runwayinstr.xml).

Just a quick overview of how the instrument works.

The virtual runway is projected by getting the "cockpit view" of the
runway in 3D and projecting the points on to the 2D HUD.  Therefore, the
virtual runway will be displayed the same in every view.  For example,
you can land an aircraft from the "Tower View" by flying the HUD.  Also
if you're in "Cockpit View" and it is centered then the virtual runway
lines will perfectly outline the actual runway.  I am getting the active
runway via the wind like done in the ATC classes, which may need changed.
Also, I made the assumption the view 0, in view manager, is always the
cockpit view, which may need changed as well.

The runway configuration file will allow you to specify a center offset
(x,y) and a bounding box (width,height).  You can also configure the line
stipple pattern for the outside and the center line.  For instance, if
you wanted a 0xFAFA pattern, then specify 64250 as the value.  If you
want a solid line, you can specify -1 or 65535 (0xFFFF) and zero will
turn the line off.  It also draws a runway indication arrow when the
runway is not in the HUD or it can be drawn all the time if arrow_always
is true.  The arrow will point in the direction of the runway (2D) by
rotating around the center  at a radius of arrow_radius.  If you wish to
turn the arrow off, you must set the arrow_scale <=0.  The arrow really
should be 3D arrow that points to the runway (or points in the direction
of the aircraft-to-runway vector).
2004-11-19 18:31:02 +00:00
ehofman
ddb15394ee Mathias FrhlichMathias Frhlich:
Add some controls required for carrier operations:

/controls/gear/launchbar

should be 1.0 if the launchbar is lowered, that means the aircraft should now
be arrested at the catapult.

/controls/gear/catapult-launch-cmd

Should be set to 1.0 when the aircraft should be launched from tha catapult.
2004-11-19 12:33:53 +00:00
ehofman
3c0ab43b43 Mathias Frhlich:
The moving ai models will jump around realtive to the moving aircraft model.
I can see that with the carrier but others have noticed that too with ai
aircraft before.
The reason is that all SGSystems are called with a dt value which is not
necessarily a multiple of 1/hz.
In contrast, most FDM's use the _calc_multiloop function from FGInterface
which forces the time update to be a multiple of 1/hz for the FDM aircraft.
As a result, in the worst case, the FDM aircraft has moved nearly 1/hz seconds
further than the rest of flightgear (1/120sec*300kts that is about 1.3m).
That patch forces the time update to be a multiple of 1/hz.
2004-11-19 12:33:08 +00:00
curt
4214cd6c10 Migrate FlightGear code to use "#include SG_GL*" defined in
"#include <simgear/compiler.h>".
2004-11-18 19:53:00 +00:00
curt
225af83b32 This code is written on top of a driver interface only available with linux
(/proc file system) so it doesn't make sense to have other OS's trying to
open these files because they could never exist.
2004-11-18 17:40:03 +00:00
curt
a1265ddc1d - ATC-Inputs.cxx: Fix some portability problems for non-linux operating
systems.  Fix a couple bugs/oversights.

- atc610x.cxx: Much code has moved into the configurable input mapper
  (ATC-Inputs.cxx) and the remaining input massaging code has moved into
  the atcsim.nas module.
2004-11-18 05:04:35 +00:00
curt
7f9566111d Tweak the atcsim command line interface. 2004-11-18 05:01:19 +00:00
curt
11548e9e7e Minor white space fix. 2004-11-18 05:00:44 +00:00
curt
d66c4c1d82 Get rid of a stray character that must have introduced itself with my random
keyboard fumbling.
2004-11-16 19:48:42 +00:00
ehofman
3142457537 Remove some changes I had put in to make it compile. those are no longer needed. 2004-11-16 19:48:09 +00:00
curt
2eeddb8c9f Begin work on revamping the ATC hardware interface so it is infinitely more
configurable.
2004-11-16 19:47:11 +00:00
ehofman
9a8eaae03d commit some pending updates from Vivian 2004-11-16 09:33:21 +00:00
andy
d43d10046b Melchior caught a missing return value that is now an error on newer gcc versions 2004-11-15 18:15:33 +00:00
ehofman
2c72f13163 Roy Vegard Ovesen:
We have decided that hardcoded initialization of instruments and systems is
bad. So we remove them.

Hardcoded initialization is bad because it can't be overridden from config
files or from the command line. We prefer to do it through config files that
should be, eventually, aircraft specific (*-set.xml), not global
(preferences.xml).
2004-11-13 15:00:00 +00:00
ehofman
2df4a3b685 Vivian Meazza:
I attach the latest version  of Nimitz. The textures have been improved. A glide-path has been added, it is on by default, but can be switched off by means of the properties browser: /ai/models/ship/controls/glide-path. The origin has been adjusted to the turning pivot and approximate roll center.

Modified AiShip files are also attached. These allow the radius of the turning circle of a ship to be input. The turning circle is adjusted for speed and rudder angle. Roll has been corrected so that a ship leans out of a turn, not inwards like an aircraft. The roll angle is adjusted for speed and rudder angle (yes, application of more rudder reduces roll angle - rudders act as stabilizers).


TODO

Add a relative wind calculation so that a carrier can be turned to the appropriate launch and recovery courses.

Add a 'flight plan' so that the carrier can carry out a racetrack for flight ops.

Add a projector landing sight.

Add auto-land facilities.
2004-11-13 14:45:57 +00:00
david
42322949fa Reverted last changes, because they caused needle flips near 0. 2004-11-10 20:01:28 +00:00
ehofman
5733464305 Melchior FRANZ:
The caption should already be set when the window is opened. This is
important for some window managers. (KDE's kwin, for example, can store
special settings for certain windows, such as "no border" and "always
on top". KDE uses the window title to determine if a special rule is
to be applied. KDE will be made more tolerant, too.)
2004-11-08 17:41:30 +00:00
ehofman
85df309a3b David Culp:
Here are files to get automated contrails working.  I've set up contrails for
the 737, using my simple, untextured contrail model.  Vivian has made another
contrail model, but I'm still trying to get his to work.  I'm hoping others
will try to make contrail models also.

Here's some code that defines a top to thermals.  When the top of a thermal is
reached the strength is phased-out linearly over the next 100 feet of
altitude.  At first I tried just capping the thermal at the top, but the
change in thermal strength was too fast for the FDM to handle well.

Included is a new version of the thermal scenario that includes a top
(height-msl) to the thermal.  The default value is 5000 feet.
2004-11-07 14:46:21 +00:00
ehofman
3420e23833 MSVC fix. 2004-11-07 14:23:48 +00:00
david
2f13bafff5 Use angular momentum so that the compass can overshoot and oscillate
before settling.
2004-11-06 16:23:18 +00:00
david
079bc3196e Fixed typo that prevented DME groundspeed display. 2004-11-06 16:22:17 +00:00
david
0f2aad8320 Minor code clean-up. 2004-11-06 16:21:41 +00:00
david
b0c1fb7755 Added acceleration error to compass (most obvious during heavy braking
on the ground) -- this is based on some wild guesses, but it seems
reasonable for now.

The next step will be to give the compass some angular momentum so
that it does not snap instantly to a heading, and so that it can
overshoot a heading and oscillate.
2004-11-05 00:18:58 +00:00
david
04842a0f5b Add errors for pitch, based on a modified equation contributed by
Chris Metzler.
2004-11-04 02:24:46 +00:00
david
956823b161 Begin a rewrite of the magnetic compass code. So far, only northerly
turning error is supported, and I don't know if this works properly in
the southern hemisphere.
2004-11-03 15:59:49 +00:00
david
63cb4e59b7 Begin a rewrite of the magnetic compass code. So far, only northerly
turning error is supported, and I don't know if this works properly in
the southern hemisphere.
2004-11-03 15:15:32 +00:00
david
889dba8d65 Make FlightGear work with 16bpp:
1. Check that SDL actually initializes successfully and sets up its
   video mode.

2. Do not try to enable stencil in 16bpp.
2004-11-03 04:18:27 +00:00
curt
b82cc40c58 Make separate left/right flap surface positions in the net_fdm.hxx
structure for future use.  Right now they are tied together.
2004-10-29 00:13:32 +00:00
ehofman
e3c89b1d33 gcc fixes. 2004-10-28 11:03:15 +00:00
ehofman
73313ed0e1 Boris Koenig:
After applying the attached patches (based on latest CVS) you should
have a new option available within your version that should also
show up using fgfs --help, the syntax is:

    fgfs --min-status={level} --show-aircraft

whereas "level" can be anything between

    "alpha","beta","early-production" and "production"

Of course running something like

    fgfs --min-status=alpha --show-aircraft

should not return any aircraft right now, as none of the
current aircraft definition files in your base-package is using the
required

    <status></status>

tag - but you can easily give it a try by adding something like

    <status>alpha</status>

The tag should be placed as a sub-tag within <sim> - so directly behind
the <description> tag would be just fine and straight-forward.
2004-10-28 09:37:21 +00:00
ehofman
4668174848 Move the submodels from the /systems proprty subtree into /ai instead. 2004-10-28 08:44:24 +00:00
ehofman
670ea7c881 David Culp:
Here's code to support a new AICarrier class, which I think will be
sufficiently different from a basic AIShip that it should have its own class.
2004-10-28 08:33:55 +00:00
ehofman
e5b1ab4831 Vivian Meazza:
As a result of recent requests, I've implemented the ability to switch off
aerodynamic stabilisation:

This has to be added to the submodel.xml files:

<aero-stabilised>false</aero-stabilised>

When false the submodel retains the pitch given at instantiation.

It defaults to true.
2004-10-28 08:29:15 +00:00
ehofman
2a94cedeba Fix some warnings. 2004-10-26 12:09:31 +00:00
ehofman
ba7fd47740 Roy Vegard Ovesen:
I've made an encoder and a transponder. The transponder gets C-Mode altitude
information from the encoder. These two might not be very usefull right now,
but I think they might come in handy when the ATC network gets going.
2004-10-26 12:06:45 +00:00
ehofman
5071415bd1 Melchior FRANZ:
input.cxx allocates memory for js->getNumAxes() axes and for jsCaps.wNumButtons
or MAX_JOYSTICK_BUTTONS buttons per joystick. But it doesn't check if some
xml config defines bindings for more axes/buttons, in which case it writes
to unallocated memory and causes crashes. This is a real world example:
sidewinder-force-feed-pro.xml defines 7 axes, but only newer versions of
this js do actually have that many. Older ones (-> gameport) don't. The patch
drops unused and unusable bindings.
2004-10-24 14:45:52 +00:00
ehofman
0ab2a40c2a Roy Vegard Ovesen:
I've added two new debug log types for the instrumentation and systems. They
used to use the autopilot debug log, because I couldn't figure out how to
make new log types. Well, now I have figured it out.  ;-)
2004-10-24 11:05:14 +00:00
ehofman
ab4f7b4c60 Add commands to load and save property (sub)trees from or to an XML file. 2004-10-24 09:13:17 +00:00
ehofman
29b5147478 Move the submodels code from the Systems manager into it's own Subsystem manager. 2004-10-22 09:58:24 +00:00