X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATCDCL%2FATCutils.hxx;h=01f2e9e9d93ea0fade3c04a7ed86d33128c38b4e;hb=1c5eb0fb3e66c5c3bcc021310c97ea6d208c4b84;hp=c47c3469a0f5e9220b40314d75362606cf5688e0;hpb=35396de6f87e2a8b8d0c21eb1d0908db586799f8;p=flightgear.git diff --git a/src/ATCDCL/ATCutils.hxx b/src/ATCDCL/ATCutils.hxx index c47c3469a..01f2e9e9d 100644 --- a/src/ATCDCL/ATCutils.hxx +++ b/src/ATCDCL/ATCutils.hxx @@ -21,8 +21,8 @@ #include #include +#include #include -#include #include using std::string; @@ -41,24 +41,22 @@ using std::string; string ConvertNumToSpokenDigits(const string &n); // Convert an integer to spoken digits -string ConvertNumToSpokenDigits(int n); - -// Convert a 2 digit rwy number to a spoken-style string -string ConvertRwyNumToSpokenString(int n); +string ConvertNumToSpokenDigits(const int& n); +string decimalNumeral(const int& n); // Convert rwy number string to a spoken-style string -// eg "05L" to "zero five left" -// Assumes we get a two-digit string optionally appended with R, L, or C -// eg 01 07L 29R 36 -// Anything else is not guaranteed to be handled correctly! +// eg "15L" to "one five left" +// Assumes we get a string of digits optionally appended with R, L, or C +// eg 1 7L 29R 36 string ConvertRwyNumToSpokenString(const string &s); -// Return the phonetic letter of a letter represented as an integer 1->26 -string GetPhoneticIdent(int i); +const int LTRS(26); +// Return the phonetic letter of a letter represented as an integer 0..25 +string GetPhoneticLetter(const int i); // Return the phonetic letter of a character in the range a-z or A-Z. // Currently always returns prefixed by lowercase. -string GetPhoneticIdent(char c); +string GetPhoneticLetter(char c); // Get the compass direction associated with a heading in degrees // Currently returns 8 direction resolution (N, NE, E etc...) @@ -72,7 +70,7 @@ string GetCompassDirection(double h); ********************************/ // Given two positions (lat & lon in degrees), get the HORIZONTAL separation (in meters) -double dclGetHorizontalSeparation(const Point3D& pos1, const Point3D& pos2); +double dclGetHorizontalSeparation(const SGGeod& pos1, const SGGeod& pos2); // Given a point and a line, get the HORIZONTAL shortest distance from the point to a point on the line. // Expects to be fed orthogonal co-ordinates, NOT lat & lon ! @@ -80,10 +78,10 @@ double dclGetLinePointSeparation(double px, double py, double x1, double y1, dou // Given a position (lat/lon/elev), heading, vertical angle, and distance, calculate the new position. // Assumes that the ground is not hit!!! Expects heading and angle in degrees, distance in meters. -Point3D dclUpdatePosition(const Point3D& pos, double heading, double angle, double distance); +SGGeod dclUpdatePosition(const SGGeod& pos, double heading, double angle, double distance); // Get a heading from one lat/lon to another (in degrees) -double GetHeadingFromTo(const Point3D& A, const Point3D& B); +double GetHeadingFromTo(const SGGeod& A, const SGGeod& B); // Given a heading (in degrees), bound it from 0 -> 360 void dclBoundHeading(double &hdg); @@ -98,6 +96,6 @@ double GetAngleDiff_deg( const double &a1, const double &a2); * ****************/ -// Given a Point3D (lon/lat/elev) and an FGRunway struct, determine if the point lies on the runway -bool OnRunway(const Point3D& pt, const FGRunwayBase* rwy); +// Given (lon/lat/elev) and an FGRunway struct, determine if the point lies on the runway +bool OnRunway(const SGGeod& pt, const FGRunwayBase* rwy);