]> git.mxchange.org Git - flightgear.git/blob - src/Navaids/ils.hxx
Added ils loader.
[flightgear.git] / src / Navaids / ils.hxx
1 // ils.hxx -- navaid class
2 //
3 // Written by Curtis Olson, started April 2000.
4 //
5 // Copyright (C) 2000  Curtis L. Olson - curt@flightgear.org
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifndef _FG_ILS_HXX
25 #define _FG_ILS_HXX
26
27
28 #include <simgear/compiler.h>
29 #include <simgear/misc/fgstream.hxx>
30
31 #ifdef FG_HAVE_STD_INCLUDES
32 #  include <istream>
33 #elif defined( FG_HAVE_NATIVE_SGI_COMPILERS )
34 #  include <iostream.h>
35 #elif defined( __BORLANDC__ )
36 #  include <iostream>
37 #else
38 #  include <istream.h>
39 #endif
40
41 #if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS )
42 FG_USING_STD(istream);
43 #endif
44
45
46 #define FG_ILS_DEFAULT_RANGE 30
47
48 class FGILS {
49
50     char ilstype;
51     char ilstypename[6];
52     char aptcode[5];
53     char rwyno[4];
54     int  locfreq;
55     char locident[5];
56     double locheading;
57     double loclat;
58     double loclon;
59     double gselev;
60     double gsangle;
61     double gslat;
62     double gslon;
63     double dmelat;
64     double dmelon;
65     double omlat;
66     double omlon;
67     double mmlat;
68     double mmlon;
69     double imlat;
70     double imlon;
71
72 public:
73
74     inline FGILS(void) {}
75     inline ~FGILS(void) {}
76
77     inline char get_ilstype() const { return ilstype; }
78     inline char *get_ilstypename() { return ilstypename; }
79     inline char *get_aptcode() { return aptcode; }
80     inline char *get_rwyno() { return rwyno; }
81     inline int get_locfreq() const { return locfreq; }
82     inline char *get_locident() { return locident; }
83     inline double get_locheading() const { return locheading; }
84     inline double get_loclat() const { return loclat; }
85     inline double get_loclon() const { return loclon; }
86     inline double get_gsangle() const { return gsangle; }
87     inline double get_gslat() const { return gslat; }
88     inline double get_gslon() const { return gslon; }
89     inline double get_dmelat() const { return dmelat; }
90     inline double get_dmelon() const { return dmelon; }
91     inline double get_omlat() const { return omlat; }
92     inline double get_omlon() const { return omlon; }
93     inline double get_mmlat() const { return mmlat; }
94     inline double get_mmlon() const { return mmlon; }
95     inline double get_imlat() const { return imlat; }
96     inline double get_imlon() const { return imlon; }
97
98     friend istream& operator>> ( istream&, FGILS& );
99 };
100
101
102 inline istream&
103 operator >> ( istream& in, FGILS& i )
104 {
105     double f;
106     in >> i.ilstype >> i.ilstypename >> i.aptcode >> i.rwyno 
107        >> f >> i.locident >> i.locheading >> i.loclat >> i.loclon
108        >> i.gselev >> i.gsangle >> i.gslat >> i.gslon
109        >> i.dmelat >> i.dmelon
110        >> i.omlat >> i.omlon
111        >> i.mmlat >> i.mmlon
112        >> i.imlat >> i.imlon;
113         
114
115     i.locfreq = (int)(f * 100.0);
116
117     // return in >> skipeol;
118     return in;
119 }
120
121
122 #endif // _FG_NAVAID_HXX