User:Callahanp/Flightgear and Simgear Code/From Command Line to Holding Short: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{WIP}}


This page covers initialization in flightgear, from the command line through the Splash Page to the first frame of the aircraft in position.


I started by stepping through bootstrap and other modules until flightgear is up and running and the aircraft is visible holding short in a parking area, holding short or placed on a runway.
This page covers initialization in flightgear, from the command line through the Splash Page to the first frame of the aircraft in position.  This page is intended to be read with flightgear and simgear open in an editor, preferably one with a global search capability.  In addition you may want to step through some parts of the flightgear code in a debugger capable of setting break points. I'll assume you don't need advice on which editor and debugging tools to choose or how to set them up.
I'm made some notes, organized by source code file and function.  The result is the information below.


It is important to know that this is an area that as of March 2018 is under active discussion on the mailing list'''See [https://sourceforge.net/p/flightgear/mailman/message/36261734/  Edward d'Auvergne's e-mail on testing]'''  Some of what is written below needs to be reviewed and changedThese changes are underway.
Flightgear consists of a number of subsystems, responsible for various aspects of the illusion of flightWhen the command to start flightgear is given, the environment capable of supporting the display of aircraft and scenery is initializedBy reviewing this initialization process step by step, you gain an overview of the main components of flightgear and insight into areas you may want to similarly explore in detail.


Follow up discussions regarding subsystems on the flightgear-devel mailing list have resulted in changes to the way subsystems are constructed and initialized.
We'll start by stepping through bootstrap and other modules until flightgear is up and running and the aircraft is visible, holding short, in a parking area, or placed on a runway waiting for takeoff clearance.  I'll provide explanations where I think they're needed, but mostly you will just be looking at specific parts of specific modules and drawing your own conclusions and making notes.  While the initialization of sub-systems does provide some insight into the organization of the code, the real functionality of the subsystems is invoked later, during frame by frame display of the simulation.  A second companion wiki page goes into additional detail on each subsystem. A third wiki page details the cycle of execution for each frame.


====From Command Line to Holding Short====
There is ongoing work by Edward d'Auvergne in the area of initialization. Where appropriate, I'll refer to various things Edward has noted in e-mails to the flightgear-devel mailing list.
{{See also|Talk:Initializing_Nasal_early#Existing_Initialization_Scheme}}


==The Command Line ==
When you start flight gear, several activities take place
When you start flight gear, several activities take place


Line 29: Line 28:
That's a lot, but the orchestration of all this activity takes place in just a few code files and a very few functions in those files.
That's a lot, but the orchestration of all this activity takes place in just a few code files and a very few functions in those files.


We'll trace our way through the code, noting the modules, specific functions and highlight specific lines of code that make up this process.  We'll cover both the initial startup and the differences in the initialization process when resetting the application.
We'll trace our way through the code and highlight specific lines of code that make up this process.  We'll cover both the initial startup and the differences in the initialization process when resetting the application.
 
So here we are on the command line.  We'll assume all the environment variables have been properly set, and an appopriate set of command line options have been used.  The executable is install/bin/fgfs. As you might expect the entry point is called main(), but it's not where you'd expect, in main.cxx.  Instead it's in bootstrap.cxx.
==src/Main/bootstrap.cxx==
===int main ( int argc, char **argv )===
The main purpose of Bootstrap.cxx is to differentiate two distinct ways of starting flightgear as a standalone [[http://wiki.flightgear.org/FGViewer |Viewer]], or as the full flight simulator. bootstrap.cxx also provides a home for globals. 
 
We will follow the full flight simulator path which takes us directly into fgMainInit.
==src/Main/main.cxx & main.hxx==
===fgMainInit( int argc, char **argv )===
==
<hr>
Below are notes from a first attempt at this document written last year.
 
I'm made some notes, organized by source code file and function.  The result is the information below.
 
It is important to know that this is an area that as of March 2018 is under active discussion on the mailing list.  '''See [https://sourceforge.net/p/flightgear/mailman/message/36261734/  Edward d'Auvergne's e-mail on testing]'''  Some of what is written below needs to be reviewed and changed.  These changes are underway.
 
Follow up discussions regarding subsystems on the flightgear-devel mailing list have resulted in changes to the way subsystems are constructed and initialized.
 
====From Command Line to Holding Short====
{{See also|Talk:Initializing_Nasal_early#Existing_Initialization_Scheme}}
 
 


There are several key concepts in this startup process:
There are several key concepts in this startup process:
936

edits

Navigation menu