]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/rad_alt.hxx
fix previous incomplete patch
[flightgear.git] / src / Instrumentation / rad_alt.hxx
1 // Radar Altimeter
2 //
3 // Written by Vivian MEAZZA, started Feb 2008.
4 // 
5 //
6 // Copyright (C) 2008  Vivain MEAZZA - vivian.meazza@lineone.net
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 //
22 //
23
24 #ifndef _INST_RADALT_HXX
25 #define _INST_RADALT_HXX
26
27 #include <simgear/structure/subsystem_mgr.hxx>
28 #include <simgear/props/props.hxx>
29 #include <simgear/math/SGMath.hxx>
30
31 class RadarAltimeter : public SGSubsystem
32 {
33 public:
34
35     RadarAltimeter ( SGPropertyNode *node );
36     virtual ~RadarAltimeter ();
37
38 private:
39
40     virtual void init ();
41     virtual void update (double dt);
42
43     void update_altitude();
44     void updateSetHeight();
45     
46     double getDistanceAntennaToHit(const SGVec3d& h) const;
47     SGVec3d getCartAntennaPos()const;
48     
49     SGVec3d rayVector(double az, double el) const;
50     
51     SGPropertyNode_ptr _Instrument;
52     SGPropertyNode_ptr _user_alt_agl_node;
53     SGPropertyNode_ptr _rad_alt_warning_node;
54     SGPropertyNode_ptr _serviceable_node;
55     SGPropertyNode_ptr _sceneryLoaded;
56     
57     
58     SGVec3d _antennaOffset; // in aircraft local XYZ frame
59     
60     std::string _name;
61     int _num;
62     double _time;
63     double _interval;
64
65     double _min_radalt;
66
67 };
68
69 #endif // _INST_AGRADAR_HXX