Esempio n. 1
0
bool FGFDMExec::Run(void)
{
  bool success=true;

  Debug(2);

  for (unsigned int i=1; i<ChildFDMList.size(); i++) {
    ChildFDMList[i]->AssignState( (FGPropagate*)Models[ePropagate] ); // Transfer state to the child FDM
    ChildFDMList[i]->Run();
  }

  if (firstPass && !IntegrationSuspended()) {
    // Outputs the initial conditions
    for (unsigned int i = 0; i < Outputs.size(); i++)
      Outputs[i]->Run(holding);

    firstPass = false;
  }

  IncrTime();

  // returns true if success, false if complete
  if (Script != 0 && !IntegrationSuspended()) success = Script->RunScript();

  for (unsigned int i = 0; i < Models.size(); i++) {
    LoadInputs(i);
    Models[i]->Run(holding);
  }

  if (Terminate) success = false;

  return (success);
}
Esempio n. 2
0
bool FGFDMExec::Run(void)
{
  bool success=true;

  Debug(2);

  for (unsigned int i=1; i<ChildFDMList.size(); i++) {
    ChildFDMList[i]->AssignState( (FGPropagate*)Models[ePropagate] ); // Transfer state to the child FDM
    ChildFDMList[i]->Run();
  }

  IncrTime();

  // returns true if success, false if complete
  if (Script != 0 && !IntegrationSuspended()) success = Script->RunScript();

  for (unsigned int i = 0; i < Models.size(); i++) {
    LoadInputs(i);
    Models[i]->Run(holding);
  }

  if (ResetMode) {
    unsigned int mode = ResetMode;

    ResetMode = 0;
    ResetToInitialConditions(mode);
  }

  if (Terminate) success = false;

  return success;
}