1
0
Fork 0
Commit graph

3562 commits

Author SHA1 Message Date
ehofman
50bdf6098a Mathias Fröhlich:
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 Fröhlich:
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 Fröhlich:
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 Fröhlich:
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 Fröhlich:
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 Fröhlich:
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