1
0
Fork 0
Commit graph

5596 commits

Author SHA1 Message Date
mfranz
4732b96861 (Frederic Bouvier) avoid gcc'ism 2005-06-25 07:57:42 +00:00
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
curt
3f8504cda5 Updated notes on the FG electrical system model. 2005-06-14 17:52:16 +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 Fröhlich:
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 Fröhlich:
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