User:Legoboyvdlp/genapts850 documentation

From FlightGear wiki
Jump to navigation Jump to search

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
search an input file to attempt to find a specified icao code
AddAirport
iterate through an input file to attempt to find a specific airport and add it to the queue
AddAirports
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
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