]> git.mxchange.org Git - flightgear.git/commitdiff
David Culp:
authorehofman <ehofman>
Tue, 23 Sep 2003 09:25:24 +0000 (09:25 +0000)
committerehofman <ehofman>
Tue, 23 Sep 2003 09:25:24 +0000 (09:25 +0000)
Here's a new FGSimTurbine module.  Changes are:

1.  Adds starting and stopping functionality
2.  Calculate() now calls other functions, based on the engine's state, which gives more readable code.

Until now turbine engines were always running as long as fuel was available. With this new module the engine defaults to OFF.  To start with the engine running, the variable FGEngine::Running must be set to true at sim startup. In FlightGear this is done with --prop:/engines/engine[n]/running=true.

To start the engine (on the ground), first set the starter to ON, i.e. FGEngine::Starter is set to true.  In FlightGear this is done by toggling /controls/engines/engine[n]/starter to TRUE.  Note that the current FlightGear key binding will not work, as it causes the starter to quit when the key is released.  A new key binding is needed, without the mod-up.

When N2 reaches 15% or greater, place the fuel cutoff control to FALSE.  This is FGEngine::Cutoff.  In FlightGear this is done with /controls/engines/engine[n]/cutoff set to FALSE.  The engine will then accelerate to idle.  Upon reaching idle, the starter is automatically turned off, and the engine is running.  There is presently no FlightGear key binding for the fuel cutoff switch.

To shut off the engine, place the fuel cutoff control to TRUE.

If you shut down the engine in flight it will windmill.  To airstart you will need at least 15% N2, just as with a ground start.  When you have enough N2, place the cutoff control to FALSE and the engine will restart. Note that if you can't get enough N2 by speeding up, you can get it by using the starter.

The reverser still works, and is controlled in FlightGear with /controls/engines/engine[n]/reverser.  With the reverser control on (TRUE), the engine will produce negative thrust in proportion to throttle position, i.e. to get more reverse
thrust, increase throttle.

src/FDM/JSBSim/JSBSim.cxx

index cd47060807001e343384f2dfdc7ef6eb9bd6f4d5..49a4abc18550d60ff5b28f11db5f857a1c0d8f68 100644 (file)
@@ -411,6 +411,7 @@ bool FGJSBsim::copy_to_JSBsim() {
       eng->SetIgnition( globals->get_controls()->get_ignition(i) );
       eng->SetCutoff( globals->get_controls()->get_cutoff(i) );
       eng->SetNitrous( globals->get_controls()->get_nitrous_injection(i) );
+      eng->SetRunning( node->getBoolValue("running") );
     }
 
     _set_Runway_altitude( cur_fdm_state->get_Runway_altitude() );
@@ -573,6 +574,7 @@ bool FGJSBsim::copy_from_JSBsim() {
       node->setDoubleValue("nozzle-pos-norm", eng->GetNozzle());
       node->setDoubleValue("inlet-pos-norm", eng->GetInlet());
       node->setBoolValue("running", eng->GetRunning());
+      node->setBoolValue("starter", eng->GetStarter());
       node->setBoolValue("cranking", eng->GetCranking());
       node->setBoolValue("ignition", eng->GetIgnition());
       node->setBoolValue("augmentation", eng->GetAugmentation());
@@ -580,6 +582,11 @@ bool FGJSBsim::copy_from_JSBsim() {
       node->setBoolValue("reversed", eng->GetReversed());
       node->setBoolValue("cutoff", eng->GetCutoff());
       node->setBoolValue("nitrous", eng->GetNitrous());
+      globals->get_controls()->set_starter(i, eng->GetStarter() );
+      globals->get_controls()->set_cutoff(i, eng->GetCutoff() );
+      globals->get_controls()->set_augmentation(i, eng->GetAugmentation() );
+      globals->get_controls()->set_reverser(i, eng->GetReversed() );
+      globals->get_controls()->set_water_injection(i, eng->GetInjection() );
     }
 
     static const SGPropertyNode *fuel_freeze