Re: [Flightgear-devel] YASim fuel problem

2004-04-30 Thread Andy Ross
I wrote:
 Lee Elliott wrote:
  I could do a script that monitors the tank levels and de-selects
  them when they're empty but I don't know how to best invoke it.

 Actually, it wouldn't be hard to make this the default.  We could set
 a kill engines if empty flag on the tank for aircraft where we
 wanted stricter behavior.

OK, this is now the default.  Tanks automatically de-select themselves
when empty, unless they have a boolean kill-if-empty property set.

Andy

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


[Flightgear-devel] YASim fuel problem

2004-04-29 Thread Lee Elliott
I just tried an endurance flight in the B-52F, after having tweaked the fdm a 
bit, but the engines shut down while I still had 64% fuel remaining.

The B-52F currently has five fuel tanks: 2 x internal wing tanks - 7lbs, 1 
x internal fuselage tank - 73318 lbs  2 x external wing tanks - 18000lbs.  
This is a simplified layout - the distribution is roughly right, afaik - but 
it was spread over more tanks.

It looks like the fuel was being taken from each tank at the same rate instead 
of proportionally, depending upon their capacity, with the result that the 
external wing tanks were emptied while the other tanks still held plenty of 
fuel, and this caused the engine shutdown.

LeeE

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim fuel problem

2004-04-29 Thread Andy Ross
Lee Elliott wrote:
 It looks like the fuel was being taken from each tank at the same rate
 instead of proportionally, depending upon their capacity, with the
 result that the external wing tanks were emptied while the other tanks
 still held plenty of fuel, and this caused the engine shutdown.

Indeed.  The proportionality feature (a hack to handle the fact that
you couldn't do tank selection in the original code) was removed with
the move to the Nasal fuel code.  Now, trying to draw fuel from an
empty tank causes an engine failure.  In real planes (with exceptions,
obviously), you have to select tanks correctly.  The proper pilot
operation in this case would have been to deselect (set the selected
property to false) the wing tanks before they were empty.

Obviously some aircraft will be able to draw fuel at different rates
from different tanks, but in general this capability will be more
complicated than simple proportionality.

Andy

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim fuel problem

2004-04-29 Thread Lee Elliott
On Thursday 29 April 2004 19:59, Andy Ross wrote:
 Lee Elliott wrote:
  It looks like the fuel was being taken from each tank at the same rate
  instead of proportionally, depending upon their capacity, with the
  result that the external wing tanks were emptied while the other tanks
  still held plenty of fuel, and this caused the engine shutdown.

 Indeed.  The proportionality feature (a hack to handle the fact that
 you couldn't do tank selection in the original code) was removed with
 the move to the Nasal fuel code.  Now, trying to draw fuel from an
 empty tank causes an engine failure.  In real planes (with exceptions,
 obviously), you have to select tanks correctly.  The proper pilot
 operation in this case would have been to deselect (set the selected
 property to false) the wing tanks before they were empty.

 Obviously some aircraft will be able to draw fuel at different rates
 from different tanks, but in general this capability will be more
 complicated than simple proportionality.

 Andy

Fair enough - it's more realistic.

Is there a way of starting a Nasal script automatically at start-up? (this 
would help with zeroing the A-10 external tanks for the clean configuration)

I could do a script that monitors the tank levels and de-selects them when 
they're empty but I don't know how to best invoke it.

Perhaps an auto fuel management instrument might be the best answer - when 
it's clicked, or set to engaged, the fuel management script is invoked.  It 
could then be switched off as well.

LeeE

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim fuel problem

2004-04-29 Thread Lee Elliott
On Thursday 29 April 2004 20:50, Andy Ross wrote:
 Lee Elliott wrote:
  Is there a way of starting a Nasal script automatically at start-up?
  (this would help with zeroing the A-10 external tanks for the clean
  configuration)

 Sure, you can put a nasal block at the top of a -set.xml file (next
 to, not inside, the sim block).  Something like this:

  nasal
   a10 !-- Module name.  The aircraft name is a good choice --
script
 # Whatever Nasal code you like ...
/script
   a10
  /nasal

 The bo105 uses slightly different syntax to load an external .nas
 file, and you can inspect
 http://www.plausible.org/nasal/flightgear.html for more detail.

  I could do a script that monitors the tank levels and de-selects them
  when they're empty but I don't know how to best invoke it.

 Actually, it wouldn't be hard to make this the default.  We could set
 a kill engines if empty flag on the tank for aircraft where we
 wanted stricter behavior.

 Andy

Thanks - a faint light is beginning to illuminate:)

So far I've been using this structure (which I copied from another a/c - don't 
remember which one though)  in the set files...

  nasal
B52F
  script![CDATA[
# Nasal script(s)
.
.
  ]]/script
/B52F
  /nasal

and the scripts then need to be explicitly invoked.

Presumably, omitting the '![CDATA[' and ']]' bits will then result in the 
scripts being executed at start-up.

I'll have a look at how the bo105 does it and see about moving all the scripts 
I've put in the set file out to external .nas files and use the set file 
scripts just for start-up stuff.

Having a default where the tanks are automatically de-selected when empty 
would probably be a good thing for beginners.

LeeE

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim fuel problem

2004-04-29 Thread Andy Ross
Lee Elliott wrote:
 and the scripts then need to be explicitly invoked.

 Presumably, omitting the '![CDATA[' and ']]' bits will then result in the
 scripts being executed at start-up.

No, the CDATA stuff is just escaping to prevent the XML parser from
being confused by literal ,  or  characters inside the
script.

Maybe the confusion is the difference between a function definition
and its execution?  The stuff between the script tags is exactly one
script, and it is always executed at startup.  But if all it does is
something like:

myFunction = func { ... }

then nothing will happen, because all it did is assign the value of
the myFunction *variable* to a function definition.  If you want to
invoke the thing you can then do a myFunction().  If you never want
to invoke it again, then they're no need for the func {} stuff at all.

This is a perfectly legal script, for example:

  nasal
B52F
  script![CDATA[

   myFunction = func { print(Executing myFunction()!); }
   print(Hello World!\n);

  ]]/script
/B52F
  /nasal

When you start up, it will print Hello World! on the console.  It
will *not* print Executing myFunction()!.  But later on some other
piece of Nasal code could do:

   B52F.myFunction();

Which would then print Executing myFunction()!.

Is that clearer?


 I'll have a look at how the bo105 does it and see about moving all
 the scripts I've put in the set file out to external .nas files and
 use the set file scripts just for start-up stuff.

There is no different in execution between code placed in an external
file and code placed in the script tag.  The choice is solely one of
convenience.  Small and simple stuff should go inline, more
complicated code ought to have its own file.

Andy

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel