]> git.mxchange.org Git - flightgear.git/blob - src/Network/opengc.hxx
Update 'magic' for more consistant cross platform padding.
[flightgear.git] / src / Network / opengc.hxx
1
2 //// opengc.hxx - Network interface program to send sim data onto a LAN
3 //
4 // Created by:  J. Wojnaroski  -- castle@mminternet.com
5 // Date:                21 Nov 2001 
6 //
7 // 
8 // Adapted from original network code developed by C. Olson
9 //
10 // This program is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU General Public License as
12 // published by the Free Software Foundation; either version 2 of the
13 // License, or (at your option) any later version.
14 //
15 // This program is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 // General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program; if not, write to the Free Software
22 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 //
24
25
26 #ifndef _FG_OPENGC_HXX
27 #define _FG_OPENGC_HXX
28
29 #include <simgear/compiler.h>
30
31 #include STL_STRING
32
33 #include <FDM/flight.hxx>
34 #include <Main/fg_props.hxx>
35
36 #include "protocol.hxx"
37 #include "opengc_data.hxx"
38
39 class FGOpenGC : public FGProtocol, public FGInterface {
40
41     ogcFGData buf;
42     int length;
43     
44     // Environment
45     SGPropertyNode *press_node;
46     SGPropertyNode *temp_node;
47     SGPropertyNode *wind_dir_node;
48     SGPropertyNode *wind_speed_node;
49     SGPropertyNode *mag_var_node;
50     
51     // Position
52     SGPropertyNode *p_latitude;
53     SGPropertyNode *p_longitude;
54     SGPropertyNode *p_alt_node;
55     SGPropertyNode *p_altitude;
56     SGPropertyNode *p_altitude_agl;
57     
58     SGPropertyNode *egt0_node;
59     SGPropertyNode *egt1_node;
60     SGPropertyNode *egt2_node;
61     SGPropertyNode *egt3_node;
62         
63     // Control surfaces
64     SGPropertyNode *p_left_aileron;
65     SGPropertyNode *p_right_aileron;
66     SGPropertyNode *p_elevator;
67     SGPropertyNode *p_elevator_trim;
68     SGPropertyNode *p_rudder;
69     SGPropertyNode *p_flaps;
70     SGPropertyNode *p_flaps_cmd;
71     
72     // Aero numbers
73     SGPropertyNode *p_alphadot;
74     SGPropertyNode *p_betadot;
75
76 public:
77
78     FGOpenGC();
79     ~FGOpenGC();
80
81     // open hailing frequencies
82     bool open();
83
84     // process work for this port
85     bool process();
86
87     // close the channel
88     bool close();
89
90     void collect_data( const FGInterface *fdm, ogcFGData *data );
91 };
92
93 #endif // _FG_OPENGC_HXX
94
95
96