Alex Perry wrote:
> 
> > Actually, I think that it starts at a very low altitude, like -9999
> > meters -- that's why it reads a maximum climb.  We need to find a way
> > to delay initialization of the steam module until after the FDM is set
> > up.
> 
> Many of the other parts of the Sim get informed when a reset happens,
> either at initial startup or subsequently.  I've been tempted to add
> the capability into Steam, which resolves after-initial-start problems.
> As far as waking up after the FDM, I've also been tempted to have the
> existing initialization last a whole second (rather than be instantaneous)
> so that the inputs have a chance to settle before integration kicks in.

Don't we have a main loop that count to 1000 during startup?

We can call each subsystem in that loop every time it iterates.
Then we give each subsystem a minimum number that the loop index is
supposed to have before it can be started.

So it can look like:

for(int i=0; i<1000; i++)
{
  /* ... */

  //FDM
  if( i == 10 )
    init_fdm();
  if( i >  10 )
    run_fdm();

  /* ... */

  //steam
  if( i == 20 )
    init_steam();
  if( i >  20 )
    run_steam();

  /* ... */
}

That guarantees us that each subsystem gets valid value as we take care
of the dependancies.

The problem is, that we have to take care about the dependancies
manually.

An other solution could look like:

bool position_determined = false;
bool FDM_initalized = false; 
int FDM_stabilized = 100;
bool steam_initalized = false;

while( !(position_determined && FDM_initalized 
         && steam_initalized) )
{
  if( !position_determined )
  {
    init_terrain();
    position_determined = true;
  }

  if( position_determined && !FDM_initalized)
  {
    init_FDM();
    FDM_initalized = true;
  }

  if( FDM_initalized && (FDM_stabilized > 0) )
  {
    run_FDM();
    FDM_stabilized--;
  }

  if( FDM_stabilized==0 && !steam_initalized )
  {
    init_steam();
    steam_initalized = true;
 }

  /* ... */
}

This takes automatically care of all dependancies - we only have to take
care that we don't get a circular dependancy...

CU,
Christian
--
The idea is to die young as late as possible.        -- Ashley Montague

Whoever that is/was; (c) by Douglas Adams would have been better...

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

Reply via email to