Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Difference between revisions of "User:Legoboyvdlp/genapts850 documentation"

From FlightGear wiki
Jump to: navigation, search
(Public Methods)
(Public Methods)
 
(No difference)

Latest revision as of 14:36, 19 January 2020

Program Arguments

--log-level 
set SG_LOG priority by calling setLoggingPriority()
--work 
set work_dir
--input 
set input_file
--start-id 
set start_id
--nudge 
set nudge
--snap 
set gSnap
--min-lon 
set SGGeod min longitude
--max-lon 
set SGGeod max longitude
--min-lat 
set SGGeod min latitude
--max-lat 
set SGGeod max latitude
--airport 
set airport_id
--clear-dem-path 
empty elev_src vector
--dem-path 
append to elev_src
--verbose 
set log level to BULK
--max-slope 
set slope_max
--threads=arg 
set num_threads
--threads automatically 
set num_threads
--debug-dir 
--debug-runways 
--debug-pavements 
--debug-taxiways 
--debug-features 
--help 
output help text and exit

main.cxx

main.cxx is the main file, where execution of the program starts.

main()

return type 
void

Arguments

int argc 
default commandline argument handling
char **argv 
default commandline argument handling

Code Path

  1. Store current time from std::chrono::high_resolution_clock::now()
  2. Declare, clear, and fill the elev_src vector by calling setup_default_elevation_sources()
  3. Iterate through and parse commandline arguments
  4. Create a tgRectangle instance using the specified min / max; sanify input such that inverting it is detected and corrected automatically.
  5. Attempt to open the apt.dat or apt.dat.gz using sg_gzifstream in order to check apt.dat version
  6. Construct a Scheduler class instance wrapped in unique_ptr
  7. Add any debug items to the Scheduler
  8. If airport_id is set, add a single airport to the Scheduler with AddAirport() and invoke Schedule()
  9. Else, if start_id is set skip to start_id and add remaining airports with AddAirports() within the boundary and then invoke Schedule()
  10. Else add all airports with AddAirports() within boundary and then invoke Schedule()
  11. Call now() again and output elapsed time
  12. Exit program

Scheduler.cxx

Scheduler.cxx adds items to the queue and invokes threaded instances of class Parser to work through the queue.

Scheduler

Class Scheduler

Public Methods

FindAirport 
long; search an input file to attempt to find a specified icao code and return its position in the file
AddAirport 
void; iterate through an input file to attempt to find a specific airport and add it to the queue
AddAirports 
bool; iterate through an input file, with a possible starting offset and return all airports which are wholly within the bounding box and add them to the queue
RetryAirport 
void; current unused
Schedule 
create threaded instances of Parser class and work through the airports
set_debug 

Private Methods

IsAirportDefinition 
search a specific line for an ICAO code; if a match is found return true, else return false

Private Attributes

filename 
the input apt.dat file
elevation 
the elevation source list
work_dir 
the working directory