User:Legoboyvdlp/genapts850 documentation: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(begin rough documentation of genapt)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Program Arguments =
= Program Arguments =
--log-level set SG_LOG priority by calling setLoggingPriority()
; --log-level : set SG_LOG priority by calling setLoggingPriority()
--work set work_dir
; --work : set work_dir
--input set input_file
; --input : set input_file
--start-id set start_id
; --start-id : set start_id
--nudge set nudge
; --nudge : set nudge
--snap set gSnap
; --snap : set gSnap
--min-lon set SGGeod min longitude  
; --min-lon : set SGGeod min longitude  
--max-lon set SGGeod max longitude  
; --max-lon : set SGGeod max longitude  
--min-lat set SGGeod min latitude
; --min-lat : set SGGeod min latitude
--max-lat set SGGeod max latitude
; --max-lat : set SGGeod max latitude
--airport set airport_id
; --airport : set airport_id
--clear-dem-path empty elev_src vector
; --clear-dem-path : empty elev_src vector
--dem-path append to elev_src
; --dem-path : append to elev_src
--verbose set log level to BULK
; --verbose : set log level to BULK
--max-slope set slope_max
; --max-slope : set slope_max
--threads=arg set num_threads
; --threads=arg : set num_threads
--threads automatically set num_threads
; --threads automatically : set num_threads
--debug-dir
; --debug-dir :
--debug-runways
; --debug-runways :
--debug-pavements
; --debug-pavements :
--debug-taxiways
; --debug-taxiways :
--debug-features
; --debug-features :
--help output help text and exit
; --help : output help text and exit
 
= main.cxx =
= main.cxx =
main.cxx is the main file, where execution of the program starts.  
main.cxx is the main file, where execution of the program starts.  


== main() ==
== main() ==
return type: void
; return type : void
arguments:
=== Arguments ===
int argc: default commandline argument handling
; int argc : default commandline argument handling
char **argv: default commandline argument handling
; char **argv : default commandline argument handling
 
=== Code Path ===
# Store current time from std::chrono::high_resolution_clock::now()
# Declare, clear, and fill the elev_src vector by calling setup_default_elevation_sources()
# Iterate through and parse commandline arguments
# Create a tgRectangle instance using the specified min / max; sanify input such that inverting it is detected and corrected automatically.
# Attempt to open the apt.dat or apt.dat.gz using sg_gzifstream in order to check apt.dat version
# Construct a Scheduler class instance wrapped in unique_ptr
# Add any debug items to the Scheduler
# If airport_id is set, add a single airport to the Scheduler with AddAirport() and invoke Schedule()
# Else, if start_id is set skip to start_id and add remaining airports with AddAirports() within the boundary and then invoke Schedule()
# Else add all airports with AddAirports() within boundary and then invoke Schedule()
# Call now() again and output elapsed time
# 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


1. A timer is marked
=== Private Attributes ===
2. A vector with strings of elevation sources is filled to match against by calling setup_default_elevation_sources()
; filename : the input apt.dat file
3. arguments are iterated through and parsed
; elevation : the elevation source list
4. create a tgRectangle instance using min / max; sanify input such that inverting it is detected and corrected automatically
; work_dir : the working directory
5. Attempt to open apt.dat or apt.dat.gz using sg_gzifstream in.
6. check apt.dat version
7. Construct scheduler instance wrapped in unique_ptr
8. add debug pavements, etc
9. if airport_id set add single airport with AddAirport() and invoke Schedule()
10. elsif start_id set skip to start_id and add remaining airports with AddAirports() within boundary then invoke Schedule()
11. else add all airports with AddAirports() within boundary then invoke Schedule()
12. mark clock finished and output elapsed time

Latest revision as of 19: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