1
0
Fork 0
Commit graph

21 commits

Author SHA1 Message Date
ThorstenB
ed0d58cd75 #705: add sanity checks to fuel tank update
Just ignore incomplete tanks (without essential properties like "level_lbs")
and avoid Nasal run-time errors.
2012-04-22 15:19:20 +02:00
ThorstenB
e282a1e6ed fgdata/Nasal: avoid performance drop after sim reset/relocate
"/sim/signals/fdm-initialized" triggers _every_ time the FDM is reset,
so for every sim reset/relocate.
We need to uninstall the listeners after its first execution, or guard
certain parts of the initialization, to avoid starting multiple
"timer/update loops", or installing multiple property listeners.
Repeating "sim reset" often enough would eventually completely block/
overload the system.
2012-03-20 21:18:20 +01:00
Stuart Buchanan
3fb129923c Fix for issue 526 - Not possible to restart YASim aircraft after fuel starvation 2011-12-28 09:09:28 +00:00
ThorstenB
5392614331 Don't crash when tank property doesn't (yet) exist. 2011-09-25 16:21:10 +02:00
ThorstenB
346b47cd5a Don't create properties for ghost tanks. 2011-04-02 11:29:40 +02:00
Torsten Dreyer
5da86c6471 Remove code now performed in TankProperties 2011-02-14 23:13:12 +01:00
mfranz
c74d6ee75e - make props.initNode a props.Node method
- props.nas: some minor improvements
2008-11-20 19:45:40 +00:00
mfranz
4ac84809e9 nasal: cleanup & minor fixes
- fuel.nas: use props.initNode()
- debug.nas: fix comment
- globals.nas: load_nasal(): check extension and set module arg
- io.nas: update log message (the rules are no longer for io.open() only)
2008-08-10 17:53:41 +00:00
mfranz
2bcddab9b6 setlistener(): accessing the node via cmdarg() is now depreciated. Use
a regular function argument for that. Note the "n" in this example:

   setlistener("/sim/current-view/view-number", func(n) {
       setprop("/sim/hud/visibility", !n.getValue());
   }, 1);
2007-10-15 18:27:42 +00:00
mfranz
dfd21c722d - add more "var" keywords, fix indentation, drop some parentheses,
fix comments, consistency fixes, ...
- aircraft.nas: angular_lowpass -> minor speedup
2007-10-07 15:12:05 +00:00
mfranz
221c23e18b - don't create tanks in empty tank nodes (that nasty native_fdm.cxx causes)
- use Nasal features that were introduced after this code was first written:
  * var for local variables (and to make clear when a variable is first used)
  * += operator
  * listeners to import seldom changing variables and to avoid waiting for
    the FDM in a loop

This new code started as empty file where I added my stuff and then copied
parts from the old code, piece by piece. This is why the coding & indentation
style has changed. Functionally the code should basically be equivalent.
2007-01-31 15:53:01 +00:00
mfranz
51712052e1 this file is broken by design. Fixing the Nasal error apparently
overstrains it, so here's the error back. Have fun!  :-|
2007-01-13 22:37:38 +00:00
mfranz
4690b3c2c3 totally pointless mini-optimization 2007-01-13 21:46:07 +00:00
mfranz
f58fcdd492 make sure the property doesn't only exist, but is actually initialized 2007-01-13 18:35:22 +00:00
andy
591c72f5b4 Comments about -lbs and -gal_us were mixed up. Pounds are the
writable property.  Gallons are a read-only convenience.
2006-08-17 16:32:41 +00:00
andy
168e592e03 Probably best to make sure the property is there (even though
"selected" certainly should be)
2004-08-12 18:49:13 +00:00
andy
f2edac1849 Oops, same bug on the next line too. 2004-08-12 18:48:44 +00:00
andy
a20598d0fd Melchior helped to debug this via chat. Turns out to have been a
typo; the SimGear "pass subproperty as first argument" shortcut
doesn't work in Nasal.  This checkin is blind, but should have a high
probability of correctness.
2004-08-12 18:38:02 +00:00
andy
aa2686c0b9 Support a "kill-when-empty" flag on tanks to enable the strict
"engines die when any tank is empty" behavior.  Otherwise, just
deselect the empty tank.  This matches the "both" behavior many
lightplane fuel selectors have.
2004-04-30 14:42:42 +00:00
andy
449c7bf7ef Oops. A last minute change broke piston engines. The "phantom" fuel
tanks created by the C++ code look empty, and were causing the fuel
code to detect out of fuel conditions.  Since there is no way to tell
a "FDM" tank from a "C++" tank, I just filter them by capacity.  Very
ugly hack, we need to fix the code to report only the tanks created
by the aircraft/FDM configuration.
2004-03-27 18:26:55 +00:00
andy
e2cf6d90d2 New fuel management code. Only works with YASim currently. It's a benign
no-op under other FDMs.
2004-03-27 04:07:56 +00:00